/* Goaly v2 — the go/looper coaster animation (the train on the voxel island).
   Used by the "How it all fits together" page (app/(site)/how-it-works) and the waitlist page.
   Markup: components/v2/looper-coaster.tsx. Script: public/v2/coaster.js.
   Everything is scoped under .v2 .lh, so it keeps its own palette and beats site.css's own
   .v2 .pill / .v2 .sq rules. Type follows the page: site.css's display, body and mono fonts. */
/* HERO · GO/LOOPER COASTER (from "Looper Hero.html"; replaces the twin-comets loop)
   Scoped under .v2 .lh: the hero animation keeps its own palette; its fonts are the page's (see --lh-*). */
.v2 .hl{position:relative;width:100%;max-width:720px;justify-self:end;min-width:0;container-type:inline-size}
.v2 .lh{
  --bg:#F1F0EB; --surface:#FFFFFF; --ink:#141414; --muted:#6B6A64; --line:#E3E1DA;
  --blue:#6B7FE0; --teal:#8ACFBF; --pink:#F1C8EB; --orange:#DE5A3A; --orange-ink:#FFFFFF;
  /* voxel faces: -t top, -v left, -d right */
  --teal-t:#A8DED1; --teal-v:#8ACFBF; --teal-d:#6CB8A6;
  --blue-t:#8E9EE8; --blue-v:#6B7FE0; --blue-d:#5467C7;
  --pink-t:#F6DCF2; --pink-v:#EDBDE6; --pink-d:#D9A0D0;
  --peri:#A3B2EA; --peri-t:#C6CFF4; --peri-v:#A3B2EA; --peri-d:#8494DA;
  --orange-t:#E9826A; --orange-d:#BE4A2E;
  --metal-t:#55534D; --metal:#3A3834; --metal-d:#262522;
  --rail:#FFFFFF;
  --pillar-t:#FFFFFF; --pillar:#F4F3EF; --pillar-d:#E1DED5;
  --grass:#C6E8E0; --grid:#B2DCD1; --soil-l:#DAD6CC; --soil-r:#C9C5B9; --soil2-l:#CFCBC0; --soil2-r:#BCB8AB;
  --water:#D3DBF7; --leaf-t:#D2E6CB; --leaf:#B8D6AE; --leaf-d:#9DC292; --trunk:#C9B79C; --trunk-d:#B3A084;
  --shadow:rgba(20,20,20,.14);
  /* the page's fonts (site.css). They come in one weight (400), so nothing here asks for bold. */
  --lh-display:var(--font-display);
  --lh-sans:var(--font-body);
  --lh-mono:var(--font-mono);
  --k:1;
  color:var(--ink);font-family:var(--lh-sans);font-size:16px;
}
.v2 .lh .sr-only{position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap}

/* Stage */
.v2 .lh .stage{position:relative; width:100%; max-width:720px; aspect-ratio:1.22}
.v2 .lh .scene{position:absolute; inset:0; width:100%; height:100%; overflow:visible; transition:opacity .45s}
.v2 .lh[data-phase="summary"] .scene{opacity:.12}
.v2 .lh .scene polygon{stroke:var(--bg); stroke-width:.5; stroke-linejoin:round}

.v2 .lh .isl-1 .f-t{fill:var(--grass)} .v2 .lh .isl-1 .f-l{fill:var(--soil-l)} .v2 .lh .isl-1 .f-r{fill:var(--soil-r)}
.v2 .lh .isl-2 .f-t{fill:var(--soil2-l)} .v2 .lh .isl-2 .f-l{fill:var(--soil2-l)} .v2 .lh .isl-2 .f-r{fill:var(--soil2-r)}
.v2 .lh .grid-line{stroke:var(--grid); stroke-width:.8}
.v2 .lh .seam{stroke:var(--bg); stroke-width:.8; opacity:.7}
.v2 .lh .water{fill:var(--water)} .v2 .lh .wall-l{fill:var(--soil-l)} .v2 .lh .wall-r{fill:var(--soil-r)}

.v2 .lh .v-prep .f-t{fill:var(--teal-t)} .v2 .lh .v-prep .f-l{fill:var(--teal-v)} .v2 .lh .v-prep .f-r{fill:var(--teal-d)}
.v2 .lh .v-cook .f-t{fill:var(--blue-t)} .v2 .lh .v-cook .f-l{fill:var(--blue-v)} .v2 .lh .v-cook .f-r{fill:var(--blue-d)}
.v2 .lh .v-eval .f-t{fill:var(--peri-t)} .v2 .lh .v-eval .f-l{fill:var(--peri-v)} .v2 .lh .v-eval .f-r{fill:var(--peri-d)}
.v2 .lh .v-plate .f-t{fill:var(--pink-t)} .v2 .lh .v-plate .f-l{fill:var(--pink-v)} .v2 .lh .v-plate .f-r{fill:var(--pink-d)}
.v2 .lh .v-orange .f-t{fill:var(--orange-t)} .v2 .lh .v-orange .f-l{fill:var(--orange)} .v2 .lh .v-orange .f-r{fill:var(--orange-d)}
.v2 .lh .trk .f-t{fill:var(--rail)}
.v2 .lh .v-metal .f-t{fill:var(--metal-t)} .v2 .lh .v-metal .f-l{fill:var(--metal)} .v2 .lh .v-metal .f-r{fill:var(--metal-d)}
.v2 .lh .v-white .f-t{fill:var(--pillar-t)} .v2 .lh .v-white .f-l{fill:var(--pillar)} .v2 .lh .v-white .f-r{fill:var(--pillar-d)}
.v2 .lh .v-ink .f-t,.v2 .lh .v-ink .f-l,.v2 .lh .v-ink .f-r{fill:var(--ink)}
.v2 .lh .v-leaf .f-t{fill:var(--leaf-t)} .v2 .lh .v-leaf .f-l{fill:var(--leaf)} .v2 .lh .v-leaf .f-r{fill:var(--leaf-d)}
.v2 .lh .v-trunk .f-t,.v2 .lh .v-trunk .f-l{fill:var(--trunk)} .v2 .lh .v-trunk .f-r{fill:var(--trunk-d)}

/* data-layout="scene" (the waitlist): the track and its posts stay a quiet stone colour; only the stretch
   the train is on takes its stage colour, and fades back once the train moves on. The rail (top) stays white. */
.v2 .lh .seg polygon{transition:fill .45s ease}
.v2 .lh[data-layout="scene"] .seg .f-l{fill:#E4E1D8} .v2 .lh[data-layout="scene"] .seg .f-r{fill:#CFCBC0} .v2 .lh[data-layout="scene"] :is(.post,.prop) .f-t{fill:#EEECE6}
.v2 .lh[data-layout="scene"][data-phase="prep"] .seg-prep .f-l{fill:var(--teal-v)} .v2 .lh[data-layout="scene"][data-phase="prep"] .seg-prep .f-r{fill:var(--teal-d)} .v2 .lh[data-layout="scene"][data-phase="prep"] :is(.post,.prop).seg-prep .f-t{fill:var(--teal-t)}
.v2 .lh[data-layout="scene"][data-phase="cook"] .seg-cook .f-l{fill:var(--blue-v)} .v2 .lh[data-layout="scene"][data-phase="cook"] .seg-cook .f-r{fill:var(--blue-d)} .v2 .lh[data-layout="scene"][data-phase="cook"] :is(.post,.prop).seg-cook .f-t{fill:var(--blue-t)}
.v2 .lh[data-layout="scene"][data-phase="eval"] .seg-eval .f-l{fill:var(--peri-v)} .v2 .lh[data-layout="scene"][data-phase="eval"] .seg-eval .f-r{fill:var(--peri-d)} .v2 .lh[data-layout="scene"][data-phase="eval"] :is(.post,.prop).seg-eval .f-t{fill:var(--peri-t)}
.v2 .lh[data-layout="scene"][data-phase="plate"] .seg-plate .f-l{fill:var(--pink-v)} .v2 .lh[data-layout="scene"][data-phase="plate"] .seg-plate .f-r{fill:var(--pink-d)} .v2 .lh[data-layout="scene"][data-phase="plate"] :is(.post,.prop).seg-plate .f-t{fill:var(--pink-t)}

/* Stage props (coaster.js). Station platform: sand tiles, so it doesn't read as track. Sign pole: a quiet grey. */
.v2 .lh .v-plat .f-t{fill:#ECE6D8} .v2 .lh .v-plat .f-l{fill:#DDD5C3} .v2 .lh .v-plat .f-r{fill:#C9C0AC}
.v2 .lh .v-pole .f-t,.v2 .lh .v-pole .f-l{fill:#A9A69E} .v2 .lh .v-pole .f-r{fill:#8E8B83}
/* the station flag: the app icon's own colours (public/favicon.svg), not the scene's softer step colours.
   Its face is f-l (the +z side); the thin edges get a shade darker. */
.v2 .lh .v-icon-board .f-l{fill:#F2F1EE} .v2 .lh .v-icon-board .f-t{fill:#FFFFFF} .v2 .lh .v-icon-board .f-r{fill:#D9D6D0}
.v2 .lh .v-icon-blue .f-l,.v2 .lh .v-icon-blue .f-t{fill:#578AE2} .v2 .lh .v-icon-blue .f-r{fill:#4470BF}
.v2 .lh .v-icon-pink .f-l,.v2 .lh .v-icon-pink .f-t{fill:#FC80D9} .v2 .lh .v-icon-pink .f-r{fill:#DB62B9}
.v2 .lh .v-icon-green .f-l,.v2 .lh .v-icon-green .f-t{fill:#5FCBBC} .v2 .lh .v-icon-green .f-r{fill:#45AD9F}
.v2 .lh .v-icon-orange .f-l,.v2 .lh .v-icon-orange .f-t{fill:#FB562F} .v2 .lh .v-icon-orange .f-r{fill:#D63F1C}
/* Data crates: a layer goes each lap */
.v2 .lh .crate{transition:opacity .5s}
.v2 .lh:is([data-lap="2"],[data-lap="3"]) .crate-3,.v2 .lh[data-lap="3"] .crate-2{opacity:0}
/* GPU rack lights: dark until the train is in the loop, then blink. One light = 2 GPUs, so a rack goes dark each lap (coaster.js) */
.v2 .lh .led polygon{fill:#8E8B83}
.v2 .lh[data-phase="cook"] .led polygon{fill:#FFFFFF; animation:lhBlink calc(.7s * var(--k)) steps(2,jump-none) infinite}
.v2 .lh .led-2 polygon,.v2 .lh .led-5 polygon,.v2 .lh .led-7 polygon{animation-delay:-.23s} .v2 .lh .led-3 polygon,.v2 .lh .led-8 polygon{animation-delay:-.47s}
.v2 .lh:is([data-lap="2"],[data-lap="3"]) :is(.led-7,.led-8) polygon,.v2 .lh[data-lap="3"] .led-6 polygon{fill:#8E8B83; animation:none}
@keyframes lhBlink{0%{fill:#FFFFFF} 100%{fill:#C6CFF4}}
/* Scoreboard bar: fills segment by segment while the train crests the eval hill */
.v2 .lh .bar polygon{fill:#CFCBC0; transition:fill .15s}
.v2 .lh[data-phase="eval"] .bar polygon{fill:#FFFFFF}
.v2 .lh[data-phase="eval"] .bar-2 polygon{transition-delay:.06s} .v2 .lh[data-phase="eval"] .bar-3 polygon{transition-delay:.12s} .v2 .lh[data-phase="eval"] .bar-4 polygon{transition-delay:.18s}
.v2 .lh[data-phase="eval"] .bar-5 polygon{transition-delay:.24s} .v2 .lh[data-phase="eval"] .bar-6 polygon{transition-delay:.3s}

.v2 .lh .chain{fill:none; stroke:var(--ink); stroke-width:2.4; stroke-dasharray:3 6; opacity:0; transition:opacity .3s}
.v2 .lh[data-phase="prep"] .chain{opacity:.6; animation:lhChain calc(.8s * var(--k)) linear infinite}
@keyframes lhChain{to{stroke-dashoffset:-18}}
.v2 .lh .train{transition:opacity .25s}
.v2 .lh[data-phase="reset"] .train,.v2 .lh[data-phase="summary"] .train{opacity:0}

/* Pills (border reset: the page's own .pill is outlined) */
.v2 .lh .pill{position:absolute; left:0; top:0; display:inline-flex; align-items:center; gap:9px; padding:9px 14px; border:0; border-radius:999px; background:var(--surface); color:var(--ink); font:400 13px/1 var(--lh-sans); box-shadow:0 10px 26px -12px var(--shadow), 0 0 0 1px var(--line); white-space:nowrap; opacity:0; visibility:hidden; transform:translateY(6px); transition:opacity .3s, transform .3s, visibility .3s; z-index:2}
.v2 .lh .pill .sq{width:11px; height:11px; background:var(--c); flex:none}
.v2 .lh .pill .m{font:400 12.5px/1 var(--lh-mono); letter-spacing:.02em; color:var(--muted)}
.v2 .lh .pill .bulb{width:14px; height:14px; color:var(--orange); flex:none}
/* pills shrink with the animation (cqi = 1% of .hl's width): full size from ~520px wide (desktop), 10.5px when it sits beside the copy on tablets */
.v2 .lh .pill{font-size:clamp(10.5px,2.5cqi,13px); padding:clamp(6px,1.73cqi,9px) clamp(8px,2.7cqi,14px); gap:clamp(6px,1.73cqi,9px)}
.v2 .lh .pill .m{font-size:clamp(10px,2.4cqi,12.5px)}
.v2 .lh .pill-cost{left:auto; right:0}
.v2 .lh[data-phase="prep"] .pill-prep,.v2 .lh[data-phase="cook"] .pill-prep,.v2 .lh[data-phase="eval"] .pill-prep,.v2 .lh[data-phase="plate"] .pill-prep,
.v2 .lh[data-phase="cook"] .pill-cook,.v2 .lh[data-phase="eval"] .pill-cook,.v2 .lh[data-phase="plate"] .pill-cook,
.v2 .lh[data-phase="eval"] .pill-eval,.v2 .lh[data-phase="plate"] .pill-eval,
.v2 .lh[data-phase="plate"] .pill-plate,
.v2 .lh[data-phase="loop"] .pill-loop,
.v2 .lh .pill-lap,.v2 .lh .pill-cost{opacity:1; visibility:visible; transform:none}
.v2 .lh[data-phase="summary"] .pill-lap,.v2 .lh[data-phase="summary"] .pill-cost,.v2 .lh[data-phase="reset"] .pill-lap,.v2 .lh[data-phase="reset"] .pill-cost{opacity:0; visibility:hidden}
@media (max-width:520px){ .v2 .lh .pill{font-size:11.5px; padding:7px 10px; gap:7px} .v2 .lh .pill .m{font-size:11px} }

/* End card */
.v2 .lh .sum{position:absolute; left:50%; top:50%; transform:translate(-50%,-46%); width:min(92%,560px); text-align:center; opacity:0; visibility:hidden; transition:opacity .45s, transform .45s, visibility .45s; z-index:3}
.v2 .lh[data-phase="summary"] .sum{opacity:1; visibility:visible; transform:translate(-50%,-50%)}
.v2 .lh .sum .rows{display:grid; gap:clamp(14px,3.5cqi,24px)}
/* the new numbers are the headline of the card: as big as the page's h1 */
.v2 .lh .sum .big{font-family:var(--lh-display); font-weight:400; font-size:clamp(2.6rem,14.5cqi,5.5rem); line-height:.95; letter-spacing:-.02em; white-space:nowrap}
.v2 .lh .sum .big .from{color:var(--muted); font-size:.42em; letter-spacing:0; margin-right:.3em; text-decoration:line-through; text-decoration-thickness:.06em}
.v2 .lh .sum .sub{font:400 clamp(12px,2.5cqi,15px)/1.4 var(--lh-mono); letter-spacing:.04em; color:var(--ink); opacity:.7; margin:6px 0 0}
.v2 .lh .sum .pills{display:flex; gap:8px; justify-content:center; flex-wrap:wrap; margin-top:clamp(16px,4cqi,26px)}
.v2 .lh .sum .pill{position:static; opacity:1; visibility:visible; transform:none}
.v2 .lh .sum .pill{font-size:clamp(12px,2.9cqi,17px); padding:clamp(8px,1.9cqi,12px) clamp(12px,3cqi,18px)}
.v2 .lh .sum .pill .m{font-size:clamp(11.5px,2.7cqi,15.5px)}
.v2 .lh .sum .pill .bulb{width:1.1em; height:1.1em}

@media (prefers-reduced-motion: reduce){
  .v2 .lh .chain,.v2 .lh .pill,.v2 .lh .sum,.v2 .lh .train,.v2 .lh .scene,.v2 .lh .led polygon,.v2 .lh .crate{animation:none !important; transition:none !important}
}
