/* KIRUPA article reveals (prototype): the states reveal.js puts blocks in. Nothing here applies
   until the script marks a block, so the page is complete without it. Only opacity and transform
   change, so text never reflows and nothing shifts. No will-change: the browser moves each block
   to the compositor for its reveal on its own and lets it go afterward. */

html[data-krv] .krv-wait {
  opacity: 0;
  transform: translate3d(var(--krv-x, 0), var(--krv-y, 12px), 0) scale(var(--krv-s, 1));
}
html[data-krv] .krv-go {
  transition:
    opacity var(--krv-dur, 450ms) var(--krv-ease, cubic-bezier(.2, .7, .2, 1)) var(--krv-delay, 0ms),
    transform var(--krv-dur, 450ms) var(--krv-ease, cubic-bezier(.2, .7, .2, 1)) var(--krv-delay, 0ms);
}
html[data-krv] .krv-now {
  transition: none !important;
}

/* Each choice's movement and timing. */
html[data-krv="fade"] {
  --krv-y: 12px;
  --krv-dur: 450ms;
}
html[data-krv="cascade"] {
  --krv-y: 16px;
  --krv-dur: 520ms;
}
html[data-krv="figures"] {
  --krv-y: 8px;
  --krv-s: .94;
  --krv-dur: 400ms;
}
html[data-krv="figures"] .krv-wait {
  transform-origin: 50% 0;
}
html[data-krv="headings"] {
  --krv-dur: 420ms;
}
/* Headings slide in from the left; the text under them only fades. */
html[data-krv="headings"] .krv-wait:is(h1, h2, h3, h4, h5, h6) {
  --krv-x: -14px;
  --krv-y: 0px;
}
html[data-krv="headings"] .krv-wait:not(h1, h2, h3, h4, h5, h6) {
  --krv-y: 0px;
}
/* The home page proposal's values (home.css): a 24px rise over 0.7s. */
html[data-krv="home"] {
  --krv-y: 24px;
  --krv-dur: 700ms;
}

/* Scroll-linked: progress follows the block's position, from the moment its top enters the
   window until it's 160px in. No script runs while scrolling. */
@supports (animation-timeline: view()) {
  html[data-krv="scrub"] .krv-scrub {
    animation: krv-scrub linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 160px;
  }
}
@keyframes krv-scrub {
  from {
    opacity: 0;
    transform: translate3d(0, 16px, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Printing, forced colors, and reduced motion always show everything as it is, including a
   reveal that was already in progress. */
@media print {
  html[data-krv] :is(.krv-wait, .krv-go, .krv-now, .krv-scrub) {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }
}
@media (forced-colors: active), (prefers-reduced-motion: reduce) {
  html[data-krv] :is(.krv-wait, .krv-go, .krv-now, .krv-scrub) {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }
}
