:root {
  --font-sans: 'Be Vietnam Pro', system-ui, -apple-system, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  --obsidian: #070C18;
  --obsidian-2: #0E172A;
  --carbon: #0A0D14;
  --slate-dark: #121826;
  --midnight: #091120;
  --alabaster: #F7F4EE;
  --porcelain: #F2F6FC;
  --ivory: #FAF8F4;
  --stone: #F4F2EC;
  --ink: #111622;
  --ink-muted: #334155;
  --light: #F5F7FC;
  --light-muted: rgba(245, 247, 252, 0.76);
  --gold: #F0C35A;
  --gold-deep: #C9972B;
  --terracotta: #B85A3A;
  --cobalt: #1D4ED8;
  --emerald: #2FB88A;
  --ice: #60A5FA;
  --container: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; overflow-x: clip; background: var(--obsidian); }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--obsidian);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.18; font-weight: 700; }
h1, h2 { font-family: var(--font-serif); letter-spacing: -0.015em; }
h1 em, h2 em { font-style: italic; font-weight: 600; }

.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;
}
.skip-link {
  position: fixed; top: -60px; left: 16px; z-index: 300;
  background: var(--gold); color: var(--obsidian); padding: 10px 18px;
  font-weight: 700; transition: transform 0.2s ease;
}
.skip-link:focus { top: 12px; }

.container { width: min(var(--container), calc(100% - 40px)); margin-inline: auto; position: relative; z-index: 2; }

/* Sticky Translucent Header */
.site-header {
  position: sticky; top: 0; z-index: 90;
  background: rgba(7, 12, 24, 0.92);
  border-bottom: 1px solid rgba(240, 195, 90, 0.14);
  color: var(--light);
  transition: background-color 0.28s ease, border-color 0.28s ease;
}
body.page-home .site-header { background: rgba(7, 12, 24, 0.72); border-bottom-color: rgba(240, 195, 90, 0.08); }
body.page-home .site-header.is-scrolled { background: rgba(7, 12, 24, 0.96); border-bottom-color: rgba(240, 195, 90, 0.22); }
.header-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand-mark { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; flex-shrink: 0; }
.brand-icon { width: 28px; height: 28px; border-radius: 6px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.05rem; letter-spacing: -0.01em; color: var(--light); }
.brand-text small { font-size: 0.7rem; color: var(--gold); letter-spacing: 0.04em; }
.site-nav { display: flex; align-items: center; }
.nav-links { list-style: none; display: flex; align-items: center; gap: 6px; margin: 0; padding: 0; }
.nav-links a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 11px;
  font-size: 0.88rem; font-weight: 500; color: rgba(245, 247, 252, 0.84);
  transition: color 0.18s ease, opacity 0.18s ease;
}
.nav-links a.is-active { color: var(--gold); }
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Inline >=44x44px WebAudio SFX Toggle */
.sound-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 44px; min-height: 44px; padding: 0 12px; border-radius: 6px; cursor: pointer;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(245, 247, 252, 0.2);
  color: rgba(245, 247, 252, 0.76); font-size: 0.8rem; font-weight: 700;
  transition: transform 0.18s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.sound-toggle .sound-wave { opacity: 0.28; transition: opacity 0.2s ease; }
.sound-toggle.is-on {
  background: rgba(240, 195, 90, 0.16); border-color: var(--gold); color: var(--gold);
}
.sound-toggle.is-on .sound-wave { opacity: 1; }

.nav-toggle {
  display: none; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px; background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(240, 195, 90, 0.26); border-radius: 8px; cursor: pointer;
}

/* Luxury Buttons (>=44px / >=48px) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 4px; border: 1px solid transparent;
  font-size: 0.92rem; font-weight: 700; cursor: pointer; white-space: nowrap;
  transition: transform 0.18s ease, opacity 0.18s ease, background-color 0.2s ease, border-color 0.2s ease;
}
.btn:active { transform: scale3d(0.985, 0.985, 1); }
.btn--sm { min-height: 44px; padding: 0 15px; font-size: 0.84rem; }
.btn--lg { min-height: 48px; padding: 0 24px; font-size: 0.96rem; }
.btn--full { width: 100%; }
.btn--gold { background: var(--gold); color: #090E1A; border-color: var(--gold); }
.btn--dark { background: var(--ink); color: var(--light); border-color: var(--ink); }
.btn--outline-light { background: rgba(255, 255, 255, 0.04); color: var(--light); border-color: rgba(245, 247, 252, 0.28); }
.btn--outline-dark { background: transparent; color: var(--ink); border-color: rgba(17, 22, 34, 0.26); }

/* Eyebrow & Section Head */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
}
.eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); flex-shrink: 0; }
.eyebrow--gold { color: var(--gold); }
.eyebrow--gold-dark { color: #9A6B12; }
.eyebrow--terracotta { color: var(--terracotta); }
.eyebrow--cobalt { color: var(--cobalt); }
.eyebrow--emerald { color: var(--emerald); }
.eyebrow--ice { color: var(--ice); }
.eyebrow--ink { color: var(--ink-muted); }

.section-head { max-width: 780px; margin: 0 auto 40px; text-align: center; }
.section-head h2 { font-size: clamp(1.85rem, 3.6vw, 2.95rem); margin-bottom: 12px; }
.section-head--light h2 { color: var(--light); }
.section-lead { margin: 0 auto; max-width: 640px; font-size: 1rem; color: var(--ink-muted); }
.section-head--light .section-lead { color: var(--light-muted); }

/* Chapters & Monumental 0px-Flow Watermarks + Sticky Header Anchor Safety */
.chapter, section[id] { scroll-margin-top: 96px; }
.chapter { position: relative; padding: 84px 0; overflow-x: clip; }
.chapter-watermark {
  position: absolute; top: 18px; left: 50%; transform: translate3d(-50%, 0, 0);
  font-family: var(--font-serif); font-weight: 800; font-size: clamp(4.2rem, 13.5vw, 12rem);
  line-height: 0.9; letter-spacing: 0.08em; white-space: nowrap;
  color: rgba(245, 247, 252, 0.042); pointer-events: none; user-select: none; z-index: 0;
}
.chapter-watermark--light { color: rgba(17, 22, 34, 0.042); }

/* Fail-Open Reveal (Visible 100% by default without JS!) */
.fx-reveal { opacity: 1; transform: none; }
html.fx-armed .fx-reveal:not(.is-revealed) { opacity: 0; transform: translate3d(0, 18px, 0); }
html.fx-armed .fx-reveal.is-revealed {
  opacity: 1; transform: translate3d(0, 0, 0);
  transition: opacity 0.48s cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0ms),
              transform 0.48s cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0ms);
}

@media (hover: hover) and (pointer: fine) {
  .nav-links a:hover { color: var(--gold); }
  .sound-toggle:hover { border-color: var(--gold); color: var(--gold); }
  .btn--gold:hover { background: #F7D37A; transform: translate3d(0, -1px, 0); }
  .btn--dark:hover { background: #1E293B; transform: translate3d(0, -1px, 0); }
  .btn--outline-light:hover { border-color: var(--gold); color: var(--gold); }
  .btn--outline-dark:hover { border-color: var(--ink); background: rgba(17, 22, 34, 0.05); }
}

@media (max-width: 1060px) {
  .sound-toggle-label { display: none; }
  .sound-toggle { padding: 0; }
}

@media (max-width: 980px) {
  .site-nav {
    position: fixed; inset: 54px 0 auto 0; background: rgba(7, 12, 24, 0.98);
    border-bottom: 1px solid rgba(240, 195, 90, 0.22); padding: 14px 20px 20px;
    display: none; z-index: 95;
  }
  .site-nav.is-open { display: block; }
  .nav-links { flex-direction: column; align-items: stretch; gap: 4px; }
  .nav-links a { padding: 0 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
  .nav-toggle { display: inline-flex; }
}

@media (max-width: 720px) {
  .container { width: calc(100% - 28px); }
  .header-inner { min-height: 52px; gap: 8px; }
  .brand-text small { display: none; }
  .header-actions { gap: 6px; }
  .header-dl-btn { padding: 0 10px; font-size: 0.78rem; }
  .chapter { padding: 44px 0; }
  .section-head { margin-bottom: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #avSoundToggle { display: none !important; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html.fx-armed .fx-reveal:not(.is-revealed) { opacity: 1; transform: none; }
}
