/* ═══════════════ VectorAIQ demo — page framework ═══════════════ */

@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --blue: #1772E8;
  --blue-dark: #125BE3;
  --navy: #232c68;
  --ink: #1c1c1c;
  --ink-2: #4b5563;
  --muted: #828282;
  --line: #e5e5e5;
  --bg: #ffffff;
  --bg-gray: #f4f5f7;
  --dark: #060b1e;
  --dark-2: #0a1230;
  --green: #10b981;
  --amber-bg: #fffbeb;
  --grad-start: #092447;
  --grad-mid: #1772e8;
  --grad-end: #b0d2ff;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);   /* entrances + settles */
  --ease-over: cubic-bezier(0.34, 1.56, 0.64, 1); /* pops: pills, launcher, checks */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --rail: 1080px; /* shared content rail — all marketing sections align to this */
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
button { font: inherit; border: 0; background: none; cursor: pointer; text-align: left; }
a { color: inherit; text-decoration: none; }

/* ─────────────── beat engine primitives ─────────────── */
[data-beat] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}
[data-beat].on {
  opacity: 1;
  transform: none;
}
[data-beat].off {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition-duration: 0.3s;
}

/* swap: replace-in-place — children stack in one grid cell, so the element
   that beats in occupies exactly the spot of the one that beats out
   (typing dots → answer, takeover card → operator message). */
.swap { display: grid; align-self: stretch; }
.swap > * { grid-area: 1 / 1; justify-self: start; align-self: start; }

/* grow: height expands/collapses with the beat, so content below slides
   smoothly instead of popping when something appears mid-layout
   (sync banner, product row expansion). */
[data-beat].grow {
  opacity: 1; transform: none;
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows 0.6s var(--ease);
}
[data-beat].grow.on { grid-template-rows: 1fr; }
[data-beat].grow.off { opacity: 1; transform: none; grid-template-rows: 0fr; }
.grow-inner {
  min-height: 0; overflow: hidden;
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}
.grow.on .grow-inner { opacity: 1; transform: none; transition-delay: 0.12s; }
.grow.off .grow-inner { opacity: 0; transform: none; transition-delay: 0s; }

/* beat polish: chat bubbles land with a little weight, quick replies pop */
.w-msg[data-beat]:not(.on) { transform: translateY(14px) scale(0.96); }
.w-msg[data-beat] { transform-origin: 50% 100%; }
.w-qr[data-beat]:not(.on) { transform: translateY(10px) scale(0.8); }
.w-qr[data-beat] { transition-timing-function: var(--ease-over); }
.w-quickreplies .w-qr:nth-child(2), .w-quickreplies .w-qr:nth-child(4) { transition-delay: 0.07s; }
/* the row the copy references flashes once as it lands, guiding the eye */
.w-prow.on td { animation: row-flash 0.9s var(--ease) both; }
@keyframes row-flash { 0%, 100% { background: transparent; } 30% { background: rgba(23, 114, 232, 0.09); } }

/* streamed text: wipes downward when its beat fires */
.stream { display: block; clip-path: inset(0 0 100% 0); }
.on .stream, .on.stream { clip-path: inset(0 0 -8% 0); transition: clip-path 1.1s ease-out 0.15s; }

/* generic scroll-in reveal (interstitials, finale) — hidden states only under
   html.js so a no-JS visit still sees the whole page */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
[data-reveal].on { opacity: 1; transform: none; }
/* mask variant: a downward wipe instead of the fade-rise */
.js [data-reveal="mask"] { opacity: 1; transform: none; clip-path: inset(0 0 100% 0); transition: clip-path 1s var(--ease-expo); }
[data-reveal="mask"].on { clip-path: inset(-4% 0 -12% 0); }
/* lines variant: the heading rises through per-line masks (the hero title's
   grammar) — spans are built at boot, CSS releases them on .on */
.js [data-reveal="lines"] { opacity: 1; transform: none; transition: none; }
.tl { display: block; overflow: hidden; padding-bottom: 0.14em; margin-bottom: -0.14em; }
.tl-i { display: block; }
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal="lines"] .tl-i { transform: translateY(112%); transition: transform 0.95s var(--ease-expo); }
  [data-reveal="lines"].on .tl-i { transform: none; }
  [data-reveal="lines"] .tl:nth-child(2) .tl-i { transition-delay: 0.09s; }
}

/* ─────────────── load choreography ───────────────
   Initial hidden states exist only under html.js (no-JS sees the page whole);
   .loaded (set on fonts.ready) releases each element with a keyframe entrance.
   `backwards` fill holds the from-state through each delay. */
.js:not(.loaded) .hero-aurora,
.js:not(.loaded) .hero-kicker,
.js:not(.loaded) .hero-sub,
.js:not(.loaded) .hero-ctas,
.js:not(.loaded) .nav,
.js:not(.loaded) .hero-scrollcue,
.js:not(.loaded) .store-browser { opacity: 0; }
.js:not(.loaded) .ht-li { transform: translateY(110%); }

/* descender room: the padding lives on .ht-li — it carries the background-clip:text
   gradient, whose painting area is its padding box, so without this the y/p/g tails
   fall outside the gradient and render transparent at line-height 1.03. The mask
   window inherits the extra height; the negative margin keeps the 1.03 line advance. */
.ht-line { display: block; overflow: hidden; margin-bottom: -0.14em; }
.ht-li { display: block; padding-bottom: 0.14em; }

.loaded .hero-aurora   { animation: lc-fade 1.4s var(--ease-expo) 0s backwards; }
.loaded .hero-kicker   { animation: lc-rise 0.8s var(--ease-expo) 0.10s backwards; }
.loaded .ht-line:nth-child(1) .ht-li { animation: lc-line 0.95s var(--ease-expo) 0.18s backwards; }
.loaded .ht-line:nth-child(2) .ht-li { animation: lc-line 0.95s var(--ease-expo) 0.28s backwards; }
.loaded .hero-sub      { animation: lc-rise 0.8s var(--ease-expo) 0.48s backwards; }
.loaded .hero-ctas     { animation: lc-rise 0.8s var(--ease-expo) 0.58s backwards; }
.loaded .nav           { animation: lc-drop 0.7s var(--ease-expo) 0.65s backwards; }
.loaded .store-browser { animation: lc-stage 1.1s var(--ease-expo) 0.75s backwards; }
.loaded .hero-scrollcue { animation: lc-fade 0.9s var(--ease-expo) 1.5s backwards; }

@keyframes lc-fade { from { opacity: 0; } }
@keyframes lc-rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes lc-drop { from { opacity: 0; transform: translateY(-12px); } }
@keyframes lc-line { from { transform: translateY(110%); } }
@keyframes lc-stage { from { opacity: 0; transform: translateY(56px); } }

/* ─────────────── interstitial word ignition ───────────────
   The scroll engine sets --ip (0→1) on each .int-text as it travels the
   viewport; every word span carries --wi. Each word fades from patient
   (0.16) to lit ink as the sweep passes it — reversible, scrub-linked. */
.js .int-text .w {
  opacity: clamp(0.16, calc((var(--ip, 0) * (var(--n, 20) + 4) - var(--wi, 0)) / 2.5), 1);
}
/* the dark em paints its gradient via background-clip:text, which lives on the
   em's own layer — word-span opacity can't dim it. When words are wrapped,
   each span carries its own clipped gradient so the ignition sweep applies. */
.int-dark .int-text em:has(.w) { background: none; }
.int-dark .int-text em .w {
  background: linear-gradient(90deg, #6aa5f8, #b0d2ff);
  background-size: 200% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.int-dark .int-text.lit em .w { animation: em-sweep 0.9s var(--ease-expo) both; }
@keyframes em-sweep { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ─────────────── hero ─────────────── */
/* the dark lives on the PIN, not the section — interstitial 1 overlaps the
   hero's release travel (see sizeActs), and the section box behind it must
   stay transparent so the white environment shows through */
.hero { height: 200vh; color: #fff; }
.hero-pin {
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  overflow: hidden; display: flex; align-items: center; justify-content: center;
  background: var(--dark);
  perspective: 1400px; /* the storefront lands with a slight rotateX settle */
}
.hero-aurora { position: absolute; inset: 0; overflow: hidden; }
.orb {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.55;
  animation: drift 18s ease-in-out infinite alternate;
}
/* GPU relief: freeze the aurora once the hero has scrolled away */
.hero.still .orb { animation-play-state: paused; }
.orb-a { width: 60vw; height: 60vw; background: radial-gradient(circle, #1772e8 0%, transparent 65%); top: -20%; left: -12%; }
.orb-b { width: 46vw; height: 46vw; background: radial-gradient(circle, #6d5df0 0%, transparent 65%); bottom: -18%; right: -8%; animation-delay: -6s; }
.orb-c { width: 34vw; height: 34vw; background: radial-gradient(circle, #b0d2ff 0%, transparent 60%); top: 32%; right: 22%; opacity: 0.28; animation-delay: -12s; }
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(6vw, -5vh) scale(1.15); }
}

.hero-copy { position: relative; text-align: center; max-width: 880px; padding: 0 28px; z-index: 2; margin-bottom: 12vh; }
.hero-copy.gone { pointer-events: none; }
.hero-kicker {
  font-size: 13px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase;
  color: #8fbcff; margin-bottom: 22px;
}
.hero-title {
  font-size: clamp(40px, 5vw, 70px); line-height: 1.03; font-weight: 800; letter-spacing: -0.035em;
}
/* the white→blue fade is sliced per line (200% background height) so the
   line-mask spans keep the exact two-line gradient the single block had */
.hero-title .ht-li {
  background: linear-gradient(180deg, #ffffff 30%, #a8c6f5 100%);
  background-size: 100% 200%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.ht-line:nth-child(1) .ht-li { background-position: 0 0; }
.ht-line:nth-child(2) .ht-li { background-position: 0 100%; }
.hero-sub {
  margin: 26px auto 0; max-width: 620px; font-size: clamp(16px, 2vw, 19px);
  line-height: 1.6; color: rgba(255, 255, 255, 0.72);
}

.hero-widget {
  position: absolute; bottom: 24px; right: 24px; z-index: 3;
  display: flex; flex-direction: column; align-items: flex-end; gap: 14px;
  opacity: 0; transform: translateY(34px) scale(0.62); transform-origin: bottom right;
  transition: opacity 0.4s var(--ease), transform 0.55s var(--ease-over);
  pointer-events: none;
}
.hero-widget.show { opacity: 1; transform: none; }
/* pulse rings hold until the launcher pops, so the first burst rides the entrance */
.hero-widget:not(.show) .pulse { animation: none; }
.hero-greeting {
  width: 250px; padding: 14px; background: #fff; color: var(--ink);
  border: 1px solid #dee1e6; border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  opacity: 0; transform: translateX(22px);
  transition: opacity 0.5s var(--ease) 0.25s, transform 0.5s var(--ease) 0.25s;
}
.hero-widget.show .hero-greeting.show { opacity: 1; transform: none; }
.hg-name { font-size: 14px; font-weight: 600; color: #1f2227; margin-bottom: 4px; }
.hg-msg { font-size: 14px; line-height: 1.45; color: #374151; }
.hero-launcher {
  /* the widget's default trigger SVG carries its own rounded-rect gradient face */
  position: relative; width: 60px; height: 60px; border-radius: 26%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.2);
}
.hero-launcher svg { display: block; width: 100%; height: 100%; }
.pulse {
  position: absolute; inset: 0; border-radius: 26%; border: 1px solid #7aaaf0;
  animation: ring 2.5s var(--ease) infinite; opacity: 0;
}
.p2 { animation-delay: 0.16s; } .p3 { animation-delay: 0.32s; }
@keyframes ring {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(2); opacity: 0; }
}

/* the dive's white resolve: one veil under the stage whitens the world first;
   the storefront then fades ITSELF out on that single white surface (its
   shadow goes with it), so no seam can show between two whitening layers */
.hero-veil-bg {
  position: absolute; inset: 0;
  background: #fff; opacity: 0; pointer-events: none;
}

.hero-scrollcue {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  z-index: 4;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  /* the cue overlays the dimmed storefront peek (mid-tone), not the dark aurora —
     shadow + brighter ink keep it legible on both */
  color: rgba(255, 255, 255, 0.75);
  text-shadow: 0 1px 10px rgba(6, 11, 30, 0.7), 0 0 3px rgba(6, 11, 30, 0.55);
  transition: opacity 0.5s ease;
}
.hero-scrollcue svg { animation: bob 1.8s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }
.hero-scrollcue.hide { opacity: 0; }

/* ─────────────── hero storefront stage ─────────────── */
.hero-stage {
  position: absolute; z-index: 1; will-change: transform;
  transform-origin: 50% 100%; /* the landing tilt pivots at the bottom edge */
  /* JS (sizeHeroStore) overrides position + size; these defaults center the
     unscaled canvas so the stage renders sanely before the engine boots */
  left: 50%; top: 50%; width: 1120px; height: 700px; margin: -350px 0 0 -560px;
}
.hero-store-inner { width: 1120px; height: 700px; transform-origin: top left; }
/* .browser.store-browser out-specifies .browser's base width (that rule sits later in the file) */
.browser.store-browser { width: 1120px; }
.hero-store-dim {
  position: absolute; inset: 0; z-index: 2;
  background: var(--dark); opacity: 0.55; pointer-events: none;
}
.store-page { height: 664px; background: #f7f9fb; }
.store-nav {
  height: 64px; display: flex; align-items: center; gap: 40px; padding: 0 40px;
  background: #fff; border-bottom: 1px solid #e4eaf1;
}
.store-wordmark { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; color: #2a3542; }
.store-links { display: flex; gap: 28px; font-size: 13.5px; font-weight: 500; color: #66788c; }
.store-cart { margin-left: auto; }
.store-banner {
  margin: 24px 40px 0; height: 260px; border-radius: 12px;
  background:
    radial-gradient(120% 160% at 85% 10%, rgba(226, 240, 255, 0.35) 0%, transparent 55%),
    linear-gradient(115deg, #9fb4c9 0%, #7590ac 45%, #5a7391 100%);
  display: flex; align-items: center; padding: 0 48px;
}
.store-banner-copy { display: flex; flex-direction: column; gap: 14px; }
.sk { display: block; border-radius: 6px; }
.store-banner .sk { background: rgba(244, 249, 255, 0.65); }
.sk-headline { width: 330px; height: 26px; }
.sk-headline.sk-short { width: 210px; }
.sk-cta { width: 132px; height: 40px; border-radius: 20px; margin-top: 10px; }
.store-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
  padding: 28px 40px 40px;
}
.store-card { display: flex; flex-direction: column; gap: 10px; }
.store-card .sk { background: #e2e8ef; }
.store-img { display: block; height: 200px; border-radius: 10px; }
.si-1 { background: linear-gradient(160deg, #b7c8d8, #7f9ab2); }
.si-2 { background: linear-gradient(160deg, #adc2bd, #74928b); }
.si-3 { background: linear-gradient(160deg, #d3d8de, #9aa4b0); }
.si-4 { background: linear-gradient(160deg, #b0b4cf, #7b81a8); }
.sk-title { width: 70%; height: 13px; }
.sk-price { width: 36%; height: 13px; }

/* ─────────────── journey environment ───────────────
   Fixed backdrop behind the whole tour; the engine morphs its color between
   chapter stops and paints the drafting grid on .env-grid. */
.env { position: fixed; inset: 0; z-index: -1; background: #fff; }
.env-grid {
  position: absolute; left: 50%; top: 50%;
  width: 150vmax; height: 150vmax; margin: -75vmax 0 0 -75vmax; /* covers at any rotation */
  background-position: center center;
  opacity: 0;
  will-change: transform;
}

/* ─────────────── interstitials ───────────────
   Statements are pinned title cards in the environment: the text holds at
   viewport centre — invisible while the section approaches — then fades in
   IN PLACE, ignites, and releases with the pin. */
.interstitial {
  height: 170vh; background: transparent;
}
.int-pin {
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 0 28px; text-align: center;
}
.interstitial.int-dark { color: #fff; }
.int-text { transform-origin: 50% 50%; }
@media (prefers-reduced-motion: no-preference) {
  .js .int-text { opacity: 0; } /* the engine owns the fade-in */
}
.int-text {
  font-size: clamp(26px, 4.2vw, 48px); font-weight: 750; letter-spacing: -0.03em; line-height: 1.18;
}
.int-text em { font-style: normal; color: var(--blue); }
.int-dark .int-text em {
  background: linear-gradient(90deg, #6aa5f8, #b0d2ff);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

/* ─────────────── acts (pinned scrolly sections) ───────────────
   Acts are transparent — they happen inside the journey environment, whose
   color and grid the engine drives (see .env above). */
.act { position: relative; }
.act-pin {
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden;
  display: flex; align-items: center;
}
.act-grid {
  position: relative; z-index: 1; /* act content above the grid backdrop */
  width: 100%; max-width: 1280px; margin: 0 auto; padding: 44px 40px 36px;
  display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 56px;
  height: 100%;
  align-items: center;
  perspective: 2400px; /* depth for scene swaps, device entrances, stage tilt */
}

/* rail */
.rail { display: flex; flex-direction: column; gap: 26px; max-height: 100%; }
.rail-title {
  font-size: clamp(28px, 3.2vw, 40px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.08;
}
/* tiles are rows of one contained card; hairline dividers separate them and
   the active row's progress bar runs edge-to-edge, taking the divider's place */
.tiles {
  display: flex; flex-direction: column;
  background: #fff;
  border: 1px solid rgba(9, 36, 71, 0.1);
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 12px 32px rgba(9, 36, 71, 0.07), 0 2px 6px rgba(9, 36, 71, 0.04);
}
.tile {
  position: relative;
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px 16px 16px;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease),
              opacity 0.4s var(--ease);
  opacity: 0.45;
}
.tile:hover { opacity: 0.8; }
.tile + .tile { border-top: 1px solid rgba(9, 36, 71, 0.08); }
.tile.active + .tile { border-top-color: transparent; }
/* scrub progress within the active scene (--sp set by the scroll engine):
   ::before is the faint track, ::after the fill */
.tile::before,
.tile::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 2.5px; opacity: 0;
  transition: opacity 0.35s var(--ease);
}
.tile::before { background: rgba(23, 114, 232, 0.14); }
.tile::after {
  background: var(--blue);
  transform: scaleX(0); transform-origin: left;
}
.tile.active::before { opacity: 1; }
.tile.active::after {
  opacity: 0.9; transform: scaleX(var(--sp, 0));
  transition: opacity 0.35s var(--ease), transform 0.12s linear;
}
.tile.active { opacity: 1; background: rgba(23, 114, 232, 0.045); }
.tile-body { display: flex; flex-direction: column; gap: 3px; }
.tile-body strong { font-size: 15px; font-weight: 700; letter-spacing: -0.015em; }
.tile-body small { font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.rail-caption { display: none; font-size: 13px; line-height: 1.5; color: var(--ink-2); }

/* stage */
.stage {
  position: relative; height: 100%; min-height: 0;
  /* pointer-ambient tilt (--tilt-*) + exit-portal zoom (--dz) + dissolve
     (--dive-fade) — all written by the engine */
  transform-style: preserve-3d;
  transform: translateX(var(--dx, 0px)) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) scale(var(--dz, 1));
  transform-origin: 50% 42%;
  opacity: var(--dive-fade, 1);
}
.act .rail { opacity: var(--rail-fade, 1); }
.act.diving .rail, .act.diving .stage { pointer-events: none; }
.act.diving .stage { will-change: transform; }
/* scenes swap in depth, not in the plane — no X/Y motion on the device frame,
   so consecutive scenes sharing the same chrome still read as one still UI;
   the outgoing pane racks out of focus behind, the incoming settles from front */
.scene {
  position: absolute; inset: 0; z-index: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding-bottom: 58px; /* note slot — keeps the device centered identically in every scene */
  opacity: 0;
  /* scene swaps are a pure stationary dissolve — NO transform/blur, so the
     shared chrome never shifts a pixel between slides. Asymmetric easing
     kills the blink: the incoming pane rises fast (ease-out) ON TOP (z 2)
     while the outgoing holds its opacity late (ease-in) underneath. */
  transition: opacity 0.38s cubic-bezier(0, 0, 0.2, 1);
  pointer-events: none; visibility: hidden;
}
.scene.active { opacity: 1; pointer-events: auto; visibility: visible; z-index: 2; }
.scene.leaving {
  opacity: 0; visibility: visible; z-index: 1;
  transition: opacity 0.38s cubic-bezier(0.55, 0, 1, 0.45);
}
/* mixed-chrome acts (scenes with different device sizes): the overlap
   dissolve would show both mocks at once, so swap sequentially instead —
   the outgoing exits fast, the incoming waits a beat before rising */
.act-mixed .scene { transition: opacity 0.3s var(--ease) 0.14s; }
.act-mixed .scene.leaving { transition: opacity 0.16s var(--ease); }

.device { position: relative; display: grid; place-items: center; }
.device-inner { transform-origin: center center; }
/* act arrival: the first scene's device rises and settles flat, once per visit
   (.entered is set by the visibility observer, cleared when the act leaves) */
.device { transition: opacity 0.95s var(--ease-expo), transform 0.95s var(--ease-expo); }
.js .act:not(.entered) .scene[data-scene="0"] .device {
  opacity: 0; transform: translateY(44px) rotateX(9deg);
}

.stage-note {
  position: absolute; bottom: 8px; left: 0; right: 0;
  margin: 0 auto; width: fit-content;
  translate: var(--note-x, 0px) var(--note-y, 0px); /* counter-drift: nearer the camera */
  font-size: 13.5px; font-weight: 500; color: var(--ink-2); text-align: center;
  max-width: 480px; line-height: 1.5;
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  padding: 9px 18px; border-radius: 22px; border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 12px 32px rgba(9, 36, 71, 0.07), 0 2px 6px rgba(9, 36, 71, 0.04); /* matches .tiles */
}
.act-gray .stage-note { background: rgba(255, 255, 255, 0.95); }

/* counters + deltas */
.delta { font-size: 11px; font-weight: 600; }
.delta.up { color: #059669; }
.delta.down { color: #ef4444; }

/* ─────────────── browser chrome frame ─────────────── */
.browser {
  width: 960px; border-radius: 14px; overflow: hidden; background: #fff;
  box-shadow: 0 40px 90px rgba(9, 36, 71, 0.22), 0 8px 26px rgba(9, 36, 71, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.07);
  position: relative;
}
.browser-bar {
  height: 36px; display: flex; align-items: center; gap: 7px; padding: 0 14px;
  background: #eceef1; border-bottom: 1px solid #dfe2e7;
}
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot.r { background: #ff5f57; } .dot.y { background: #febc2e; } .dot.g { background: #28c840; }
.browser-url {
  margin: 0 auto; font-size: 11.5px; color: #5f6672; background: #fff;
  padding: 4px 30px; border-radius: 7px; border: 1px solid #e3e6ea;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%;
}

/* ─────────────── finale ───────────────
   Transparent — the environment goes dark here and stays dark to the footer. */
.finale {
  color: #fff; text-align: center;
  padding: 18vh 28px 60px; position: relative; overflow: hidden;
}
.finale::before {
  content: ""; position: absolute; top: -30%; left: 50%; transform: translateX(-50%);
  width: 80vw; height: 60vh; border-radius: 50%;
  background: radial-gradient(circle, rgba(23, 114, 232, 0.35) 0%, transparent 70%);
  filter: blur(60px); pointer-events: none;
}
.finale-inner { position: relative; max-width: var(--rail); margin: 0 auto; }
.finale-title {
  font-size: clamp(38px, 6vw, 72px); font-weight: 800; letter-spacing: -0.035em; margin-bottom: 40px;
  background: linear-gradient(180deg, #fff 30%, #a8c6f5 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
/* when the title is line-wrapped, each line paints its own gradient slice
   (same trick as the hero title — clip on the parent ignores span masks) */
.finale-title:has(.tl) { background: none; }
.finale-title .tl-i {
  background: linear-gradient(180deg, #ffffff 30%, #a8c6f5 100%);
  background-size: 100% 200%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.finale-title .tl:nth-child(1) .tl-i { background-position: 0 0; }
.finale-title .tl:nth-child(2) .tl-i { background-position: 0 100%; }
.finale-ctas { margin-top: 40px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn-primary {
  padding: 14px 30px; border-radius: 28px; background: var(--blue); color: #fff;
  font-weight: 600; font-size: 15px; transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 30px rgba(23, 114, 232, 0.4);
}
.btn-primary:hover { background: var(--blue-dark); }
.btn-ghost {
  padding: 14px 30px; border-radius: 28px; border: 1px solid rgba(255, 255, 255, 0.25);
  font-weight: 600; font-size: 15px; transition: border-color 0.2s ease, background 0.2s ease;
}
.btn-ghost:hover { border-color: rgba(255, 255, 255, 0.6); background: rgba(255, 255, 255, 0.06); }

/* cursor-following glow on all pill buttons — JS sets --glow-x/--glow-y on mousemove */
.btn-primary, .btn-ghost, .btn-hero-ghost, .nav-cta { position: relative; overflow: hidden; }
@media (hover: hover) {
  /* the glow layer fills the button exactly (inset 0, radius inherited) and
     positions its light via the gradient's `at` point — nothing is ever
     painted outside the pill, so no clipping can fail (a translated
     oversized circle escaped overflow:hidden under compositing) */
  .btn-primary::after, .btn-ghost::after, .btn-hero-ghost::after, .nav-cta::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit;
    background: radial-gradient(circle 70px at var(--glow-x, 50%) var(--glow-y, 50%),
      rgba(150, 200, 255, 0.55) 0%, rgba(150, 200, 255, 0) 70%);
    pointer-events: none; opacity: 0; transition: opacity 0.32s ease-out;
  }
  /* revealed by JS (.is-glow) only AFTER the position is set, so the glow never
     flashes at the centre/stale spot before the first pointer move */
  .btn-primary.is-glow::after, .btn-ghost.is-glow::after,
  .btn-hero-ghost.is-glow::after, .nav-cta.is-glow::after { opacity: 1; }
}

.recap {
  margin-top: 100px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; text-align: left;
}
.recap-item {
  padding: 18px; border-radius: 14px; background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex; flex-direction: column; gap: 5px;
  transition: background 0.25s ease, border-color 0.25s ease;
}
.recap-item:hover { background: rgba(255, 255, 255, 0.09); border-color: rgba(23, 114, 232, 0.5); }
.recap-item strong { font-size: 14px; letter-spacing: -0.01em; }
.recap-item small { font-size: 12px; color: rgba(255, 255, 255, 0.55); line-height: 1.45; }

/* ─────────────── responsive ─────────────── */
@media (max-width: 960px) {
  .hero-widget { right: 12px; bottom: 12px; }
  .act-grid {
    /* top padding clears the 60px fixed nav so the rail title isn't hidden behind it */
    grid-template-columns: 1fr; gap: 14px; padding: 74px 18px 20px;
    grid-template-rows: auto 1fr; align-items: start;
  }
  .rail { gap: 10px; }
  .rail-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
  .rail-title { font-size: 22px; }
  .rail-title br { display: none; }
  .tiles { display: none; }
  .rail-caption { display: block; min-height: 40px; }
  .rail-caption strong { color: var(--ink); }
  .stage-note { display: none; }
  .recap { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .int-text .w { opacity: 1 !important; }
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
