/* Scroll-scrub hero. Default (no JS / reduced motion): a normal full-height hero with the poster. */
.hx { position: relative; height: 100svh; min-height: 560px; background: var(--hx-bg, #111); }
.hx--scrub { height: var(--hx-length, 240vh); }

.hx__stage { position: sticky; top: 0; height: 100svh; min-height: 560px; overflow: hidden; }

.hx__poster, .hx__poster img, .hx__canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
}
.hx__poster img { object-fit: cover; }
.hx__canvas { opacity: 0; transition: opacity .4s ease-out; }
.hx--live .hx__canvas { opacity: 1; }

/* White text stays ≥ 4.5:1 even over a pure-white frame. That needs ≥ 82% black behind the text
   (white on a (1-a)-luminance background: 1.05 / ((1-a) + .05) ≥ 4.5  →  a ≥ .817).
   The darkness follows the text, not a guess about screen height:
   - .hx__scrim: a light 30% wash over the whole frame, plus a solid band behind a ≤ 72 px header;
   - .hx__content::before: solid behind the whole text block, fading in over 64 px above it.
   Combined behind text: 1 - (1-.3)(1-.82) = .874  →  5.97:1 over pure white. */
.hx__scrim {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to bottom, rgb(0 0 0 / .82) 0, rgb(0 0 0 / .82) 72px, rgb(0 0 0 / 0) 128px),
    rgb(0 0 0 / .3);
}

.hx__content {
  position: absolute; inset: auto 0 0 0; z-index: 2;
  padding: 0 var(--gutter, 16px) clamp(88px, 14vh, 140px);
  max-width: 1200px; margin-inline: auto; color: #fff;
}
.hx__content::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  left: -100vw; right: -100vw; top: -64px; bottom: 0;   /* full width; .hx__stage clips the overflow */
  background: linear-gradient(to bottom, rgb(0 0 0 / 0) 0, rgb(0 0 0 / .82) 64px);
}

.hx__chapters {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: 24px;
  display: flex; gap: 8px; justify-content: center; list-style: none; margin: 0; padding: 0 16px;
  font: 600 12px/1 var(--font-text, system-ui); letter-spacing: .08em; text-transform: uppercase; color: rgb(255 255 255 / .75);
}
.hx__chapters li { padding: 8px 12px; border-radius: 999px; background: rgb(0 0 0 / .35); transition: background .25s, color .25s; }
.hx__chapters li.is-active { background: #fff; color: #111; }

@media (prefers-reduced-motion: reduce) {
  .hx, .hx--scrub { height: 100svh; }
  .hx__canvas { display: none; }
}
