/* Scroll motion, ported from diligent.style (docs/specs/2026-10-17-scroll-motion.md and its motion review).
   Everything here sits behind the `js` class that reveal.js sets, so with no script the page is fully visible.
   Values, copied exactly:
   - words:  from opacity 0, translateY(12px), blur(4px); 0.6s on cubic-bezier(.25,.46,.45,.94); 0.12s per word; hero +0.1s
   - blocks: same start state; in 0.6s on the same curve; out 0.3s on cubic-bezier(.7,0,.84,0)
   - reduced motion: opacity only, 0.24s, no blur, no travel, no stagger */
:root {
  --rv-curve: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --rv-exit: cubic-bezier(0.7, 0, 0.84, 0);
  --rv-enter-reduced: cubic-bezier(0.16, 1, 0.3, 1);
}

/* until reveal.js has split the hero headline it is not painted, so words never flash at rest first (below-fold h2s are split
   before they can scroll into view, so they need no gate).
   reveal.js sets rv-ready after the split, and a timer sets it regardless, so nothing stays hidden. */
html.js:not(.rv-ready) main #hero h1 { visibility: hidden; }

/* ---- words ---- */
html.js [data-rv-words] { word-spacing: 0.1em; }
html.js .rv-word { display: inline-block; opacity: 0; transform: translateY(12px); filter: blur(4px); }
html.js [data-rv-words].rv-in .rv-word {
  opacity: 1; transform: none; filter: none;
  transition:
    opacity 0.6s var(--rv-curve) calc(var(--i) * 0.12s + var(--rv-delay, 0s)),
    transform 0.6s var(--rv-curve) calc(var(--i) * 0.12s + var(--rv-delay, 0s)),
    filter 0.6s var(--rv-curve) calc(var(--i) * 0.12s + var(--rv-delay, 0s));
}

/* ---- reduced motion headings: whole element, one opacity fade ---- */
html.js [data-rv-fade] { opacity: 0; }
html.js [data-rv-fade].rv-in { opacity: 1; transition: opacity 0.24s var(--rv-curve); }

/* ---- section blocks ---- */
html.js .rv-block { transition: opacity 0.6s var(--rv-curve), filter 0.6s var(--rv-curve), transform 0.6s var(--rv-curve); }
html.js .rv-block.rv-hidden {
  opacity: 0; filter: blur(4px); transform: translateY(12px);
  transition-duration: 0.3s; transition-timing-function: var(--rv-exit);
}
html.js .rv-block.rv-instant { transition: none; }
@media (prefers-reduced-motion: reduce) {
  html.js .rv-block { transition: opacity 0.24s var(--rv-enter-reduced); }
  html.js .rv-block.rv-hidden { filter: none; transform: none; transition-duration: 0.24s; transition-timing-function: var(--rv-enter-reduced); }
  html.js .rv-word, html.js [data-rv-words].rv-in .rv-word { transition: none; }
}

/* ---- cue sheet rows: blur + rise + fade, 40ms apart (8 rows land inside 280ms), once ---- */
html.js .cue-sheet li { opacity: 0; transform: translateY(12px); filter: blur(4px); }
html.js .cue-sheet.rv-in li {
  opacity: 1; transform: none; filter: none;
  transition: opacity 0.6s var(--rv-curve) calc(var(--i) * 0.04s), transform 0.6s var(--rv-curve) calc(var(--i) * 0.04s), filter 0.6s var(--rv-curve) calc(var(--i) * 0.04s);
}
@media (prefers-reduced-motion: reduce) { html.js .cue-sheet li { opacity: 1; transform: none; filter: none; } }
.proof-figure .value, .count { font-variant-numeric: lining-nums tabular-nums; }
.count { display: inline-block; }

/* print: read content never depends on scroll position */
@media print { html.js .rv-block, html.js .rv-word, html.js .cue-sheet li { opacity: 1 !important; filter: none !important; transform: none !important; } html.js main :is(h1, h2) { visibility: visible !important; } }
