/* =========================================================
   ORÉON — Maison de Haute Horlogerie
   Gold · obsidian · cinematic scroll experience
   ========================================================= */

:root {
  /* —— Color ——————————————————————————— */
  --bg-0: #050403;
  --bg-1: #0a0805;
  --ink-0: #f4ead8;
  --ink-1: #c9bfa9;
  --ink-2: #8a8170;
  --ink-3: #4a4438;
  --line: rgba(216, 184, 124, 0.10);
  --line-strong: rgba(216, 184, 124, 0.22);
  --glass: rgba(255, 240, 210, 0.025);
  --glass-strong: rgba(255, 240, 210, 0.05);
  --gold: #d8b87c;
  --gold-bright: #f0d28a;
  --gold-deep: #8a6a2e;
  --teal: #5fb8c0;
  --teal-bright: #7ed4dc;
  --focus: rgba(216, 184, 124, 0.55);

  /* —— Space scale ——————————————————————
     Modular, warm-tinted spacing for visual rhythm.
     Use these instead of hardcoded pixel values. */
  --s-1:  4px;
  --s-2:  8px;
  --s-3:  12px;
  --s-4:  16px;
  --s-5:  20px;
  --s-6:  24px;
  --s-7:  32px;
  --s-8:  40px;
  --s-9:  56px;
  --s-10: 72px;
  --s-11: 96px;
  --s-12: 128px;

  /* —— Shape & motion ——————————————————— */
  --radius: 14px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  /* exponential easings for natural deceleration */
  --ease:        cubic-bezier(0.22, 0.61, 0.36, 1);   /* ease-out-quart */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);       /* ease-out-expo  */
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);      /* ease-in-out-quart */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* —— Focus rings —— Investors will tab through. Every interactive surface
   gets a single, calm, gold focus halo. Never remove without replacement. */
:where(button, a, [tabindex]):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
  transition: outline-offset 0.2s var(--ease);
}
.btn-primary:focus-visible,
.btn-ghost:focus-visible {
  outline-offset: 4px;
  border-radius: var(--radius-pill);
}

/* —— Reduced motion —— Honor the OS preference. The page still tells the
   story but skips long animations, scroll-driven sequences, and autoplay video. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .scroll-line::after,
  .dot,
  .status-dot,
  .pre-mark-img { animation: none !important; }
}

html, body {
  background: var(--bg-0);
  color: var(--ink-0);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* overflow-x: hidden on html/body breaks position: sticky in Chromium.
   Instead, prevent horizontal scroll by isolating any element that could overflow
   (ambient orbs already have overflow:hidden on their wrapper). */
html { overflow-x: clip; }

body {
  min-height: 100vh;
  background:
    radial-gradient(1400px 800px at 70% -10%, rgba(216, 184, 124, 0.10), transparent 60%),
    radial-gradient(900px 700px at 10% 110%, rgba(216, 184, 124, 0.06), transparent 60%),
    linear-gradient(180deg, #050403 0%, #08060a 40%, #050403 100%);
}

/* lock scroll while preloader is active */
body.loading { overflow: hidden; height: 100vh; }

/* ---------- Preloader ---------- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 200;
  background:
    radial-gradient(ellipse 60% 50% at 50% 40%, rgba(216, 184, 124, 0.06), transparent 60%),
    #050403;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-6);
  transition: opacity 1s var(--ease), visibility 1s var(--ease);
}
.pre-wordmark {
  font-family: "Cormorant Garamond", serif;
  font-size: 38px;
  font-weight: 300;
  letter-spacing: 0.36em;
  color: var(--ink-0);
  margin-top: var(--s-3);
  text-indent: 0.36em; /* visually re-center for tracking */
  text-shadow: 0 0 30px rgba(216, 184, 124, 0.15);
}
.preloader.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.pre-mark-img {
  width: 78px; height: 78px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 0 40px rgba(216, 184, 124, 0.4));
  animation: pre-breathe 3.6s ease-in-out infinite;
}
@keyframes pre-breathe {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50%      { transform: scale(1.04); opacity: 1; }
}
.pre-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-width: 280px;
}
.pre-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.35em;
  color: var(--ink-2);
}
.pre-bar {
  width: 100%; height: 1px;
  background: rgba(216, 184, 124, 0.12);
  overflow: hidden;
}
.pre-bar-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, transparent, var(--gold));
  transition: width 0.2s linear;
}
.pre-pct {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--ink-1);
  letter-spacing: 0.2em;
}

/* ---------- Grain ---------- */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 0.92 0 0 0 0 0.75 0 0 0 0.6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ---------- Ambient gold orbs ---------- */
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  will-change: transform;
}
.orb-1 { width: 600px; height: 600px; top: -10%; right: -10%;
  background: radial-gradient(circle, rgba(216, 184, 124, 0.32), transparent 70%); }
.orb-2 { width: 500px; height: 500px; bottom: 5%; left: -10%;
  background: radial-gradient(circle, rgba(95, 184, 192, 0.10), transparent 70%); }
.orb-3 { width: 800px; height: 800px; top: 40%; left: 50%; transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(216, 184, 124, 0.06), transparent 70%); }

/* When the body scene is the dominant view, fade the warm-gold ambient
   so the platform aesthetic reads navy-institutional, not maison-warm. */
.ambient, .stage-vignette { transition: opacity 0.6s var(--ease); }
body.in-body-stage .ambient,
body.in-body-stage .stage-vignette { opacity: 0; }
body.in-body-stage { background: #050b18; }

/* ---------- 3D Canvas (frame sequence) ---------- */
#scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
  will-change: opacity;
}

/* Vignette: permanent radial darkening at corners — feels cinematic */
.stage-vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 70% at 50% 50%, transparent 30%, rgba(0, 0, 0, 0.65) 100%);
  mix-blend-mode: multiply;
}

/* Scrim: scroll-driven dark wash that grows as the gold logo emerges,
   keeping headlines readable. Driven by JS via --scrim CSS var. */
.stage-scrim {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5, 4, 3, calc(var(--scrim, 0) * 0.35)) 0%, rgba(5, 4, 3, calc(var(--scrim, 0) * 0.55)) 50%, rgba(5, 4, 3, calc(var(--scrim, 0) * 0.35)) 100%);
}

/* ---------- Glass utility ---------- */
.glass {
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow:
    inset 0 1px 0 rgba(216, 184, 124, 0.06),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    0 30px 80px -10px rgba(0, 0, 0, 0.55),
    0 1px 0 rgba(216, 184, 124, 0.04);
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 8px 14px 8px 16px;
  border-radius: 999px;
  width: min(1100px, calc(100vw - 40px));
  justify-content: space-between;
}

.nav-left, .nav-right { display: flex; align-items: center; gap: 10px; }

.logo { display: flex; align-items: center; gap: 12px; }
.logo-mark {
  width: 30px; height: 30px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 0 14px rgba(216, 184, 124, 0.35));
}
.logo-text {
  font-family: "Cormorant Garamond", serif;
  font-weight: 500;
  letter-spacing: 0.18em;
  font-size: 17px;
  color: var(--ink-0);
}

.nav-center { display: flex; gap: 30px; }
.nav-center a {
  color: var(--ink-1);
  text-decoration: none;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: color 0.3s var(--ease);
  position: relative;
}
.nav-center a:hover { color: var(--gold-bright); }
.nav-center a::after {
  content: ''; position: absolute; bottom: -6px; left: 50%;
  width: 0; height: 1px; background: var(--gold);
  transition: width 0.4s var(--ease), left 0.4s var(--ease);
}
.nav-center a:hover::after { width: 100%; left: 0; }

/* ---------- Buttons ---------- */
.btn-primary, .btn-ghost {
  font-family: "Inter", sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 11px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.4s var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 50%, var(--gold-deep) 100%);
  color: #1a1408;
  border: 1px solid rgba(240, 210, 138, 0.6);
  box-shadow:
    0 8px 28px rgba(216, 184, 124, 0.20),
    inset 0 1px 0 rgba(255, 240, 200, 0.6);
  position: relative;
  overflow: hidden;
}
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.4) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.9s var(--ease-out);
  pointer-events: none;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow:
    0 18px 48px rgba(216, 184, 124, 0.34),
    inset 0 1px 0 rgba(255, 240, 200, 0.8);
}
.btn-primary:hover::after { transform: translateX(120%); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: var(--glass);
  color: var(--ink-0);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(20px);
}
.btn-ghost:hover {
  background: var(--glass-strong);
  border-color: rgba(216, 184, 124, 0.4);
  color: var(--gold-bright);
}
.btn-ghost:active { transform: translateY(1px); }
.btn-primary.large, .btn-ghost.large { padding: 16px 30px; font-size: 12px; }
.btn-primary.xl, .btn-ghost.xl { padding: 20px 38px; font-size: 13px; }

/* ---------- Rail (scroll progress) ---------- */
.rail {
  position: fixed;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.rail-bar {
  width: 1px;
  height: 240px;
  background: rgba(216, 184, 124, 0.10);
  position: relative;
  overflow: hidden;
}
.rail-fill {
  position: absolute;
  left: 0; top: 0;
  width: 100%;
  height: 0%;
  background: linear-gradient(180deg, transparent, var(--gold));
  box-shadow: 0 0 10px rgba(216, 184, 124, 0.5);
  transition: height 0.12s linear;
}
.rail-meta {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  display: flex;
  gap: 14px;
  align-items: center;
}
.rail-chapter, .rail-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--ink-2);
}
.rail-label { color: var(--gold); }

/* ---------- HUD ---------- */
.hud {
  position: fixed;
  right: var(--s-6);
  bottom: var(--s-6);
  z-index: 40;
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-4) var(--s-5);
  min-width: 232px;
  border-radius: 10px;
  opacity: 0.9;
  transition: opacity 0.4s var(--ease);
}
.hud:hover { opacity: 1; }
.hud-row {
  display: flex;
  justify-content: space-between;
  gap: var(--s-6);
  line-height: 1.5;
}
.hud-row span { color: var(--ink-3); letter-spacing: 0.22em; font-size: 9.5px; }
.hud-row b {
  color: var(--ink-1);
  font-weight: 400;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

/* ---------- Main / Chapters ---------- */
main {
  position: relative;
  z-index: 5;
}

.chapter {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-12) var(--s-10);
  position: relative;
}
/* Hairline gold divider above every chapter except the hero — subtle, optional rhythm */
.chapter + .chapter::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(80px, 14vw, 200px);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold) 50%, transparent);
  opacity: 0.45;
}
.chapter-inner {
  width: 100%;
  max-width: 1280px;
  position: relative;
  z-index: 2;
}

/* ---------- Typography ---------- */
.eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(14px);
}
.dot {
  width: 5px; height: 5px;
  background: var(--gold-bright);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(240, 210, 138, 0.9);
  animation: pulse 2.4s infinite var(--ease);
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.hero-title {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(56px, 9vw, 140px);
  font-weight: 400;
  line-height: 0.96;
  letter-spacing: -0.022em;
  margin-bottom: var(--s-8);
  max-width: 18ch;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  text-rendering: optimizeLegibility;
  text-shadow: 0 4px 40px rgba(0, 0, 0, 0.7);
}
.hero-title em {
  font-style: italic;
  font-weight: 300;
  background: linear-gradient(180deg, var(--gold-bright) 20%, var(--gold-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-1);
  max-width: 52ch;
  margin-bottom: 44px;
  font-weight: 300;
}

.hero-cta { display: flex; gap: 12px; }

.chapter-title {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(40px, 6vw, 84px);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.018em;
  margin-bottom: var(--s-6);
  font-feature-settings: "kern" 1, "liga" 1;
  text-rendering: optimizeLegibility;
  text-shadow: 0 4px 40px rgba(0, 0, 0, 0.7);
}
.chapter-title em {
  font-style: italic;
  font-weight: 300;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.chapter-title.center { text-align: center; }

.tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.4em;
  color: var(--gold);
  margin-bottom: var(--s-7);
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
}
.tag::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 1px;
  background: var(--gold);
  opacity: 0.65;
}
.tag.center {
  text-align: center;
  justify-content: center;
}

.lede {
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-1);
  max-width: 52ch;
  font-weight: 300;
}
.lede.center { margin: 0 auto; text-align: center; }

/* ---------- Chapter layouts ---------- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}
.center-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.chapter-hero .chapter-inner {
  display: grid;
  align-content: end;
  min-height: 78vh;
}

.chapter-rotate .col-left { padding-right: 40px; }
.chapter-rotate .col-right { display: flex; flex-direction: column; gap: 32px; }

.chapter-reassemble .col-left { order: 2; }
.chapter-reassemble .col-right { order: 1; }
.chapter-reassemble .col-left { padding-left: 40px; }

/* ---------- Stat grid ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 36px;
  gap: 0;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 24px;
  border-left: 1px solid var(--line);
}
.stat:first-child { border-left: none; padding-left: 0; }
.stat-num {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(40px, 4.4vw, 64px);
  font-weight: 300;
  letter-spacing: -0.03em;
  color: var(--ink-0);
  line-height: 1;
}
.stat-num i {
  font-style: normal;
  font-size: 0.42em;
  opacity: 0.55;
  letter-spacing: 0.05em;
  margin-left: 2px;
  vertical-align: 0.45em;
}
.stat-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--ink-2);
  text-transform: uppercase;
}

/* ---------- Feature grid ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 60px;
  width: 100%;
}
.feature {
  padding: 36px;
  text-align: left;
  transition: transform 0.6s var(--ease-out), border-color 0.4s var(--ease);
}
.feature:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
}
.feature-icon {
  font-size: 22px;
  color: var(--gold);
  margin-bottom: 24px;
  text-shadow: 0 0 18px rgba(216, 184, 124, 0.6);
}
.feature h3 {
  font-family: "Cormorant Garamond", serif;
  font-size: 24px;
  font-weight: 400;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}
.feature p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-2);
  font-weight: 300;
}

/* ---------- Spec block ---------- */
.spec-block {
  padding: 8px 36px;
}
.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.spec-row:last-child { border-bottom: none; }
.spec-row span {
  color: var(--ink-2);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.spec-row b {
  font-family: "Cormorant Garamond", serif;
  font-weight: 500;
  font-size: 17px;
  color: var(--ink-0);
  letter-spacing: -0.005em;
  text-align: right;
}

/* ---------- Scroll cue ---------- */
.scroll-cue {
  position: absolute;
  bottom: -20px;
  left: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.35em;
  color: var(--ink-2);
  transition: opacity 0.7s var(--ease);
}
body.has-scrolled .scroll-cue { opacity: 0; }
.scroll-line {
  width: 70px;
  height: 1px;
  background: rgba(216, 184, 124, 0.15);
  position: relative;
  overflow: hidden;
}
.scroll-line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--gold), transparent);
  width: 35%;
  animation: scroll-cue 2.6s infinite var(--ease);
}
@keyframes scroll-cue {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(300%); }
}

/* ---------- CTA / Footer ---------- */
.chapter-cta {
  padding-top: 80px;
  padding-bottom: 60px;
  min-height: auto;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

/* Cinematic full-bleed video background — autoplays once on enter */
.cta-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.4s var(--ease);
  /* feather edges so it blends into the page bg */
  -webkit-mask-image: radial-gradient(ellipse 130% 110% at 50% 45%, #000 70%, transparent 100%);
          mask-image: radial-gradient(ellipse 130% 110% at 50% 45%, #000 70%, transparent 100%);
}
.chapter-cta.is-playing .cta-video { opacity: 1; }

/* Dark scrim over the video so headline & buttons stay legible.
   Two layers: a top band that darkens behind the headline area, and a
   broad vignette that lifts overall contrast against the bright crest. */
.cta-video-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 70% at 50% 50%, rgba(5, 4, 3, 0.72) 0%, rgba(5, 4, 3, 0.92) 100%),
    linear-gradient(180deg, rgba(5, 4, 3, 0.85) 0%, rgba(5, 4, 3, 0.65) 18%, rgba(5, 4, 3, 0.55) 50%, rgba(5, 4, 3, 0.75) 80%, rgba(5, 4, 3, 0.95) 100%);
}
.cta-video-grain {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 0.92 0 0 0 0 0.75 0 0 0 0.5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* CTA content sits above the video layers */
.cta-content { position: relative; z-index: 3; }

/* Cascaded reveal animation — driven by .is-playing class on section */
.cta-reveal {
  opacity: 0;
  transform: translateY(28px);
  filter: blur(6px);
  transition: opacity 1.1s var(--ease-out), transform 1.1s var(--ease-out), filter 1.1s var(--ease-out);
}
.chapter-cta.is-playing .cta-reveal-1 { transition-delay: 0.35s; }
.chapter-cta.is-playing .cta-reveal-2 { transition-delay: 0.85s; }
.chapter-cta.is-playing .cta-reveal-3 { transition-delay: 1.55s; }
.chapter-cta.is-playing .cta-reveal-4 { transition-delay: 2.25s; }
.chapter-cta.is-playing .cta-reveal {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.cta-title {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(56px, 7vw, 110px);
  font-weight: 400;
  line-height: 1.0;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
  text-align: center;
  text-shadow:
    0 2px 20px rgba(0, 0, 0, 0.9),
    0 8px 60px rgba(0, 0, 0, 0.7);
}
.cta-title em {
  font-style: italic;
  font-weight: 300;
  background: linear-gradient(180deg, var(--gold-bright) 20%, var(--gold-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.cta-row {
  display: flex;
  gap: 12px;
  margin-top: 28px;
}

.footer {
  margin-top: 140px;
  width: 100%;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 60px;
  padding: 60px 0 40px;
  border-top: 1px solid var(--line);
  text-align: left;
}
.footer-col { display: flex; flex-direction: column; gap: 12px; }
.footer-mini { color: var(--ink-2); font-size: 12px; letter-spacing: 0.1em; }
.footer-h {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--gold);
  margin-bottom: 4px;
  text-transform: uppercase;
}
.footer-col a {
  color: var(--ink-1);
  font-size: 13.5px;
  line-height: 1.85;
  text-decoration: none;
  cursor: pointer;
  font-weight: 300;
  position: relative;
  width: fit-content;
  transition: color 0.4s var(--ease);
}
.footer-col a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease-out);
}
.footer-col a:hover { color: var(--gold-bright); }
.footer-col a:hover::after { transform: scaleX(1); }
.legal {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--ink-3);
  text-align: center;
  width: 100%;
  margin-top: 30px;
}

/* ---------- Platform pinned scroll stage ---------- */
.chapter-platform-intro {
  min-height: 70vh;
  padding: 140px 80px 80px;
}

/* The stage section behaves like a tall pinned scene. The body canvas
   bleeds full-screen, so the sequence feels native to the page.
   Taller now to accommodate 7 distinct phases of scroll storytelling. */
.chapter-frame-stage {
  position: relative;
  height: 520vh;                 /* 7 phases × generous scroll room each */
  padding: 0;
  background: #050b18;           /* navy — matches frame backdrop */
}
.stage-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  background: #050b18;
  z-index: 6;
}
#body-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  /* feather only the outermost ~12% so cards stay fully opaque and the
     canvas dissolves seamlessly into the #000 page background at the edges */
  -webkit-mask-image: radial-gradient(ellipse 130% 115% at 50% 50%, #000 88%, transparent 100%);
          mask-image: radial-gradient(ellipse 130% 115% at 50% 50%, #000 88%, transparent 100%);
}

/* Subtle full-viewport vignette tied to the stage interior color, so the
   pinned scene reads as one continuous space with the chapters above/below. */
.stage-bleed-top,
.stage-bleed-bottom {
  position: absolute;
  left: 0; right: 0;
  height: 22vh;
  pointer-events: none;
  z-index: 2;
}
.stage-bleed-top    { top: 0;    background: linear-gradient(180deg, #050b18 0%, transparent 100%); }
.stage-bleed-bottom { bottom: 0; background: linear-gradient(0deg,   #050b18 0%, transparent 100%); }

/* Floating overlay rows — tiny technical labels in the safe top/bottom
   margins of the viewport, well away from the cards baked into the frame. */
.stage-overlay {
  position: absolute;
  top: 96px; left: 56px; right: 56px;     /* clear of the fixed nav at top: 20px */
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  pointer-events: none;
}
.stage-overlay-bottom {
  top: auto;
  bottom: 28px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--ink-2);
}
.stage-overlay-bottom .stage-foot-c { color: var(--gold); }

.stage-eye-l {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.stage-tag { margin: 0; }
.stage-eye-r {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--ink-2);
}
.status-dot {
  width: 6px; height: 6px;
  background: #7be39c;
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(123, 227, 156, 0.85);
  animation: pulse 2.4s infinite var(--ease);
}

/* ---------- Mode toggle pill ---------- */
.mode-toggle {
  position: absolute;
  top: 96px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: inline-flex;
  align-items: center;
  padding: 6px;
  border-radius: 999px;
  background: rgba(10, 18, 32, 0.55);
  border: 1px solid rgba(95, 184, 192, 0.14);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}
body.in-body-stage .mode-toggle { opacity: 1; }

.mode-btn {
  position: relative;
  z-index: 2;
  background: transparent;
  border: none;
  color: var(--ink-1);
  font-family: "Inter", sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding: 9px 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  cursor: default;
  transition: color 0.35s var(--ease);
}
.mode-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  display: inline-block;
}
.mode-dot-teal {
  background: #5fc7d0;
  box-shadow: 0 0 10px rgba(95, 199, 208, 0.7);
}
.mode-dot-gold {
  background: var(--gold);
  box-shadow: 0 0 10px rgba(216, 184, 124, 0.7);
}
.mode-indicator {
  position: absolute;
  top: 4px; left: 4px;
  height: calc(100% - 8px);
  width: calc(50% - 4px);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(216, 184, 124, 0.18);
  transition: transform 0.6s var(--ease-out), background 0.6s var(--ease), border-color 0.6s var(--ease);
  pointer-events: none;
  opacity: 0;
}

/* Phase-bound toggle state — set via data-phase on the section */
.chapter-frame-stage[data-phase="hover-copy"]   .mode-btn[data-mode="copy"],
.chapter-frame-stage[data-phase="copy-active"]  .mode-btn[data-mode="copy"]   { color: var(--ink-0); }
.chapter-frame-stage[data-phase="hover-manual"] .mode-btn[data-mode="manual"],
.chapter-frame-stage[data-phase="manual-active"] .mode-btn[data-mode="manual"] { color: var(--ink-0); }

.chapter-frame-stage[data-phase="hover-copy"]   .mode-indicator,
.chapter-frame-stage[data-phase="copy-active"]  .mode-indicator {
  opacity: 1;
  transform: translateX(0);
  background: rgba(95, 199, 208, 0.10);
  border-color: rgba(95, 199, 208, 0.30);
}
.chapter-frame-stage[data-phase="hover-manual"] .mode-indicator,
.chapter-frame-stage[data-phase="manual-active"] .mode-indicator {
  opacity: 1;
  transform: translateX(100%);
  background: rgba(216, 184, 124, 0.10);
  border-color: rgba(216, 184, 124, 0.30);
}

/* ---------- Phase cards (left = copy, right = manual) ---------- */
.phase-card {
  position: absolute;
  top: 50%;
  z-index: 5;
  width: 360px;
  padding: 30px 28px;
  border-radius: 14px;
  background: rgba(10, 22, 38, 0.55);
  border: 1px solid rgba(216, 184, 124, 0.10);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease-out);
}
.phase-card-left {
  left: 56px;
  transform: translate(-30px, -50%);
  border-color: rgba(95, 199, 208, 0.14);
}
.phase-card-right {
  right: 56px;
  transform: translate(30px, -50%);
  border-color: rgba(216, 184, 124, 0.16);
}
.phase-card.is-visible {
  opacity: 1;
  transform: translate(0, -50%);
}

.phase-card-eye {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.28em;
  color: var(--ink-2);
  margin-bottom: 22px;
}
.phase-card h3 {
  font-family: "Cormorant Garamond", serif;
  font-size: 28px;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.012em;
  margin-bottom: 14px;
  color: var(--ink-0);
}
.phase-card h3 em {
  font-style: italic;
  font-weight: 300;
  color: var(--gold);
}
.phase-card-left h3 em { color: #7ed4dc; }
.phase-card p {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-1);
  font-weight: 300;
  margin-bottom: 22px;
}

.phase-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 22px;
  padding-left: 0;
}
.phase-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: baseline;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-1);
}
.phase-list-num {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--gold);
}
.phase-card-left .phase-list-num { color: #7ed4dc; }

.phase-mini-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.phase-mini-stats div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.phase-mini-stats b {
  font-family: "Cormorant Garamond", serif;
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink-0);
}
.phase-card-left .phase-mini-stats b { color: #a7e3ea; }
.phase-card-right .phase-mini-stats b { color: var(--gold-bright); }
.phase-mini-stats span {
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--ink-2);
  text-transform: uppercase;
}

/* ---------- Stats bar (final balanced phase) ---------- */
.stats-bar {
  position: absolute;
  left: 50%;
  bottom: 96px;
  transform: translate(-50%, 16px);
  z-index: 5;
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  padding: 8px 4px;
  border-radius: 14px;
  background: rgba(10, 22, 38, 0.55);
  border: 1px solid rgba(216, 184, 124, 0.12);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease-out);
  pointer-events: none;
}
.stats-bar.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.stat-cell {
  padding: 12px 28px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
}
.stat-cell:last-child { border-right: none; }
.stat-cell b {
  font-family: "Cormorant Garamond", serif;
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink-0);
}
.stat-cell span {
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.24em;
  color: var(--ink-2);
  text-transform: uppercase;
}

/* ---------- Discipline section — v3 crest as full-bleed scrolling background ---------- */
.chapter-discipline {
  min-height: 260vh;       /* generous scroll room to scrub 121 frames at a slow, cinematic pace */
  padding: 0;              /* the inner content has its own padding */
  display: block;          /* override .chapter flex centering */
  position: relative;
  background:
    linear-gradient(180deg,
      var(--bg-0) 0%,
      #0a1322 6%,
      #0a1322 94%,
      var(--bg-0) 100%);
}

/* —— Sticky full-viewport background —— The canvas scrubs as you scroll.
   margin-bottom: -100vh pulls following content on top of the sticky region. */
.discipline-bg {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  margin-bottom: -100vh;
  z-index: 0;
  overflow: hidden;
}
#discipline-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Directional scrim: dark on the left (where editorial copy sits),
   transparent through the centre-right (let the crest breathe), then a
   softer dark on the far right edge for balance. */
.discipline-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  /* Hold a strong dark wash over the left ~45% (where the manifesto sits),
     fade through the middle, and a softer dark on the right edge. */
  background:
    linear-gradient(90deg,
      rgba(10, 19, 34, 0.93) 0%,
      rgba(10, 19, 34, 0.88) 30%,
      rgba(10, 19, 34, 0.62) 48%,
      rgba(10, 19, 34, 0.28) 64%,
      rgba(10, 19, 34, 0.40) 86%,
      rgba(10, 19, 34, 0.65) 100%);
}
.discipline-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(10, 19, 34, 0.9) 0%, transparent 14%, transparent 86%, rgba(10, 19, 34, 0.9) 100%);
}

/* Tech labels float over the background */
.discipline-eyebrow {
  position: absolute;
  top: var(--s-9);
  right: var(--s-9);
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  pointer-events: none;
}
.discipline-footnote {
  position: absolute;
  bottom: var(--s-9);
  right: var(--s-9);
  z-index: 4;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

/* Editorial manifesto floats on top of the sticky bg, anchored to the left */
.discipline-content {
  position: relative;
  z-index: 2;
  padding: var(--s-12) var(--s-10) var(--s-11);
  max-width: 620px;
  margin-left: 4vw;
}

/* Manifesto header — generous breathing room before the doctrine list */
.discipline-header {
  margin-bottom: var(--s-12);
}
.discipline-header .chapter-title {
  margin-bottom: var(--s-7);
  /* slightly smaller than the global chapter-title so the headline fits
     cleanly in the narrower editorial column without word-by-word wrapping */
  font-size: clamp(36px, 4.4vw, 64px);
  max-width: 14ch;
}
.discipline-header .lede { max-width: 38ch; }

/* —— Doctrine list — editorial, no cards, asymmetric —— */
.doctrine-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  position: relative;
  margin: 0;
  padding: 0;
}
.doctrine-list::before {
  /* connecting hairline at the very left edge of the numbers column */
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(180deg,
    transparent 0%,
    rgba(216, 184, 124, 0.32) 6%,
    rgba(216, 184, 124, 0.32) 94%,
    transparent 100%);
}

.doctrine {
  display: grid;
  grid-template-columns: 56px 1fr;
  column-gap: var(--s-7);
  padding: var(--s-9) 0;
  position: relative;
  opacity: 0.42;
  transform: translateX(-6px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease-out);
}
.doctrine + .doctrine {
  border-top: 1px solid rgba(216, 184, 124, 0.08);
}
.doctrine.is-active {
  opacity: 1;
  transform: translateX(0);
}

.doctrine-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-3);
  padding-top: 6px;
}
.doctrine-num {
  font-family: "Cormorant Garamond", serif;
  font-size: 32px;
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--gold);
  line-height: 1;
  position: relative;
  z-index: 1;
  padding-left: var(--s-4);    /* offset from the hairline at left:0 */
  transition: color 0.6s var(--ease), transform 0.6s var(--ease-out);
}
.doctrine.is-active .doctrine-num {
  color: var(--gold-bright);
  transform: scale(1.06);
}
/* Glowing gold dot on the hairline next to the active doctrine */
.doctrine::before {
  content: '';
  position: absolute;
  left: -4px;
  top: calc(var(--s-9) + 14px);
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--gold-bright);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease-out), box-shadow 0.5s var(--ease);
}
.doctrine.is-active::before {
  opacity: 1;
  transform: scale(1);
  box-shadow: 0 0 18px rgba(240, 210, 138, 0.7), 0 0 4px rgba(240, 210, 138, 1);
}
.doctrine-kicker {
  font-family: "JetBrains Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 0.32em;
  color: var(--ink-3);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  margin-top: var(--s-4);
  white-space: nowrap;
  transition: color 0.6s var(--ease);
}
.doctrine.is-active .doctrine-kicker { color: var(--ink-2); }

.doctrine-body h3 {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(28px, 3.2vw, 44px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.018em;
  margin: 0 0 var(--s-4);
  color: var(--ink-0);
  font-feature-settings: "kern" 1, "liga" 1;
}
.doctrine-body h3 em {
  font-style: italic;
  font-weight: 300;
  color: rgba(244, 234, 216, 0.72);
}
.doctrine.is-active .doctrine-body h3 em { color: var(--gold); }

.doctrine-body p {
  font-family: "Inter", sans-serif;
  font-size: 15px;
  line-height: 1.68;
  color: var(--ink-2);
  font-weight: 300;
  max-width: 44ch;
  margin: 0;
}

/* Coda — closing line under the doctrines */
.discipline-coda {
  display: grid;
  grid-template-columns: 56px 1fr;
  column-gap: var(--s-7);
  padding: var(--s-9) 0 0;
  margin-top: var(--s-6);
  border-top: 1px solid rgba(216, 184, 124, 0.10);
}
.discipline-coda-mark {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 14px rgba(240, 210, 138, 0.7);
  align-self: center;
  margin-left: 10px;
}
.discipline-coda p {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 300;
  color: var(--ink-1);
  margin: 0;
  letter-spacing: -0.005em;
}

/* —— Right column stamp (active doctrine indicator over the canvas) —— */
.discipline-stamp {
  position: absolute;
  bottom: var(--s-5);
  left: var(--s-5);
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 2px;
  pointer-events: none;
}
.discipline-stamp-roman {
  font-family: "Cormorant Garamond", serif;
  font-size: 56px;
  font-weight: 300;
  line-height: 0.9;
  color: var(--gold);
  letter-spacing: 0.04em;
  transition: color 0.5s var(--ease);
}
.discipline-stamp-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 0.32em;
  color: var(--ink-3);
}

.discipline-right {
  align-self: stretch;
}
.discipline-pin {
  position: sticky;
  top: 14vh;
  height: 72vh;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  overflow: hidden;
}
#discipline-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  /* Now that the section bg matches the frame navy, the mask only needs a
     soft inner feather — most of the canvas is fully opaque. */
  -webkit-mask-image: radial-gradient(ellipse 120% 115% at 50% 50%, #000 92%, transparent 100%);
          mask-image: radial-gradient(ellipse 120% 115% at 50% 50%, #000 92%, transparent 100%);
}
.discipline-eyebrow {
  position: absolute;
  top: var(--s-5);
  left: var(--s-5);
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  z-index: 2;
  pointer-events: none;
}
.discipline-footnote {
  position: absolute;
  bottom: var(--s-5);
  right: var(--s-5);
  z-index: 2;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

/* ---------- Reveal animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1.2s var(--ease-out), transform 1.2s var(--ease-out);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive ---------- */

/* —— Tablet & small laptops (≤1024px) ———————————————————————— */
@media (max-width: 1024px) {
  .chapter { padding: 90px 32px; }
  .chapter-platform-intro { padding: 110px 32px 60px; }
  .two-col { grid-template-columns: 1fr; gap: 40px; }
  .chapter-reassemble .col-left,
  .chapter-rotate .col-left { padding-left: 0; padding-right: 0; }
  /* On stacked layouts, restore natural reading order: title before spec */
  .chapter-reassemble .col-left { order: 1; }
  .chapter-reassemble .col-right { order: 2; }
  .feature-grid { grid-template-columns: 1fr; gap: 16px; margin-top: 40px; }
  .stat-grid { grid-template-columns: 1fr; padding: 24px; }
  .stat { border-left: none; border-top: 1px solid var(--line); padding: 16px 0; }
  .stat:first-child { border-top: none; padding-top: 0; }

  .nav { gap: 14px; padding: 7px 12px 7px 14px; width: calc(100vw - 24px); }
  .nav-center { display: none; }

  .footer { grid-template-columns: 1fr 1fr; gap: 32px; }
  .rail, .hud { display: none; }

  /* Frame stage: shorter pinned region, smaller in-stage UI */
  .chapter-frame-stage { height: 360vh; }
  .stage-overlay { top: 80px; left: 24px; right: 24px; gap: 14px; }
  .stage-overlay-bottom { bottom: 20px; }

  .mode-toggle { top: 80px; padding: 5px; }
  .mode-btn { padding: 7px 14px; font-size: 11px; }

  /* Phase cards — narrower, hugged to edges */
  .phase-card { width: min(360px, 42vw); padding: 22px 20px; }
  .phase-card-left { left: 20px; }
  .phase-card-right { right: 20px; }
  .phase-card h3 { font-size: 22px; margin-bottom: 10px; }
  .phase-card p { font-size: 12.5px; margin-bottom: 14px; }
  .phase-list { gap: 8px; margin-bottom: 14px; }
  .phase-list li { font-size: 12px; }
  .phase-mini-stats b { font-size: 22px; }

  /* Stats bar — allow wrap and trim cells */
  .stats-bar { flex-wrap: wrap; justify-content: center; max-width: 92vw; bottom: 60px; }
  .stat-cell { padding: 8px 16px; }
  .stat-cell b { font-size: 18px; }
  .stat-cell span { font-size: 8.5px; letter-spacing: 0.18em; }

  /* Discipline */
  .discipline-content { padding: 80px 32px; margin-left: 0; max-width: none; }
  .discipline-scrim {
    background: linear-gradient(180deg, rgba(10, 19, 34, 0.85), rgba(10, 19, 34, 0.7));
  }
  .chapter-discipline { min-height: 200vh; }
  .discipline-eyebrow, .discipline-footnote, .discipline-stamp { display: none; }
  .doctrine { grid-template-columns: 48px 1fr; column-gap: 20px; padding: 36px 0; }
  .doctrine-kicker { font-size: 8.5px; }

  /* CTA */
  .chapter-cta { padding-top: 70px; }
  .footer { margin-top: 80px; padding: 40px 0 24px; }
}

/* —— Phones (≤640px) —————————————————————————————————— */
@media (max-width: 640px) {
  .chapter { padding: 64px 20px; }
  .chapter-platform-intro { padding: 90px 20px 40px; min-height: auto; }
  .chapter-hero .chapter-inner { min-height: 70vh; padding-top: 60px; }

  /* Nav — slim down, drop "Sign in" to keep primary CTA visible */
  .nav { top: 12px; padding: 6px 10px 6px 12px; width: calc(100vw - 16px); gap: 8px; }
  .logo-mark { width: 26px; height: 26px; }
  .logo-text { font-size: 14px; letter-spacing: 0.12em; }
  .nav-right .btn-ghost { display: none; }
  .nav-right .btn-primary { padding: 9px 14px; font-size: 10.5px; letter-spacing: 0.10em; }

  /* Typography */
  .eyebrow { font-size: 9px; padding: 7px 12px; margin-bottom: 24px; gap: 8px; }
  .hero-title { font-size: clamp(40px, 11vw, 60px); margin-bottom: 24px; max-width: none; }
  .hero-sub { font-size: 15px; margin-bottom: 28px; max-width: none; }
  .chapter-title { font-size: clamp(32px, 9vw, 48px); }
  .lede { font-size: 15px; line-height: 1.65; }

  /* Buttons — full-width stacked */
  .hero-cta, .cta-row {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 10px;
  }
  .hero-cta .btn-primary,
  .hero-cta .btn-ghost,
  .cta-row .btn-primary,
  .cta-row .btn-ghost { justify-content: center; width: 100%; }
  .btn-primary.large, .btn-ghost.large { padding: 14px 22px; font-size: 11px; }
  .btn-primary.xl, .btn-ghost.xl { padding: 16px 28px; font-size: 12px; }

  .scroll-cue { display: none; }

  /* Stats / features / specs */
  .stat-grid { padding: 18px; gap: 8px; }
  .stat-num { font-size: clamp(32px, 9vw, 44px); }
  .feature { padding: 24px 20px; }
  .feature h3 { font-size: 21px; }
  .feature p { font-size: 13.5px; }
  .feature-icon { margin-bottom: 16px; }

  .spec-block { padding: 4px 20px; }
  .spec-row {
    padding: 14px 0;
    gap: 10px 12px;
    font-size: 13px;
    flex-wrap: wrap;
  }
  .spec-row span { font-size: 10px; letter-spacing: 0.12em; flex-basis: 100%; }
  .spec-row b { font-size: 15px; text-align: left; }

  /* Frame stage on mobile — phase cards become compact bottom-centered
     panels (left/right anchoring doesn't fit on a phone). Drop the dense
     phase-list and mini-stats so the card stays short and readable while
     the 3D sphere stays the hero. */
  .chapter-frame-stage { height: 280vh; }
  .phase-card {
    top: auto;
    bottom: 64px;
    left: 50% !important;
    right: auto !important;
    width: 92vw;
    max-width: 380px;
    padding: 14px 16px 16px;
    border-radius: 12px;
    transform: translate(-50%, 20px);
  }
  .phase-card.is-visible { transform: translate(-50%, 0); }
  .phase-card-eye { margin-bottom: 8px; font-size: 9px; letter-spacing: 0.24em; }
  .phase-card h3 { font-size: 19px; line-height: 1.12; margin-bottom: 6px; }
  .phase-card p { font-size: 12.5px; line-height: 1.45; margin-bottom: 0; }
  /* Hide secondary detail to keep the panel under 130px tall */
  .phase-card .phase-list,
  .phase-card .phase-mini-stats { display: none; }

  /* Move the bottom-of-stage label up so the card doesn't sit on top of it */
  .stage-overlay-bottom { bottom: 12px; }
  .stage-overlay-bottom .stage-foot-c { display: none; }

  .stats-bar {
    bottom: 34px;
    padding: 4px 2px;
    border-radius: 10px;
  }
  .stat-cell { padding: 6px 10px; }
  .stat-cell b { font-size: 14px; }
  .stat-cell span { font-size: 7.5px; letter-spacing: 0.14em; }

  .stage-overlay { top: 64px; left: 14px; right: 14px; gap: 10px; }
  .stage-overlay-bottom { bottom: 14px; font-size: 8.5px; letter-spacing: 0.2em; }
  .stage-overlay-bottom .stage-foot-r { display: none; }
  .stage-tag { font-size: 9px; letter-spacing: 0.28em; }

  .mode-toggle { top: 62px; padding: 4px; }
  .mode-btn { padding: 6px 10px; font-size: 10.5px; gap: 6px; }

  /* Discipline */
  .discipline-content { padding: 56px 20px 72px; }
  .discipline-header { margin-bottom: 36px; }
  .doctrine { grid-template-columns: 36px 1fr; column-gap: 14px; padding: 24px 0; }
  .doctrine-num { font-size: 26px; padding-left: 6px; }
  .doctrine-kicker { display: none; }
  .doctrine-body h3 { font-size: clamp(22px, 7vw, 30px); }
  .doctrine-body p { font-size: 14px; line-height: 1.6; }
  .doctrine::before { left: -3px; top: calc(24px + 12px); width: 7px; height: 7px; }
  .discipline-coda { grid-template-columns: 36px 1fr; column-gap: 14px; padding-top: 32px; }
  .discipline-coda p { font-size: 17px; }
  .discipline-coda-mark { margin-left: 6px; }

  /* CTA section */
  .chapter-cta { padding-top: 60px; padding-bottom: 36px; }
  .cta-title { font-size: clamp(36px, 11vw, 56px); margin-bottom: 20px; }

  /* Footer */
  .footer { grid-template-columns: 1fr; gap: 24px; margin-top: 56px; padding: 32px 0 20px; }
  .footer-col { gap: 8px; }
  .footer-col a { font-size: 13px; line-height: 1.7; }
  .legal { margin-top: 22px; font-size: 9px; letter-spacing: 0.18em; }
}

/* —— Tiny phones (≤380px) —— extra squeeze for nav + spec —————————— */
@media (max-width: 380px) {
  .nav { gap: 6px; }
  .logo-text { display: none; }
  .nav-right .btn-primary { padding: 8px 12px; font-size: 10px; }
  .chapter { padding: 56px 16px; }
  .hero-title { font-size: clamp(36px, 13vw, 52px); }
}

/* —— Touch-friendly tap targets on coarse pointers ————————————————— */
@media (hover: none) and (pointer: coarse) {
  .btn-primary, .btn-ghost { min-height: 44px; }
  .nav-center a { padding: 6px 0; }
  .footer-col a { padding: 4px 0; }
}
