/* ==========================================================================
   GRIMMLOCH — Shared Stylesheet

   Design system derived from the NoesisGUI game client aesthetic:
   warm blacks, bronze/gold hierarchy, parchment text, sharp corners,
   atmospheric backgrounds, minimal borders that appear on interaction.

   Web-adapted: optimized for long-form reading, proper vertical rhythm,
   modular type scale, and responsive prose width.
   ========================================================================== */

/* --- Design Tokens --- */
:root {
  /* Backgrounds — warm dark spectrum */
  --bg0: #0D0B09;
  --bg1: #1A1612;
  --bg2: #2A2318;
  --bg-modal: rgba(10,8,6,.7);

  /* Bronze / Gold — primary accent hierarchy */
  --br0: #B59E8C;   /* borders, muted, disabled */
  --br1: #BA9E7A;   /* secondary accent */
  --br2: #A89168;   /* labels, secondary text, links */
  --gd:  #C8A872;   /* headers, primary buttons, selected */
  --gdb: #E5C080;   /* title text, active/emphasized */

  /* Semantic */
  --amb: #FFBF47;   /* caret, CTA highlight */
  --err: #C85A3C;   /* error */
  --ok:  #5A7A4D;   /* success */

  /* Text — warm parchment spectrum */
  --pc:  #E8DCC8;   /* body text */
  --pcl: #F5EBD8;   /* bright text, emphasis */

  /* Fonts — matching the game client
     Prose uses Cormorant Garamond: elegant serif with excellent readability,
     broad Unicode coverage (Cyrillic, Vietnamese, Latin Extended),
     and a literary character without the "every fantasy site" cliché. */
  --font-heading: 'Julius Sans One', sans-serif;
  --font-body:    'Barlow', sans-serif;
  --font-prose:   'Cormorant Garamond', 'Georgia', serif;
  --font-hand:    'Bad Script', cursive;

  /*
     Modular type scale — 1.25 ratio (Major Third)
     Base: 17px (optimal for Barlow 300 on dark bg at reading distance)

     Step -2:  11px  (.687rem)   tiny labels
     Step -1:  14px  (.824rem)   captions, meta
     Step  0:  17px  (1rem)      body text          — base
     Step  1:  21px  (1.25rem)   large body, lead
     Step  2:  27px  (1.563rem)  h3
     Step  3:  33px  (1.953rem)  h2
     Step  4:  42px  (2.441rem)  h1 / page title (sourcebook)
     Step  5:  52px  (3.052rem)  display / hero title
  */
  --fs-tiny:    .687rem;
  --fs-caption: .824rem;
  --fs-body:    1rem;
  --fs-lead:    1.25rem;
  --fs-h3:      1.563rem;
  --fs-h2:      1.953rem;
  --fs-h1:      2.441rem;
  --fs-display: 3.052rem;

  /* Vertical rhythm — Editorial uses ~60px after h2, ~104px section padding.
     Spacing proportions taken from a designer's actual decisions. */
  --lh:     1.65;         /* body line-height (Editorial uses 1.65) */
  --lh-px:  28px;         /* 17px × 1.65 */
  --sp-xs:  7px;          /* tight */
  --sp-sm:  14px;         /* ½ line */
  --sp-md:  28px;         /* 1 line */
  --sp-lg:  56px;         /* 2 lines — Editorial's h2 margin-bottom is ~60px */
  --sp-xl:  100px;        /* Editorial banner top padding: 104px */
  --sp-2xl: 128px;        /* generous section breaks */

  /* Content width — Editorial runs ~700px content column with ~350px sidebar */
  --content-width: 720px;
  --site-width: 1140px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  font-size: 17px;    /* root = step 0 of our scale */
}

/* --- Base Typography --- */
body {
  background: var(--bg0);
  color: var(--pc);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: var(--lh);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Headings — Julius Sans One, gold hierarchy, tracked out */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.2;
  text-wrap: balance;
}
h2 {
  color: var(--gd);
  letter-spacing: .12em;
  font-size: var(--fs-h2);
  margin-top: var(--sp-lg);      /* big gap above — separates from previous section */
  margin-bottom: var(--sp-md);   /* smaller gap below — keeps heading tied to its content */
}
h3 {
  color: var(--gd);
  letter-spacing: .08em;
  font-size: var(--fs-h3);
  margin-bottom: var(--sp-md);
}
p {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--pc);
  line-height: var(--lh);
  font-size: var(--fs-body);
  margin-bottom: var(--sp-md);
}
p:last-child { margin-bottom: 0; }

/* Kill browser default blue/purple on links — keep everything on palette.
   Specific containers (.prose a, .hub-prose a, etc.) override this with
   the gold link colour. This fallback ensures no link ever shows browser
   default blue, which Firefox enforces more strictly than Chrome. */
a, a:link, a:visited { color: inherit; text-decoration: none; }

/* Selection */
::selection {
  background: rgba(200,168,114,.3);
  color: var(--pcl);
}

/* --- Decorative Lines --- */
.kl {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--br0) 12%, var(--gd) 38%, var(--gdb) 50%, var(--gd) 62%, var(--br0) 88%, transparent);
  opacity: .4;
}
.kleft {
  height: 1px;
  background: linear-gradient(90deg, var(--gd), var(--gdb) 30%, var(--br0) 75%, transparent);
  opacity: .4;
  margin: var(--sp-sm) 0;
}

/* --- Layout Containers --- */
.si  { max-width: var(--site-width); margin: 0 auto; padding: var(--sp-xl) 48px; }
.sin { max-width: var(--content-width); margin: 0 auto; padding: var(--sp-xl) 48px; }

/* --- Section Labels --- */
.slbl {
  font-family: var(--font-heading);
  font-size: var(--fs-tiny);
  letter-spacing: .35em;
  color: var(--br2);
  text-transform: uppercase;
  display: block;
  margin-bottom: var(--sp-sm);
}

/* --- Reveal Animations (marketing pages) --- */
.rv { opacity: 0; transform: translateY(28px); transition: opacity .75s ease, transform .75s ease; }
.rv.vis { opacity: 1; transform: none; }
.d1 { transition-delay: .12s; }
.d2 { transition-delay: .24s; }
.d3 { transition-delay: .36s; }
.d4 { transition-delay: .48s; }

/* --- Buttons (game-matched: sharp corners, gold primary) --- */
.btn {
  position: relative;
  overflow: hidden;
  display: inline-block;
  padding: 14px 32px;
  font-family: var(--font-heading);
  font-size: var(--fs-caption);
  letter-spacing: .16em;
  text-decoration: none;
  cursor: pointer;
  border-radius: 0;
  border: none;
  transition: background .2s, color .2s, border-color .2s;
  text-transform: uppercase;
  text-align: center;
}
.btn::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 55%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent);
  transform: skewX(-15deg);
}
.btn:hover::after { animation: shm .7s ease-out forwards; }
@keyframes shm { 0% { left: -100%; } 100% { left: 200%; } }

.bp, .bp:link, .bp:visited { background: var(--gd); color: var(--bg0); font-weight: 500; }
.bp:hover { background: var(--gdb); color: var(--bg0); }
.bp:active { background: var(--amb); color: var(--bg0); }

.bs { background: transparent; color: var(--pc); border: 1px solid var(--br0); }
.bs:hover { background: var(--bg2); border-color: var(--gd); color: var(--pcl); }
.bs:active { background: var(--br0); }

/* Sidebar button variant */
.sidebar-cta .btn {
  display: block;
  padding: 11px 16px;
  font-size: var(--fs-tiny);
  letter-spacing: .14em;
  margin-bottom: 8px;
}

/* --- Navigation Bar --- */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  padding: 16px 48px 16px 22px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  background: rgba(13,11,9,.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(107,93,79,.2);
  transition: background .4s, padding .3s;
}
#nav.sc { padding: 12px 48px 12px 22px; background: rgba(13,11,9,.98); }

.nlogo img { height: 36px; width: auto; display: block; }
.nlinks { display: flex; gap: 28px; list-style: none; align-items: center; justify-self: center; }
.nlinks a {
  font-family: var(--font-heading);
  font-size: var(--fs-caption);
  letter-spacing: .14em;
  color: var(--br2);
  text-decoration: none;
  font-variant: small-caps;
  transition: color .2s;
  position: relative;
}
.nlinks a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 2px;
  background: var(--gd);
  transition: width .3s;
}
.nlinks a:visited { color: var(--br2); }
.nlinks a:hover { color: var(--gd); }
.nlinks a:hover::after { width: 100%; }
.nlinks .active { color: var(--gd); }

.ncta {
  color: var(--bg0) !important;
  padding: 8px 18px;
  background: var(--gd);
  font-family: var(--font-heading);
  font-size: var(--fs-tiny);
  letter-spacing: .14em;
  transition: background .2s;
}
.ncta:hover { background: var(--gdb) !important; }
.ncta::after { display: none !important; }

/* Nav right group — language selector + theme toggle */
.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
}

/* Language selector */
.lang-sel {
  position: relative;
}
.lang-sel-btn {
  background: none;
  border: 1px solid rgba(107,93,79,.4);
  color: var(--br2);
  font-family: var(--font-heading);
  font-size: var(--fs-tiny);
  letter-spacing: .12em;
  padding: 6px 12px;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.lang-sel-btn:hover {
  color: var(--gd);
  border-color: var(--gd);
}
.lang-sel-btn::after {
  content: ' \25BE';
  font-size: 0.7em;
}
.lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: rgba(13,11,9,.98);
  border: 1px solid rgba(107,93,79,.3);
  min-width: 200px;
  max-height: 360px;
  overflow-y: auto;
  z-index: 300;
  padding: 6px 0;
}
.lang-dropdown.open {
  display: block;
}
.lang-dropdown a {
  display: block;
  padding: 8px 18px;
  font-family: var(--font-body);
  font-size: var(--fs-tiny);
  color: var(--br2);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.lang-dropdown a:hover {
  background: rgba(107,93,79,.15);
  color: var(--gd);
}
.lang-dropdown a.lang-active {
  color: var(--gd);
  font-weight: 500;
}
.lang-dropdown a.lang-unavail {
  color: rgba(200,168,114,.7);
  cursor: default;
  pointer-events: none;
}
.lang-dropdown a.lang-unavail::after {
  content: '';
}

/* ==========================================================================
   MARKETING HOME — Sections
   ========================================================================== */

/* Hero */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 140px 48px 100px;
}
.hero-img {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.hero-img::after {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 50% 55%, rgba(13,11,9,.55) 0%, transparent 100%),
    linear-gradient(180deg, rgba(13,11,9,.82) 0%, rgba(13,11,9,.50) 35%, rgba(13,11,9,.60) 65%, rgba(13,11,9,.97) 100%);
}
.hero-content {
  position: relative; z-index: 2;
  text-align: center;
  max-width: 860px;
}
.hram {
  width: 160px; height: auto;
  margin: 0 auto 24px;
  animation: fl 6s ease-in-out infinite;
  filter: drop-shadow(0 0 28px rgba(200,168,114,.4));
}
@keyframes fl { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

.htitle {
  font-family: var(--font-heading);
  font-size: clamp(4rem, 11vw, 9rem);
  letter-spacing: .22em;
  line-height: 1;
  background: linear-gradient(180deg, #F5EBD8 0%, #E5C080 20%, #C8A872 55%, #8B7355 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 60px rgba(200,168,114,.3));
  margin-bottom: 8px;
}
.htitle.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.htitle-img {
  width: clamp(320px, 55vw, 700px);
  height: auto;
  filter: drop-shadow(0 0 60px rgba(200,168,114,.3));
  margin-bottom: 8px;
}
.hsub {
  font-family: var(--font-heading);
  font-size: clamp(.62rem, 1.4vw, .82rem);
  letter-spacing: .38em;
  text-shadow: 0 2px 12px rgba(0,0,0,.6);
  color: var(--br2);
  text-transform: uppercase;
  margin-bottom: 38px;
}
.htag {
  font-family: var(--font-prose);
  font-weight: 400;
  font-style: italic;
  font-size: var(--fs-lead);
  color: var(--pcl);
  margin-bottom: var(--sp-sm);
  line-height: 1.6;
  text-shadow: 0 2px 16px rgba(0,0,0,.6);
}
.hdate {
  font-family: var(--font-heading);
  font-size: var(--fs-tiny);
  letter-spacing: .2em;
  color: var(--br2);
  margin-bottom: 50px;
}
.hctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.scroll-cue {
  position: absolute;
  bottom: 32px; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column;
  align-items: center; gap: 10px;
  animation: cue-bounce 2s ease-in-out infinite;
  z-index: 2;
  animation: scfade 3s ease-in-out infinite;
}
@keyframes scfade { 0%, 100% { opacity: .4; } 50% { opacity: .9; } }
.scroll-cue span {
  font-family: var(--font-heading);
  font-size: .7rem;
  letter-spacing: .28em;
  color: var(--tx0);
  text-shadow: 0 1px 4px rgba(0,0,0,.6);
}
.scroll-chevron {
  width: 18px; height: 18px;
  border-right: 2px solid var(--tx0);
  border-bottom: 2px solid var(--tx0);
  transform: rotate(45deg);
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.5));
}
@keyframes cue-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(10px); }
}

/* Pull Quote */
#pq { background: var(--bg1); }
.pq-text {
  font-family: var(--font-prose);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1.15rem, 2.4vw, 1.6rem);
  color: var(--pcl);
  line-height: 1.75;
  text-align: center;
  position: relative;
  padding: 0 24px;
}
.pq-text::before {
  content: '\201C';
  font-family: var(--font-prose);
  font-size: 6rem;
  line-height: 0;
  position: absolute;
  top: 44px; left: -6px;
  color: var(--br0);
  opacity: .28;
}
.pq-cite {
  display: block;
  margin-top: var(--sp-md);
  font-family: var(--font-heading);
  font-size: var(--fs-tiny);
  letter-spacing: .22em;
  color: var(--br2);
}

/* World Section */
#world { background: var(--bg1); }
#world .si { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-xl); align-items: center; }
.world-text h2 { margin-bottom: var(--sp-md); }
.world-text p  { margin-bottom: var(--sp-sm); }
.gate-wrap {
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 460px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 24px;
  overflow: hidden;
}
.gate-wrap::before {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(13,11,9,.60) 0%, transparent 10%, transparent 85%, rgba(13,11,9,.70) 100%),
    linear-gradient(90deg, rgba(13,11,9,.60) 0%, transparent 8%, transparent 92%, rgba(13,11,9,.60) 100%);
}
.gate-label {
  position: relative; z-index: 2;
  font-family: var(--font-hand);
  font-size: var(--fs-body);
  color: var(--br2);
  opacity: .85;
  text-align: center;
  text-shadow: 0 2px 12px rgba(0,0,0,.9), 0 0 40px rgba(0,0,0,.7);
}

/* Pillars */
#pillars { background: var(--bg0); }
.pillar-head { text-align: center; margin-bottom: var(--sp-lg); }
.pillar-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; background: rgba(107,93,79,.15); }
.pillar {
  background: var(--bg1);
  padding: var(--sp-lg) 32px;
  position: relative;
  transition: background .3s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.pillar:hover { background: var(--bg2); }
.pillar::before {
  content: '';
  position: absolute;
  top: 0; left: 32px; right: 32px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gd), transparent);
  opacity: 0;
  transition: opacity .3s;
}
.pillar:hover::before { opacity: 1; }
.pillar-icon { font-size: 1.5rem; margin-bottom: var(--sp-sm); display: block; opacity: .55; }
.pillar h3 { margin-bottom: var(--sp-sm); font-size: var(--fs-body); letter-spacing: .1em; }
.pillar p  { font-size: var(--fs-body); color: var(--br2); line-height: var(--lh); margin-bottom: 0; }

/* Descriptor */
#descriptor { background: var(--bg0); }
#descriptor .si { display: grid; grid-template-columns: 1fr 1.1fr; gap: var(--sp-xl); align-items: start; }
.desc-lbl {
  font-family: var(--font-heading);
  font-size: var(--fs-tiny);
  letter-spacing: .38em;
  color: var(--br2);
  text-transform: uppercase;
  margin-bottom: var(--sp-md);
  display: block;
}
.desc-phrase {
  font-family: var(--font-prose);
  font-weight: 400;
  font-style: italic;
  font-size: var(--fs-lead);
  color: var(--pcl);
  line-height: 1.8;
  border-left: 2px solid var(--gd);
  padding-left: 24px;
  margin-bottom: var(--sp-md);
}
.desc-sub { font-size: var(--fs-body); color: var(--br2); line-height: var(--lh); margin-bottom: var(--sp-md); }

/* UI Panel (RP sample) */
.ui-panel { background: var(--bg1); border: 1px solid rgba(107,93,79,.25); }
.ui-panel-head {
  background: var(--bg2);
  padding: 10px 16px;
  display: flex;
  align-items: center; gap: 8px;
  border-bottom: 1px solid rgba(107,93,79,.25);
}
.ui-dot  { width: 6px; height: 6px; background: var(--br0); border-radius: 50%; }
.ui-title { font-family: var(--font-heading); font-size: var(--fs-tiny); letter-spacing: .13em; color: var(--gd); }
.ui-body  { padding: 22px; }
.rp-entry { margin-bottom: var(--sp-sm); padding-bottom: var(--sp-sm); border-bottom: 1px solid rgba(107,93,79,.15); }
.rp-entry:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.rp-name  { font-family: var(--font-heading); font-size: var(--fs-tiny); letter-spacing: .1em; color: var(--gd); margin-bottom: var(--sp-xs); }
.rp-text  { font-family: var(--font-prose); font-style: italic; font-weight: 400; font-size: var(--fs-caption); color: var(--pc); line-height: 1.7; }
.rp-speech { font-style: normal; color: var(--pcl); }
.compose-bar {
  background: rgba(13,11,9,.7);
  border: 1px solid rgba(107,93,79,.15);
  padding: 11px 16px;
  margin-top: 10px;
  display: flex;
  align-items: center; gap: 10px;
}
.cb-label { font-family: var(--font-heading); font-size: .6rem; letter-spacing: .12em; color: var(--br0); }
.cb-line  { flex: 1; height: 1px; background: rgba(107,93,79,.18); }
.cursor {
  display: inline-block;
  width: 2px; height: 14px;
  background: var(--amb);
  animation: cblink 1.1s step-end infinite;
  vertical-align: text-bottom;
}
@keyframes cblink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* Screenshot Gallery */
#screens { background: var(--bg1); }
.screens-head { text-align: center; margin-bottom: var(--sp-lg); }

.ss-gallery { max-width: 960px; margin: 0 auto; }

.ss-showcase {
  position: relative;
  background: var(--bg0);
  border: 1px solid rgba(107,93,79,.2);
  overflow: hidden;
}
.ss-showcase img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity .3s ease;
}
.ss-showcase-cap {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 32px 20px 14px;
  background: linear-gradient(180deg, transparent 0%, rgba(13,11,9,.75) 35%, rgba(13,11,9,.95) 100%);
  font-family: var(--font-heading);
  font-size: var(--fs-tiny);
  letter-spacing: .12em;
  color: var(--gd);
  text-align: center;
}

.ss-thumbs {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--br0) var(--bg0);
}
.ss-thumb {
  flex: 0 0 auto;
  width: calc((960px - 32px) / 9);
  background: none;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
  opacity: .5;
  transition: opacity .25s, border-color .25s;
  overflow: hidden;
}
.ss-thumb img {
  width: 100%;
  height: auto;
  display: block;
}
.ss-thumb:hover { opacity: .8; }
.ss-thumb.active {
  opacity: 1;
  border-color: var(--gd);
}

/* Setting / Factions */
#setting { background: var(--bg0); }
.setting-head { text-align: center; margin-bottom: var(--sp-lg); }
.faction-intro { font-family: var(--font-body); font-style: italic; font-weight: 300; font-size: var(--fs-body); color: var(--br2); line-height: 1.7; max-width: 680px; margin: var(--sp-md) auto 0; }
.faction-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1px; background: rgba(107,93,79,.15); }
.faction-divider {
  grid-column: 1 / -1;
  padding: 14px 24px 10px;
  font-family: var(--font-heading);
  font-size: var(--fs-caption);
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--br1);
  background: var(--bg0);
}
.faction-card {
  background: var(--bg1);
  padding: 30px 24px;
  transition: background .3s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}
.faction-card:hover { background: var(--bg2); }
.faction-name { font-family: var(--font-heading); font-size: var(--fs-body); letter-spacing: .1em; color: var(--gd); margin-bottom: var(--sp-xs); }
.faction-tag  { font-family: var(--font-body); font-style: italic; font-weight: 300; font-size: var(--fs-caption); color: var(--br2); line-height: 1.6; }

/* Who / Studio */
#who { background: var(--bg1); }
#who .si { padding-top: var(--sp-lg); padding-bottom: var(--sp-lg); }
.who-centered { text-align: center; max-width: 680px; margin: 0 auto; }
.who-centered h2 { margin-bottom: var(--sp-md); }
.who-centered p { margin-bottom: var(--sp-sm); text-align: left; }
.studio-logo {
  height: 44px;
  width: auto;
  margin-bottom: var(--sp-md);
}
.who-stat { display: flex; justify-content: center; gap: 56px; margin-top: var(--sp-md); padding-top: var(--sp-md); border-top: 1px solid rgba(107,93,79,.2); }
.ws-num { font-family: var(--font-heading); font-size: var(--fs-h1); color: var(--gd); display: block; }
.ws-lbl { font-family: var(--font-heading); font-size: var(--fs-tiny); letter-spacing: .14em; color: var(--br2); text-transform: uppercase; }

/* Newsletter / Community CTA */
#nl { background: var(--bg1); position: relative; overflow: hidden; }
.nl-bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: .25;
}
#nl .sin { position: relative; z-index: 2; text-align: center; }
.nl-eyebrow {
  font-family: var(--font-heading);
  font-size: var(--fs-tiny);
  letter-spacing: .38em;
  color: var(--br2);
  text-transform: uppercase;
  margin-bottom: var(--sp-sm);
  display: block;
}
#nl h2 { margin-bottom: var(--sp-sm); }
.nl-form { display: flex; gap: 0; max-width: 480px; margin: 0 auto var(--sp-sm); }
.nl-input {
  flex: 1;
  background: var(--bg0);
  border: 1px solid var(--br0);
  border-right: none;
  padding: 14px 20px;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: var(--fs-body);
  color: var(--pc);
  outline: none;
  transition: border-color .2s;
  border-radius: 0;
}
.nl-input::placeholder { color: var(--br0); }
.nl-input:focus { border-color: var(--gd); caret-color: var(--amb); }
.nl-note { font-size: var(--fs-tiny); color: var(--br0); letter-spacing: .05em; }
.nl-ctas {
  margin-top: var(--sp-lg);
  padding-top: var(--sp-lg);
  border-top: 1px solid rgba(107,93,79,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}
.nl-cta-lbl { font-family: var(--font-heading); font-size: var(--fs-caption); letter-spacing: .14em; color: var(--br2); }

/* ==========================================================================
   SOURCEBOOK PAGES
   ========================================================================== */

/* Breadcrumb */
.breadcrumb { padding: 100px 0 0; background: var(--bg0); }
.bc-inner { max-width: none; margin: 0; padding: 0 48px; }
.bc-inner nav {
  font-family: var(--font-heading);
  font-size: var(--fs-tiny);
  letter-spacing: .18em;
  color: var(--br0);
}
.bc-inner nav a { color: var(--br2); text-decoration: none; transition: color .2s; }
.bc-inner nav a:visited { color: var(--br2); }
.bc-inner nav a:hover { color: var(--gd); }
.bc-inner nav span { margin: 0 8px; color: var(--br0); }

/* Page Hero (sourcebook) */
.page-hero {
  position: relative;
  padding: var(--sp-lg) 0 var(--sp-xl);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
}
.page-hero.hero-map {
  background-size: 100% auto;
}
.page-hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 70% at 50% 55%, rgba(13,11,9,.30) 0%, transparent 100%),
    linear-gradient(180deg, rgba(13,11,9,.95) 0%, rgba(13,11,9,.70) 6%, rgba(13,11,9,.55) 15%, rgba(13,11,9,.55) 80%, rgba(13,11,9,.70) 90%, rgba(13,11,9,.95) 100%),
    linear-gradient(90deg, rgba(13,11,9,.90) 0%, transparent 15%, transparent 85%, rgba(13,11,9,.90) 100%);
}
.hero-inner {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
  position: relative; z-index: 2;
  text-align: center;
}
.region-label {
  font-family: var(--font-heading);
  font-size: var(--fs-tiny);
  letter-spacing: .38em;
  color: var(--br2);
  text-transform: uppercase;
  display: block;
  margin-bottom: var(--sp-sm);
  text-shadow: 0 2px 12px rgba(0,0,0,.7);
}
.page-title {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 6.5vw, 4.8rem);
  letter-spacing: .18em;
  line-height: 1;
  white-space: nowrap;
  background: linear-gradient(180deg, #F5EBD8 0%, #E5C080 25%, #C8A872 60%, #8B7355 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.95)) drop-shadow(0 0 30px rgba(0,0,0,.7)) drop-shadow(0 0 60px rgba(0,0,0,.4));
  margin: 0 auto var(--sp-sm);
  text-align: center;
  width: 95%;
}
.page-subtitle {
  font-family: var(--font-prose);
  font-style: italic;
  font-size: var(--fs-lead);
  color: var(--br2);
  margin-bottom: var(--sp-md);
}
.page-hero .kl {
  background: linear-gradient(90deg, transparent 0%, var(--br0) 12%, var(--gd) 38%, var(--gdb) 50%, var(--gd) 62%, var(--br0) 88%, transparent);
  opacity: .5;
  margin: 0 auto var(--sp-md);
  max-width: 60%;
}

/* Content Area */
.content-wrap { background: var(--bg0); position: relative; }
.content-wrap::before {
  content: '';
  position: absolute; inset: 0;
  background: url('../images/background.jpg') center center/cover no-repeat;
  opacity: .12;
  pointer-events: none;
}
.content-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--sp-lg) 48px var(--sp-2xl);
  position: relative; z-index: 2;
}

/* --- Prose — the heart of the sourcebook ---
   Uses Cormorant Garamond: an elegant, high-contrast serif
   with literary character and broad Unicode coverage.
   Optimized for sustained reading on dark backgrounds.
   Line length ~60-68 characters at this width. */

.prose p {
  font-family: var(--font-prose);
  font-weight: 400;
  font-size: clamp(1.08rem, 1.6vw, 1.2rem);
  color: var(--pc);
  line-height: 1.82;
  margin-bottom: 1.5em;
}

/* Drop cap — gold initial letter */
.prose p:first-child::first-letter {
  font-family: var(--font-heading);
  font-size: 4.2em;
  line-height: .78;
  float: left;
  margin: 0.04em 0.12em 0 0;
  color: var(--gd);
  filter: drop-shadow(0 0 18px rgba(200,168,114,.25));
}

/* Standalone quote — indented italic with gold left border */
.prose .standalone {
  font-family: var(--font-prose);
  font-style: italic;
  font-size: clamp(1.12rem, 1.8vw, 1.28rem);
  color: var(--pcl);
  line-height: 1.78;
  margin: 2.2em 0;
  padding-left: 28px;
  border-left: 2px solid var(--gd);
}

/* Section divider — centered ornamental dots */
.divider {
  text-align: center;
  color: var(--gd);
  font-size: var(--fs-body);
  letter-spacing: .4em;
  margin: 3em 0;
  opacity: .45;
}

/* Region sub-headings (e.g. "An Alternate Iberian Peninsula") */
.prose .region-sub {
  font-family: var(--font-prose);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.2rem, 2vw, 1.4rem);
  color: var(--gdb);
  letter-spacing: .02em;
  margin-top: 0.8em;
  margin-bottom: 1.2em;
}

/* Prose section headings — small-caps heading font */
.prose .prose-heading {
  font-family: var(--font-heading);
  font-size: var(--fs-h3);
  font-weight: 400;
  font-variant: small-caps;
  letter-spacing: .10em;
  color: var(--gd);
  margin-top: 2.4em;
  margin-bottom: 0.8em;
}
.prose .prose-heading:first-child {
  margin-top: 0;
}

/* Faction closing block — the emotional payoff */
.prose .faction-closing {
  border-left: 2px solid var(--gd);
  padding: var(--sp-md) 32px;
  margin: 3em 0 0;
  background: linear-gradient(135deg, rgba(26,22,18,.5) 0%, rgba(13,11,9,.3) 100%);
}
.prose .faction-closing p {
  font-family: var(--font-prose);
  font-style: italic;
  font-size: clamp(1.02rem, 1.6vw, 1.14rem);
  color: var(--br2);
  line-height: 1.78;
  margin-bottom: 1.3em;
}
.prose .faction-closing p:last-child {
  margin-bottom: 0;
}

/* Cross-reference links in prose */
.prose a {
  color: var(--gdb);
  text-decoration: none;
  border-bottom: 1px solid rgba(229,192,128,.2);
  transition: color .2s, border-color .2s;
}
.prose a:visited {
  color: var(--gdb);
}
.prose a:hover {
  color: var(--pcl);
  border-bottom-color: var(--gd);
}

/* Footer Note */
.page-note {
  background: var(--bg1);
  border-top: 1px solid rgba(107,93,79,.2);
  border-bottom: 1px solid rgba(107,93,79,.2);
  padding: var(--sp-md) 48px;
  max-width: var(--content-width);
  margin: 0 auto;
  position: relative; z-index: 2;
}
.note-label {
  font-family: var(--font-heading);
  font-size: var(--fs-tiny);
  letter-spacing: .28em;
  color: var(--br2);
  text-transform: uppercase;
  display: block;
  margin-bottom: var(--sp-sm);
}
.note-text {
  font-family: var(--font-prose);
  font-style: italic;
  font-size: var(--fs-body);
  color: var(--br2);
  line-height: 1.8;
}

/* Prev/Next Page Navigation */
.page-nav {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--sp-md) 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative; z-index: 2;
}
.pn-link {
  font-family: var(--font-heading);
  font-size: var(--fs-caption);
  letter-spacing: .14em;
  color: var(--br2);
  text-decoration: none;
  font-variant: small-caps;
  transition: color .2s;
  display: flex;
  align-items: center; gap: 8px;
}
.pn-link:hover { color: var(--gd); }
.pn-section {
  font-family: var(--font-heading);
  font-size: var(--fs-tiny);
  letter-spacing: .22em;
  color: var(--br0);
  text-align: center;
}

/* --- Persistent Sourcebook Sidebar (left) --- */
.sb-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 56px);
}
.sb-nav {
  width: 260px;
  background: var(--bg1);
  border-right: 1px solid rgba(200,168,114,.1);
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  padding: 0;
}
.sb-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(200,168,114,.2) transparent;
}
.sb-scroll::-webkit-scrollbar { width: 5px; }
.sb-scroll::-webkit-scrollbar-thumb { background: rgba(200,168,114,.2); border-radius: 3px; }

/* Section toggle (Waking World, Dreaming World) */
.sb-section + .sb-section { margin-top: 2px; }
.sb-toggle {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 10px 18px;
  background: none; border: none; cursor: pointer;
  font-family: var(--font-heading);
  font-size: .68rem; letter-spacing: .16em;
  color: var(--gd); text-align: left;
  transition: background .15s;
}
.sb-toggle:hover { background: rgba(200,168,114,.06); }
a.sb-toggle-link {
  text-decoration: none; color: var(--gd);
}
a.sb-toggle-link:visited { color: var(--gd); }
a.sb-toggle-link.current { color: var(--gdb); background: rgba(200,168,114,.08); }

/* Clickable link inside a section toggle heading (navigates to hub page) */
a.sb-section-link {
  color: inherit; text-decoration: none;
}
a.sb-section-link:hover { color: var(--pc); text-decoration: underline; }
a.sb-section-link:visited { color: inherit; }
.sb-chevron {
  display: inline-block; width: 7px; height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform .2s; flex-shrink: 0;
}
.sb-toggle.open .sb-chevron { transform: rotate(45deg); }

/* Collapsible containers */
.sb-children { overflow: hidden; max-height: 0; transition: max-height .3s ease; }
.sb-children.open { max-height: 2000px; }

/* Sub-group toggle (Allodial Regions, Valdaran Cities) */
.sb-group-toggle {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 6px 18px 6px 30px;
  background: none; border: none; cursor: pointer;
  font-family: var(--font-body);
  font-size: .82rem; font-weight: 400;
  color: var(--br1); text-align: left;
  transition: background .15s;
}
.sb-group-toggle:hover { background: rgba(200,168,114,.06); }
.sb-group-toggle.open .sb-chevron { transform: rotate(45deg); }
.sb-items { overflow: hidden; max-height: 0; transition: max-height .3s ease; }
.sb-items.open { max-height: 2000px; }

/* Leaf page link */
.sb-link {
  display: block; padding: 5px 18px 5px 44px;
  font-size: .82rem; color: var(--br0);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background .12s, color .12s;
}
.sb-link:hover { background: rgba(200,168,114,.06); color: var(--pc); }
.sb-link:visited { color: var(--br0); }
.sb-link.current {
  color: var(--gdb); background: rgba(200,168,114,.08);
  border-left-color: var(--gd); font-weight: 400;
}

/* Geographic subcategory toggle (e.g. The Western Shores) */
.sb-subgroup { margin: 0; }
.sb-subgroup-toggle {
  display: flex; align-items: center; gap: 6px;
  width: 100%; padding: 4px 18px 4px 44px;
  background: none; border: none; cursor: pointer;
  font-family: var(--font-body);
  font-size: .75rem; font-weight: 500;
  color: var(--br0); opacity: .7;
  text-align: left;
  transition: background .15s, opacity .15s;
}
.sb-subgroup-toggle:hover { background: rgba(200,168,114,.06); opacity: 1; }
.sb-subgroup-toggle.open .sb-chevron { transform: rotate(45deg); }
.sb-subgroup-toggle .sb-chevron { width: 6px; height: 6px; }
.sb-subgroup .sb-items .sb-link { padding-left: 58px; }

/* Hub overview link (e.g. Waking World overview) */
.sb-hub-link {
  display: block; padding: 5px 18px 5px 30px;
  font-size: .78rem; color: var(--br0);
  text-decoration: none; opacity: .75;
  border-left: 3px solid transparent;
  transition: background .12s, color .12s, opacity .12s;
}
.sb-hub-link:hover { background: rgba(200,168,114,.06); color: var(--pc); opacity: 1; }
.sb-hub-link:visited { color: var(--br0); }
.sb-hub-link.current {
  color: var(--gdb); background: rgba(200,168,114,.08);
  border-left-color: var(--gd); opacity: 1;
}

/* Clickable link inside a group toggle (navigates to hub page) */
a.sb-group-link {
  color: inherit; text-decoration: none;
}
a.sb-group-link:hover { color: var(--pc); text-decoration: underline; }
a.sb-group-link:visited { color: inherit; }

/* Clickable link inside a subgroup toggle (navigates to parent faction page) */
a.sb-subgroup-link {
  color: inherit; text-decoration: none;
}
a.sb-subgroup-link:hover { color: var(--pc); text-decoration: underline; }
a.sb-subgroup-link:visited { color: inherit; }

/* Direct links (non-grouped, e.g. The Faith, Glossary) */
.sb-direct {
  display: block; padding: 5px 18px 5px 30px;
  font-size: .82rem; color: var(--br0);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background .12s, color .12s;
}
.sb-direct:hover { background: rgba(200,168,114,.06); color: var(--pc); }
.sb-direct:visited { color: var(--br0); }
.sb-direct.current {
  color: var(--gdb); background: rgba(200,168,114,.08);
  border-left-color: var(--gd); font-weight: 400;
}

.sb-divider { height: 1px; margin: 10px 18px; background: rgba(200,168,114,.1); }

/* Sidebar signup/notify link */
.sb-notify {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 18px;
  text-decoration: none;
  color: var(--br1);
  font-family: var(--font-body);
  font-size: .78rem;
  line-height: 1.4;
  transition: background .15s, color .15s;
}
.sb-notify:hover { background: rgba(200,168,114,.06); color: var(--gd); }
.sb-notify:visited { color: var(--br1); }
.sb-notify:hover:visited { color: var(--gd); }
.sb-notify-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--gd);
}
.sb-soon { font-size: .65rem; color: var(--br2); opacity: .6; margin-left: 6px; font-style: italic; }

/* Mobile: sidebar off-canvas with toggle button */
.sb-mobile-toggle {
  display: none; position: fixed;
  bottom: 20px; left: 20px; z-index: 200;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--gd); color: var(--bg0); border: none; cursor: pointer;
  font-size: 1.3rem; box-shadow: 0 4px 16px rgba(0,0,0,.5);
  align-items: center; justify-content: center;
}

/* Content area inside sb-layout */
.sb-main { overflow: hidden; }

/* Legacy right sidebar (kept for backward compat but hidden by default) */
.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  max-width: var(--content-width);
  margin: 0 auto;
  align-items: start;
}
.sidebar { display: none; }
.sidebar-inner, .sidebar-title, .sidebar-nav, .sidebar-group-label,
.sidebar-divider, .sidebar-cta { display: none; }

/* ==========================================================================
   SOURCEBOOK HUB PAGES
   ========================================================================== */

.hub-prose {
  margin-bottom: var(--sp-lg);
}
.hub-prose p {
  font-family: var(--font-prose);
  font-size: clamp(1.08rem, 1.6vw, 1.2rem);
  color: var(--pc);
  line-height: 1.82;
  margin-bottom: 1.5em;
}
.hub-prose p:last-child {
  margin-bottom: 0;
}
.hub-prose a {
  color: var(--gdb);
  text-decoration: none;
  border-bottom: 1px solid rgba(229,192,128,.2);
  transition: color .2s, border-color .2s;
}
.hub-prose a:visited {
  color: var(--gdb);
}
.hub-prose a:hover {
  color: var(--pcl);
  border-bottom-color: var(--gd);
}
.hub-prose .hub-prose-heading {
  font-family: var(--font-heading);
  font-size: var(--fs-h3);
  font-weight: 400;
  font-variant: small-caps;
  letter-spacing: .10em;
  color: var(--gd);
  margin-top: 0;
  margin-bottom: 1em;
}

.hub-closer {
  margin-top: var(--sp-lg);
  padding-top: var(--sp-md);
  border-top: 1px solid rgba(107,93,79,.2);
}
.hub-closer p {
  font-family: var(--font-prose);
  font-style: italic;
  font-size: clamp(1.02rem, 1.6vw, 1.14rem);
  color: var(--br2);
  line-height: 1.78;
}
.hub-closer a {
  color: var(--gdb);
  text-decoration: none;
  border-bottom: 1px solid rgba(229,192,128,.2);
  transition: color .2s, border-color .2s;
}
.hub-closer a:visited {
  color: var(--gdb);
}
.hub-closer a:hover {
  color: var(--pcl);
  border-bottom-color: var(--gd);
}

/* ── Illuminated manuscript card grid ── */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-md);
  background: none;
}
/* When an odd number of cards exists, the last card spans the full width
   so that no empty gap cell renders beside it. */
.hub-grid > :last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.hub-card {
  position: relative;
  background: transparent;
  padding: 2em 2.2em;
  text-decoration: none;
  display: block;
  border: 1px solid var(--br0);
  transition: border-color .3s, box-shadow .3s;
}
/* Inner rule — the double-border manuscript look */
.hub-card::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(200,168,114,.25);
  pointer-events: none;
  transition: border-color .3s;
}
.hub-card:hover {
  border-color: var(--gd);
  box-shadow: 0 0 18px rgba(200,168,114,.08);
}
.hub-card:hover::before {
  border-color: rgba(200,168,114,.5);
}

/* Corner flourishes — small decorative L-shapes at the four corners */
.hub-card::after {
  content: "";
  position: absolute;
  inset: 10px;
  pointer-events: none;
  /* Four corner marks via gradient stops */
  background:
    /* top-left */
    linear-gradient(var(--br0), var(--br0)) 0 0 / 14px 1px no-repeat,
    linear-gradient(var(--br0), var(--br0)) 0 0 / 1px 14px no-repeat,
    /* top-right */
    linear-gradient(var(--br0), var(--br0)) 100% 0 / 14px 1px no-repeat,
    linear-gradient(var(--br0), var(--br0)) 100% 0 / 1px 14px no-repeat,
    /* bottom-left */
    linear-gradient(var(--br0), var(--br0)) 0 100% / 14px 1px no-repeat,
    linear-gradient(var(--br0), var(--br0)) 0 100% / 1px 14px no-repeat,
    /* bottom-right */
    linear-gradient(var(--br0), var(--br0)) 100% 100% / 14px 1px no-repeat,
    linear-gradient(var(--br0), var(--br0)) 100% 100% / 1px 14px no-repeat;
  transition: opacity .3s;
  opacity: .45;
}
.hub-card:hover::after { opacity: .8; }

.hub-card h3 {
  font-family: var(--font-heading);
  font-variant: small-caps;
  letter-spacing: .12em;
  font-size: var(--fs-lead);
  font-weight: 400;
  color: var(--gd);
  margin-bottom: var(--sp-xs);
}
.hub-card p {
  font-size: var(--fs-body);
  color: var(--br2);
  line-height: var(--lh);
  margin-bottom: 0;
}

/* Single-column on narrow screens */
@media (max-width: 600px) {
  .hub-grid { grid-template-columns: 1fr; }
  .hub-grid > :last-child:nth-child(odd) { grid-column: auto; }
}

/* Hub Reference — kept for backward compatibility but no longer
   used on the WW hub (Reference is now a child card). */
.hub-reference {
  margin-top: var(--sp-lg);
  padding-top: var(--sp-md);
  border-top: 1px solid rgba(107,93,79,.2);
}
.hub-reference-label {
  font-family: var(--font-heading);
  font-size: var(--fs-lead);
  letter-spacing: .18em;
  color: var(--br2);
  text-transform: uppercase;
  display: block;
  margin-bottom: var(--sp-md);
}
.hub-ref-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-md);
  background: none;
}
.hub-ref-grid > :last-child:nth-child(odd) {
  grid-column: 1 / -1;
}
.hub-ref-card {
  position: relative;
  background: transparent;
  padding: 1.6em 1.8em;
  text-decoration: none;
  display: block;
  border: 1px solid rgba(107,93,79,.3);
  transition: border-color .3s;
}
.hub-ref-card::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(200,168,114,.15);
  pointer-events: none;
  transition: border-color .3s;
}
.hub-ref-card:hover {
  border-color: var(--gd);
}
.hub-ref-card:hover::before {
  border-color: rgba(200,168,114,.35);
}
.hub-ref-card h4 {
  font-family: var(--font-heading);
  font-variant: small-caps;
  letter-spacing: .10em;
  font-size: var(--fs-body);
  font-weight: 400;
  color: var(--br2);
  margin-bottom: var(--sp-xs);
  transition: color .25s;
}
.hub-ref-card:hover h4 { color: var(--gd); }
.hub-ref-card p {
  font-size: var(--fs-caption);
  color: var(--br0);
  line-height: var(--lh);
  margin-bottom: 0;
}
@media (max-width: 600px) {
  .hub-ref-grid { grid-template-columns: 1fr; }
  .hub-ref-grid > :last-child:nth-child(odd) { grid-column: auto; }
}

/* Hub Groups */
.hub-group { margin-bottom: var(--sp-lg); }
.hub-group:last-child { margin-bottom: 0; }
.hub-group-label {
  font-family: var(--font-heading);
  font-size: var(--fs-caption);
  letter-spacing: .22em;
  color: var(--br2);
  text-transform: uppercase;
  display: block;
  margin-bottom: var(--sp-sm);
}

/* ==========================================================================
   SCROLLBARS (game-matched: minimal, bronze)
   ========================================================================== */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--br0); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--br2); }

/* ==========================================================================
   FOOTER
   ========================================================================== */

footer { background: var(--bg1); border-top: 1px solid rgba(107,93,79,.2); }
.footer-inner { max-width: var(--site-width); margin: 0 auto; padding: var(--sp-lg) 48px var(--sp-md); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--sp-lg); margin-bottom: var(--sp-lg); }
.flogo-img { height: 28px; display: block; margin-bottom: 8px; }
.footer-brand p { font-size: var(--fs-caption); color: var(--br2); font-style: italic; margin-top: 6px; margin-bottom: 0; }
.footer-col h4 {
  font-family: var(--font-heading);
  font-size: var(--fs-tiny);
  letter-spacing: .18em;
  color: var(--gd);
  text-transform: uppercase;
  margin-bottom: var(--sp-sm);
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-col a {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: var(--fs-caption);
  color: var(--br2);
  text-decoration: none;
  transition: color .2s;
}
.footer-col a:visited { color: var(--br2); }
.footer-col a:hover { color: var(--gd); }
.footer-social { display: flex; gap: 8px; margin-top: var(--sp-sm); }
.soc-link {
  width: 36px; height: 36px;
  border: 1px solid rgba(107,93,79,.25);
  display: flex;
  align-items: center; justify-content: center;
  color: var(--br2);
  text-decoration: none;
  font-size: var(--fs-tiny);
  font-family: var(--font-heading);
  transition: border-color .2s, color .2s, background .2s;
}
.soc-link:hover { border-color: var(--gd); color: var(--gd); background: var(--bg2); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--sp-md);
  border-top: 1px solid rgba(107,93,79,.2);
}
.footer-bottom p { font-size: var(--fs-tiny); color: var(--br0); margin-bottom: 0; }
.footer-oc { display: flex; align-items: center; gap: 10px; }
.oc-logo-sm { height: 22px; opacity: .5; filter: saturate(.6) brightness(1.2); border-radius: 2px; }
.oc-txt { font-family: var(--font-heading); font-size: var(--fs-tiny); letter-spacing: .1em; color: var(--br0); }

/* ==========================================================================
   CONTENT GATES — signup-driven access control
   ========================================================================== */

/* ── Hard Gate: Coming Soon cards (Dreaming World) ── */
.hub-card.coming-soon { position: relative; pointer-events: auto; cursor: pointer; }
.hub-card.coming-soon .coming-soon-badge {
  font-family: var(--font-prose);
  font-style: italic;
  font-size: var(--fs-caption);
  letter-spacing: .02em;
  color: var(--br0);
  display: block;
  margin-top: var(--sp-xs);
}
.hub-card.coming-soon:hover .coming-soon-badge { color: var(--gd); }

/* ── Soft Gate: teaser + fade (Waking World) ── */
.content-gate.gated .content-inner { max-height: 520px; overflow: hidden; }
.content-gate.gated .page-nav,
.content-gate.gated .sidebar { display: none; }

.gate-fade {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 280px;
  background: linear-gradient(180deg, rgba(13,11,9,0) 0%, rgba(13,11,9,.85) 45%, rgba(13,11,9,1) 100%);
  pointer-events: none;
  z-index: 5;
}
.gate-prompt {
  position: relative;
  z-index: 6;
  text-align: center;
  padding: var(--sp-lg) 48px var(--sp-xl);
  background: var(--bg0);
}
.gate-prompt .slbl { margin-bottom: var(--sp-sm); }
.gate-prompt h2 {
  font-family: var(--font-heading);
  font-size: var(--fs-h2);
  letter-spacing: .14em;
  color: var(--gd);
  margin-bottom: var(--sp-sm);
}
.gate-prompt p {
  font-family: var(--font-prose);
  font-style: italic;
  font-size: var(--fs-lead);
  color: var(--br2);
  max-width: 520px;
  margin: 0 auto var(--sp-md);
  line-height: 1.7;
}
.gate-prompt .btn { min-width: 260px; }

/* ── Inline Notify Prompt (bottom of content pages) ── */
.notify-prompt {
  text-align: center;
  padding: var(--sp-lg) var(--sp-md);
  border-top: 1px solid rgba(200,168,114,.15);
  margin-top: var(--sp-lg);
}
.notify-prompt h2 {
  font-family: var(--font-heading);
  font-size: var(--fs-h3);
  letter-spacing: .12em;
  color: var(--gd);
  margin-bottom: var(--sp-xs);
}
.notify-prompt p {
  font-family: var(--font-prose);
  font-style: italic;
  font-size: var(--fs-body);
  color: var(--br2);
  line-height: 1.7;
  margin-bottom: var(--sp-sm);
}
.notify-form { max-width: 480px; margin: 0 auto; }
.notify-field {
  display: flex; gap: 10px;
  align-items: stretch;
}
.notify-field .form-input {
  flex: 1; min-width: 0;
}
.notify-field .btn {
  white-space: nowrap;
  flex-shrink: 0;
}
.notify-prompt .submit-note {
  font-family: var(--font-body);
  font-size: var(--fs-tiny);
  color: var(--br0);
  margin-top: var(--sp-xs);
}
.notify-prompt.notify-confirmed .btn {
  margin-top: var(--sp-sm);
  display: inline-block;
}
@media (max-width: 500px) {
  .notify-field {
    flex-direction: column;
  }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 960px) {
  #world .si,
  #descriptor .si { grid-template-columns: 1fr; gap: var(--sp-lg); }
  .who-stat { gap: 32px; }
  .pillar-grid { grid-template-columns: 1fr; }
  .faction-grid { grid-template-columns: 1fr 1fr; }
  .faction-divider { grid-column: 1 / -1; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .ss-thumb { width: 80px; }
  .nlinks { display: none; }
  .gate-wrap { min-height: 280px; }
}

/* ─── Reference Images ─────────────────────────────────────────────── */

.reference-images {
  margin-top: 80px;
  padding-top: 48px;
  border-top: 1px solid rgba(107,93,79,.25);
}

.reference-images-label {
  font-family: var(--font-heading);
  font-size: .824rem;
  letter-spacing: .2em;
  color: var(--br1);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.reference-images-note {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: .824rem;
  color: var(--br0);
  font-style: italic;
  margin-bottom: 32px;
}

.reference-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.reference-item {
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  background: var(--bg1);
}

.reference-item img {
  width: 100%;
  height: auto;
  display: block;
  opacity: .85;
  transition: opacity .3s ease;
  filter: sepia(.08) saturate(.9);
}

.reference-item:hover img {
  opacity: 1;
  filter: none;
}

.reference-caption {
  padding: 10px 12px;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: .75rem;
  color: var(--br2);
  line-height: 1.4;
}

/* ─── Editor's Note ───────────────────────────────────────────────── */

.editors-note {
  margin-top: 56px;
  padding: 24px 0 0;
  border-top: 1px solid rgba(107,93,79,.15);
}

.editors-note .note-label {
  display: block;
  font-family: var(--font-heading);
  font-size: .7rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--br0);
  margin-bottom: 8px;
}

.editors-note .note-text {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: .824rem;
  line-height: 1.6;
  color: var(--br0);
  font-style: italic;
  max-width: 600px;
}
.editors-note a {
  color: var(--br2);
  text-decoration: underline;
  text-decoration-color: rgba(168,145,104,.35);
  transition: color .2s, text-decoration-color .2s;
}
.editors-note a:visited { color: var(--br2); }
.editors-note a:hover { color: var(--gd); text-decoration-color: var(--gd); }

/* Legal pages */
.legal-effective {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: .85rem;
  color: var(--br2);
  font-style: italic;
  margin-bottom: 28px;
}

/* ── Signup Form ── */
.signup-wrap {
  background: var(--bg0);
  min-height: 100vh;
  padding-top: 80px;
}
.signup-hero {
  position: relative;
  padding: var(--sp-xl) 48px var(--sp-lg);
  text-align: center;
  background: var(--bg1);
  border-bottom: 1px solid rgba(107,93,79,.2);
}
.signup-hero .slbl {
  margin-bottom: var(--sp-sm);
}
.signup-hero h1 {
  font-family: var(--font-heading);
  font-size: var(--fs-h1);
  letter-spacing: .18em;
  color: var(--gd);
  margin-bottom: var(--sp-sm);
}
.signup-hero p {
  font-family: var(--font-prose);
  font-style: italic;
  font-size: var(--fs-lead);
  color: var(--br2);
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.7;
}

.signup-form {
  max-width: 620px;
  margin: 0 auto;
  padding: var(--sp-xl) 48px var(--sp-2xl);
}

.field-group {
  margin-bottom: var(--sp-lg);
}
.field-group:last-of-type {
  margin-bottom: var(--sp-xl);
}

.field-label {
  font-family: var(--font-heading);
  font-size: var(--fs-caption);
  letter-spacing: .18em;
  color: var(--gd);
  text-transform: uppercase;
  display: block;
  margin-bottom: var(--sp-sm);
}
.field-hint {
  font-family: var(--font-body);
  font-size: var(--fs-caption);
  color: var(--br0);
  display: block;
  margin-top: -8px;
  margin-bottom: var(--sp-sm);
}

.form-input {
  width: 100%;
  background: var(--bg1);
  border: 1px solid var(--br0);
  padding: 14px 20px;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--fs-body);
  color: var(--pc);
  outline: none;
  transition: border-color .2s;
  border-radius: 0;
}
.form-input::placeholder {
  color: var(--br0);
}
.form-input:focus {
  border-color: var(--gd);
  caret-color: var(--amb);
}

.radio-group,
.check-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.radio-option,
.check-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--bg1);
  border: 1px solid rgba(107,93,79,.15);
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.radio-option:hover,
.check-option:hover {
  background: var(--bg2);
  border-color: rgba(107,93,79,.35);
}

.radio-option input[type="radio"],
.check-option input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1px solid var(--br0);
  background: transparent;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  transition: border-color .2s;
}
.radio-option input[type="radio"] {
  border-radius: 50%;
}
.check-option input[type="checkbox"] {
  border-radius: 0;
}
.radio-option input[type="radio"]:checked,
.check-option input[type="checkbox"]:checked {
  border-color: var(--gd);
}
.radio-option input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 8px; height: 8px;
  background: var(--gd);
  border-radius: 50%;
}
.check-option input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 1px; left: 4px;
  width: 5px; height: 9px;
  border: solid var(--gd);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.radio-option span,
.check-option span {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--pc);
  line-height: 1.4;
}

.form-select {
  width: 100%;
  background: var(--bg1);
  border: 1px solid var(--br0);
  padding: 14px 20px;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--fs-body);
  color: var(--pc);
  outline: none;
  transition: border-color .2s;
  border-radius: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23A89168' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}
.form-select:focus {
  border-color: var(--gd);
}
.form-select option {
  background: var(--bg1);
  color: var(--pc);
}

.form-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--br0) 20%, var(--gd) 50%, var(--br0) 80%, transparent);
  opacity: .25;
  margin: var(--sp-lg) 0;
}

.submit-wrap {
  text-align: center;
}
.submit-wrap .btn {
  min-width: 280px;
  padding: 16px 40px;
  font-size: var(--fs-caption);
}
.submit-note {
  font-family: var(--font-body);
  font-size: var(--fs-tiny);
  color: var(--br0);
  margin-top: var(--sp-sm);
  letter-spacing: .03em;
}

@media (max-width: 900px) {
  .sb-layout { grid-template-columns: 1fr; }
  .sb-nav {
    position: fixed; left: -280px; top: 56px; z-index: 150;
    width: 270px;
    transition: left .3s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,.5);
  }
  .sb-nav.mobile-open { left: 0; }
  .sb-mobile-toggle { display: flex; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .bc-inner, .content-inner, .page-note, .page-nav {
    padding-left: 24px;
    padding-right: 24px;
  }
  .hero-inner {
    padding-left: 0;
    padding-right: 0;
  }
}

@media (max-width: 600px) {
  html { font-size: 16px; }
  .si, .sin { padding: var(--sp-lg) 20px; }
  .faction-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .nl-form { flex-direction: column; }
  .nl-input { border-right: 1px solid var(--br0); border-bottom: none; }
  .content-inner { padding-left: 20px; padding-right: 20px; }
}

/* ==========================================================================
   LIGHT MODE
   Cream/old-paper background with near-black brown text.
   Activated by data-theme="light" on <html>, or by OS preference.
   ========================================================================== */

[data-theme="light"] {
  /* Backgrounds — warm cream/paper spectrum */
  --bg0: #F5F0E8;
  --bg1: #EDE7DC;
  --bg2: #E3DBCF;
  --bg-modal: rgba(245,240,232,.85);

  /* Bronze / Gold — darkened for WCAG AAA (7:1+) on cream backgrounds */
  --br0: #534A40;
  --br1: #554A3B;
  --br2: #574936;
  --gd:  #5A4924;
  --gdb: #564421;

  /* Semantic */
  --amb: #B8860B;
  --err: #A0422A;
  --ok:  #3D6B2E;

  /* Text — near-black brown for maximum readability on cream */
  --pc:  #2C2418;
  --pcl: #1A140C;
}

/* Marketing hero — lighten with cream wash, mask edges to transparent */
[data-theme="light"] .hero-img {
  -webkit-mask-image:
    linear-gradient(180deg, transparent 0%, black 10%, black 85%, transparent 100%);
  mask-image:
    linear-gradient(180deg, transparent 0%, black 10%, black 85%, transparent 100%);
}
[data-theme="light"] .hero-img::after {
  background:
    rgba(245,240,232,.5);
}

/* Nav bar */
[data-theme="light"] #nav {
  background: rgba(245,240,232,.96);
  border-bottom-color: rgba(107,93,79,.15);
}
[data-theme="light"] #nav.sc {
  background: rgba(245,240,232,.98);
}
[data-theme="light"] .nlinks a { color: var(--br2); }
[data-theme="light"] .nlinks a:visited { color: var(--br2); }
[data-theme="light"] .nlinks a:hover { color: var(--gd); }
[data-theme="light"] .ncta {
  background: var(--gd) !important;
  color: #F5F0E8 !important;
}
[data-theme="light"] .ncta:hover {
  background: var(--gdb) !important;
}
[data-theme="light"] .lang-sel-btn {
  color: var(--br2);
  border-color: rgba(107,93,79,.25);
}
[data-theme="light"] .lang-sel-btn:hover {
  border-color: var(--gd);
  color: var(--gd);
}
[data-theme="light"] .lang-dropdown {
  background: var(--bg1);
  border-color: rgba(107,93,79,.2);
}

/* Page hero — lighten + sepia wash, edges blend to cream via mask */
[data-theme="light"] .page-hero {
  -webkit-mask-image:
    linear-gradient(180deg, transparent 0%, black 10%, black 88%, transparent 100%);
  mask-image:
    linear-gradient(180deg, transparent 0%, black 10%, black 88%, transparent 100%);
}
[data-theme="light"] .page-hero::before {
  background:
    rgba(245,240,232,.55);
}
/* Light mode: swap the dark swirl for the cream scrollwork on non-map heroes */
[data-theme="light"] .page-hero:not(.hero-map) {
  background-image: url('../images/Delicate scrollwork and gilded waves.png') !important;
  background-size: cover;
  background-position: center;
}
[data-theme="light"] .page-hero:not(.hero-map)::before {
  background: transparent;
}
/* Hero text — dark brown for readability on the now-lighter hero */
[data-theme="light"] .page-title {
  background: linear-gradient(180deg, #2C2418 0%, #3D3220 40%, #5A4924 80%, #6B5A42 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 8px rgba(255,255,255,.6)) drop-shadow(0 0 20px rgba(245,240,232,.4));
}
[data-theme="light"] .region-label {
  color: var(--br2);
  text-shadow: 0 1px 8px rgba(255,255,255,.6);
}
[data-theme="light"] .page-subtitle {
  color: var(--br2);
  text-shadow: 0 1px 6px rgba(255,255,255,.5);
}
[data-theme="light"] .page-hero .kl {
  background: linear-gradient(90deg, transparent 0%, var(--br0) 12%, var(--gd) 38%, var(--gdb) 50%, var(--gd) 62%, var(--br0) 88%, transparent);
}

/* Breadcrumb */
[data-theme="light"] .breadcrumb {
  background: var(--bg0);
}

/* Content area */
[data-theme="light"] .content-wrap {
  background: var(--bg0);
}
[data-theme="light"] .content-wrap::before {
  opacity: .04;
}

/* Prose — dark brown on cream */
[data-theme="light"] .prose p {
  color: var(--pc);
}
[data-theme="light"] .prose p:first-child::first-letter {
  color: var(--gd);
  filter: none;
}
[data-theme="light"] .prose a {
  color: var(--gd);
}
[data-theme="light"] .prose a:visited {
  color: var(--br1);
}
[data-theme="light"] .prose a:hover {
  color: var(--gdb);
}

/* Faction closing blockquote */
[data-theme="light"] .prose .faction-closing {
  background: linear-gradient(135deg, rgba(90,73,36,.08) 0%, rgba(90,73,36,.04) 100%);
  border-left-color: var(--gd);
}
[data-theme="light"] .prose .faction-closing p {
  color: var(--pc);
}

/* Selection */
[data-theme="light"] ::selection {
  background: rgba(122,99,50,.2);
  color: var(--pcl);
}

/* Decorative lines */
[data-theme="light"] .kl {
  background: linear-gradient(90deg, transparent 0%, var(--br0) 12%, var(--gd) 38%, var(--gdb) 50%, var(--gd) 62%, var(--br0) 88%, transparent);
}

/* Sidebar */
[data-theme="light"] .sb-nav {
  background: var(--bg1);
  border-right-color: rgba(107,93,79,.15);
}
[data-theme="light"] .sb-scroll::-webkit-scrollbar-thumb {
  background: rgba(107,93,79,.2);
}
[data-theme="light"] .sb-toggle { color: var(--gd); }
[data-theme="light"] .sb-link { color: var(--br1); }
[data-theme="light"] .sb-link:hover { background: rgba(107,93,79,.08); color: var(--pc); }
[data-theme="light"] .sb-link:visited { color: var(--br0); }
[data-theme="light"] .sb-link.current { color: var(--gd); background: rgba(122,99,50,.1); }
[data-theme="light"] .sb-group-toggle { color: var(--br2); }
[data-theme="light"] .sb-group-toggle:hover { background: rgba(107,93,79,.06); }
[data-theme="light"] .sb-subgroup-toggle { color: var(--br2); }
[data-theme="light"] .sb-subgroup-toggle:hover { background: rgba(107,93,79,.06); }
[data-theme="light"] a.sb-section-link { color: var(--gd); }
[data-theme="light"] a.sb-group-link { color: inherit; }
[data-theme="light"] a.sb-subgroup-link { color: inherit; }
[data-theme="light"] .sb-notify { color: var(--br1); }
[data-theme="light"] .sb-notify:hover { background: rgba(107,93,79,.06); color: var(--gd); }
[data-theme="light"] .sb-chevron { border-color: var(--br1); }

/* Hub cards — light theme */
[data-theme="light"] .hub-grid { background: none; }
[data-theme="light"] .hub-card {
  background: transparent;
  border-color: var(--br0);
}
[data-theme="light"] .hub-card::before {
  border-color: rgba(90,73,36,.2);
}
[data-theme="light"] .hub-card::after { opacity: .35; }
[data-theme="light"] .hub-card:hover {
  border-color: var(--gd);
  box-shadow: 0 0 18px rgba(90,73,36,.06);
}
[data-theme="light"] .hub-card:hover::before { border-color: rgba(90,73,36,.4); }
[data-theme="light"] .hub-card:hover::after { opacity: .7; }
[data-theme="light"] .hub-card h3 { color: var(--gd); }
[data-theme="light"] .hub-card p { color: var(--br2); }
[data-theme="light"] .hub-card.coming-soon .coming-soon-badge {
  color: var(--br0);
}
[data-theme="light"] .hub-ref-card { border-color: rgba(107,93,79,.25); }
[data-theme="light"] .hub-ref-card::before { border-color: rgba(90,73,36,.12); }
[data-theme="light"] .hub-ref-card:hover { border-color: var(--gd); }
[data-theme="light"] .hub-ref-card:hover::before { border-color: rgba(90,73,36,.3); }

/* Newsletter section */
[data-theme="light"] .nl-bg {
  background: var(--bg1);
}
[data-theme="light"] .nl-input {
  background: var(--bg0);
  border-color: rgba(107,93,79,.2);
  color: var(--pc);
}
[data-theme="light"] .nl-input::placeholder { color: var(--br0); }
[data-theme="light"] .nl-input:focus { border-color: var(--gd); }

/* Footer */
[data-theme="light"] footer {
  background: var(--bg1);
  border-top-color: rgba(107,93,79,.15);
}
[data-theme="light"] .footer-col a { color: var(--br2); }
[data-theme="light"] .footer-col a:visited { color: var(--br2); }
[data-theme="light"] .footer-col a:hover { color: var(--gd); }
[data-theme="light"] .footer-bottom p { color: var(--br0); }

/* Page navigation (prev/next) */
[data-theme="light"] .page-nav a {
  border-color: rgba(107,93,79,.15);
}
[data-theme="light"] .page-nav a:hover {
  background: rgba(107,93,79,.06);
  border-color: var(--gd);
}

/* Mobile sidebar toggle */
[data-theme="light"] .sb-mobile-toggle {
  color: var(--br2);
}

/* Theme toggle button */
.theme-toggle {
  background: none;
  border: 1px solid rgba(107,93,79,.25);
  border-radius: 4px;
  cursor: pointer;
  padding: 4px 8px;
  font-size: var(--fs-caption);
  color: var(--br2);
  transition: border-color .2s, color .2s;
  display: flex;
  align-items: center;
}
.theme-toggle:hover {
  border-color: var(--gd);
  color: var(--gd);
}
.theme-toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Show moon icon in dark mode, sun icon in light mode */
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* Glossary definition list — visual presentation only.
   The build script emits <dl class="glossary">, <dt class="glossary-term">,
   and <dd class="glossary-definition"> from explicit JSON fields. Bold weight
   on the term comes from CSS, not from <strong> markup, so JSON content
   stays free of presentation tags.
   Typography matches .prose p so the glossary visually integrates with
   surrounding prose paragraphs (same font family, size, color, line-height). */
dl.glossary { margin: 0 0 1.5em 0; }
dl.glossary .glossary-term,
dl.glossary .glossary-definition {
  font-family: var(--font-prose);
  font-size: clamp(1.08rem, 1.6vw, 1.2rem);
  color: var(--pc);
  line-height: 1.82;
}
dl.glossary .glossary-term { font-weight: 700; margin-top: 1em; }
dl.glossary .glossary-term:first-child { margin-top: 0; }
dl.glossary .glossary-definition { font-weight: 400; margin: 0 0 0 1.5em; }
