/* hero3d: pinned WebGL phone hero (prefix h3d-).
   Base rules = the static layout (no JS, no WebGL, reduced motion).
   The pinned "live" layout is scoped to
     .js .h3d:not(.h3d-static, .scene-failed)   inside (prefers-reduced-motion: no-preference)
   so the page never flashes a pinned stage it cannot drive. */

.h3d {
  position: relative;
  --h3d-px: 62%;      /* phone centre, x, in stage coordinates (set by JS in px) */
  --h3d-py: 48%;      /* phone centre, y */
  --h3d-wx: 61%;      /* phone centre, x, in .h3d-wrap coordinates */
  --h3d-lift: 0px;    /* how far the stage still is from its pinned position */
  --h3d-blast: 0;     /* 0..1 while the campaign is sending */
  --h3d-ctop: 104px;  /* phones: where the stepper sits once the head is compact */
  color: var(--ink);
}
.h3d-stick {
  position: relative;
  overflow: clip;
  /* dusk: deep navy sky that warms toward a horizon glowing under the phone */
  background:
    radial-gradient(46% 30% at var(--h3d-px) 86%, rgba(252, 115, 77, .42), transparent 72%),
    radial-gradient(60% 46% at var(--h3d-px) 74%, rgba(201, 120, 196, .34), transparent 74%),
    radial-gradient(80% 60% at 30% 0%, rgba(11, 28, 74, .9), transparent 70%),
    linear-gradient(180deg, #050A1E 0%, #071233 38%, #0D1F5C 62%, #2A2766 78%, #120F33 90%, #050A1E 100%);
}

/* ---------- backdrop ---------- */
.h3d-bg { position: absolute; inset: 0; pointer-events: none; }
.h3d-bg i { position: absolute; display: block; }
.h3d-grid {
  inset: 0;
  /* a few faint stars, fading out toward the horizon */
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255, 255, 255, .8), transparent 1.5px),
    radial-gradient(1px 1px at 63% 9%, rgba(255, 255, 255, .7), transparent 1.5px),
    radial-gradient(1.4px 1.4px at 84% 27%, rgba(255, 255, 255, .75), transparent 2px),
    radial-gradient(1px 1px at 37% 34%, rgba(255, 255, 255, .5), transparent 1.5px),
    radial-gradient(1px 1px at 92% 6%, rgba(255, 255, 255, .6), transparent 1.5px),
    radial-gradient(1.2px 1.2px at 26% 61%, rgba(255, 255, 255, .35), transparent 1.8px),
    radial-gradient(1px 1px at 73% 44%, rgba(255, 255, 255, .45), transparent 1.5px),
    radial-gradient(1px 1px at 5% 42%, rgba(255, 255, 255, .5), transparent 1.5px);
  background-size: 420px 300px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .7) 45%, transparent 75%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .7) 45%, transparent 75%);
  opacity: .8;
}
.h3d-glow {
  left: var(--h3d-px); top: var(--h3d-py);
  width: min(1040px, 150vw); aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(243, 194, 179, .34) 0%, rgba(201, 120, 196, .22) 26%, rgba(54, 173, 224, .12) 50%, rgba(11, 28, 74, 0) 74%);
}
.h3d-flash {
  left: var(--h3d-px); top: var(--h3d-py);
  width: min(1500px, 220vw); aspect-ratio: 1;
  transform: translate(-50%, -50%) scale(calc(.55 + var(--h3d-blast) * .45));
  background: radial-gradient(closest-side, rgba(252, 140, 93, .32) 0%, rgba(201, 120, 196, .22) 30%, rgba(54, 173, 224, .12) 55%, transparent 76%);
  opacity: var(--h3d-blast);
}

/* ---------- headline block ---------- */
.h3d-head { position: relative; z-index: 2; }
.h3d-head .tag { margin-bottom: 16px; }
.h3d-head .h1 { font-size: clamp(2.3rem, min(4.7vw, 8.6vh), 4.1rem); margin-bottom: .38em; }
.h3d-lede { max-width: 46ch; margin-bottom: 1.5em; }
.h3d-lede-go { color: var(--ink); font-weight: 500; white-space: nowrap; }
.h3d-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.h3d-fine { margin: 14px 0 0; font-family: var(--f-mono); font-size: .7rem; letter-spacing: 0; color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
.h3d-fine::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px color-mix(in srgb, var(--mint) 22%, transparent); }

/* ---------- stage list ---------- */
.h3d-stages { list-style: none; margin: 0; padding: 0; position: relative; z-index: 2; }
.h3d-stages li { --f: 0; position: relative; display: grid; grid-template-columns: 26px 1fr; column-gap: 12px; align-items: center; padding: 4px 0; color: var(--ink); opacity: .42; transition: opacity .4s ease; }
.h3d-st-m { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .04); border: 1px solid var(--line-2); color: var(--ink-2); font: 500 .62rem/1 var(--f-mono); font-style: normal; letter-spacing: .02em; transition: background .35s ease, border-color .35s ease, color .35s ease, box-shadow .35s ease, transform .45s var(--e-spring); }
.h3d-st-m svg { display: none; }
.h3d-stages b { font-weight: 600; font-size: .96rem; line-height: 26px; letter-spacing: -.005em; }
.h3d-stages small { display: none; grid-column: 2; font: 400 .68rem/1.5 var(--f-mono); letter-spacing: 0; color: var(--ink-2); max-height: 0; opacity: 0; overflow: hidden; transition: max-height .5s var(--e-out), opacity .35s ease; }
.h3d-stages li:not(:last-child)::after { content: ""; position: absolute; left: 12px; top: 32px; bottom: -2px; width: 2px; border-radius: 2px; background: linear-gradient(var(--brand) calc(var(--f) * 100%), var(--line-2) 0); }
.h3d-stages li.is-done { opacity: .78; --f: 1; }
.h3d-stages li.is-done .h3d-st-m { background: var(--brand-soft); border-color: transparent; color: var(--brand-light); }
.h3d-stages li.is-done .h3d-st-m span { display: none; }
.h3d-stages li.is-done .h3d-st-m svg { display: block; }
.h3d-stages li.is-cur { opacity: 1; }
.h3d-stages li.is-cur .h3d-st-m { background: #fff; border-color: #fff; color: var(--navy); box-shadow: 0 0 0 5px rgba(124, 203, 236, .16); transform: scale(1.08); }
.h3d-stages li.is-cur b { color: #fff; }
.h3d-stages li.is-cur small { max-height: 22px; opacity: 1; }

/* ---------- pieces that only exist while the stage is live ---------- */
.h3d-canvas, .h3d-result, .h3d-hint, .h3d-mini { display: none; }

/* ---------- static layout ---------- */
.h3d-ui { position: relative; }
.h3d-wrap { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 28px 56px; align-items: center; padding-top: clamp(40px, 6vw, 84px); padding-bottom: clamp(48px, 7vw, 96px); }
.h3d-head { grid-column: 1; align-self: end; }
.h3d-stages { grid-column: 1; align-self: start; display: flex; flex-wrap: wrap; gap: 6px 24px; }
.h3d-stages li { grid-template-columns: 26px auto; column-gap: 9px; }
.h3d-stages li:not(:last-child)::after { display: none; }
.h3d-mock { grid-column: 2; grid-row: 1 / span 2; justify-self: center; display: grid; justify-items: center; gap: 16px; }
.h3d-mock-phone { width: min(280px, 72vw); aspect-ratio: 9 / 17.6; border-radius: 46px; padding: 9px; background: linear-gradient(145deg, #55575d, #1d1e21 38%, #0d0d0f 62%, #45474c); box-shadow: 0 2px 0 rgba(255, 255, 255, .5) inset, 0 40px 80px -24px rgba(201, 120, 196, .45), 0 18px 36px -18px rgba(0, 0, 0, .6); transform: rotate(-3deg); }
.h3d-mock-screen { height: 100%; border-radius: 38px; background: #f3f6fb; padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.h3d-mock-screen p { margin: 0; }
.h3d-mock-bar { display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: .78rem; color: var(--ink); }
.h3d-mock-bar i { width: 74px; height: 22px; border-radius: 12px; background: #05070b; }
.h3d-mock-batt { width: 24px; height: 11px; border-radius: 3.5px; border: 1.5px solid var(--ink); position: relative; }
.h3d-mock-batt::after { content: ""; position: absolute; inset: 1.5px 5px 1.5px 1.5px; background: var(--ink); border-radius: 1px; }
.h3d-mock-title { font-weight: 600; font-size: 1.02rem; color: var(--ink); margin-top: 4px; }
.h3d-mock-bubble { align-self: flex-end; max-width: 88%; background: var(--brand); color: #fff; font-size: .74rem; line-height: 1.4; padding: 9px 12px; border-radius: 16px 16px 4px 16px; }
.h3d-mock-meta { align-self: flex-end; font: 400 .58rem/1 var(--f-mono); letter-spacing: 0; color: var(--ink-3); }
.h3d-mock-stat { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; display: grid; gap: 2px; }
.h3d-mock-stat span { font: 500 .58rem/1.4 var(--f-mono); letter-spacing: 0; color: var(--ink-3); }
.h3d-mock-stat b { font-size: 1.9rem; line-height: 1.1; letter-spacing: -.02em; color: var(--brand); }
.h3d-mock-bars { display: flex; align-items: flex-end; gap: 5px; height: 54px; margin-top: 6px; }
.h3d-mock-bars i { flex: 1; height: calc(var(--h) * 100%); border-radius: 4px 4px 2px 2px; background: linear-gradient(var(--brand-light), var(--brand)); }
.h3d-mock-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.h3d-mock-reply { align-self: flex-start; max-width: 80%; background: #fff; border: 1px solid var(--line); color: var(--ink); font-size: .74rem; line-height: 1.4; padding: 8px 12px; border-radius: 16px 16px 16px 4px; }
.h3d-mock-tiles div { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 9px 12px; display: grid; }
.h3d-mock-tiles b { font-size: 1rem; color: var(--ink); }
.h3d-mock-tiles span { font: 400 .56rem/1.4 var(--f-mono); letter-spacing: 0; color: var(--ink-3); }
.h3d-mock-chip { margin-top: auto !important; align-self: center; }
@media (max-width: 900px) {
  .h3d-wrap { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .h3d-head, .h3d-stages, .h3d-mock { grid-column: 1; grid-row: auto; }
  .h3d-head .h1 { font-size: clamp(2rem, 9vw, 2.9rem); }
  .h3d-cta .btn { flex: 1 1 0; padding-inline: 16px; }
}

/* ======================================================================
   LIVE: pinned stage, WebGL phone, scroll-driven UI
   ====================================================================== */
@media (prefers-reduced-motion: no-preference) {
  .js .h3d:not(.h3d-static, .scene-failed) { height: 560vh; }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-stick { position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); height: calc(100svh - var(--header-h)); }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-canvas { display: block; position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1.1s ease; }
  .js .h3d.h3d-ready:not(.h3d-static, .scene-failed) .h3d-canvas { opacity: 1; }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-ui { position: absolute; inset: 0; }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-wrap { display: block; position: relative; height: 100%; padding-top: 0; padding-bottom: 0; }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-mock { display: none; }

  /* headline: top-left, readable for the whole pin */
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-head { position: absolute; left: var(--gutter); top: clamp(20px, 6vh, 58px); width: min(500px, calc(100% - 2 * var(--gutter))); }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-head::before { content: ""; position: absolute; z-index: -1; inset: -36px -70px -44px -90px; background: radial-gradient(closest-side, rgba(5, 10, 30, .55), rgba(5, 10, 30, .3) 60%, rgba(5, 10, 30, 0)); pointer-events: none; }

  /* the head rises in on load (fill backwards only, so later transforms still apply) */
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-head > * { animation: h3d-rise .95s var(--e-out) backwards; }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-head > :nth-child(2) { animation-delay: .08s; }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-head > :nth-child(3) { animation-delay: .18s; }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-head > :nth-child(4) { animation-delay: .28s; }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-head > :nth-child(5) { animation-delay: .38s; }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-head .grad { background-image: linear-gradient(92deg, #fff 0%, var(--peach) 30%, var(--sun-2) 50%, var(--peach) 70%, #fff 100%); background-size: 220% 100%; animation: h3d-shimmer 9s linear infinite; }

  /* stage list: bottom-left, a compact timeline; only the live stage shows its sub-label */
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-stages { position: absolute; left: var(--gutter); bottom: calc(30px + var(--h3d-lift)); width: 310px; display: block; }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-stages li { grid-template-columns: 26px 1fr; column-gap: 12px; }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-stages li:not(:last-child)::after { display: block; }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-stages small { display: block; }
  /* short viewports: the list lies down, then steps aside */
  .js .h3d.h3d-tight1:not(.h3d-static, .scene-failed) .h3d-stages { display: flex; width: auto; gap: 26px; }
  .js .h3d.h3d-tight1:not(.h3d-static, .scene-failed) .h3d-stages li { grid-template-columns: 26px auto; column-gap: 8px; }
  .js .h3d.h3d-tight1:not(.h3d-static, .scene-failed) .h3d-stages li small { display: none; }
  .js .h3d.h3d-tight1:not(.h3d-static, .scene-failed) .h3d-stages li:not(:last-child)::after { left: calc(100% + 7px); right: auto; top: 16px; bottom: auto; width: 12px; height: 2px; opacity: .7; background: linear-gradient(90deg, var(--brand) calc(var(--f) * 100%), var(--line-2) 0); }
  .js .h3d.h3d-tight2:not(.h3d-static, .scene-failed) .h3d-stages { display: none; }

  /* result card: a text from SMSBlast, bottom-right */
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-result {
    display: grid; gap: 8px; position: absolute; z-index: 3; right: var(--gutter); bottom: calc(30px + var(--h3d-lift)); width: 296px;
    opacity: 0; transform: translateY(14px) scale(.98); transform-origin: 0 100%; transition: opacity .45s ease, transform .6s var(--e-out);
  }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-result.is-on { opacity: 1; transform: none; }
  .h3d-result p { margin: 0; }
  .h3d-r-head { display: flex; align-items: center; gap: 9px; padding: 0 4px; }
  .h3d-r-ava { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--navy); background: linear-gradient(150deg, #fff 30%, var(--sky)); box-shadow: 0 4px 14px rgba(124, 203, 236, .35), inset 0 0 0 1px rgba(255, 255, 255, .5); }
  .h3d-r-who { display: grid; line-height: 1.15; min-width: 0; }
  .h3d-r-who b { font-size: .86rem; font-weight: 600; color: var(--ink); }
  .h3d-r-who small { font-size: .72rem; color: var(--ink-3); }
  .h3d-r-time { margin-left: auto; font-size: .72rem; color: var(--ink-3); }
  .h3d-r-bubble {
    position: relative; display: grid; gap: 4px; padding: 13px 16px 14px; border-radius: 22px 22px 22px 6px;
    background: rgba(9, 18, 48, .72); -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
    border: 1px solid var(--line-2); box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .7), 0 1px 0 rgba(255, 255, 255, .06) inset;
  }
  .h3d-result.is-new .h3d-r-bubble { animation: h3d-msg .55s var(--e-spring); }
  .h3d-r-k { font-weight: 600; font-size: .95rem; line-height: 1.25; color: var(--ink-2); }
  .h3d-r-v { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 7px; line-height: 1.05; }
  .h3d-r-num { font-weight: 700; font-size: 2rem; letter-spacing: -.03em; color: var(--ink); font-variant-numeric: tabular-nums; display: inline-block; transform-origin: 0 80%; }
  .h3d-r-num.is-pop { animation: h3d-pop .45s var(--e-out); }
  .h3d-r-unit { font-size: .9rem; font-weight: 500; color: var(--ink-3); }
  .h3d-r-c { display: block; width: 100%; height: 50px; margin: 6px 0 2px; }
  .h3d-r-n { font-size: .8rem; line-height: 1.45; color: var(--ink-2); }
  .h3d-r-foot { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 18px; padding: 0 6px; font-size: .72rem; color: var(--ink-3); }
  .h3d-r-ok { position: absolute; left: 6px; top: 50%; translate: 0 -50%; font-weight: 600; color: var(--mint); opacity: 0; transform: translateY(4px); transition: opacity .3s ease, transform .4s var(--e-spring); }
  .h3d-r-ok::after { content: " ✓✓"; letter-spacing: -.12em; }
  .h3d-result.is-locked .h3d-r-ok { opacity: 1; transform: none; }
  .h3d-r-demo { margin-left: auto; }


  /* scroll hint sits under the phone */
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-hint { display: flex; flex-direction: column; align-items: center; gap: 7px; position: absolute; z-index: 2; margin: 0; left: var(--h3d-wx); bottom: calc(12px + var(--h3d-lift)); transform: translateX(-50%); font: 500 .62rem/1 var(--f-mono); letter-spacing: 0; color: var(--ink-2); transition: opacity .45s ease; }
  .h3d-hint i { display: block; width: 1.5px; height: 26px; border-radius: 2px; background: linear-gradient(var(--brand), transparent); transform-origin: 50% 0; animation: h3d-hint 1.8s var(--e-out) infinite; }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-hint.is-off { opacity: 0; }

  /* bottom-anchored UI waits for the scene, then rises in */
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-stages,
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-hint { opacity: 0; }
  .js .h3d.h3d-ready:not(.h3d-static, .scene-failed) .h3d-stages { opacity: 1; transition: opacity .9s ease .25s; }
  .js .h3d.h3d-ready:not(.h3d-static, .scene-failed) .h3d-hint:not(.is-off) { opacity: 1; }

  @keyframes h3d-rise { from { opacity: 0; transform: translateY(24px); filter: blur(6px); } }
  @keyframes h3d-shimmer { to { background-position: -220% 0; } }
  @keyframes h3d-msg { from { opacity: .3; transform: translateY(10px) scale(.94); } }
  @keyframes h3d-pop { 35% { transform: scale(1.09); } }
  @keyframes h3d-hint { 0% { transform: scaleY(0); opacity: 1; } 60% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }
}

/* short desktop windows: tighten the head so the stage list keeps its place */
@media (prefers-reduced-motion: no-preference) and (max-height: 740px) and (min-width: 901px) {
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-head .tag { margin-bottom: 10px; }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-lede { font-size: 1rem; margin-bottom: 1.2em; }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-cta .btn { padding: 13px 24px; font-size: 1rem; }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-fine { margin-top: 10px; }
}

/* narrower desktops: give the phone the middle */
@media (prefers-reduced-motion: no-preference) and (max-width: 1180px) and (min-width: 901px) {
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-head { width: min(430px, 44vw); }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-result { width: 268px; }
  .js .h3d.h3d-tight1:not(.h3d-static, .scene-failed) .h3d-stages { gap: 22px; }
  .js .h3d.h3d-tight1:not(.h3d-static, .scene-failed) .h3d-stages li:not(.is-cur) b { display: none; }
  .js .h3d.h3d-tight1:not(.h3d-static, .scene-failed) .h3d-stages li:not(.is-cur) { grid-template-columns: 26px; }
}

/* ---------- LIVE on phones and small tablets: centred phone, compacting head, stepper, result strip ---------- */
@media (prefers-reduced-motion: no-preference) and (max-width: 900px) {
  .js .h3d:not(.h3d-static, .scene-failed) { height: 460vh; }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-head { top: 18px; right: var(--gutter); width: auto; }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-head::before { display: none; }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-head .tag { font-size: .62rem; margin-bottom: 10px; }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-head .h1 { font-size: clamp(1.9rem, 8.8vw, 2.9rem); max-width: 11.5em; margin-bottom: .34em; transform-origin: 0 0; transition: transform .6s var(--e-out); }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-lede { font-size: .97rem; line-height: 1.5; max-width: 36ch; margin-bottom: 1.05em; }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-cta { gap: 10px; flex-wrap: nowrap; max-width: 420px; }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-cta .btn { flex: 1 1 0; padding: 13px 14px; font-size: .98rem; }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-fine { margin-top: 11px; font-size: .64rem; }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-lede,
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-cta,
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-fine { transition: opacity .4s ease, transform .55s var(--e-out), visibility 0s; }
  /* after the intro the head folds down to a title so the phone and the result strip have room */
  .js .h3d.h3d-compact:not(.h3d-static, .scene-failed) .h3d-head .h1 { transform: scale(.6); }
  .js .h3d.h3d-compact:not(.h3d-static, .scene-failed) .h3d-lede,
  .js .h3d.h3d-compact:not(.h3d-static, .scene-failed) .h3d-cta,
  .js .h3d.h3d-compact:not(.h3d-static, .scene-failed) .h3d-fine { opacity: 0; transform: translateY(-14px); visibility: hidden; pointer-events: none; transition: opacity .3s ease, transform .5s var(--e-out), visibility 0s .3s; }

  /* once compact, a soft fog under the title keeps dots and bubbles from crowding it */
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-ui::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: calc(var(--h3d-ctop) + 78px); background: linear-gradient(180deg, rgba(5, 10, 30, .96) 0%, rgba(6, 12, 36, .9) 60%, rgba(7, 18, 51, 0) 100%); opacity: 0; transition: opacity .45s ease; pointer-events: none; }
  .js .h3d.h3d-compact:not(.h3d-static, .scene-failed) .h3d-ui::before { opacity: 1; }

  /* a small CTA keeps the sign-up one tap away once the big buttons have folded */
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-mini { display: inline-flex; position: absolute; z-index: 3; right: var(--gutter); top: 48px; padding: 9px 14px; font-size: .82rem; opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.94); transition: opacity .3s ease, transform .5s var(--e-out), visibility 0s .3s; }
  .js .h3d.h3d-compact:not(.h3d-static, .scene-failed) .h3d-mini { opacity: 1; visibility: visible; transform: none; transition: opacity .4s ease .15s, transform .55s var(--e-spring) .15s, visibility 0s; }

  /* stage list becomes a five-part stepper under the title */
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-stages,
  .js .h3d.h3d-tight1:not(.h3d-static, .scene-failed) .h3d-stages,
  .js .h3d.h3d-tight2:not(.h3d-static, .scene-failed) .h3d-stages { display: flex; gap: 6px; left: var(--gutter); right: var(--gutter); top: var(--h3d-ctop); bottom: auto; width: auto; }
  .js .h3d.h3d-ready:not(.h3d-static, .scene-failed) .h3d-stages { opacity: 0; transform: translateY(8px); transition: opacity .35s ease, transform .5s var(--e-out); }
  .js .h3d.h3d-ready.h3d-compact:not(.h3d-static, .scene-failed) .h3d-stages { opacity: 1; transform: none; transition-delay: .12s; }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-stages li { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 5px; padding: 9px 0 0; opacity: 1; white-space: nowrap; transition: flex-grow .55s var(--e-out); }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-stages li.is-cur { flex-grow: 2.7; }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-stages li::after,
  .js .h3d.h3d-tight1:not(.h3d-static, .scene-failed) .h3d-stages li::after { content: ""; display: block; position: absolute; left: 0; right: 0; top: 0; bottom: auto; width: auto; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--brand) calc(var(--f) * 100%), var(--line-2) 0); }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-stages .h3d-st-m { width: auto; height: auto; border: 0; background: none; box-shadow: none; transform: none; font-size: .62rem; color: var(--ink-3); }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-stages li.is-done .h3d-st-m,
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-stages li.is-cur .h3d-st-m { background: none; color: var(--brand-light); box-shadow: none; transform: none; }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-stages b { display: none; font: 600 .7rem/1 var(--f-sans); }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-stages li.is-cur b { display: block; }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-stages small { display: none; }

  /* result card becomes a slim message along the bottom */
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-result { left: var(--gutter); right: var(--gutter); width: auto; bottom: calc(10px + var(--h3d-lift)); gap: 6px; }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-r-head { display: none; }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-r-bubble { grid-template-columns: minmax(0, 1fr) 44%; column-gap: 12px; row-gap: 2px; align-items: center; padding: 11px 14px 12px; border-radius: 20px 20px 20px 6px; }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-r-k { grid-column: 1; font-size: .82rem; }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-r-v { grid-column: 1; }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-r-num { font-size: 1.5rem; }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-r-unit { font-size: .74rem; }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-r-c { grid-column: 2; grid-row: 1 / span 2; height: 44px; margin: 0; }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-r-n { display: none; }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-r-foot { font-size: .66rem; min-height: 16px; }

  .js .h3d:not(.h3d-static, .scene-failed) .h3d-hint { left: 50%; bottom: calc(8px + var(--h3d-lift)); gap: 5px; font-size: .56rem; }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-hint i { height: 16px; }
}
@media (prefers-reduced-motion: no-preference) and (max-width: 380px) {
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-head .h1 { font-size: 1.86rem; }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-lede { font-size: .92rem; }
  .js .h3d:not(.h3d-static, .scene-failed) .h3d-cta .btn { padding: 12px 10px; font-size: .94rem; }
}
