/* Hero (v14 river). Loaded after styles.css, so rules here win over older hero rules.
   A full-bleed Three.js stage (hero3d.js): the river of real drafts flows behind the whole hero
   and converges into one film on the right (desktop) or below the headline (phones).
   The headline sits in a calm zone with a scrim only where it needs one. */

.hero { display: block; position: relative; min-height: max(640px, 100svh); grid-template-columns: none; grid-template-rows: none; background: var(--dark); overflow: hidden; isolation: isolate; }

/* the stage fills the whole hero, under the floating nav */
.hero-stage { position: absolute; inset: 0; z-index: 1; height: auto; margin: 0; grid-area: auto; }
.hero-stage::before { content: none; }
.hero-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1.6s ease; -webkit-mask-image: none; mask-image: none; }
.hero-stage.is-live canvas { opacity: 1; }
/* scrim: phones, a wash from the top where the headline sits */
.hero-stage::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(180deg, oklch(0.165 0.008 70 / .86) 0%, oklch(0.165 0.008 70 / .72) 34%, oklch(0.165 0.008 70 / 0) 56%); }

/* the old drum sequence's overlays are gone; keep stray copies hidden */
.hs-notes, .hs-count, .hs-replay, .hero-play { display: none !important; }

/* headline block: phones and portrait tablets, stacked at the top */
.hero-top { position: relative; z-index: 3; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 100px 16px 0; container-type: inline-size; pointer-events: none; grid-area: auto; align-self: auto; }
.hero-top > * { pointer-events: auto; }
.hero .lockup { margin-bottom: 20px; }
.hero-title { align-items: center; font-size: min(60px, 100cqi / 15.5); line-height: 1.06; }
.ht-line { white-space: nowrap; }
.ht-second { color: var(--signal); }
.hero-sub { margin-top: 18px; font-size: clamp(16px, 1.35vw, 19px); }
.hero-cta { justify-content: center; margin-top: 24px; }

/* the front screen: a real button over the projected film, with its caption under it */
.hr-front { position: absolute; left: 0; top: 0; z-index: 2; width: 0; height: 0; margin: 0; padding: 0; border: 0; border-radius: 10px; background: transparent; cursor: pointer; will-change: transform; -webkit-tap-highlight-color: transparent; }
.hero-stage:not(.is-live) .hr-front { display: none; }
.hr-front:focus-visible { outline: 2px solid var(--signal); outline-offset: 6px; }
.hr-cap { position: absolute; left: 50%; top: calc(100% + 30px); transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px; width: max-content; max-width: min(92vw, 560px); padding: 6px 11px 6px 9px; border-radius: 6px; background: oklch(0.165 0.008 70 / .78); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); font: 500 var(--t-label)/1.35 var(--mono); letter-spacing: .05em; color: var(--on-dark-2); text-align: left; opacity: var(--cap-o, 1); transition: color .2s, background-color .2s; }
.hr-cap svg { flex: none; width: 10px; height: 10px; fill: var(--signal); }
.hr-front:hover .hr-cap, .hr-front:focus-visible .hr-cap { color: var(--on-dark); background: oklch(0.165 0.008 70 / .82); }

/* no WebGL: a still of the river, composed */
.hero-fallback { position: absolute; inset: 0; left: 0; top: 0; width: 100%; height: 100%; transform: none; margin: 0; }
.hero-fallback img { width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; object-position: 78% 50%; border-radius: 0; }
.hero-fallback figcaption { display: none; }

@media (max-width: 620px) {
  .hr-cap { font-size: 10.5px; letter-spacing: 0; top: calc(100% + 22px); }
}

/* desktop and landscape tablets: headline in the left calm zone, the river to the right */
@media (min-width: 900px) and (min-aspect-ratio: 1/1) {
  .hero-top { position: absolute; left: 0; top: 0; bottom: 0; width: min(52vw, 860px); justify-content: center; align-items: flex-start; text-align: left; padding: 96px 0 72px max(40px, calc((100vw - 1280px) / 2 + 40px)); }
  .hero-title { align-items: flex-start; font-size: min(80px, 100cqi / 15.6); }
  .hero-cta { justify-content: flex-start; }
  .hero .lockup { margin-bottom: 26px; }
  .hero-sub { margin-top: 24px; }
  .hero-cta { margin-top: 32px; }
  .hero-stage::after { background: linear-gradient(90deg, oklch(0.165 0.008 70 / .84) 0%, oklch(0.165 0.008 70 / .66) 30%, oklch(0.165 0.008 70 / 0) 54%); }
  .hero-fallback img { object-position: 100% 50%; }
}

/* reduced motion: the entrance animation is switched off site-wide, so show the words at rest */
@media (prefers-reduced-motion: reduce) {
  .hero-in { opacity: 1; filter: none; transform: none; }
}
/* phones: the two sub-lines are longer than a phone is wide, so let each wrap evenly */
@media (max-width: 620px) { .hero-sub span { white-space: normal; text-wrap: balance; } .hero-sub span + span { margin-top: 4px; } }

/* ---------- the draft wall: real drafts and finished videos drifting behind the hero ---------- */
.hero-wall { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 42%, transparent 80%); mask-image: linear-gradient(90deg, #000 0%, #000 42%, transparent 80%); }
.hw-rows { position: absolute; left: -14%; top: 44%; display: grid; gap: 16px; translate: 0 -50%; rotate: -6deg; }
.hw-row { display: flex; gap: 14px; width: max-content; animation: hw-drift var(--dur, 120s) linear infinite; }
.hw-row:nth-child(even) { animation-direction: reverse; }
@keyframes hw-drift { from { translate: 0 0; } to { translate: -50% 0; } }
.hw-f { position: relative; flex: none; height: 124px; margin: 0; border-radius: 10px; overflow: hidden; opacity: .34; box-shadow: inset 0 0 0 1px oklch(1 0 0 / .12); }
.hw-f img { display: block; height: 100%; width: auto; filter: grayscale(.4) brightness(.72); }
.hw-f figcaption { position: absolute; left: 6px; bottom: 6px; padding: 3px 6px; border-radius: 5px; background: oklch(0.14 0.01 70 / .88); font: 500 9.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--on-dark); white-space: nowrap; }
.hw-f.is-ok { opacity: .46; }
.hw-f.is-ok img { filter: none; }
.hw-f.is-ok figcaption { background: var(--signal); color: var(--ink); }
.hero-stage { z-index: 1; }
.hero-top::before { content: ""; position: absolute; z-index: -1; inset: 8% -6% 6% -20%; background: radial-gradient(52% 44% at 40% 54%, oklch(0.14 0.01 70 / .84), oklch(0.14 0.01 70 / .42) 58%, transparent 80%); pointer-events: none; }
@media (max-width: 1099px) {
  .hero-wall { -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 45%, transparent 75%); mask-image: linear-gradient(180deg, #000 0%, #000 45%, transparent 75%); }
  .hw-rows { top: 34%; }
  .hw-f { height: 88px; }
  .hero-top::before { inset: 4% -10% 0; }
}
@media (prefers-reduced-motion: reduce) { .hw-row { animation: none; } }
/* phones: the hero starts closer under the (now shorter) pill */
@media (max-width: 899px) { .hero-top { padding-top: 78px; } }
