/* ==========================================================================
   Hero: a scroll-scrubbed film. The tall .hero-scroll track pins .hero while
   100 JPEG frames (assets/hero-frames/) are drawn onto the canvas against
   scroll by js/hero.js. The poster stands in until frame 0 decodes and under
   reduced motion. Three captions cross-fade with the three beats via
   --cap-0/1/2, which hero.js sets on .hero__body.
   ========================================================================== */
.hero-scroll { position: relative; height: 400vh; background: var(--ink); padding: 0; }

.hero {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  overflow: hidden; background: var(--ink);
}
.hero picture, .hero__poster, .hero__canvas {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%; display: block;
}
.hero__poster { object-fit: cover; object-position: 72% 50%; }
/* Phone-shaped viewports get the portrait poster, already cut at the focal point. */
@media (max-width: 768px) and (max-aspect-ratio: 5/7) { .hero__poster { object-position: 50% 50%; } }

/* Scrim: darker from the left and the bottom so copy sits over the road shoulder. */
.hero__haze {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(to right, rgba(11, 13, 16, .82) 0%, rgba(11, 13, 16, .4) 45%, transparent 75%),
    linear-gradient(180deg, rgba(11, 13, 16, .5) 0%, transparent 22%, transparent 50%, rgba(11, 13, 16, .92) 100%);
}

.hero__body { position: absolute; inset: 0; z-index: 2; }
.hero__caption {
  position: absolute;
  left: max(var(--gutter), calc((100% - var(--shell)) / 2 + var(--gutter)));
  right: var(--gutter);
  bottom: 11vh;
  opacity: 0; pointer-events: none; visibility: hidden;
  will-change: opacity;
}
.hero__caption[data-beat="0"] { opacity: var(--cap-0, 1); }
.hero__caption[data-beat="1"] { opacity: var(--cap-1, 0); }
.hero__caption[data-beat="2"] { opacity: var(--cap-2, 0); }
.hero__body[data-beat="0"] .hero__caption[data-beat="0"],
.hero__body[data-beat="1"] .hero__caption[data-beat="1"],
.hero__body[data-beat="2"] .hero__caption[data-beat="2"] { pointer-events: auto; visibility: visible; }

.hero h1 {
  font-size: var(--text-7); font-weight: 800; line-height: .98; letter-spacing: -0.01em;
  max-width: 14ch; text-shadow: 0 2px 24px rgba(0, 0, 0, .8);
}
.hero__h {
  font-size: var(--text-6); font-weight: 800; line-height: 1.02; letter-spacing: -0.005em;
  max-width: 18ch; text-shadow: 0 2px 24px rgba(0, 0, 0, .8);
}
.hero .eyebrow { margin-bottom: var(--sp-2); text-shadow: 0 1px 12px rgba(0, 0, 0, .9); }
.hero__lede {
  margin-top: var(--sp-2); max-width: 34ch;
  font-size: var(--text-3); color: var(--bone-dim); text-shadow: 0 1px 12px rgba(0, 0, 0, .9);
}
.hero__act { margin-top: var(--sp-3); display: flex; gap: 12px; flex-wrap: wrap; }
.hero__caption > .btn { margin-top: var(--sp-3); }

.hero__chips { margin-top: var(--sp-3); display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: rgba(11, 13, 16, .55); font-size: var(--text-2); color: var(--bone);
}
.chip:has(.fact--pending) { display: none; }
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); flex: none; }

.hero__cue {
  margin-top: var(--sp-3); color: var(--mute);
  font-size: var(--text-1); font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
}
.hero__cue span { display: inline-block; margin-left: 6px; animation: cue 1.6s ease-in-out infinite; }
@keyframes cue { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

@media (min-width: 900px) {
  .hero__caption { bottom: 14vh; right: auto; max-width: 640px; }
}

/* Reduced motion: unpin the hero, show the poster and beat 0 only. */
@media (prefers-reduced-motion: reduce) {
  .hero-scroll { height: auto; }
  .hero { position: relative; height: auto; min-height: 100svh; display: flex; align-items: flex-end; }
  .hero__canvas { display: none; }
  .hero__body { position: relative; inset: auto; width: 100%; }
  .hero__caption[data-beat="1"], .hero__caption[data-beat="2"] { display: none; }
  .hero__caption[data-beat="0"] {
    position: relative; left: auto; right: auto; bottom: auto;
    opacity: 1 !important; pointer-events: auto; visibility: visible;
    padding: 24vh var(--gutter) 10vh;
    margin-left: max(0px, calc((100% - var(--shell)) / 2));
  }
  .hero__cue span { animation: none; }
}
