/* ═══════════════════════════════════════════════════════════════
   DDS v2 — design layer (additive; loads after style.css)
   Narrative clarity + Modern Dark Cinema polish + perf containment.
   Rollback: remove the v2.css/v2.js tags from index.html (or git
   checkout main).
═══════════════════════════════════════════════════════════════ */

:root {
  --v2-ease: cubic-bezier(0.16, 1, 0.3, 1);        /* expo-out */
  --v2-primary: #6366F1;
  --v2-primary-glow: rgba(99, 102, 241, 0.35);
  --v2-dur-fast: 180ms;
  --v2-dur: 300ms;
}

/* ── PERF: skip layout/paint of heavy below-fold sections until near view ── */
#catalog, .footer {
  content-visibility: auto;
  contain-intrinsic-size: auto 1200px;
}

/* ── PERF/UX: kill the 300ms tap delay; predictable touch ── */
a, button, .btn-primary, .btn-secondary { touch-action: manipulation; }

/* ── A11y: visible focus without breaking brand ── */
:focus-visible {
  outline: 2px solid var(--v2-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ═══ NARRATIVE: kinetic explainer line ═══ */
.hero-explain { line-height: 1.75; }
.hero-explain .hx-tail b { font-weight: 700; }

/* inline-grid stack: words share one cell; v2.js sets the container's
   width to the CURRENT word and animates it, so the rest of the sentence
   slides left/right to hug each word — no dead space after short words */
.hx-rot {
  display: inline-grid;
  justify-items: start;          /* words sit at natural width (measurable) */
  vertical-align: bottom;
  text-align: left;
  transition: width 320ms var(--v2-ease);   /* leads the 420ms word fade */
}
.hx-rot .hx-w {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(0.55em);
  transition: opacity 420ms var(--v2-ease), transform 420ms var(--v2-ease);
  will-change: transform, opacity;
  white-space: nowrap;
  pointer-events: none;
}
.hx-rot .hx-w.hx-on {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.hx-rot .hx-w.hx-out {
  opacity: 0;
  transform: translateY(-0.55em);
}

/* ═══ NARRATIVE: step/instruction cards — uupm.cc card language ═══
   Dark glass card on cream (echoes the hero's dark code card): subtle
   border, accent icon + big number, bold title, muted body, glow wash. */
.v2-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-width: 860px;
  margin: 28px auto 0;
  text-align: left;
}
.v2-step {
  position: relative;
  overflow: hidden;
  background: #101017;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  padding: 20px 20px 18px;
  transition: transform 200ms var(--v2-ease),
              border-color 250ms var(--v2-ease),
              box-shadow 250ms var(--v2-ease);
}
/* stars + space theme inside the dark tiles: nebula glow + two star layers */
.v2-step::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    /* star field — bright pinpoints */
    radial-gradient(1.2px 1.2px at 12% 22%, rgba(255,255,255,0.95), transparent 100%),
    radial-gradient(1px 1px     at 78% 14%, rgba(255,255,255,0.8),  transparent 100%),
    radial-gradient(1.4px 1.4px at 88% 64%, rgba(255,255,255,0.7),  transparent 100%),
    radial-gradient(1px 1px     at 34% 78%, rgba(255,255,255,0.65), transparent 100%),
    radial-gradient(1px 1px     at 58% 38%, rgba(255,255,255,0.55), transparent 100%),
    radial-gradient(1.3px 1.3px at 22% 56%, rgba(255,255,255,0.5),  transparent 100%),
    radial-gradient(1px 1px     at 68% 86%, rgba(255,255,255,0.45), transparent 100%),
    radial-gradient(1px 1px     at 44% 10%, rgba(255,255,255,0.6),  transparent 100%),
    /* faint dust */
    radial-gradient(0.8px 0.8px at 8% 84%,  rgba(255,255,255,0.3),  transparent 100%),
    radial-gradient(0.8px 0.8px at 92% 34%, rgba(255,255,255,0.3),  transparent 100%),
    radial-gradient(0.8px 0.8px at 52% 62%, rgba(255,255,255,0.25), transparent 100%),
    /* one warm marigold star */
    radial-gradient(1.5px 1.5px at 82% 42%, rgba(245,197,24,0.7),   transparent 100%),
    /* nebula wash */
    radial-gradient(120% 90% at 18% 0%,  rgba(99, 102, 241, 0.22), transparent 55%),
    radial-gradient(90% 70%  at 85% 100%, rgba(83, 74, 183, 0.14), transparent 60%);
  pointer-events: none;
}
.v2-step:hover {
  transform: translateY(-3px);
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 16px 36px -16px rgba(15, 15, 15, 0.5);
}
.v2-step-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.v2-step-top svg { color: #8B8FF7; flex: 0 0 auto; }
.v2-step-num {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 22px;
  font-weight: 700;
  color: var(--v2-primary);
  line-height: 1;
}
.v2-step h3 {
  font-family: 'General Sans', 'JetBrains Mono', sans-serif;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #FFFCF5;
  margin: 0 0 6px;
}
.v2-step p {
  font-family: 'General Sans', 'JetBrains Mono', sans-serif;
  font-size: 11.5px;
  line-height: 1.65;
  color: rgba(245, 241, 232, 0.55);
  margin: 0;
}
.v2-step .v2-step-tag {
  display: inline-block;
  margin-top: 10px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 8.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(139, 143, 247, 0.9);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.28);
  border-radius: 999px;
  padding: 3px 9px;
}
@media (max-width: 680px) {
  .v2-steps { grid-template-columns: 1fr; gap: 10px; max-width: 420px; }
  .v2-step { padding: 16px 18px 15px; }
}

/* ═══ Two-tone gradient keyword for headlines (uupm-style accent) ═══
   Motion graphic: starts SOLID purple, then the marigold gradient sweeps
   in from the right when the heading scrolls into view (.v2-in). */
.v2-grad {
  background: linear-gradient(92deg,
    var(--v2-primary) 0%, var(--v2-primary) 67%, #F5C518 94%, #F5C518 100%);
  background-size: 300% 100%;
  background-position: 100% 0;   /* resting/final: gradient visible */
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.v2-reveal.v2-in .v2-grad,
.v2-in .v2-grad {
  animation: v2GradSweep 1.5s var(--v2-ease) 0.35s both;
}
@keyframes v2GradSweep {
  from { background-position: 0% 0; }     /* window over solid purple */
  to   { background-position: 100% 0; }   /* sweeps to purple→marigold */
}

/* ═══ POLISH: tactile press on every button-like control ═══ */
.btn-primary, .btn-secondary, button, .hs-step {
  -webkit-tap-highlight-color: transparent;
}
.btn-primary:active, .btn-secondary:active, .hero-steps .hs-step:active {
  transform: scale(0.97);
  transition-duration: 80ms;
}
.btn-primary, .btn-secondary {
  transition: transform var(--v2-dur-fast) var(--v2-ease),
              box-shadow var(--v2-dur) var(--v2-ease),
              background var(--v2-dur) var(--v2-ease);
}
.btn-primary:hover { box-shadow: 0 8px 28px var(--v2-primary-glow); }

/* ═══ POLISH: scroll-reveal (v2.js adds .v2-reveal, then .v2-in) ═══ */
.v2-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 600ms var(--v2-ease), transform 600ms var(--v2-ease);
}
.v2-reveal.v2-in { opacity: 1; transform: none; }

/* ═══ DEMO OVERLAY: cinematic entrance (was: instant display snap) ═══
   fitDemoCard() owns .demo-frame-wrap's transform, so we animate the
   overlay backdrop and the iframe itself — zero conflicts. */
#demoOverlay.open {
  animation: v2-overlay-in 280ms var(--v2-ease) both;
}
#demoOverlay.open iframe {
  animation: v2-card-in 380ms var(--v2-ease) both;
}
@keyframes v2-overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes v2-card-in {
  from { opacity: 0; transform: scale(0.955) translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ═══ CARD POLISH: $1 badge glow on cinema hover (no transform — the
   Netflix scale/push system owns card transforms) ═══ */
.ncard .ncard-price { transition: box-shadow 250ms var(--v2-ease); }
.ncard:hover .ncard-price {
  box-shadow: 0 0 0 3px rgba(255,255,255,0.35), 0 4px 18px rgba(0,200,117,0.55);
}

/* ═══ NARRATIVE: cinema hover hint — appears after the mini-movie starts ═══ */
.v2-cinema-hint {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 8.5px;
  letter-spacing: 0.06em;
  color: #fff;
  background: rgba(15, 15, 15, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  pointer-events: none;
  z-index: 5;
  animation: v2HintIn 350ms var(--v2-ease) 1.1s both;
}
@keyframes v2HintIn {
  from { opacity: 0; transform: translateX(-50%) translateY(6px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ═══ PRODUCT CARDS: chrome upgrade (uupm elevation language) ═══
   NON-TRANSFORM properties only — the cinema system owns .ncard
   transforms (scale 1.36 + neighbor push). Selectors are scoped to
   the track containers to out-rank the later inline v4 style block. */
.nrow-track .ncard, .spotlight-ntrack .ncard {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06),
              0 0 0 1px rgba(15, 15, 15, 0.05);
}
.nrow-track .ncard:hover, .spotlight-ntrack .ncard:hover {
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22),
              0 0 0 1.5px rgba(99, 102, 241, 0.4),
              0 0 32px rgba(99, 102, 241, 0.18);
}
/* tiny always-on "this card plays" affordance — bottom-left of the thumb
   ($1 badge owns bottom-right); hides when the cinema takes over */
.nrow-track .ncard .ncard-thumb::after,
.spotlight-ntrack .ncard .ncard-thumb::after {
  content: '▶';
  position: absolute;
  bottom: 10px;
  left: 10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(15, 15, 21, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  font-size: 7px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 1.5px;
  z-index: 2;
  opacity: 0.75;
  backdrop-filter: blur(3px);
  transition: opacity 200ms var(--v2-ease);
  pointer-events: none;
}
.nrow-track .ncard:hover .ncard-thumb::after,
.spotlight-ntrack .ncard:hover .ncard-thumb::after { opacity: 0; }

/* ═══ ROW CHROME: dark-glass arrows + always-reachable "See all" ═══ */
.nrow-slider-wrap .nrow-arrow {
  background: rgba(16, 16, 23, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #FFFCF5;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.28);
  transition: border-color 200ms var(--v2-ease), box-shadow 200ms var(--v2-ease);
}
.nrow-slider-wrap .nrow-arrow:hover {
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 4px 24px rgba(99, 102, 241, 0.3);
}
.nrow .nrow-see-all {
  border: 1px solid rgba(15, 15, 15, 0.14);
  border-radius: 999px;
  padding: 5px 13px 6px;
  transition: opacity 200ms, border-color 200ms, background 200ms;
}
.nrow .nrow-see-all:hover {
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(99, 102, 241, 0.07);
}
/* touch devices never hover — keep row actions reachable */
@media (hover: none) {
  .nrow .nrow-see-all { opacity: 1; }
}

/* ═══ DEMO OVERLAY: deeper cinematic backdrop + glass close button ═══ */
#demoOverlay.open {
  background: rgba(6, 6, 12, 0.74);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
}
#demoOverlay.open .demo-close {
  background: rgba(16, 16, 23, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #FFFCF5;
  transition: border-color 180ms var(--v2-ease), transform 180ms var(--v2-ease);
}
#demoOverlay.open .demo-close:hover {
  border-color: rgba(99, 102, 241, 0.7);
  transform: scale(1.08);
}

/* ═══ DEMO ENGINE: main spotlight showcase — bigger, more prominent ═══ */
.demo-engine { position: relative; }
/* ambient stage glow behind the demo so it reads as THE centerpiece */
.demo-engine::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  width: min(1200px, 92vw);
  height: 78%;
  background:
    radial-gradient(55% 55% at 50% 50%, rgba(99, 102, 241, 0.12), transparent 70%),
    radial-gradient(40% 45% at 68% 42%, rgba(245, 197, 24, 0.07), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.demo-engine .section-head, .demo-engine-frame { position: relative; z-index: 1; }
/* taller stage at every size */
.demo-engine-frame { height: 560px !important; }
@media (min-width: 940px)  { .demo-engine-frame { height: 660px !important; } }
@media (max-width: 680px)  { .demo-engine-frame { height: 540px !important; } }
/* wide screens: scale the whole card up — the site's main showcase.
   transform doesn't take layout space, so the margin absorbs the growth */
@media (min-width: 1280px) {
  .demo-engine-frame {
    transform: scale(1.15);
    transform-origin: top center;
    margin-bottom: 120px;
  }
}

/* ═══ AMBIENT CARD DEMOS: the product uses itself while you just look ═══
   CSS-only loops keyed to the product's identity (spk kind). Scoped to
   `.ncard-thumb > .spk` so the cinema-hover clone (inside .cinema-overlay,
   which has its own dv4 choreography) is untouched. Desynced per card via
   --spkd (set from the product id). All killed under reduced motion. */
@media (prefers-reduced-motion: no-preference) {

  /* shared: give the preview body a positioning context for sweeps */
  .ncard-thumb > .spk .spk-body { position: relative; overflow: hidden; }

  /* SHEETS — a data-scan band drifts down the table, then the numeric
     cells flash their green "totalled" state */
  .ncard-thumb > .spk-sheets .spk-body::after {
    content: ''; position: absolute; left: 0; right: 0; height: 26%; top: 0;
    background: linear-gradient(180deg, transparent, rgba(61,170,110,0.12), transparent);
    animation: v2SpkScan 4.4s ease-in-out var(--spkd, 0s) infinite;
    will-change: transform;
  }
  .ncard-thumb > .spk-sheets .spk-grid .c.n {
    animation: v2SpkCell 4.4s var(--spkd, 0s) infinite;
  }

  /* DOCS — numbered sections light up one after another, like a reader
     working down the page */
  .ncard-thumb > .spk-docs .spk-doc .sec { animation: v2SpkSec 5.2s var(--spkd, 0s) infinite; }
  .ncard-thumb > .spk-docs .spk-doc .sec:nth-child(2) { animation-delay: calc(var(--spkd, 0s) + 0.65s); }
  .ncard-thumb > .spk-docs .spk-doc .sec:nth-child(3) { animation-delay: calc(var(--spkd, 0s) + 1.3s); }
  .ncard-thumb > .spk-docs .spk-doc .sec:nth-child(4) { animation-delay: calc(var(--spkd, 0s) + 1.95s); }
  .ncard-thumb > .spk-docs .spk-pages .pg { animation: v2SpkPage 4.6s ease-in-out var(--spkd, 0s) infinite; }
  .ncard-thumb > .spk-docs .spk-pages .pg:nth-child(2) { animation-delay: calc(var(--spkd, 0s) + 0.8s); }
  .ncard-thumb > .spk-docs .spk-pages .pg:nth-child(3) { animation-delay: calc(var(--spkd, 0s) + 1.6s); }

  /* CODE — the script "runs": lines brighten in execution order and a
     cursor blinks on the last line */
  .ncard-thumb > .spk-ag .spk-code .cl { animation: v2SpkLine 4.8s var(--spkd, 0s) infinite; }
  .ncard-thumb > .spk-ag .spk-code .cl:nth-child(2) { animation-delay: calc(var(--spkd, 0s) + 0.5s); }
  .ncard-thumb > .spk-ag .spk-code .cl:nth-child(3) { animation-delay: calc(var(--spkd, 0s) + 1.0s); }
  .ncard-thumb > .spk-ag .spk-code .cl:nth-child(4) { animation-delay: calc(var(--spkd, 0s) + 1.5s); }
  .ncard-thumb > .spk-ag .spk-code .cl:last-child .ct::after {
    content: '▍'; margin-left: 2px; color: #4AFF7A; opacity: 0.9;
    animation: v2SpkBlink 1.05s steps(1) infinite;
  }

  /* NOTION — unchecked to-dos ghost-tick in turn: the template filling
     itself in; pages without to-dos still breathe (emoji bob + tag pulse) */
  .ncard-thumb > .spk-notion .nb .cb:not(.done) { animation: v2SpkTick 5.4s var(--spkd, 0s) infinite; }
  .ncard-thumb > .spk-notion .nb:nth-child(odd) .cb:not(.done) { animation-delay: calc(var(--spkd, 0s) + 1.1s); }
  .ncard-thumb > .spk-notion .spk-ntn .em { display: inline-block; animation: v2SpkPage 4.8s ease-in-out var(--spkd, 0s) infinite; }
  .ncard-thumb > .spk-notion .pr .tag { animation: v2SpkMerge 3.6s ease-in-out calc(var(--spkd, 0s) + 0.6s) infinite; }

  /* GMAIL — the {{merge_field}} pills pulse: "this part personalises" */
  .ncard-thumb > .spk-gmail .spk-ph { animation: v2SpkMerge 3.2s ease-in-out var(--spkd, 0s) infinite; }
}
/* ── PAYOFF CHIPS: the end of every ambient loop says what just happened,
   in words a 10-year-old reads instantly. The chip pops after the kind's
   action beats (scan/typing/ticking) — cause, effect, "✓ done". ── */
.ncard-thumb > .spk .spk-body::before {
  content: none;
  position: absolute; left: 50%; bottom: 7px;
  transform: translateX(-50%);
  font-family: 'General Sans', -apple-system, sans-serif;
  font-size: 9.5px; font-weight: 600; letter-spacing: 0.01em;
  color: #fff; background: rgba(15, 15, 21, 0.82);
  border-radius: 999px; padding: 4px 11px;
  opacity: 0; z-index: 4; pointer-events: none; white-space: nowrap;
  box-shadow: 0 3px 12px rgba(15, 15, 15, 0.3);
  transition: opacity 300ms ease;
  max-width: 94%; overflow: hidden; text-overflow: ellipsis;
}
@media (prefers-reduced-motion: no-preference) {
  /* 3-beat story captions: what YOU do → what IT does → done + it's $1.
     Written for a non-technical 10-year-old AND 70-year-old: no jargon,
     numbered beats, slow enough to read (each line ~2.2s on screen). */
  .ncard-thumb > .spk-sheets .spk-body::before { content: '1. you type your numbers'; animation: v2StorySheets 12s var(--spkd, 0s) infinite; }
  .ncard-thumb > .spk-ag     .spk-body::before { content: '1. you open it';           animation: v2StoryCode   12s var(--spkd, 0s) infinite; }
  .ncard-thumb > .spk-docs   .spk-body::before { content: '1. you print it out';      animation: v2StoryDocs   12s var(--spkd, 0s) infinite; }
  .ncard-thumb > .spk-notion .spk-body::before { content: '1. you paste it in';       animation: v2StoryNotion 12s var(--spkd, 0s) infinite; }
  .ncard-thumb > .spk-gmail  .spk-body::before { content: '1. you pick a message';    animation: v2StoryGmail  12s var(--spkd, 0s) infinite; }
  /* notion ticks get a visible ✓ during their fill moment (clearer story) */
  .ncard-thumb > .spk-notion .nb .cb:not(.done)::after {
    content: '✓'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-size: 8px; line-height: 1; color: #fff; opacity: 0;
    animation: v2SpkTickMark 5.4s var(--spkd, 0s) infinite;
  }
  .ncard-thumb > .spk-notion .nb:nth-child(odd) .cb:not(.done)::after { animation-delay: calc(var(--spkd, 0s) + 1.1s); }
}
/* reduced motion: no loops — but the story's PAYOFF stays, shown statically */
@media (prefers-reduced-motion: reduce) {
  .ncard-thumb > .spk .spk-body::before { background: rgba(44, 133, 84, 0.94); }
  .ncard-thumb > .spk-sheets .spk-body::before { content: '✓ does the math — just $1';    opacity: 1; }
  .ncard-thumb > .spk-ag     .spk-body::before { content: '✓ does the work — just $1';    opacity: 1; }
  .ncard-thumb > .spk-docs   .spk-body::before { content: '✓ easy steps — just $1';       opacity: 1; }
  .ncard-thumb > .spk-notion .spk-body::before { content: '✓ keeps you organized — $1';   opacity: 1; }
  .ncard-thumb > .spk-gmail  .spk-body::before { content: '✓ ready to send — just $1';    opacity: 1; }
}
/* the 3-beat rhythm all story captions share: in → read → out, ×3.
   Beat 3 turns green and lands the price. `content` swaps discretely
   at keyframes; opacity fades carry the transitions. */
@keyframes v2StorySheets {
  0%        { opacity: 0; }
  4%, 28%   { content: '1. you type your numbers';      opacity: 1; background: rgba(15,15,21,0.82); }
  32%       { opacity: 0; }
  37%, 61%  { content: '2. it does the math for you';   opacity: 1; background: rgba(15,15,21,0.82); }
  65%       { opacity: 0; }
  70%, 94%  { content: '✓ answer ready — just $1';      opacity: 1; background: rgba(44,133,84,0.94); }
  98%, 100% { opacity: 0; }
}
@keyframes v2StoryCode {
  0%        { opacity: 0; }
  4%, 28%   { content: '1. you open it';                opacity: 1; background: rgba(15,15,21,0.82); }
  32%       { opacity: 0; }
  37%, 61%  { content: '2. it does the boring work';    opacity: 1; background: rgba(15,15,21,0.82); }
  65%       { opacity: 0; }
  70%, 94%  { content: '✓ done in seconds — just $1';   opacity: 1; background: rgba(44,133,84,0.94); }
  98%, 100% { opacity: 0; }
}
@keyframes v2StoryDocs {
  0%        { opacity: 0; }
  4%, 28%   { content: '1. you print it out';           opacity: 1; background: rgba(15,15,21,0.82); }
  32%       { opacity: 0; }
  37%, 61%  { content: '2. follow the easy steps';      opacity: 1; background: rgba(15,15,21,0.82); }
  65%       { opacity: 0; }
  70%, 94%  { content: '✓ that simple — just $1';       opacity: 1; background: rgba(44,133,84,0.94); }
  98%, 100% { opacity: 0; }
}
@keyframes v2StoryNotion {
  0%        { opacity: 0; }
  4%, 28%   { content: '1. you paste it in';            opacity: 1; background: rgba(15,15,21,0.82); }
  32%       { opacity: 0; }
  37%, 61%  { content: '2. it keeps you organized';     opacity: 1; background: rgba(15,15,21,0.82); }
  65%       { opacity: 0; }
  70%, 94%  { content: '✓ all in one place — just $1';  opacity: 1; background: rgba(44,133,84,0.94); }
  98%, 100% { opacity: 0; }
}
@keyframes v2StoryGmail {
  0%        { opacity: 0; }
  4%, 28%   { content: '1. you pick a message';         opacity: 1; background: rgba(15,15,21,0.82); }
  32%       { opacity: 0; }
  37%, 61%  { content: '2. it fills in the words';      opacity: 1; background: rgba(15,15,21,0.82); }
  65%       { opacity: 0; }
  70%, 94%  { content: '✓ ready to send — just $1';     opacity: 1; background: rgba(44,133,84,0.94); }
  98%, 100% { opacity: 0; }
}
@keyframes v2SpkTickMark {
  0%, 78%, 100% { opacity: 0; }
  81%, 93%      { opacity: 1; }
}
@keyframes v2SpkScan  { 0% { transform: translateY(-110%); } 55%, 100% { transform: translateY(500%); } }
@keyframes v2SpkCell  { 0%, 55%, 100% { background: transparent; } 63%, 78% { background: rgba(61,170,110,0.16); } }
@keyframes v2SpkSec   { 0%, 12%, 100% { opacity: 1; } 4%, 8% { opacity: 0.55; } }
@keyframes v2SpkPage  { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2.5px); } }
@keyframes v2SpkLine  { 0%, 10%, 100% { opacity: 1; } 3%, 6% { opacity: 0.5; } }
@keyframes v2SpkBlink { 0%, 49% { opacity: 0.9; } 50%, 100% { opacity: 0; } }
@keyframes v2SpkTick  { 0%, 74%, 100% { background: transparent; box-shadow: none; }
                        80%, 92% { background: rgba(91,79,232,0.55); box-shadow: 0 0 6px rgba(91,79,232,0.5); } }
@keyframes v2SpkMerge { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.35); } }

/* ═══ SPK PREVIEW HARDENING: no card can ever clip, overflow, or blank ═══
   (.ncard-thumb prefix out-ranks the later inline v4 spk rules) */
/* notion: compact page layout — title row, progress, exactly 3 rows */
.ncard-thumb .spk-ntn { display: flex; flex-direction: column; gap: 4px; padding: 0; }
.ncard-thumb .spk-ntn .ntt { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ncard-thumb .spk-ntn .ntt .em { font-size: 15px; line-height: 1; margin: 0; flex: 0 0 auto; }
.ncard-thumb .spk-ntn .ntt .nt { margin: 0; flex: 1; font-size: 11.5px; font-weight: 700; color: #37352f;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ncard-thumb .spk-ntn .npr { height: 4px; border-radius: 2px; background: #EBEBEB; overflow: hidden; }
.ncard-thumb .spk-ntn .npr i { display: block; height: 100%; background: #6366F1; border-radius: 2px; }
.ncard-thumb .spk-ntn .nb { padding: 1.5px 0; min-width: 0; }
.ncard-thumb .spk-ntn .nb .nbt { flex: 1; min-width: 0; }
/* checkboxes: done boxes always show a white ✓ (a solid purple square
   with no tick read as a broken blob) */
.ncard-thumb .spk-ntn .nb .cb { position: relative; }
.ncard-thumb .spk-ntn .nb .cb.done::after {
  content: '✓'; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 8px; line-height: 1; color: #fff; font-weight: 700;
}
/* ghost bars — honest skeleton lines for rows without safe text */
.ncard-thumb .spk-ghost { display: inline-block; height: 4px; border-radius: 2px;
  background: rgba(15, 15, 15, 0.12); vertical-align: middle; }
/* gmail body copy can be long — clamp to two lines */
.ncard-thumb .spk-gm .bd { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* sheets: long cell values were WRAPPING (Broad Market Index Fund…) and
   pushing the grid ~42px past the body — one line per cell, always */
.ncard-thumb .spk-sheets .spk-grid .c { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
/* docs: section names single-line too (same overflow class) */
.ncard-thumb .spk-doc .sec .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.ncard-thumb .spk-doc .sec { min-width: 0; }
/* the notion progress bar quietly fills as part of the ambient self-demo */
@media (prefers-reduced-motion: no-preference) {
  .ncard-thumb > .spk-notion .npr i { animation: v2SpkFill 5.4s ease-in-out var(--spkd, 0s) infinite; }
}
@keyframes v2SpkFill { 0%, 15% { width: 34%; } 55%, 88% { width: 78%; } 100% { width: 34%; } }

/* ═══ SPOTLIGHT: zoomed cards must never be cut off ═══
   .spotlight-ntrack's will-change:transform creates a stacking context
   that traps the hovered card's z-index — the NEXT (dark) section was
   painting over the zoom's bottom half. Lift the whole section above
   its neighbours so the cinema zoom always shows fully. */
.spotlight { position: relative; z-index: 30; }

/* the story caption belongs to BROWSING — hide it the moment the cinema
   hover takes over (it was covering the zoomed preview's text) */
.ncard:hover .ncard-thumb > .spk .spk-body::before,
.ncard.nf-demo-hover .ncard-thumb > .spk .spk-body::before {
  opacity: 0 !important;
  transition: opacity 150ms ease;
}

/* ═══ Reduced motion: everything above collapses to static ═══ */
@media (prefers-reduced-motion: reduce) {
  .hx-rot .hx-w { transition: none; }
  .v2-reveal { opacity: 1; transform: none; transition: none; }
  .btn-primary, .btn-secondary { transition: none; }
  #demoOverlay.open, #demoOverlay.open iframe { animation: none; }
  /* cinema hover-movies + animated spk previews go static (content stays visible) */
  .cinema-overlay *, .spk-anim * { animation: none !important; }
  /* gradient keyword: skip the sweep, land on the final gradient */
  .v2-reveal.v2-in .v2-grad, .v2-in .v2-grad { animation: none; }
}

/* Mobile: steps strip wraps tight, rotator words stay readable */
@media (max-width: 640px) {
  .hero-steps { gap: 6px; font-size: 11.5px; }
  .hero-steps .hs-arrow { display: none; }
}
