/* ============================================================
   Beau Bryan Home Loans — "The night before the keys"
   Cinematic dark, committed single-theme.
   ============================================================ */

:root {
  --ink:   #070B12;
  --night: #0D1420;
  --line:  #22304A;
  --glow:  #7FB4FF;
  --ember: #F5A524;
  --paper: #E9EDF4;
  --muted: #8A96AB;

  --gutter: clamp(20px, 5vw, 72px);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --font-display: 'Archivo', 'Arial Narrow', sans-serif;
  --font-body: 'Archivo', 'Helvetica Neue', sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 96px; overflow-x: clip; }

body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

::selection { background: rgba(127, 180, 255, .25); color: var(--paper); }

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--glow);
  outline-offset: 3px;
}

/* ---------- Stage / overlays ---------- */
#stage {
  position: fixed; inset: 0; z-index: 0;
  overflow: hidden; /* nothing bleeds past the frame edge on any viewport */
  background:
    radial-gradient(120% 90% at 50% 110%, #0C1626 0%, var(--ink) 60%);
}
#scene { display: block; width: 100%; height: 100%; }

.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(140% 120% at 50% 45%, transparent 55%, rgba(2, 4, 9, .38) 100%);
}

.grain {
  position: fixed; inset: -50%; z-index: 1; pointer-events: none;
  opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  animation: grain-shift 1.2s steps(3) infinite;
}
@keyframes grain-shift {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-2%, 1%); }
  66% { transform: translate(1%, -2%); }
  100% { transform: translate(0, 0); }
}

/* ---------- Typography ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 900;
  font-stretch: 115%;
  text-transform: uppercase;
  letter-spacing: -0.015em;
  line-height: 0.94;
  font-size: clamp(64px, 10vw, 160px);
  color: var(--paper);
  text-shadow: 0 2px 28px rgba(7, 11, 18, .8), 0 0 72px rgba(7, 11, 18, .55);
}
.d-lg { font-size: clamp(52px, 8vw, 128px); }
.d-md { font-size: clamp(36px, 5vw, 72px); }

.mono {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--glow);
}

.lede {
  font-size: clamp(16px, 1.4vw, 20px);
  font-weight: 400;
  color: #B8C4D9; /* one body-copy voice — matches .il-sub / .hud-copy */
  max-width: 58ch;
  line-height: 1.7;
}
.lede strong { color: var(--paper); font-weight: 500; }

.center { text-align: center; margin-left: auto; margin-right: auto; }

/* masked line reveals */
.line { display: block; overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }
.line > span {
  display: inline-block;
  transform: translateY(118%);
  transition: transform 1.1s var(--ease-out);
}
.line:nth-child(2) > span { transition-delay: .09s; }
.line:nth-child(3) > span { transition-delay: .18s; }
.in .line > span, .chapter.in .line > span { transform: translateY(0); }

/* fade-up reveals */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .9s ease var(--d, 0s), transform .9s var(--ease-out) var(--d, 0s);
}
.in .reveal, .reveal.in { opacity: 1; transform: none; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px var(--gutter);
  background: linear-gradient(to bottom, rgba(7, 11, 18, .82), transparent);
  border-bottom: 1px solid transparent;
  transition: opacity .35s ease, background .3s ease, border-color .3s ease;
}
.nav.scrolled {
  background: rgba(10, 14, 22, .92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom-color: rgba(34, 48, 74, .5);
}
.nav.nav-hidden { opacity: 0; pointer-events: none; }

/* mid-story the nav yields to the display type: logo only, no band */
.nav.nav-min, .nav.scrolled.nav-min {
  background: transparent;
  border-bottom-color: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.nav-sub, .nav-right { transition: opacity .35s ease; }
.nav.nav-min .nav-right, .nav.nav-min .nav-sub { opacity: 0; pointer-events: none; }

.nav-brand { display: flex; flex-direction: column; gap: 3px; transition: opacity .2s ease; }
/* mobile: the wordmark yields whenever a story card reaches the top edge */
.nav.nav-yield .nav-brand { opacity: 0; }
.nav-name {
  font-family: var(--font-display);
  font-weight: 900; font-stretch: 115%;
  text-transform: uppercase; letter-spacing: .02em;
  font-size: 17px; line-height: 1;
}
.nav-sub { color: var(--muted); letter-spacing: .14em; font-size: 9.5px; }
.nav-right { display: flex; align-items: center; gap: 22px; }
.nav-loc { color: var(--muted); }

/* ---------- HUD ---------- */
.hud {
  position: fixed; inset: 0; z-index: 10; pointer-events: none;
  overflow: hidden;
  transition: opacity .2s ease;
}
/* the legal panel owns its rows — the HUD yields entirely */
.hud.hud-off { opacity: 0; }

/* opaque gradient bar behind the ticker — headlines can never collide
   with live ticker text at the bottom edge */
.hud::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0;
  height: 150px;
  background: linear-gradient(to bottom, rgba(7, 11, 18, 0), rgba(7, 11, 18, .94) 62%);
}
.hud-phase {
  position: absolute; left: var(--gutter); bottom: 26px; z-index: 1;
  display: flex; align-items: center; gap: 12px;
  color: var(--glow); opacity: .85;
  transition: opacity .3s ease, transform .3s var(--ease-out);
}
.hud-dot { width: 5px; height: 5px; background: var(--glow); border-radius: 50%;
  box-shadow: 0 0 8px var(--glow); animation: hud-pulse 2.4s ease-in-out infinite; }
@keyframes hud-pulse { 0%,100% { opacity: .4; } 50% { opacity: 1; } }
/* persistent caption block — no scroll frame is ever a captionless wireframe.
   Feathered scrim (same family as .il-cap): wireframe strokes never cross
   raw glyphs. Copy advances one line per phase with a staggered fade. */
.hud-copy {
  position: absolute; left: calc(var(--gutter) - 20px); bottom: 46px; z-index: 1;
  font-family: var(--font-body);
  font-size: 20px; line-height: 1.5;
  color: #E6EDF5; max-width: 34ch;
  padding: 14px 20px 10px;
  background: radial-gradient(130% 150% at 0% 100%, rgba(7, 11, 20, .92) 35%, rgba(7, 11, 20, 0) 75%);
  text-shadow: 0 1px 12px rgba(7, 11, 18, .95);
  opacity: 0; transition: opacity .3s ease, transform .3s var(--ease-out);
}
/* master visibility gate — the swap animation drives inline opacity */
.hud.copy-off .hud-copy { opacity: 0 !important; }
.hud-coords {
  position: absolute; right: var(--gutter); bottom: 26px; z-index: 1;
  display: flex; flex-direction: column; gap: 4px; text-align: right;
  color: var(--muted); opacity: .8;
  transition: opacity .45s ease;
}
/* the footer owns the coordinates in the closing frames — never twice per viewport */
.hud.hud-late .hud-coords { opacity: 0; }
.hud-rail {
  position: absolute; right: calc(var(--gutter) / 2); top: 50%;
  transform: translateY(-50%);
  display: flex; gap: 8px; align-items: stretch; height: 170px;
}
.hud-rail-track { width: 1px; background: var(--line); position: relative; }
.hud-rail-fill {
  position: absolute; top: 0; left: -0.5px; width: 2px; height: 100%;
  background: var(--glow); box-shadow: 0 0 6px var(--glow);
  transform: scaleY(0); transform-origin: top;
}
.hud-rail-ticks { display: flex; flex-direction: column; justify-content: space-between; }
.hud-rail-ticks i { font-style: normal; font-size: 9px; color: var(--muted); letter-spacing: .1em; }

/* ---------- Layout ---------- */
.wrap { position: relative; z-index: 2; padding: 0 var(--gutter); max-width: 1480px; margin: 0 auto; width: 100%; }

.chapter {
  position: relative; z-index: 2;
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 15vh 0;
}

/* ---- Pinned chapters — headlines resolve fully in-viewport, then release.
   The section is taller than the viewport; its content stays sticky-centered
   while JS fades it in/out inside the pin, so no scroll position ever
   catches display type half-clipped at an edge or under the nav band. ---- */
.chapter.pinned { min-height: 155vh; padding: 0; display: block; }
.chapter.pinned .wrap {
  position: sticky; top: 0;
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  padding-top: 96px;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
  will-change: opacity, transform;
}
/* JS drives the pin-fade; without JS everything stays visible */
.js .chapter.pinned .wrap, .js .interlude .il-cap { opacity: 0; }

.chapter-tag {
  display: inline-flex; align-items: center; gap: 14px;
  color: var(--muted); margin-bottom: 28px;
}
.chapter-tag em { font-style: normal; color: var(--glow); }
.chapter-tag::after {
  content: ''; width: 64px; height: 1px; background: var(--line); display: inline-block;
}
.chapter-tag.center { justify-content: center; display: flex; }

/* ---------- Panels (blueprint surfaces) ---------- */
.panel {
  background: rgba(13, 20, 32, .62);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 28px;
  position: relative;
}
.tick::before, .tick::after {
  content: ''; position: absolute; width: 11px; height: 11px; pointer-events: none;
}
.tick::before { top: -1px; left: -1px; border-top: 1px solid var(--glow); border-left: 1px solid var(--glow); }
.tick::after { bottom: -1px; right: -1px; border-bottom: 1px solid var(--glow); border-right: 1px solid var(--glow); }

.panel-kicker { display: block; margin-bottom: 14px; color: var(--glow); }
.panel p { color: var(--muted); font-size: 15.5px; }
.panel h3 { color: var(--paper); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700; font-stretch: 110%;
  text-transform: uppercase; letter-spacing: .08em;
  font-size: 13.5px; line-height: 1;
  padding: 18px 34px;
  min-height: 56px;
  border: 1px solid transparent;
  transition: transform .35s var(--ease-out), background .25s ease,
              border-color .25s ease, box-shadow .25s ease, color .25s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-ember {
  background: var(--ember); color: #14100A;
  box-shadow: 0 0 0 rgba(245, 165, 36, 0);
}
.btn-ember:hover { box-shadow: 0 6px 32px rgba(245, 165, 36, .35); background: #FFB63A; }

.btn-ghost {
  border-color: rgba(233, 237, 244, .35); color: var(--paper);
  background: rgba(13, 20, 32, .55);
}
.btn-ghost:hover { border-color: var(--glow); box-shadow: 0 0 24px rgba(127, 180, 255, .12); }

.btn-sm { padding: 12px 22px; font-size: 12px; min-height: 42px; }

.cta-row { display: flex; gap: 16px; flex-wrap: wrap; }
.cta-row.center { justify-content: center; }

/* ============================================================
   Sections
   ============================================================ */

/* ---- 01 Hero ---- */
.hero { justify-content: flex-end; padding-bottom: 13vh; }
.microstrip {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  color: var(--muted); margin-bottom: 4vh;
}
.ms-sep { width: 24px; height: 1px; background: var(--line); }
.hero-h1 { margin-bottom: 4.5vh; }
/* left-anchored feathered scrim (matches .finale-wrap's pattern) —
   no grid line or wireframe stroke ever crosses the hero paragraph */
.hero-foot {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 40px; flex-wrap: wrap;
  position: relative;
  padding: 30px 34px 26px;
  margin-left: -34px;
  background: radial-gradient(115% 145% at 0% 100%, rgba(7, 11, 20, .85) 30%, rgba(7, 11, 20, 0) 72%);
}
.hero-foot .lede { max-width: 46ch; }

.scroll-cue {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--muted); letter-spacing: .22em; font-size: 9.5px;
}
.cue-line {
  width: 1px; height: 44px; background: linear-gradient(to bottom, var(--glow), transparent);
  animation: cue 2.2s var(--ease-out) infinite;
  transform-origin: top;
}
@keyframes cue {
  0% { transform: scaleY(0); opacity: 0; }
  35% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1) translateY(18px); opacity: 0; }
}

/* ---- Interludes — scene-forward build chapters ---- */
.interlude { position: relative; z-index: 2; }
.i-a { min-height: 215vh; }
.i-b { min-height: 205vh; }
.i-c { min-height: 170vh; }

/* delay each pin start so headlines never enter half-clipped under the nav */
.interlude::before { content: ''; display: block; height: 40vh; }

.interlude-sticky {
  position: sticky; top: 0; height: 100vh;
  display: flex; align-items: center;
  padding: 96px var(--gutter) calc(56px + env(safe-area-inset-bottom));
}
.il-left   { justify-content: flex-start; }
.il-right  { justify-content: flex-end; text-align: right; }
/* centered captions drop to the lower third — never over the model's darkest wall */
.il-center {
  justify-content: center; text-align: center;
  align-items: flex-end;
  padding-bottom: 12vh;
}
.il-center .il-line { font-size: clamp(24px, 3vw, 44px); }

/* captions get a feathered radial scrim so wireframe lines never strike raw copy */
.il-cap {
  max-width: 620px;
  padding: 48px;
  background: radial-gradient(80% 105% at 50% 50%, rgba(7, 11, 20, .9) 30%, rgba(7, 11, 20, 0) 74%);
  will-change: opacity, transform;
}
.il-kicker {
  display: block; color: var(--glow); margin-bottom: 16px; opacity: .95;
  text-shadow: 0 0 12px rgba(10, 14, 22, .9);
}
.il-line {
  font-family: var(--font-display);
  font-weight: 800; font-stretch: 112%;
  text-transform: uppercase; letter-spacing: -0.01em;
  font-size: clamp(28px, 3.6vw, 54px); line-height: 1.02;
  color: var(--paper); margin-bottom: 18px;
  text-shadow: 0 2px 20px rgba(7, 11, 18, .85);
}
.il-sub {
  display: block; color: #B8C4D9; line-height: 1.9;
  text-shadow: 0 0 12px rgba(10, 14, 22, .9);
  text-wrap: balance;
}
.il-right .il-cap { margin-right: clamp(0px, 4vw, 60px); }
.il-left .il-cap { margin-left: clamp(0px, 4vw, 60px); }

/* interlude reveals resolve fast — never caught mid-fade while pinned */
.interlude .reveal {
  transition: opacity .5s ease var(--d, 0s), transform .5s var(--ease-out) var(--d, 0s);
}

/* ---- 02 Bo ---- */
.bo .wrap { max-width: 1480px; }
.bo-layout {
  display: grid; grid-template-columns: minmax(320px, 1fr) minmax(320px, 560px);
  gap: 24px; margin-top: 5vh; max-width: 1180px; align-items: stretch;
}
.bo-media {
  position: relative; overflow: hidden;
  border: 1px solid var(--line);
  background: #0A0E16;
  min-height: 300px;
}
.bo-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.bo-media-scrim {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to top, rgba(7, 11, 18, .72), rgba(7, 11, 18, .1) 55%),
    radial-gradient(130% 110% at 50% 45%, transparent 62%, rgba(7, 11, 18, .55) 100%);
}
.bo-media-cap {
  position: absolute; left: 18px; bottom: 14px;
  color: var(--paper); opacity: .85;
  text-shadow: 0 0 12px rgba(10, 14, 22, .9);
}
.bo-body { max-width: 560px; }
.bo-body p { margin-bottom: 18px; color: var(--muted); font-size: 16.5px; }
.bo-body p.bo-strong { color: var(--paper); font-weight: 500; font-size: 17.5px; }
.bo-body p.bo-note { margin-bottom: 0; color: var(--muted); opacity: .9; }

/* ---- 03 Way ---- */
.way-lede { margin: 3vh 0 6vh; }
.way-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  max-width: 1180px;
}
.way-grid .panel { padding: 32px 28px 34px; }
.way-grid p { line-height: 1.65; }

/* ---- 04 Programs ---- */
.programs .lede { margin: 2.5vh 0 5.5vh; }
.prog-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  max-width: 1180px;
}
.prog-grid h3 {
  font-family: var(--font-display); font-weight: 700; font-stretch: 110%;
  font-size: 19px; text-transform: uppercase; letter-spacing: .02em;
  display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px;
}
.prog-code { color: var(--glow); font-size: 10px; }

/* ---- 05 Trust ---- */
.trust-grid {
  display: grid; grid-template-columns: minmax(260px, 380px) 1fr;
  gap: clamp(32px, 5vw, 84px);
  margin-top: 5vh; align-items: start;
  max-width: 1180px;
}
.photo-slot { color: var(--glow); position: relative; }
.photo-slot img {
  width: 100%; height: auto; display: block;
  border: 1px solid var(--line);
  background: rgba(13, 20, 32, .45);
  filter: saturate(.95);
}
.photo-slot figcaption { margin-top: 12px; color: var(--muted); }
.trust-body {
  background: rgba(7, 11, 18, .55);
  border: 1px solid rgba(34, 48, 74, .6);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  padding: clamp(24px, 3vw, 40px);
}
.trust-body p { color: var(--muted); font-size: 16.5px; max-width: 56ch; margin-bottom: 20px; line-height: 1.7; }
.trust-body p strong { color: var(--paper); }

.award {
  display: flex; align-items: center; gap: 20px;
  max-width: 480px; margin: 10px 0 24px; padding: 22px 24px;
  color: var(--paper);
}
.award svg { width: 40px; height: 40px; flex-shrink: 0; color: var(--glow); }
.award-k { display: block; color: var(--muted); margin-bottom: 6px; }
.award strong { font-weight: 600; font-size: 15.5px; line-height: 1.4; }
.trust-body p.trust-nmls { color: var(--muted); margin-bottom: 0; line-height: 1.9; }

/* ---- 06 Finale — pinned CTA beat, then the house gets the last word ---- */
.finale { min-height: 165vh; text-align: center; }
.finale .finale-wrap {
  align-items: center;
  background: radial-gradient(60% 80% at 50% 50%, rgba(7, 11, 18, .78) 30%, rgba(7, 11, 18, 0) 76%);
}
.finale .lede { margin: 3.5vh auto 4.5vh; }

/* the payoff hold — one uninterrupted viewport of the lit house, zero UI */
.payoff {
  position: relative; z-index: 2;
  min-height: 100vh;
  pointer-events: none;
}
.finale-phone {
  display: inline-block; margin-top: 4vh; color: #B8C4D9;
  text-shadow: 0 0 12px rgba(10, 14, 22, .9);
}
.finale-phone:hover { color: var(--paper); }

/* ---- Footer ---- */
.footer {
  position: relative; z-index: 2;
  padding: 8vh 0 6vh;
  background: linear-gradient(to top, rgba(4, 7, 12, .97) 62%, rgba(4, 7, 12, .86) 84%, transparent);
}
.foot-top {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 20px; flex-wrap: wrap; margin-bottom: 22px;
  text-shadow: 0 0 14px rgba(4, 7, 12, .95), 0 1px 4px rgba(4, 7, 12, .9);
}
.foot-brand {
  font-family: var(--font-display); font-weight: 900; font-stretch: 115%;
  text-transform: uppercase; font-size: 15px; letter-spacing: .03em;
}
.foot-loc { color: var(--muted); overflow-wrap: anywhere; max-width: 100%; }
.foot-rule { height: 1px; background: var(--line); margin-bottom: 26px; }
.foot-legal {
  background: #0A0E16;
  border: 1px solid var(--line);
  padding: 24px;
}
.foot-legal p {
  color: var(--muted); text-transform: none; letter-spacing: .04em;
  font-size: 12px; line-height: 1.6; margin-bottom: 10px; max-width: 88ch;
}
.foot-legal p:last-child { margin-bottom: 0; }
.foot-legal a { text-decoration: underline; text-underline-offset: 2px; }
.foot-ehl { display: flex; align-items: center; gap: 8px; }
.ehl { width: 16px; height: 16px; color: var(--muted); }

/* ============================================================
   Fallbacks / preferences
   ============================================================ */

.no-webgl #stage {
  background:
    radial-gradient(80% 60% at 50% 85%, #12203A 0%, transparent 60%),
    radial-gradient(120% 90% at 50% 110%, #0C1626 0%, var(--ink) 60%);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .line > span, .reveal { transition: none; transform: none; opacity: 1; }
  .js .chapter.pinned .wrap, .js .interlude .il-cap { opacity: 1; }
  .cue-line, .grain, .hud-dot { animation: none; }
  .btn { transition: none; }
  /* B-roll: static poster frame instead of motion */
  .bo-video { display: none; }
  .bo-media { background: url('assets/hero-broll-poster.jpg') center / cover no-repeat #0A0E16; }
}

/* ============================================================
   Responsive — 390px is a real composition, not a squeeze
   ============================================================ */

@media (max-width: 1023px) {
  .way-grid, .prog-grid { grid-template-columns: repeat(2, 1fr); }
  .bo-layout { grid-template-columns: 1fr; }
  .bo-media { min-height: 0; aspect-ratio: 16 / 9; }
  .hud-rail { display: none; }
}

@media (max-width: 767px) {
  .display { font-stretch: 100%; font-size: clamp(52px, 15vw, 80px); }
  .d-lg { font-size: clamp(44px, 13vw, 64px); }
  .d-md { font-size: clamp(34px, 10vw, 48px); }

  /* fluid lockup — never clips; a 3-line break beats a cropped word */
  .hero-h1 { font-size: clamp(2.25rem, 10.5vw, 4rem); letter-spacing: -0.02em; }

  .nav { padding: 16px 20px; }
  .nav-sub { display: none; }
  .nav-loc { display: none; }

  .hud-coords { display: none; }
  .hud-phase { bottom: 18px; font-size: 12px; color: #A9C4EA; }
  .hud-copy {
    left: 0; bottom: 42px;
    font-size: 17px; line-height: 1.5; color: #E6EDF5;
    max-width: min(32ch, calc(100vw - 24px));
    padding: 14px 20px 10px;
  }

  .chapter { padding: 12vh 0; }
  .chapter.pinned { min-height: 145vh; padding: 0; }
  .chapter.pinned .wrap { padding-top: 80px; }
  .hero { padding-bottom: 15vh; }
  .microstrip { gap: 10px; font-size: 9px; margin-bottom: 3.5vh; }
  .ms-sep { display: none; }
  .microstrip span { display: block; }

  .hero-foot { flex-direction: column; align-items: flex-start; gap: 28px; }
  .cta-row { width: 100%; flex-direction: column; }
  .cta-row .btn { width: 100%; padding: 19px 20px; }
  .scroll-cue { display: none; }

  .way-grid, .prog-grid { grid-template-columns: 1fr; gap: 14px; }
  .trust-grid { grid-template-columns: 1fr; gap: 36px; }
  .photo-slot { max-width: 300px; }

  .panel { padding: 24px 20px; }
  .award { gap: 14px; padding: 18px; }

  /* build phases run ~40% shorter on mobile — no empty-grid treks between beats */
  .i-a, .i-b { min-height: 150vh; }
  .i-c { min-height: 140vh; }
  .interlude::before { height: 24vh; }
  .interlude-sticky { padding-top: 72px; }
  /* story cards sit vertically centered; the scene fills the lower half */
  .il-center { align-items: center; padding-bottom: 0; }
  /* mobile scrim hardens to a blurred panel — copy never sits raw on
     wireframe lines when the radial feather has less room to breathe */
  .il-cap {
    max-width: 360px; padding: 28px 22px;
    background: rgba(10, 16, 28, .55);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(34, 48, 74, .35);
  }
  /* narrative ledes over the live scene get the same panel treatment */
  .way-lede, .programs .lede {
    background: rgba(10, 16, 28, .55);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    padding: 20px;
  }
  .hero-foot { padding: 24px 20px 20px; margin-left: -20px; }
  .il-line { font-size: clamp(26px, 8vw, 36px); }
  .il-center .il-line { font-size: clamp(22px, 6.4vw, 30px); }

  .finale { min-height: 160vh; }
  .finale .cta-row { width: 100%; }
  .payoff { min-height: 92vh; }

  .foot-top { flex-direction: column; gap: 8px; }
  .foot-loc { font-size: 12px; letter-spacing: .08em; }
  /* reserved clearance below the legal panel — the sticky phase indicator
     also fades out entirely while this panel is on screen (JS .hud-off) */
  .foot-legal { padding: 20px 16px; margin-bottom: calc(20px + env(safe-area-inset-bottom)); }
}

/* ---------- Docked mobile CTA ---------- */
.mobile-dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  display: none;
  align-items: center; justify-content: center;
  min-height: 56px;
  padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
  background: var(--ember); color: #14100A;
  font-family: var(--font-display); font-weight: 800; font-stretch: 110%;
  text-transform: uppercase; letter-spacing: .1em; font-size: 14px;
  transform: translateY(102%);
  transition: transform .45s var(--ease-out), background .12s ease;
  box-shadow: 0 -8px 32px rgba(4, 7, 12, .55);
}
/* 120ms pressed state — the full-width bar reads as a button, not a banner */
.mobile-dock:active { background: #D98E12; }
@media (max-width: 767px) {
  .mobile-dock { display: flex; }
  body.dock-on .mobile-dock { transform: translateY(0); }
  /* the HUD steps above the dock so the narrative anchor stays readable */
  body.dock-on .hud-phase { bottom: calc(72px + env(safe-area-inset-bottom)); }
  body.dock-on .hud-copy { bottom: calc(98px + env(safe-area-inset-bottom)); }
  body.dock-on .hud::after { height: 190px; }
}
@media (prefers-reduced-motion: reduce) {
  .mobile-dock { transition: none; }
}

@media (max-width: 419px) {
  /* tracked mono breathes at narrow widths — lines break at phrase
     boundaries instead of orphaning single words */
  .il-sub, .microstrip, .hud-phase { letter-spacing: .12em; }
}
