/* Header, hero (three.js factory + projected cards) and the "works in" band. Prefix: hero- */

/* ---------- Nav ---------- */
.hero-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgb(14 16 19 / 0.78);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
/* Three columns: logo left, links in the true centre, actions right. */
.hero-nav-in { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 20px; height: 64px; }
.hero-brand { grid-column: 1; justify-self: start; }
.hero-links { grid-column: 2; }
.hero-nav-end { grid-column: 3; justify-self: end; }
.hero-brand {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin-left: -4px; padding: 0 4px;
  color: var(--title); text-decoration: none; font-family: var(--font-display); font-size: 18px; font-weight: 650; letter-spacing: -0.02em;
}
.hero-brand svg { flex: none; width: 32px; height: 32px; color: var(--lime); transition: transform var(--dur-slow) var(--ease); }
.hero-brand:hover svg { transform: translateX(1px) scale(1.08); }
.hero-links { display: flex; gap: 2px; }
.hero-links a, .hero-signin {
  position: relative; isolation: isolate; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px;
  color: var(--body); text-decoration: none; font-size: 14px; font-weight: 500;
  transition: color var(--dur-fast) var(--ease);
}
/* The pill behind a link: a whisper on hover, the app's lime wash on the current location. */
.hero-links a::before, .hero-signin::before {
  content: ""; position: absolute; inset: 7px 2px; z-index: -1; border-radius: 999px; opacity: 0;
  background: rgb(255 255 255 / 0.045); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.05);
  transition: opacity var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.hero-links a:hover, .hero-signin:hover { color: var(--title); }
.hero-links a:hover::before, .hero-signin:hover::before { opacity: 1; }
.hero-links a[aria-current] { color: var(--title); }
.hero-links a[aria-current]::before {
  opacity: 1; background: linear-gradient(to right, color-mix(in oklab, var(--lime) 16%, var(--card)), var(--card) 70%);
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--lime) 24%, var(--line)), inset 0 1px 0 rgb(255 255 255 / 0.04);
}
/* Duotone link icons (the inside section's set): muted wash + stroke at rest; the lime wash and a
   lighter stroke on hover and on the current location. */
.hero-ico { width: 16px; height: 16px; flex: none; margin-right: 7px; }
.hero-ico .w { fill: var(--muted); fill-opacity: 0.2; transition: fill var(--dur-base) var(--ease), fill-opacity var(--dur-base) var(--ease); }
.hero-ico .s { fill: none; stroke: var(--muted); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: stroke var(--dur-base) var(--ease); }
.hero-links a:is(:hover, [aria-current]) .hero-ico .w { fill: var(--lime); fill-opacity: 0.32; }
.hero-links a:is(:hover, [aria-current]) .hero-ico .s { stroke: var(--lime-ink); }
.hero-nav-end { display: flex; align-items: center; gap: 10px; }
.hero-nav-end .hero-signin {
  min-height: 38px; padding: 0 13px 0 11px; border-radius: 10px; color: var(--body-strong);
  border: 1px solid var(--line-strong); background: rgb(255 255 255 / 0.02); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.04);
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.hero-nav-end .hero-signin::before { display: none; }
.hero-nav-end .hero-signin:hover { color: var(--title); border-color: var(--faint); background: rgb(255 255 255 / 0.045); }
.hero-signin:hover .hero-ico .w { fill: var(--lime); fill-opacity: 0.32; }
.hero-signin:hover .hero-ico .s { stroke: var(--lime-ink); }
.hero-nav-btn { position: relative; min-height: 38px; padding: 0 14px; font-size: 14px; }

/* Primary: lit from above (inset top light, a whisper of shade at the foot). Ghost: a hover wash.
   One recipe for every primary/ghost on the page (header, hero, CTA, final), scoped by section id. */
:is(#top, #hero, #cta, #final) .btn-primary {
  background-image: linear-gradient(to bottom, rgb(255 255 255 / 0.45), rgb(255 255 255 / 0) 60%);
  box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgb(0 0 0 / 0.1), 0 1px 2px rgb(0 0 0 / 0.5), 0 8px 18px -10px rgb(0 0 0 / 0.7);
  transition: background-color var(--dur-fast) var(--ease), box-shadow var(--dur-base) var(--ease), transform var(--dur-fast) var(--ease);
}
:is(#top, #hero, #cta, #final) .btn-primary:hover { box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgb(0 0 0 / 0.08), 0 1px 2px rgb(0 0 0 / 0.5), 0 10px 22px -10px rgb(0 0 0 / 0.8); }
:is(#top, #hero, #cta, #final) .btn-primary:active { transform: translateY(0.5px); box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.14), 0 1px 1px rgb(0 0 0 / 0.4); }
/* The lime call to action ("Get started free", and the compact nav "Get started"): a real lime gradient,
   lighter at the top, with a darker lime edge, a top light, a soft lime shadow, and the arrow in a small
   chip that nudges on hover. Dark ink on lime clears 7:1. */
:is(#top, #hero, #cta) .btn-primary.btn-lime {
  color: #0d1a06; font-weight: 600; letter-spacing: -0.005em;
  background-color: var(--lime);
  background-image: linear-gradient(to bottom, #8dcf60, var(--lime) 55%, #63a839);
  border: 1px solid #4e8a2b;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.45), inset 0 -1px 0 rgb(0 0 0 / 0.12), 0 1px 2px rgb(0 0 0 / 0.55), 0 10px 24px -12px rgb(111 181 65 / 0.55);
  transition: background-image var(--dur-fast) var(--ease), box-shadow var(--dur-base) var(--ease), transform var(--dur-fast) var(--ease);
}
:is(#top, #hero, #cta) .btn-primary.btn-lime:hover {
  background-color: #7cc24d;
  background-image: linear-gradient(to bottom, #9bd970, #7cc24d 55%, #6bb042);
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.5), inset 0 -1px 0 rgb(0 0 0 / 0.1), 0 1px 2px rgb(0 0 0 / 0.55), 0 14px 28px -12px rgb(111 181 65 / 0.7);
}
:is(#top, #hero, #cta) .btn-primary.btn-lime:active { transform: translateY(0); box-shadow: inset 0 1px 3px rgb(0 0 0 / 0.22), 0 1px 1px rgb(0 0 0 / 0.4); }
:is(#top, #hero, #cta) .btn-primary.btn-lime:focus-visible { outline-color: var(--title); }
.btn-lime .arrow {
  display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: -7px; border-radius: 999px;
  font-size: 13px; line-height: 1; background: rgb(13 26 6 / 0.14); box-shadow: inset 0 0 0 1px rgb(13 26 6 / 0.1);
}
.hero-nav-btn.btn-lime { gap: 7px; }
.hero-nav-btn.btn-lime .arrow { width: 20px; height: 20px; margin-right: -6px; font-size: 12px; }
:is(#hero, #cta) .btn-ghost {
  background-image: linear-gradient(to bottom, rgb(255 255 255 / 0.035), rgb(255 255 255 / 0) 70%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.04);
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
:is(#hero, #cta) .btn-ghost:hover { background-color: rgb(255 255 255 / 0.04); border-color: var(--faint); }
.hero-nav-btn::after { content: ""; position: absolute; inset: -3px 0; }
@media (max-width: 760px) {
  .hero-links { display: none; }
  /* No centre menu on phones: logo left, actions take the rest. */
  .hero-nav-in { gap: 8px; grid-template-columns: auto minmax(0, 1fr); }
  .hero-nav-end { grid-column: 2; }
  .hero-nav-end a { white-space: nowrap; }
}
@media (max-width: 399px) {
  /* Very narrow phones: drop the decorations so the row never collides. */
  .hero-nav-end .hero-signin .hero-ico, .hero-nav-btn.btn-lime .arrow { display: none; }
  .hero-nav-end { gap: 6px; }
  .hero-brand { gap: 8px; font-size: 17px; }
  .hero-brand svg { width: 28px; height: 28px; }
}

/* ---------- Hero ---------- */
.hero { position: relative; isolation: isolate; overflow: clip; }
/* A soft lime spotlight drifts behind the copy and lights the page's dot grid (#hero::before in tokens.css,
   same 22px grid, so the lit dots land on the gray ones) in the brand green. */
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(circle, rgb(111 181 65 / 0.7) 1.2px, transparent 1.7px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(closest-side, rgb(0 0 0 / 0.8), rgb(0 0 0 / 0.3) 50%, transparent);
  mask-image: radial-gradient(closest-side, rgb(0 0 0 / 0.8), rgb(0 0 0 / 0.3) 50%, transparent);
  -webkit-mask-size: 560px 560px; mask-size: 560px 560px;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: 6% 30%; mask-position: 6% 30%;
  opacity: 0.55;
  animation: hero-glow-drift 22s var(--ease-inout) infinite alternate;
}
@keyframes hero-glow-drift {
  0%   { -webkit-mask-position: 6% 30%;  mask-position: 6% 30%; }
  35%  { -webkit-mask-position: 26% 62%; mask-position: 26% 62%; }
  70%  { -webkit-mask-position: 12% 82%; mask-position: 12% 82%; }
  100% { -webkit-mask-position: 34% 22%; mask-position: 34% 22%; }
}
.hero:not([data-inview])::after { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .hero::after { animation: none; } }
@media (max-width: 1099px) {
  /* Stacked layout: keep it behind the copy at the top. */
  .hero::after { -webkit-mask-size: 420px 420px; mask-size: 420px 420px; animation-name: hero-glow-drift-sm; }
  @keyframes hero-glow-drift-sm {
    0%   { -webkit-mask-position: 0% 4%;   mask-position: 0% 4%; }
    50%  { -webkit-mask-position: 70% 18%; mask-position: 70% 18%; }
    100% { -webkit-mask-position: 20% 30%; mask-position: 20% 30%; }
  }
}
.hero-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.hero-grid { position: relative; z-index: 2; padding-block: clamp(56px, 9vw, 112px) 8px; pointer-events: none; }
.hero-copy { max-width: 710px; pointer-events: auto; }
@media (min-width: 1100px) { .hero-copy { position: relative; top: -40px; } }
/* Mid widths have less room beside the town: keep the copy narrower so it never runs under a story card. */
@media (min-width: 1100px) and (max-width: 1439px) { .hero-copy { max-width: 600px; } }
/* Large screens: the town sits 40px further right. */
@media (min-width: 1441px) { .hero-stage { translate: 40px 0; } }
/* Past 1440 the copy steps 100px left of the column (ramping in over 1440-1540) to give the town room. */
@media (min-width: 1441px) { .hero-copy { margin-left: calc(-1 * clamp(0px, 100vw - 1440px, 100px)); } }
.hero-title { font-size: clamp(38px, 4.3vw, 60px); line-height: 1.04; letter-spacing: -0.035em; font-weight: 650; }
/* Entrance, once on load: headline words rise out of a soft blur one after another, the sub fades up,
   then the two buttons pop (a tiny overshoot that settles). Transform/opacity/filter only. */
.hero-w { display: inline-block; opacity: 0; transform: translateY(0.32em); filter: blur(8px);
  animation: hero-word-in 760ms var(--ease) forwards; animation-delay: calc(90ms + var(--i) * 42ms); }
@keyframes hero-word-in { to { opacity: 1; transform: none; filter: blur(0); } }
.hero-in { opacity: 0; transform: translateY(10px); animation: hero-fade-in 700ms var(--ease) forwards; animation-delay: var(--d); }
@keyframes hero-fade-in { to { opacity: 1; transform: none; } }
.hero-btn-in { opacity: 0; transform: translateY(6px) scale(0.94); animation: hero-btn-pop 620ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards; animation-delay: var(--d); }
@keyframes hero-btn-pop { to { opacity: 1; transform: none; } }
/* After the pop, hand transform back to the buttons' own hover/press motion. */
.hero-btn-in.is-in { animation: none; opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .hero-w, .hero-in, .hero-btn-in { animation: none; opacity: 1; transform: none; filter: none; }
}
.hero-sub { margin-top: 22px; max-width: 33em; text-wrap: pretty; font-size: clamp(17px, 1.35vw, 19px); line-height: 1.55; color: var(--body); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
@media (max-width: 479px) { .hero-actions .btn { flex: 1 1 100%; } }

.hero-stage { position: relative; height: 460px; margin-top: 28px; }
.hero-canvas { position: absolute; inset: 0; }
.hero-canvas canvas { width: 100%; height: 100%; outline: none; }
.hero-stage.is-live .hero-canvas {
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 10%, #000 92%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 10%, #000 92%, transparent 100%);
}

@media (min-width: 720px) {
  .hero-stage { height: clamp(460px, 62vw, 580px); }
}

@media (min-width: 1100px) {
  .hero { display: flex; align-items: center; min-height: clamp(660px, calc(100svh - 64px), 860px); }
  .hero-grid { width: 100%; padding-block: 72px; }
  /* Pinned to the page's centred frame, not the window: the stage starts 40% into the text column and
     grows into whatever room is free on the right (up to 240px past the column), so wide screens get a
     bigger town beside the copy instead of a capped one drifting to the far edge. The camera fits the
     whole plate inside it (01-hero.js fit()), so nothing is cut. */
  .hero-stage {
    position: absolute; top: 0; bottom: 0; height: auto; margin: 0;
    left: calc(max(0px, (100% - var(--wrap)) / 2) + min(100%, var(--wrap)) * 0.5);
    right: max(0px, calc((100% - var(--wrap)) / 2 - 240px));
  }
  .hero-stage.is-live .hero-canvas {
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12%), linear-gradient(180deg, transparent 0, #000 8%, #000 92%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(90deg, transparent 0, #000 12%), linear-gradient(180deg, transparent 0, #000 8%, #000 92%, transparent 100%);
    mask-composite: intersect;
  }
}

/* ---------- Cards over the scene ---------- */
.hero-cards { position: absolute; inset: 0; pointer-events: none; --stem: 26px; }
.hero-card {
  width: 232px; padding: 10px 12px 11px; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--card) linear-gradient(to bottom, rgb(255 255 255 / 0.02), rgb(255 255 255 / 0) 45%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.045), var(--shadow-overlay);
  font-size: 13px; line-height: 1.4; color: var(--body);
}
.hero-who { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.hero-who b { color: var(--title); font-weight: 600; }
.hero-what { margin-top: 7px; color: var(--ink); font-size: 13.5px; font-weight: 500; }
.hero-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 12px; color: var(--muted); }
.hero-card .ref { font-size: 11.5px; padding-inline: 0; }
.hero-meta .ref { color: var(--body-strong); }

/* Avatars use the shared .avatar (top light + hairline ring); people round, agents rounded-square. */
.hero-av { width: 22px; height: 22px; line-height: 1; }
.hero-av.agent { border-radius: 6px; }
.hero-av svg { width: 13px; height: 13px; fill: currentColor; }
.hero-av-blue { background-color: var(--id-blue); }
.hero-av-teal { background-color: var(--id-teal); }
.hero-av-purple { background-color: var(--id-purple); }
.hero-av-amber { background-color: var(--id-amber); }
.hero-pair { display: inline-flex; flex: none; }
.hero-pair .hero-av + .hero-av { margin-left: -5px; box-shadow: 0 0 0 2px var(--card); }

.hero-meta .live-dot { margin-right: 1px; }
.hero:not([data-inview]) .live-dot { animation-play-state: paused; }

.hero-stem { display: none; }

/* The record card */
/* Its edge takes the status tone (the app's wash grammar): neutral at Todo, lime in progress, info in review,
   success when done; a tint fades in from the top left, and a dark outer ring + deeper shadow lift it off the plate. */
.hero-rec {
  --tone: #5b6670;
  width: 264px; padding: 11px 12px 10px; border-color: transparent;
  background:
    linear-gradient(to bottom, rgb(255 255 255 / 0.03), rgb(255 255 255 / 0) 45%) padding-box,
    linear-gradient(135deg, color-mix(in oklab, var(--tone) 10%, var(--card)), var(--card) 55%) padding-box,
    linear-gradient(to bottom, color-mix(in oklab, var(--tone) 62%, #4a525d), color-mix(in oklab, var(--tone) 26%, var(--line-strong)) 45%, #2b3038) border-box;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.45), 0 22px 44px -18px rgb(0 0 0 / 0.9), 0 8px 18px -10px color-mix(in oklab, var(--tone) 30%, transparent);
  transition: --tone 400ms var(--ease);
}
.hero-rec:has(.hero-st-prog.is-on) { --tone: var(--lime); }
.hero-rec:has(.hero-st-review.is-on) { --tone: var(--info); }
.hero-rec:has(.hero-st-done.is-on) { --tone: var(--success); }
.hero-stage:is(:not(.is-live), .is-static) .hero-rec { --tone: var(--success); }
.hero-rec-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 22px; }
.hero-rec-title { margin: 5px 0 9px; color: var(--title); font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.hero-status { display: grid; }
/* Status steps are the app's wash badges: Todo neutral, In progress live, In review info, Done success. */
.hero-st { grid-area: 1 / 1; justify-self: end; height: 22px; font-size: 11.5px; }
.hero-st-todo { --wash: #5b6670; }
.hero-st-prog { --wash: var(--lime); }
.hero-st-prog::before { display: none; }
.hero-st-review { --wash: var(--info); }
.hero-st-done { --wash: var(--success); }
.hero-stack { display: flex; }
.hero-stack .hero-av { box-shadow: 0 0 0 2px var(--card), inset 0 0 0 1px rgb(255 255 255 / 0.1); }
.hero-stack .hero-av + .hero-av { margin-left: 4px; }
.hero-rec-note { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* The email's final spec, the story's output: the app's page view in miniature (title, Spec pill, Approved
   badge, version, the document, a resolved comment, the approval receipt). Success-toned edge like the record. */
.hero-spec {
  --tone: var(--success);
  width: 316px; padding: 12px 14px; border-color: transparent;
  background:
    linear-gradient(to bottom, rgb(255 255 255 / 0.03), rgb(255 255 255 / 0) 40%) padding-box,
    linear-gradient(135deg, color-mix(in oklab, var(--tone) 9%, var(--card)), var(--card) 55%) padding-box,
    linear-gradient(to bottom, color-mix(in oklab, var(--tone) 60%, #4a525d), color-mix(in oklab, var(--tone) 24%, var(--line-strong)) 45%, #2b3038) border-box;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.45), 0 26px 50px -20px rgb(0 0 0 / 0.9), 0 10px 22px -12px color-mix(in oklab, var(--tone) 32%, transparent);
}
.hero-spec-head { display: flex; align-items: center; gap: 7px; }
.hero-spec-ico { width: 16px; height: 16px; flex: none; }
.hero-spec-ico .w { fill: var(--lime); fill-opacity: 0.3; }
.hero-spec-ico .s { fill: none; stroke: var(--lime-ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.hero-spec-title { color: var(--title); font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.hero-spec-kind { height: 18px; padding: 0 7px; font-size: 11px; }
.hero-spec-ok { margin-left: auto; height: 22px; font-size: 11.5px; }
.hero-spec-meta { margin: 3px 0 0 23px; font-size: 11.5px; color: var(--muted); }
.hero-spec-doc { margin-top: 10px; padding: 9px 11px 8px; border-radius: 9px; background: var(--sunk); border: 1px solid var(--line-soft);
  font-size: 12.5px; line-height: 1.55; color: var(--body-strong); }
.hero-spec-doc p + p { margin-top: 2px; }
.hero-spec-subject { margin-bottom: 6px !important; padding-bottom: 6px; border-bottom: 1px solid var(--line-soft); color: var(--title); font-weight: 500; }
.hero-spec-subject span { margin-right: 7px; color: var(--muted); font-weight: 400; }
.hero-spec-mark { color: var(--title); background: color-mix(in oklab, var(--success) 18%, transparent); border-radius: 3px;
  box-shadow: -3px 0 0 color-mix(in oklab, var(--success) 18%, transparent), 3px 0 0 color-mix(in oklab, var(--success) 18%, transparent); }
.hero-spec-comment { display: flex; align-items: center; gap: 7px; margin-top: 9px; font-size: 12px; color: var(--body); }
.hero-spec-comment .hero-av { width: 20px; height: 20px; font-size: 10px; }
.hero-spec-comment b, .hero-spec-receipt b { color: var(--ink); font-weight: 600; }
.hero-spec-receipt { display: flex; align-items: center; gap: 6px; margin-top: 8px; padding: 6px 9px; border-radius: 8px;
  background: rgb(255 255 255 / 0.03); border: 1px solid var(--line-soft); font-size: 12px; color: var(--body); }
.hero-spec-receipt svg { width: 14px; height: 14px; fill: none; stroke: var(--success-ink); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
/* Lines reveal one after another as the spec opens. */
.hero-stage.is-live .hero-pin-spec .hero-k { opacity: 0; transform: translateY(4px); transition: opacity 320ms var(--ease), transform 320ms var(--ease); }
.hero-stage.is-live .hero-pin-spec.is-on .hero-k { opacity: 1; transform: none; transition-delay: calc(260ms + var(--k) * 140ms); }
.hero-stage:is(:not(.is-live), .is-static) .hero-pin-spec .hero-k { opacity: 1; transform: none; }
/* The still frame ends on the spec alone: the story cards and the record card step aside there. */
.hero-stage.is-static .hero-pin:not(.hero-pin-spec) { display: none; }

/* Live: JS projects each pin to its 3D anchor; [data-on] states come and go with the story. */
.hero-stage.is-live .hero-pin { position: absolute; left: 0; top: 0; will-change: transform; }
.hero-stage.is-live .hero-pin > .hero-card { position: absolute; left: var(--shift, 0px); bottom: var(--stem); translate: -50% 0; transform-origin: 50% 100%; }
.hero-stage.is-live .hero-pin-rec > .hero-card { top: 0; bottom: auto; translate: -50% -50%; transform-origin: 50% 50%; }
.hero-stage.is-live .hero-stem {
  display: block; position: absolute; left: -0.5px; bottom: 0; width: 1px; height: var(--stem);
  background: var(--line-strong); transform-origin: 50% 100%;
}
.hero-stage.is-live .hero-stem::after {
  content: ""; position: absolute; left: -2.5px; bottom: -3px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--body-strong); box-shadow: 0 0 0 2px rgb(14 16 19 / 0.7);
}

.hero-stage.is-live .hero-pin > .hero-card {
  opacity: 0; transform: translateY(10px) scale(0.92);
  transition: opacity 160ms var(--ease), transform 200ms var(--ease);
}
.hero-stage.is-live .hero-pin.is-on > .hero-card {
  opacity: 1; transform: none;
  transition: opacity 240ms var(--ease) 90ms, transform 560ms cubic-bezier(0.34, 1.5, 0.55, 1) 90ms;
}
.hero-stage.is-live .hero-stem { transform: scaleY(0); transition: transform 160ms var(--ease); }
.hero-stage.is-live .hero-pin.is-on .hero-stem { transform: none; transition: transform 260ms var(--ease); }

.hero-stage.is-live .hero-rec [data-on] { opacity: 0; transform: scale(0.7); transition: opacity 180ms var(--ease), transform 180ms var(--ease); }
.hero-stage.is-live .hero-rec [data-on].is-on {
  opacity: 1; transform: none;
  transition: opacity 260ms var(--ease) 120ms, transform 480ms cubic-bezier(0.34, 1.6, 0.55, 1) 120ms;
}
.hero-stage.is-live .hero-rec .hero-rec-note[data-on] { transform: translateX(-4px); }
.hero-stage.is-live .hero-rec .hero-rec-note[data-on].is-on { transform: none; }

/* Fallback (no WebGL / no JS) and reduced motion: the finished story, every card shown. */
.hero-stage:is(:not(.is-live), .is-static) :is(.hero-pin > .hero-card, .hero-stem, .hero-rec [data-on]) { opacity: 1; transform: none; transition: none; }
.hero-stage:is(:not(.is-live), .is-static) .hero-st:not([data-final]) { display: none; }

.hero-stage:not(.is-live) { height: auto; }
.hero-stage:not(.is-live) .hero-cards {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 0 24px;
}
.hero-stage:not(.is-live) .hero-pin { width: min(100%, 300px); }
.hero-stage:not(.is-live) .hero-card { width: 100%; }

/* The still frame folds Codex's second beat into its first card, so nothing sits on the Codex sign. */
.hero-later { display: none; margin-top: 9px; padding-top: 2px; border-top: 1px solid var(--line); }
.hero-stage.is-static .hero-later { display: block; }
.hero-stage.is-static .hero-pin[data-pin="review"] { display: none; }

@media (min-width: 1100px) {
  .hero-stage:not(.is-live) { height: auto; }
  .hero-stage:not(.is-live) .hero-cards { position: absolute; inset: 0; justify-content: center; padding: 0; }
}

@media (max-width: 719px) {
  .hero-cards { --stem: 18px; }
  .hero-card { width: 214px; padding: 9px 10px 10px; font-size: 12px; }
  .hero-who { font-size: 12px; }
  .hero-what { font-size: 13px; margin-top: 6px; }
  .hero-rec { width: 256px; }
  /* On phones the record docks under the scene instead of floating in it. */
  .hero-stage.is-live .hero-pin-rec { transform: none !important; left: 50%; top: auto; bottom: 28px; }
  .hero-stage.is-live .hero-pin-rec > .hero-card { top: auto; bottom: 0; left: 0; translate: -50% 0; transform-origin: 50% 100%; }
  .hero-stage.is-static .hero-pin[data-narrow-static="hide"] { display: none; }
}

/* ---------- Works in your AI ---------- */
/* A banner: copy block and logos centred on one line; a slow light sweeps across it and a lime glint
   runs along the top hairline, both paused offscreen (data-inview) and off under reduced motion. */
.hero-works { position: relative; z-index: 1; overflow: hidden; background: var(--sidebar); border-block: 1px solid var(--line); }
.hero-works::before, .hero-works::after { content: ""; position: absolute; pointer-events: none; animation: hero-works-sweep 9s var(--ease-inout) infinite; }
.hero-works::before { inset: 0; background: linear-gradient(100deg, transparent 38%, rgb(255 255 255 / 0.028) 50%, transparent 62%) 0 0 / 260% 100% no-repeat; }
.hero-works::after { left: 0; right: 0; top: -1px; height: 1px; background: linear-gradient(90deg, transparent 42%, var(--lime-line) 50%, transparent 58%) 0 0 / 260% 100% no-repeat; }
.hero-works:not([data-inview])::before, .hero-works:not([data-inview])::after { animation-play-state: paused; }
@keyframes hero-works-sweep { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .hero-works::before, .hero-works::after { animation: none; opacity: 0; } }
.hero-works-in { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 40px; padding-block: 22px; }
.hero-works-copy { display: flex; flex-direction: column; gap: 2px; }
.hero-works-title { font-size: 15px; font-weight: 600; line-height: 1.35; letter-spacing: -0.01em; color: var(--title); }
.hero-tools { display: flex; flex-wrap: wrap; gap: 4px 36px; margin: 0; padding: 0; list-style: none; }
.hero-tool {
  --tone: rgb(255 255 255 / 0.55);
  display: flex; align-items: center; gap: 10px; min-height: 44px; margin-inline: -10px; padding: 0 12px 0 10px; border-radius: 10px;
  color: var(--ink); font-size: 15px; font-weight: 550;
  transition: background-color var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}
.hero-tool-claude { --tone: #d97757; }
.hero-tool:hover {
  background-color: var(--sidebar);
  background-image: linear-gradient(to right, color-mix(in oklab, var(--tone) 12%, var(--sidebar)), var(--sidebar) 75%);
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--tone) 18%, var(--line)), inset 0 1px 0 rgb(255 255 255 / 0.04);
}
.hero-tool svg { width: 22px; height: 22px; fill: var(--body-strong); transition: fill var(--dur-base) var(--ease), transform var(--dur-base) var(--ease); }
.hero-tool:hover svg { fill: var(--title); transform: translateY(-1px); }
.hero-tool-claude:hover svg { fill: #d97757; }
.hero-works-note { font-size: 13.5px; line-height: 1.4; color: var(--muted); }

@media (max-width: 1099px) {
  .hero-works-in { justify-content: flex-start; }
  .hero-works-copy { flex-basis: 100%; }
}
@media (max-width: 719px) {
  .hero-works-in { padding-block: 24px; gap: 10px; }
  .hero-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; width: 100%; }
}


/* ---------- Story scrubber: play/pause, drag the handle through the story, jump to a step ---------- */
.hero-scrub {
  position: relative; z-index: 3; display: flex; align-items: center; gap: 12px;
  width: min(100%, 560px); margin: 10px auto 0; padding: 8px 20px 9px; border-radius: 16px;
  background: rgb(17 20 25 / 0.8); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid var(--line); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.04), var(--shadow-overlay);
}
.hero-scrub[hidden] { display: none; }
.hero-scrub-body { flex: 1; min-width: 0; }
.hero-scrub-track { position: relative; height: 22px; cursor: pointer; touch-action: none; }
.hero-scrub-rail, .hero-scrub-fill { position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 4px; }
.hero-scrub-rail { background: var(--line-strong); }
.hero-scrub-fill { transform-origin: 0 50%; transform: scaleX(var(--p, 0)); background: linear-gradient(90deg, #4e8a2b, var(--lime)); }
.hero-scrub-knob {
  position: absolute; top: 50%; left: calc(var(--p, 0) * 100%); width: 16px; height: 16px; border-radius: 50%;
  translate: -50% -50%; cursor: grab; background: linear-gradient(to bottom, #9bd970, var(--lime));
  box-shadow: 0 0 0 2px #0d1a06, 0 0 0 5px rgb(111 181 65 / 0.22), 0 3px 8px rgb(0 0 0 / 0.6);
  transition: scale var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.hero-scrub-track:hover .hero-scrub-knob, .hero-scrub.is-dragging .hero-scrub-knob { scale: 1.15; box-shadow: 0 0 0 2px #0d1a06, 0 0 0 7px rgb(111 181 65 / 0.28), 0 3px 10px rgb(0 0 0 / 0.6); }
.hero-scrub.is-dragging .hero-scrub-knob { cursor: grabbing; }
.hero-scrub-knob:focus-visible { outline: 2px solid var(--title); outline-offset: 3px; }
.hero-scrub-marks { position: relative; height: 16px; margin-top: 2px; }
.hero-scrub-mark {
  position: absolute; top: 0; left: calc(var(--at) * 100%); display: flex; align-items: center;
  padding: 0; border: 0; background: none; cursor: pointer; font: inherit; font-size: 11.5px; font-weight: 600; letter-spacing: -0.005em; line-height: 1; white-space: nowrap; color: var(--muted);
  transition: color var(--dur-fast) var(--ease);
}
.hero-scrub-mark::after { content: ""; position: absolute; inset: -10px -6px; } /* a comfortable tap target */
.hero-scrub-mark.is-past { color: var(--body-strong); }
.hero-scrub-mark.is-current { color: var(--lime-ink); }
.hero-scrub-mark:hover { color: var(--title); }
@media (prefers-reduced-motion: reduce) { .hero-scrub { display: none !important; } }
@media (max-width: 479px) { .hero-scrub-marks { display: none; } }
/* Desktop: the pill sits at the far right of the hero, one gutter in from its edge; the stage gives up its
   bottom 72px so no card sits under it. */
@media (min-width: 1100px) {
  .hero-stage { bottom: 72px; }
  .hero-scrub { position: absolute; bottom: 18px; margin: 0; width: min(560px, 46%); left: auto; right: var(--gutter); }
}


/* ---------- Loading: an empty 3D plate with the brand dots, until the town is live ----------
   With JS running (html.js) the stacked fallback cards wait; they only show if 3D fails (.is-failed) or JS is off. */
.hero-loader { display: none; }
.js .hero-stage:not(.is-live):not(.is-failed) { height: 460px; }
.js .hero-stage:not(.is-live):not(.is-failed) .hero-cards { display: none; }
.js .hero-stage:not(.is-live):not(.is-failed) .hero-loader { position: absolute; inset: 0; display: grid; place-items: center; perspective: 900px; }
@media (min-width: 720px) { .js .hero-stage:not(.is-live):not(.is-failed) { height: clamp(460px, 62vw, 580px); } }
@media (min-width: 1100px) { .js .hero-stage:not(.is-live):not(.is-failed) { height: auto; } }
.hero-loader-plate {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 12px;
  width: min(52%, 320px); aspect-ratio: 1; border-radius: 24%; overflow: hidden;
  transform: rotateX(58deg) rotateZ(45deg);
  background: radial-gradient(circle, rgb(163 171 181 / 0.14) 1px, transparent 1.4px) 0 0 / 16px 16px, linear-gradient(135deg, #1b1f25, #121418);
  box-shadow: 0 0 0 1px var(--line), 0 14px 0 -1px #0b0d10, 0 40px 60px -30px rgb(0 0 0 / 0.9);
  animation: hero-plate-in 700ms var(--ease) both;
}
.hero-loader-plate::after {
  content: ""; position: absolute; inset: -20%;
  background: linear-gradient(115deg, transparent 40%, rgb(111 181 65 / 0.09) 50%, transparent 60%);
  animation: hero-plate-sweep 1.8s var(--ease-inout) infinite;
}
.hero-loader-plate i { width: 12px; height: 12px; border-radius: 50%; background: var(--lime); opacity: 0.25; animation: hero-dot-pulse 1.2s var(--ease) infinite; }
.hero-loader-plate i:nth-child(2) { animation-delay: 160ms; }
.hero-loader-plate i:nth-child(3) { animation-delay: 320ms; }
@keyframes hero-plate-in { from { opacity: 0; transform: rotateX(58deg) rotateZ(45deg) scale(0.92); } }
@keyframes hero-plate-sweep { from { translate: -60% 0; } to { translate: 60% 0; } }
@keyframes hero-dot-pulse { 0%, 100% { opacity: 0.22; scale: 0.8; } 40% { opacity: 1; scale: 1.15; } }
@media (prefers-reduced-motion: reduce) { .hero-loader-plate, .hero-loader-plate::after, .hero-loader-plate i { animation: none; } .hero-loader-plate i { opacity: 0.6; } }
