:root {
  --bg: #06080c;
  --ink: #eef2f6;
  --muted: #93a0b1;
  --teal: #19a7b9;
  --blue: #2a6fc4;
  --orange: #f28c1c;
  --yellow: #fcc200;
  --line: rgba(255, 255, 255, .08);
  --gutter: clamp(20px, 6vw, 96px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
#stage { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; z-index: 0;
  background: radial-gradient(120% 90% at 65% 40%, #121a24 0%, #0a0e14 45%, var(--bg) 100%); }
#scroller { height: 900vh; }

.topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: calc(18px + env(safe-area-inset-top, 0px)) var(--gutter) 18px; pointer-events: none;
  background: linear-gradient(to bottom, rgba(6,8,12,.75), rgba(6,8,12,0)); }
.brand { font-weight: 600; font-size: 22px; letter-spacing: -.02em; }
.b1 { color: #3b77c9 } .b2 { color: var(--teal) } .b3 { color: var(--orange) } .b4 { color: var(--yellow) } .b5 { color: #d9dee5 }
.topmeta { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: flex; gap: 12px; align-items: center; }
.pill { border: 1px solid rgba(242, 140, 28, .5); color: #f6b26b; border-radius: 99px; padding: 3px 10px; letter-spacing: .06em; }

#copy { position: fixed; z-index: 4; left: var(--gutter); top: 50%; transform: translateY(-50%); width: min(34vw, 470px); pointer-events: none; }
.chapter { position: absolute; left: 0; top: 0; transform: translateY(-50%); opacity: 0; will-change: opacity, transform; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--teal); margin: 0 0 18px; display: flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; opacity: .7; }
.chapter h2 { font-size: clamp(30px, 3.4vw, 54px); line-height: 1.04; letter-spacing: -.035em; font-weight: 600; margin: 0 0 20px; }
.chapter sup, .eyebrow sup { font-size: .7em; line-height: 0; color: var(--orange); }
.chapter h2 em { font-style: normal; background: linear-gradient(90deg, var(--teal), #7fd6e2); -webkit-background-clip: text; background-clip: text; color: transparent; }
.chapter p { font-size: clamp(15px, 1.05vw, 17px); line-height: 1.6; color: var(--muted); margin: 0; max-width: 40ch; }
.stats { display: flex; gap: 28px; margin-top: 28px; flex-wrap: wrap; }
.stat b { display: block; font-size: clamp(22px, 2vw, 30px); font-weight: 600; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); letter-spacing: .02em; }
.legend { display: flex; gap: 16px; margin-top: 24px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: 0; }
.credit { margin-top: 18px; font-size: 11px; color: #6c7787; letter-spacing: .02em; }
.chapter.hero h2 { font-size: clamp(40px, 5vw, 78px); }

.rail { position: fixed; z-index: 4; right: var(--gutter); top: 50%; transform: translateY(-50%); height: 44vh; width: 2px; background: var(--line); }
.rail-fill { position: absolute; left: 0; top: 0; width: 2px; height: 0; background: linear-gradient(var(--teal), var(--orange)); }
.rail ol { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; }
.rail li { position: absolute; right: 12px; transform: translateY(-50%); font-size: 11px; color: #5b6676; white-space: nowrap; letter-spacing: .04em; transition: color .3s; }
.rail li::after { content: ""; position: absolute; right: -16px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: #2a3340; transition: background .3s, box-shadow .3s; }
.rail li.on { color: var(--ink); }
.rail li.on::after { background: var(--teal); box-shadow: 0 0 0 4px rgba(25,167,185,.18); }

.hint { position: fixed; z-index: 4; left: 50%; bottom: calc(34px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); transition: opacity .5s; }
.hint i { width: 1px; height: 38px; background: linear-gradient(var(--muted), transparent); animation: drip 1.8s ease-in-out infinite; transform-origin: top; }
@keyframes drip { 0% { transform: scaleY(0) } 50% { transform: scaleY(1) } 100% { transform: scaleY(1); opacity: 0 } }

.fineprint { position: fixed; z-index: 3; left: var(--gutter); right: var(--gutter); bottom: calc(10px + env(safe-area-inset-bottom, 0px)); font-size: 10px; line-height: 1.4; color: #4a5361; text-align: center; pointer-events: none; }

.loader { position: fixed; inset: 0; z-index: 10; display: grid; place-content: center; justify-items: center; gap: 18px; background: var(--bg); color: var(--muted); font-size: 13px; letter-spacing: .06em; transition: opacity .8s; }
.loader.done { opacity: 0; pointer-events: none; }
.ring { width: 38px; height: 38px; border-radius: 50%; border: 2px solid #1b2430; border-top-color: var(--teal); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }
.poster { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 820px), (max-aspect-ratio: 1/1) {
  #copy { left: var(--gutter); right: var(--gutter); width: auto; top: auto; bottom: calc(40px + env(safe-area-inset-bottom, 0px)); transform: none; }
  .chapter { top: auto; bottom: 0; transform: none; padding: 22px 0 8px; }
  #copy::before { content: ""; position: fixed; left: 0; right: 0; bottom: 0; height: 52vh; background: linear-gradient(to top, rgba(6,8,12,.96) 55%, rgba(6,8,12,0)); z-index: -1; }
  .chapter h2 { font-size: clamp(26px, 7vw, 36px); }
  .chapter.hero h2 { font-size: clamp(32px, 9vw, 44px); }
  .rail, .topmeta, .fineprint, .hint { display: none; }
  .stats { gap: 18px; margin-top: 18px; }
}
@media (prefers-reduced-motion: reduce) { .hint i, .ring { animation: none; } }
.brand { color: inherit; text-decoration: none; pointer-events: auto; }
