/* ---------------------------------------------------------------------------
 * intro.css — the opening, and the light behind the hero.
 *
 * Two things live here, and they are the two things the mission asks for that
 * the page did not have: a multi-beat opening timeline in the real hero, and a
 * code-driven ambient layer (near-black, light from above, a floor that catches
 * some of it, one accent). Both are CSS; there is no video, no image, no canvas
 * and no WebGL anywhere in this file, which is the decision recorded in
 * ANALYSIS.md: the hero's 3D renderer fetches 1.3 MB of three.js from a CDN and
 * an audit session watched it never arrive, so nothing that has to happen on the
 * first frame of the page is allowed to depend on it.
 *
 * WHY A SEPARATE FILE. index.html carries 300 KB of inline <style>. Four more
 * beats' worth of keyframes inside it would be a fifth owner of the same rules
 * with no way to cache them apart from the page, and the hero is the one part of
 * the site whose timing has to be readable in one place. This file is the whole
 * of the introduction: 1.5-2.5s of beats, statable as a list.
 *
 * THE FOUR BEATS (intro.js ends the sequence; nothing here depends on it)
 *    0 -  320ms   the wordmark's mark arrives; the eyebrow is still unlit
 *  140 -  760ms   the eyebrow lights
 *  180 -  880ms   the headline settles 10px into place
 *  240 - 1180ms   the headline illuminates word by word, tail last
 *  880 - 1500ms   the CTAs settle into place
 * 1320 - 2080ms   the ambient light arrives and the whole layer comes to rest
 * after 2080ms     the resting state, held; the typer is already mid-hold
 * on the first scroll  the release: every piece the opening is still holding travels a
 *                 few pixels further along its own direction and settles back into that
 *                 same resting state, inside the bound in the tokens below
 *
 * WHAT THIS FILE REFUSES TO DO, on purpose:
 *
 *  - It never sets opacity 0 on anything that carries words, and it never moves
 *    an element's box. Illumination is a colour coming up in letters that were
 *    painted from the first frame; the only motion on content is a translate,
 *    which cannot cause a layout shift and cannot hide the LCP element from
 *    being measured. A visitor whose script never runs gets the finished state,
 *    not a blank hero.
 *  - It never animates an element the page's reveal system owns. The trust strip
 *    below the CTAs is `data-reveal` with its own 200ms stagger and its own
 *    observer; a second clock on those four items would fight the first, so the
 *    intro stops at .hero-actions and lets the page's own order finish the job.
 *  - It never animates the shared header chrome beyond the mark's opacity. The
 *    wordmark sits on every page and is compared as chrome across all of them;
 *    moving it would move a box that other pages' shots read as identical.
 *  - It never drives the composition from scroll position. The release is triggered
 *    by the first scroll and then runs on its own bound, because two other systems
 *    already own scroll on this page (the reveal observer and the morph) and a
 *    scroll-linked timeline would be a third — one that could leave the hero
 *    stranded mid-release if the gesture stopped. The gesture is answered, not
 *    followed: the page scrolls natively and the opening is at rest ~320ms later
 *    whatever the gesture does next.
 *
 * A NOTE ON THE AUDIT. tools/verify/motion-shots.cjs fails the page for any
 * gradient outside a glass box and for any blur at all. Both rules are right,
 * and light is the exception they cannot describe on their own terms: a ray is a
 * gradient, and there is no way to paint one that is not. So this layer is
 * declared as the third sanctioned surface in that audit, held to a check of its
 * own — exactly six gradient layers, brass or the page's own ink, no layer above
 * 0.16 alpha, no blur, no shadow, no radius, no border — rather than waved
 * through. There is no `filter` in this file at all: a radial gradient already
 * falls off the way a blurred wedge does, so the blur would have been three
 * large composited layers bought for nothing.
 * ------------------------------------------------------------------------- */

/* ---------------------------------------------------------------------------
 * The layer itself.
 *
 * It sits inside .hero and is clipped to the hero's box. It is deliberately NOT
 * full-bleed: `width: 100vw` inside a max-width wrap is the classic way to put a
 * horizontal scrollbar on a page that has none, and this page's own audit reads
 * document overflow. Oversized children clipped by the layer give the same
 * edge-to-edge light with nothing to scroll: the rays are wider than the hero and
 * the ones at the sides fade out inside their own box.
 * ------------------------------------------------------------------------- */
.hero { position: relative; }

.hero-ambient {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  contain: paint;
}

/* The copy and the 3D render are painted above the light rather than through it. */
.hero-grid { position: relative; z-index: 1; }

.amb-ray,
.amb-pool,
.amb-reflect,
.amb-horizon { position: absolute; pointer-events: none; }

/* Rays. Each is a soft radial falloff anchored near the top of the hero, tilted
   off vertical so the three read as one light source and not a curtain. The
   gradient is doing the volumetric work: there is no blur, and the element's own
   edges never show because the fill has already reached zero alpha by the time
   the box ends.

   WHERE THE LIGHT FALLS, and why it is not the middle. Above 900px the hero is two
   columns — words on the left, the lit sculpture on the right — and the sculpture
   is measured as sitting on near-black: hero-appearance reads the four corners of
   its frame and fails the page above luma 6, because a figure on a grey ground is a
   figure in a box. So the light is placed over the copy and the sculpture keeps its
   black. This is not a compromise: it is the composition. Light comes down behind
   the words, lands on the floor in front of them, and the object stands outside it
   with its own light. Measured at 1440, corner lumas 19/0/8.6/0 before this and
   0/0/0/0 after; below 900px the columns stack, the object falls outside the rays'
   falloff on its own, and the light is centred again. */
.amb-ray {
  top: -22%;
  left: 30%;
  height: 165%;
  transform: var(--t);
}

.amb-ray-a {
  --t: translateX(-50%) rotate(17deg);
  --dur: 23s;
  --sway: -16px;
  width: 58%;
  background: radial-gradient(44% 50% at 50% 11%, rgba(241, 237, 227, .085), rgba(241, 237, 227, 0) 68%);
}

.amb-ray-b {
  --t: translateX(-50%) rotate(-11deg);
  --dur: 29s;
  --sway: 13px;
  left: 26%;
  width: 44%;
  background: radial-gradient(42% 56% at 50% 9%, rgba(201, 162, 39, .075), rgba(201, 162, 39, 0) 66%);
}

.amb-ray-c {
  --t: translateX(-50%) rotate(3deg);
  --dur: 31s;
  --sway: -10px;
  left: 28%;
  width: 76%;
  background: radial-gradient(50% 42% at 50% 4%, rgba(241, 237, 227, .05), rgba(241, 237, 227, 0) 72%);
}

/* The floor: where the light lands, and the edge of the plane it lands on. The
   hairline is the same 1px rule the rest of the page is built from, and the
   reflection is a dim brass band hanging below it — the light that came off the
   floor rather than the light itself. */
.amb-pool {
  left: 4%;
  bottom: -8%;
  width: 56%;
  height: 52%;
  transform: translateX(-50%);
  background: radial-gradient(50% 100% at 50% 100%, rgba(201, 162, 39, .085), rgba(201, 162, 39, 0) 74%);
}

.amb-horizon {
  left: 31%;
  bottom: 24%;
  width: 62%;
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, rgba(241, 237, 227, 0) 0%, rgba(241, 237, 227, .14) 50%, rgba(241, 237, 227, 0) 100%);
}

.amb-reflect {
  left: 16%;
  bottom: 0;
  width: 28%;
  height: 24%;
  transform: translateX(-50%);
  background: radial-gradient(46% 100% at 50% 0%, rgba(201, 162, 39, .05), rgba(201, 162, 39, 0) 70%);
}

/* One column: the copy is on top and the object is below it, so the light goes
   back to the middle of the hero and the layer's own vertical falloff keeps it off
   the object (measured: all four corners of the frame at luma 0 at 390px, with and
   without this block, because the rays end above where the object begins). */
@media (max-width: 900px) {
  .amb-ray, .amb-ray-b, .amb-ray-c { left: 50%; }
  .amb-pool { left: 50%; width: 130%; }
  .amb-horizon { left: 50%; width: 150%; }
  .amb-reflect { left: 50%; width: 46%; }
}

/* The release: the numbers, in one place. The beat itself is in intro.js, because
   it starts from wherever the opening had got to and only script can read that. The
   distances and the timing are the design, so they live here with the rest of the
   opening's timing, and intro.js reads them back by name. Each distance is a
   transform composed ONTO wherever the piece is — a headline halfway up from
   translateY(10px) releases through translateY(4px), one already at rest flares out
   and comes back — which is why one set of numbers is right at every moment of the
   opening. `--disperse-step` is the gap between pieces, and the order is the order
   the opening assembled them in, so the release reads as the opening finishing
   rather than as a second animation. */
:root {
  --disperse: 180ms;
  --disperse-step: 14ms;
  --disperse-mark: translateY(-6px);
  --disperse-eyebrow: translateY(-4px);
  --disperse-headline: translateY(-3px);
  --disperse-actions: translateY(6px);
  --disperse-light: scale(1.025);
  --disperse-breath: 0.86;
}

/* The opening, and the settling. Everything is inside the media query, so the
   reduced-motion path is the resting state by construction: no keyframes are
   applied at all, and the light is simply there, still. */
@media (prefers-reduced-motion: no-preference) {
  /* The mark is the only piece of shared chrome the intro touches, and it touches
     opacity only — no box moves, so every page's chrome still measures identical. */
  html:not(.intro-no-webgl) .wordmark-mark {
    animation: intro-mark 320ms var(--ease-ui) backwards;
  }

  html:not(.intro-no-webgl) .hero .eyebrow {
    animation: intro-eyebrow 620ms linear 140ms backwards;
  }

  /* The headline arrives whole and then lights word by word. Both are colour and
     translate: nothing here can move the CTA under the headline, and the h1 is
     painted and measurable from the first frame. */
  html:not(.intro-no-webgl) #hero-title {
    animation: intro-headline 700ms var(--ease) 180ms backwards;
  }

  html:not(.intro-no-webgl) #hero-title .intro-word {
    animation: intro-word 520ms linear backwards;
    animation-delay: calc(240ms + var(--i, 0) * 55ms);
  }

  /* The tail lights last of all, through the same keyframes as the words: its
     accent is the italic, and the colour it returns to is the same ink. Lighting it
     to the brass would have been inventing an accent the hero does not have — the
     stylesheet gives .accent the italic and nothing else, whatever the comment above
     the tail claims — and, because every beat here is filled `backwards` and not
     `forwards`, an accent that was not the resting one would flash on the last beat
     and vanish at the handoff. */
  html:not(.intro-no-webgl) #hero-title .type-tail {
    animation: intro-word 560ms linear backwards;
    animation-delay: calc(240ms + var(--w, 4) * 55ms);
  }

  html:not(.intro-no-webgl) .hero-actions {
    animation: intro-actions 620ms var(--ease) 880ms backwards;
  }

  /* The light. Each element declares its whole animation once, here, rather than
     being given a drift in one place and a settle in another — two `animation`
     shorthand declarations on one element is how the timing lists silently
     mismatch. Rays drift; the floor does not. */
  html:not(.intro-no-webgl) .amb-ray-a,
  html:not(.intro-no-webgl) .amb-ray-b,
  html:not(.intro-no-webgl) .amb-ray-c {
    animation: amb-settle 760ms var(--ease) 1320ms backwards,
               amb-sway var(--dur, 23s) ease-in-out 0s infinite alternate;
  }

  html:not(.intro-no-webgl) .amb-pool,
  html:not(.intro-no-webgl) .amb-horizon,
  html:not(.intro-no-webgl) .amb-reflect {
    animation: amb-settle 900ms var(--ease) 1380ms backwards;
  }

  /* Off-screen, the only thing still moving on the page stops. */
  html:not(.intro-no-webgl) .hero-ambient.is-paused .amb-ray-a,
  html:not(.intro-no-webgl) .hero-ambient.is-paused .amb-ray-b,
  html:not(.intro-no-webgl) .hero-ambient.is-paused .amb-ray-c,
  html:not(.intro-no-webgl) .hero-ambient.is-paused .amb-pool,
  html:not(.intro-no-webgl) .hero-ambient.is-paused .amb-horizon,
  html:not(.intro-no-webgl) .hero-ambient.is-paused .amb-reflect {
    animation-play-state: paused;
  }
}

@keyframes intro-mark {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes intro-eyebrow {
  from { color: var(--muted); }
  to { color: var(--brass); }
}

@keyframes intro-headline {
  from { transform: translateY(10px); }
  to { transform: none; }
}

/* The page's own illumination language, borrowed: `--muted` is what an unlit word
   in a heading already looks like, and `--ink` is what a lit one becomes. The tail
   lights from that same grey into the accent instead, so the brass arrives last. */
@keyframes intro-word {
  from { color: var(--muted); }
  to { color: var(--ink); }
}

@keyframes intro-actions {
  from { transform: translateY(12px); }
  to { transform: none; }
}

@keyframes amb-settle {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* One sway for four elements, composed on top of each one's own placement: the
   rotation lives in --t, so the drift is written once and every ray keeps its
   angle. Durations are 23/29/31s and the distances differ, which is what keeps
   three layers from pulsing in unison and reading as a heartbeat. */
@keyframes amb-sway {
  from { transform: var(--t) translateY(0); }
  to { transform: var(--t) translateY(var(--sway, -14px)); }
}

/* The skip, the release, and the handoff. `intro-done` is set by intro.js the
   moment the last beat ends, on the first press or key — and at the START of the
   release, where it is not an ending but a base: it takes the keyframes off, so the
   element's own authored value is what the release animates towards, and the flight
   is a script animation on top of it with nothing behind it to fight. `data-intro`
   turns to `done` when the last piece has landed, which is what tells the two
   moments apart. Killing the animation is the whole mechanism of the skip: every
   property these keyframes touch is animated with `backwards` fill and no
   `forwards`, so with no animation at all each element is already at its authored
   resting value. There is no end state to snap to and nothing to unwind. The sway
   survives all of it: it is the resting behaviour of the light, not part of the
   opening. */
html.intro-done .wordmark-mark,
html.intro-done .hero .eyebrow,
html.intro-done #hero-title,
html.intro-done #hero-title .intro-word,
html.intro-done #hero-title .type-tail,
html.intro-done .hero-actions,
html.intro-done .amb-pool,
html.intro-done .amb-horizon,
html.intro-done .amb-reflect {
  animation: none;
}

html.intro-done .amb-ray-a,
html.intro-done .amb-ray-b,
html.intro-done .amb-ray-c {
  animation: amb-sway var(--dur, 23s) ease-in-out 0s infinite alternate;
}

/* Forced colours replace author fills with the system palette, and a ray is a
   fill: there is nothing left of it to redraw, so it is removed rather than left
   as a rectangle of Canvas. Same reasoning as the page's own forced-colors block,
   reached the other way round — decoration that cannot be expressed in the user's
   palette is not expressed at all. */
@media (forced-colors: active) {
  .hero-ambient { display: none; }
}

/* Light does not print. */
@media print {
  .hero-ambient { display: none; }
}
