/* =====================================================================
   $ROBINHOOD — styles.css
   Cinematic scroll story: a fixed image stack (stills + the scrubbed flight) behind
   sticky chapter panels. Layout, type and colour system live here; motion in js/scroll-fx.js.
   ===================================================================== */

:root {
  --ink: #06090c;
  --ink-2: #0b1118;
  --paper: #f2ede2;
  --paper-70: rgba(242, 237, 226, .72);
  --paper-50: rgba(242, 237, 226, .5);
  --paper-25: rgba(242, 237, 226, .25);
  --green: #29e27f;
  --green-glow: rgba(41, 226, 127, .45);
  --gold: #d3b062;
  --gold-60: rgba(211, 176, 98, .6);
  --gold-30: rgba(211, 176, 98, .3);

  --font-display: 'Cinzel', 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-ui: 'Jost', 'Segoe UI', system-ui, sans-serif;

  --nav-h: 76px;
  --gutter: clamp(20px, 5vw, 76px);
  --panel-w: clamp(300px, 34vw, 520px);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* NOTE: only <body> carries the page background. It propagates to the root canvas, which paints
   BENEATH the z-index:-1 .bgstack. A background on <html> would stop that propagation and the body
   would then paint over the stack, hiding the footage. */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 2px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link {
  position: fixed; top: -60px; left: 16px; z-index: 100;
  padding: 10px 16px; background: var(--paper); color: var(--ink);
  font-family: var(--font-ui); font-size: .8rem; letter-spacing: .1em; border-radius: 4px;
  transition: top .2s;
}
.skip-link:focus { top: 12px; }

/* Film grain, above everything visual, below the nav */
.grain {
  position: fixed; inset: 0; z-index: 20; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Fixed background stack (built by scroll-fx.js) ---------- */
.bgstack { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: var(--ink); }
.bgstack__stills, .bgstack__veils, .bgflight { position: absolute; inset: 0; }
.bgl { position: absolute; inset: 0; opacity: 0; visibility: hidden; will-change: opacity; background: var(--tint, var(--ink-2)); }
.bgl__img {
  position: absolute; inset: -2px;
  background-size: cover; background-position: var(--pos, center); background-repeat: no-repeat;
  transform-origin: 50% 50%; will-change: transform;
}
.bgflight__canvas, .bgflight__video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .9s var(--ease);
}
.bgstack.has-flight .bgflight__canvas, .bgstack.has-flight .bgflight__video { opacity: 1; }

/* Veils sit above the footage so type stays legible. They cross-fade on section coverage. */
.bgv { position: absolute; inset: 0; opacity: 0; visibility: hidden; }
.bgv--right {
  background:
    linear-gradient(90deg, rgba(6, 9, 12, 0) 38%, rgba(6, 9, 12, .34) 62%, rgba(6, 9, 12, .58) 100%),
    linear-gradient(180deg, rgba(6, 9, 12, .55) 0, rgba(6, 9, 12, 0) 22%, rgba(6, 9, 12, 0) 72%, rgba(6, 9, 12, .62) 100%);
}
.bgv--left {
  background:
    linear-gradient(270deg, rgba(6, 9, 12, 0) 38%, rgba(6, 9, 12, .34) 62%, rgba(6, 9, 12, .58) 100%),
    linear-gradient(180deg, rgba(6, 9, 12, .55) 0, rgba(6, 9, 12, 0) 22%, rgba(6, 9, 12, 0) 72%, rgba(6, 9, 12, .62) 100%);
}
.bgv--center {
  background:
    radial-gradient(55% 50% at 50% 52%, rgba(6, 9, 12, .45), transparent 72%),
    linear-gradient(180deg, rgba(6, 9, 12, .55) 0, rgba(6, 9, 12, 0) 22%, rgba(6, 9, 12, 0) 72%, rgba(6, 9, 12, .7) 100%);
}
.bgv--soft, .bgv--none {
  background: linear-gradient(180deg, rgba(6, 9, 12, .5) 0, rgba(6, 9, 12, 0) 20%, rgba(6, 9, 12, 0) 78%, rgba(6, 9, 12, .55) 100%);
}

/* ---------- Loading screen (removed from the DOM by js/main.js once enough frames are in) ---------- */
body.is-loading { overflow: hidden; }
.loader {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center;
  background: radial-gradient(70% 60% at 50% 42%, #0b1118, var(--ink) 78%);
  transition: opacity .8s var(--ease), visibility .8s;
}
.loader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.loader__inner { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; padding: 24px; }
.loader__feather {
  width: 52px; height: 52px; color: var(--green);
  filter: drop-shadow(0 0 16px var(--green-glow));
  animation: loaderFloat 2.6s ease-in-out infinite;
}
.loader__word { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; letter-spacing: .34em; color: var(--paper); }
.loader__line { position: relative; width: 200px; max-width: 60vw; height: 1px; background: rgba(242, 237, 226, .14); overflow: hidden; }
.loader__fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: calc(var(--flight-loaded, 0) * 100%);
  background: var(--green); box-shadow: 0 0 10px var(--green-glow);
  transition: width .25s linear;
}
.loader__hint { margin: 0; font-family: var(--font-ui); font-size: .6rem; letter-spacing: .34em; text-transform: uppercase; color: var(--paper-50); }
.loader__pct { color: var(--green); }
.loader.is-armed .loader__hint { display: none; }
.loader__enter { margin-top: 4px; animation: loaderEnterIn .7s var(--ease) both; }
.loader__note { margin: 0; font-family: var(--font-ui); font-size: .54rem; letter-spacing: .32em; text-transform: uppercase; color: var(--paper-50); }
@keyframes loaderEnterIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes loaderFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
html.no-js .loader { display: none; }
@media (prefers-reduced-motion: reduce) { .loader { display: none; } .loader__feather, .loader__enter { animation: none; } }

/* ---------- Sound toggle (nav): four bars that dance while the theme plays ---------- */
.sound {
  display: inline-flex; align-items: flex-end; justify-content: center; gap: 3px;
  width: 40px; height: 40px; padding: 0 0 12px; border-radius: 50%;
  border: 1px solid rgba(242, 237, 226, .25); background: rgba(6, 9, 12, .3);
  transition: border-color .3s, background .3s;
}
.sound:hover { border-color: var(--green); background: rgba(41, 226, 127, .07); }
.sound__bar { width: 2px; height: 4px; border-radius: 1px; background: var(--paper-70); transition: height .3s, background .3s, opacity .3s; }
body.music-on .sound__bar { background: var(--green); animation: soundEq 1.1s ease-in-out infinite; }
body.music-on .sound__bar:nth-child(2) { animation-delay: .25s; }
body.music-on .sound__bar:nth-child(3) { animation-delay: .5s; }
body.music-on .sound__bar:nth-child(4) { animation-delay: .12s; }
body.music-muted .sound__bar { opacity: .45; }
@keyframes soundEq { 0%, 100% { height: 4px; } 50% { height: 14px; } }
@media (prefers-reduced-motion: reduce) { body.music-on .sound__bar { animation: none; height: 10px; } }

/* Flight frames loading bar (2px, bottom edge). Hidden once loaded / missing / no JS. */
.loadbar { position: fixed; left: 0; right: 0; bottom: 0; height: 2px; z-index: 35; background: rgba(242, 237, 226, .08); transition: opacity .8s var(--ease); pointer-events: none; }
.loadbar::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--flight-loaded, 0) * 100%); background: var(--green); box-shadow: 0 0 10px var(--green-glow); transition: width .25s linear; }
html.flight-loaded .loadbar, html.flight-missing .loadbar, html.no-js .loadbar { opacity: 0; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--gutter);
  transition: background .5s var(--ease), backdrop-filter .5s;
}
.nav::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(6, 9, 12, .7), rgba(6, 9, 12, 0));
}
body.scrolled .nav { background: rgba(6, 9, 12, .38); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.nav__brand { display: inline-flex; align-items: center; gap: 12px; }
.nav__feather { width: 32px; height: 32px; color: var(--paper); transition: color .3s; }
.nav__brand:hover .nav__feather { color: var(--green); }
.nav__word { font-family: var(--font-display); font-weight: 600; font-size: 1rem; letter-spacing: .14em; white-space: nowrap; }
.nav__links { position: absolute; left: 50%; transform: translateX(-50%); display: flex; gap: clamp(18px, 3vw, 44px); }
.nav__links a {
  position: relative; padding: 8px 2px;
  font-family: var(--font-ui); font-weight: 400; font-size: .7rem; letter-spacing: .26em; text-transform: uppercase;
  color: var(--paper-70); transition: color .3s;
}
.nav__links a::after { content: ""; position: absolute; left: 2px; right: 2px; bottom: 2px; height: 1px; background: var(--green); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
.nav__links a:hover, .nav__links a.is-active { color: var(--paper); }
.nav__links a.is-active::after { transform: scaleX(1); }
.nav__actions { display: flex; align-items: center; gap: 14px; }
.nav__toggle { display: none; width: 40px; height: 40px; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.nav__toggle span { display: block; width: 22px; height: 1px; background: var(--paper); transition: transform .3s, opacity .3s; }
body.nav-open .nav__toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.nav-open .nav__toggle span:nth-child(2) { opacity: 0; }
body.nav-open .nav__toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Buttons & chips ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 30px; border-radius: 999px;
  border: 1px solid var(--gold-60);
  font-family: var(--font-ui); font-weight: 400; font-size: .7rem; letter-spacing: .28em; text-transform: uppercase;
  color: var(--paper); background: rgba(6, 9, 12, .28);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  white-space: nowrap;
  transition: border-color .3s, box-shadow .3s, background .3s, transform .3s var(--ease);
}
.btn:hover { border-color: var(--gold); background: rgba(211, 176, 98, .08); box-shadow: 0 0 0 1px rgba(211, 176, 98, .18), 0 12px 40px rgba(211, 176, 98, .14); transform: translateY(-1px); }
.btn--sm { padding: 10px 20px; font-size: .62rem; letter-spacing: .24em; }
.btn--green { border-color: rgba(41, 226, 127, .55); }
.btn--green:hover { border-color: var(--green); background: rgba(41, 226, 127, .08); box-shadow: 0 0 0 1px rgba(41, 226, 127, .2), 0 12px 40px rgba(41, 226, 127, .16); }

.chip {
  display: inline-flex; align-items: center; gap: 10px; max-width: 100%;
  padding: 9px 14px; border-radius: 999px;
  border: 1px solid rgba(242, 237, 226, .18); background: rgba(6, 9, 12, .4);
  font-family: var(--font-ui); font-size: .68rem; letter-spacing: .08em; color: var(--paper-70);
  transition: border-color .3s, color .3s;
}
.chip:hover { border-color: var(--green); color: var(--paper); }
.chip__label { color: var(--green); letter-spacing: .24em; font-size: .6rem; }
.chip__mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 30ch; }
.chip__copy { font-size: .58rem; letter-spacing: .24em; text-transform: uppercase; color: var(--paper-50); }
/* CA chip: TBA state hides the Copy hint; live state gets the green treatment. */
.chip--ca { background: rgba(6, 9, 12, .55); }
.chip--ca:not(.is-live) .chip__copy { display: none; }
.chip--ca:not(.is-live) .chip__mono { font-family: var(--font-ui); font-size: .62rem; letter-spacing: .2em; text-transform: uppercase; }
.chip--ca.is-live { border-color: rgba(41, 226, 127, .4); }
.chip--ca.is-live:hover .chip__copy { color: var(--green); }
.chapter__panel > .chip--ca { margin-top: 20px; }

/* ---------- Chapters (sticky panels over the flight) ---------- */
main { position: relative; z-index: 1; }
.chapter { position: relative; min-height: 220vh; min-height: 220svh; }
.chapter--hero { min-height: 200vh; min-height: 200svh; }
.chapter--last { min-height: 200vh; min-height: 200svh; }
.chapter__sticky {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  display: grid; grid-template-columns: 1fr var(--panel-w); align-items: center;
  padding: var(--nav-h) var(--gutter) 0;
  opacity: var(--fade, 1);
  transform: translate3d(0, calc(var(--rise, 0) * 1px), 0);
  will-change: opacity, transform;
}
.chapter--left .chapter__sticky { grid-template-columns: var(--panel-w) 1fr; }
.chapter__panel { grid-column: 2; }
.chapter--left .chapter__panel { grid-column: 1; }

.chapter__kicker {
  margin: 0 0 16px;
  font-family: var(--font-ui); font-size: .64rem; letter-spacing: .38em; text-transform: uppercase;
  color: var(--green); text-shadow: 0 0 14px var(--green-glow);
}
.chapter__title {
  margin: 0 0 22px;
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.45rem, 2.8vw, 2.5rem); letter-spacing: .26em; line-height: 1.3; text-transform: uppercase;
  text-shadow: 0 2px 26px rgba(0, 0, 0, .65);
}
.chapter__copy {
  margin: 0; max-width: 34ch;
  font-size: clamp(1.06rem, 1.25vw, 1.28rem); line-height: 1.55; font-weight: 400;
  color: var(--paper-70); text-shadow: 0 1px 14px rgba(0, 0, 0, .75);
}
.chapter__copy strong { color: var(--paper); font-weight: 500; }
.chapter__copy em { font-style: italic; color: var(--paper); }

/* Thread: the thin vertical line + ring motif. The fill grows as the chapter is scrolled (--q). */
.thread { position: relative; display: flex; flex-direction: column; align-items: center; width: 24px; margin: 34px 0 0 2px; }
.thread__line { position: relative; width: 1px; height: 96px; background: rgba(242, 237, 226, .22); overflow: hidden; }
.thread__fill { position: absolute; left: 0; top: 0; width: 100%; height: calc(var(--q, 0) * 100%); background: linear-gradient(180deg, var(--paper-50), var(--paper)); }
.thread__ring { width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; border: 1px solid var(--paper-70); box-shadow: 0 0 12px rgba(242, 237, 226, .25); animation: ring 2.6s ease-in-out infinite; }
.thread__label { margin-top: 12px; font-family: var(--font-ui); font-size: .56rem; letter-spacing: .42em; text-transform: uppercase; color: var(--paper-50); transition: opacity .6s; }
body.has-scrolled .thread--cue .thread__label { opacity: 0; }
@keyframes ring { 0%, 100% { box-shadow: 0 0 0 0 rgba(242, 237, 226, .35); } 50% { box-shadow: 0 0 0 6px rgba(242, 237, 226, 0); } }

/* Tags: the concept's in-scene signage, carried as HTML so it stays crisp and editable. */
.tags { display: flex; flex-wrap: wrap; gap: 8px 8px; margin: 26px 0 0; max-width: 40ch; }
.tag {
  display: inline-block; padding: 7px 12px; border-radius: 3px;
  border: 1px solid rgba(242, 237, 226, .22); background: rgba(6, 9, 12, .3);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  font-family: var(--font-ui); font-size: .58rem; letter-spacing: .24em; text-transform: uppercase; color: var(--paper-70);
  white-space: nowrap;
}
.tags--wood .tag { border-color: rgba(190, 140, 80, .45); background: rgba(56, 36, 18, .38); color: #ead9b6; }
.tags--led .tag { border-color: rgba(41, 226, 127, .38); background: rgba(6, 22, 14, .5); color: var(--green); text-shadow: 0 0 10px var(--green-glow); }
.tags--stone .tag { border-color: rgba(242, 237, 226, .32); background: rgba(22, 24, 28, .55); letter-spacing: .3em; }
.tags--glass .tag { border-color: rgba(41, 226, 127, .3); background: rgba(10, 30, 20, .35); color: var(--paper); }
.tag--accent { color: var(--green) !important; border-color: rgba(41, 226, 127, .5) !important; text-shadow: 0 0 10px var(--green-glow); }

/* Headquarters chapter */
.hq__welcome { margin: 0 0 8px; font-family: var(--font-display); font-weight: 500; font-size: clamp(.85rem, 1.15vw, 1.05rem); letter-spacing: .42em; text-transform: uppercase; color: var(--paper-70); }
.hq__brand {
  margin: 0;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2rem, 4.4vw, 3.9rem); letter-spacing: .1em; line-height: 1.05;
  color: var(--green);
  text-shadow: 0 0 18px var(--green-glow), 0 0 64px rgba(41, 226, 127, .28), 0 2px 20px rgba(0, 0, 0, .6);
}
.hq__sub { margin: 10px 0 24px; font-family: var(--font-display); font-weight: 500; font-size: clamp(.8rem, 1.1vw, 1rem); letter-spacing: .46em; text-transform: uppercase; color: var(--paper-70); }
.hq__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 30px; }

/* Footer strip (lives inside the last chapter's sticky panel, like the concept) */
.foot {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: clamp(18px, 3.4vh, 34px);
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
}
.foot__motto { margin: 0; font-family: var(--font-ui); font-size: .56rem; letter-spacing: .38em; text-transform: uppercase; line-height: 1.9; color: var(--paper-70); }
.foot__legal { margin: 0; flex: 1; text-align: center; font-family: var(--font-ui); font-size: .6rem; letter-spacing: .06em; color: var(--paper-50); line-height: 1.6; text-shadow: 0 1px 8px rgba(0, 0, 0, .8); }
.socials { display: flex; align-items: center; gap: 18px; }
.socials a { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; color: var(--paper-70); transition: color .3s, transform .3s var(--ease); }
.socials a:hover { color: var(--green); transform: translateY(-2px); }
.socials svg { width: 17px; height: 17px; fill: currentColor; }
.socials .sep { width: 1px; height: 18px; background: var(--paper-25); }
.socials .socials__feather svg { width: 22px; height: 22px; fill: none; }

/* ---------- Waypoints: floating info cards between chapter panels ---------- */
.waypoints { position: fixed; inset: 0; z-index: 6; pointer-events: none; }
.wp {
  position: absolute; right: calc(var(--gutter) + 40px); top: var(--wp-y, 50%);
  display: flex; align-items: flex-start; gap: 14px; max-width: 340px;
  opacity: 0; visibility: hidden;
  transform: translate3d(0, 18px, 0);
  will-change: opacity, transform;
}
.wp__num {
  flex: none; margin-top: 2px;
  font-family: var(--font-ui); font-size: .62rem; letter-spacing: .3em; color: var(--green);
  text-shadow: 0 0 12px var(--green-glow);
  border: 1px solid rgba(41, 226, 127, .35); border-radius: 999px; padding: 6px 10px 5px 12px;
  background: rgba(6, 9, 12, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.wp__body {
  padding: 16px 18px; border-radius: 6px;
  border: 1px solid rgba(242, 237, 226, .16); border-left: 2px solid rgba(41, 226, 127, .5);
  background: rgba(6, 9, 12, .66); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.wp__kicker { margin: 0 0 8px; font-family: var(--font-ui); font-size: .6rem; letter-spacing: .34em; text-transform: uppercase; color: var(--green); }
.wp__text { margin: 0; font-size: 1rem; line-height: 1.55; color: var(--paper); font-weight: 400; }
.wp__text--sub { margin-top: 10px; font-size: .92rem; color: var(--paper-70); font-style: italic; }
.wp__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.wp__chips li {
  padding: 6px 10px; border-radius: 3px; border: 1px solid rgba(41, 226, 127, .32);
  background: rgba(6, 22, 14, .55);
  font-family: var(--font-ui); font-size: .58rem; letter-spacing: .2em; text-transform: uppercase; color: var(--green);
  white-space: nowrap;
}
.wp__steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.wp__steps li {
  counter-increment: step;
  display: flex; align-items: baseline; gap: 10px;
  padding: 5px 0; font-size: 1rem; color: var(--paper);
}
.wp__steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-ui); font-size: .58rem; letter-spacing: .16em; color: var(--paper-50);
}

/* ---------- Chapter rail (right edge) ---------- */
.rail {
  position: fixed; right: clamp(12px, 2vw, 30px); top: 50%; transform: translateY(-50%); z-index: 30;
  display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 42px 0;
}
.rail::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: rgba(242, 237, 226, .14); }
.rail::after { content: ""; position: absolute; top: 0; left: 50%; width: 1px; height: calc(var(--flight, 0) * 100%); background: var(--green); box-shadow: 0 0 8px var(--green-glow); }
.rail a { position: relative; z-index: 1; width: 9px; height: 9px; border-radius: 50%; border: 1px solid rgba(242, 237, 226, .55); background: var(--ink); transition: background .3s, border-color .3s, box-shadow .3s; }
.rail a:hover { border-color: var(--paper); }
.rail a.is-active { background: var(--green); border-color: var(--green); box-shadow: 0 0 12px var(--green-glow); }
.rail a span {
  position: absolute; right: 22px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-ui); font-size: .56rem; letter-spacing: .3em; text-transform: uppercase; white-space: nowrap;
  color: var(--paper-70); opacity: 0; pointer-events: none; transition: opacity .3s;
}
.rail a:hover span, .rail a:focus-visible span { opacity: 1; }

/* ---------- Reveal helper + toast ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 60; transform: translate(-50%, 12px);
  padding: 10px 18px; border-radius: 999px; border: 1px solid rgba(41, 226, 127, .35);
  background: rgba(6, 9, 12, .85); color: var(--paper);
  font-family: var(--font-ui); font-size: .72rem; letter-spacing: .1em;
  opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  :root { --panel-w: clamp(300px, 42vw, 480px); }
}
@media (max-width: 760px) {
  :root { --nav-h: 64px; --gutter: 20px; }
  body { font-size: 17px; }
  .nav__word { font-size: .86rem; letter-spacing: .12em; }
  .nav__feather { width: 26px; height: 26px; }
  .nav__actions .btn { display: none; }
  .nav__toggle { display: flex; }
  .nav__links {
    position: fixed; inset: 0; left: 0; transform: none;
    display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 28px;
    background: rgba(6, 9, 12, .94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    opacity: 0; visibility: hidden; transition: opacity .35s var(--ease), visibility .35s;
    z-index: -1;
  }
  .nav__links.is-open { opacity: 1; visibility: visible; }
  .nav__links a { font-family: var(--font-display); font-size: 1.2rem; letter-spacing: .3em; }
  .nav__links a::after { display: none; }

  .rail { display: none; }

  .chapter { min-height: 200vh; min-height: 200svh; }
  .chapter__sticky {
    grid-template-columns: 1fr; align-items: end;
    padding: var(--nav-h) var(--gutter) clamp(26px, 8vh, 64px);
  }
  .chapter__panel, .chapter--left .chapter__panel { grid-column: 1; max-width: 100%; }
  .chapter__title { font-size: clamp(1.3rem, 6vw, 1.7rem); letter-spacing: .22em; margin-bottom: 14px; }
  .chapter__copy { font-size: 1.05rem; max-width: 100%; }
  .chapter__copy br { display: none; }
  .thread { margin-top: 22px; }
  .thread__line { height: 56px; }
  .tags { margin-top: 18px; }
  .hq__brand { font-size: clamp(1.9rem, 10vw, 2.6rem); }
  .hq__actions { gap: 10px; margin-top: 22px; }
  /* HQ chapter on phones: the footer strip flows under the panel instead of floating over it, and the
     panel may grow taller than the screen on small phones (sticky still pins it while the section lasts). */
  .chapter--last .chapter__sticky { height: auto; min-height: 100vh; min-height: 100svh; grid-template-rows: 1fr auto; padding-bottom: 22px; }
  .chapter--last .chapter__panel { grid-row: 1; }
  .chapter--hq .tags { display: none; }
  .foot { position: static; grid-row: 2; flex-direction: column; align-items: flex-start; gap: 14px; margin-top: 28px; }
  .foot__legal { text-align: left; order: 3; font-size: .56rem; }
  .foot__motto { line-height: 1.7; }
  .foot__motto br { display: none; }

  /* On phones the imagery is portrait; darken the lower half for the text instead of a side. */
  .bgv--right, .bgv--left, .bgv--center, .bgv--soft, .bgv--none {
    background: linear-gradient(180deg, rgba(6, 9, 12, .55) 0, rgba(6, 9, 12, 0) 18%, rgba(6, 9, 12, 0) 42%, rgba(6, 9, 12, .78) 100%);
  }

  /* Waypoints: top-left on phones (the bird flies mid-frame, panels dock at the bottom). */
  .wp {
    right: auto; left: var(--gutter); top: calc(var(--nav-h) + 26px) !important;
    max-width: min(360px, calc(100vw - 2 * var(--gutter)));
    gap: 10px;
  }
  .wp__body { padding: 13px 15px; }
  .wp__text, .wp__steps li { font-size: .95rem; }
}
@media (max-width: 380px) {
  .chapter__title { letter-spacing: .16em; }
  .tag { font-size: .54rem; padding: 6px 9px; }
}
@media (max-height: 560px) and (orientation: landscape) {
  .chapter__title { font-size: 1.3rem; margin-bottom: 10px; }
  .thread__line { height: 40px; }
  .tags { display: none; }
}

/* ---------- Reduced motion / no JS: static chapters, stills as backgrounds ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .chapter, .chapter--hero, .chapter--last { min-height: 100vh; min-height: 100svh; }
  .chapter__sticky { position: relative; height: auto; min-height: 100svh; opacity: 1 !important; transform: none !important; padding-bottom: 80px; }
  .chapter { background: var(--still) center / cover no-repeat; }
  .thread__ring { animation: none; }
  .bgl__img { transform: none !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
  /* Waypoints become a normal stacked section so the info is never lost. */
  .waypoints { position: static; pointer-events: auto; padding: 60px var(--gutter); background: var(--ink); }
  .wp { position: static; opacity: 1 !important; visibility: visible !important; transform: none !important; margin: 0 auto 26px; max-width: 520px; }
}
html.no-js .chapter, html.no-js .chapter--hero, html.no-js .chapter--last { min-height: 100svh; background: var(--still) center / cover no-repeat; }
html.no-js .chapter::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(6, 9, 12, .1), rgba(6, 9, 12, .7)); }
html.no-js .chapter__sticky { position: relative; height: auto; min-height: 100svh; opacity: 1; transform: none; padding-bottom: 80px; }
html.no-js .foot { position: relative; left: 0; right: 0; bottom: 0; margin-top: 40px; }
html.no-js .waypoints { position: static; pointer-events: auto; padding: 60px var(--gutter); background: var(--ink); }
html.no-js .wp { position: static; opacity: 1; visibility: visible; transform: none; margin: 0 auto 26px; max-width: 520px; }
