/* kora-reveal — scroll-entry text/unit reveal for /divorce-procedure/ blocks 2-15.
   Measured recipe (owner's kora.framer.media reference, scroll-probe over the FULL 25,200px
   page, not just the first sample): opacity 0->1, blur EXACTLY 5px->0, scale 0.95->1 UNIFORM
   across every unit type (headings, body, cards, panels - kora does not vary the look per
   section, only how many units participate and their order), translateY ~2px->0, 400ms
   cubic-bezier(.22,.61,.36,1) per unit (ROUND 3: was 600ms - kora's own units complete within a
   median of 0px / max 175px of scroll, effectively immediate; the whole block's arrival budget is
   now a hard 800ms, see kora-reveal.js), units staggered by kora-reveal.js.

   RULING 7 (non-negotiable): nothing here defaults to opacity:0. The hidden pre-reveal state
   only applies once the ROOT carries [data-kr-armed] - an attribute kora-reveal.js adds BEFORE
   it starts observing anything. No JS => no [data-kr-armed] => the page renders exactly as its
   own markup and site.css describe it, fully visible. */

.kr-char, .kr-run, .kr-item {
  --kr-scale: .95; /* uniform page-wide, ROUND 2 correction — not .90 for big headings */
}

[data-kr-armed] .kr-char,
[data-kr-armed] .kr-run {
  display: inline-block;
  opacity: 0;
  /* PERF (issue #28): blur() dropped from the entrance — non-composited, forced a full-layer
     repaint on every one of 464 transitioning atoms measured on this page (kora-reveal.js's own
     scroll-jank contribution). Opacity + transform (scale + translateY) are compositor-only and
     keep the same 400ms cubic-bezier timing, so the look is unchanged apart from the missing
     softening; will-change is no longer declared here (permanently-on for every not-yet-revealed
     atom on the page) — kora-reveal.js now sets it inline right before firing each atom and clears
     it on transitionend (see fireAtoms()). */
  transform: scale(var(--kr-scale)) translateY(2px);
  transition: opacity .4s cubic-bezier(.22,.61,.36,1),
              transform .4s cubic-bezier(.22,.61,.36,1);
}

/* Kinsoku: a glued run (number/currency/Latin word) must never crack mid-token, and the
   inline-block boxing that per-char transform requires must not itself force an ugly break
   right before closing punctuation glued onto the previous character. */
.kr-char, .kr-run { white-space: pre; }

[data-kr-armed] .kr-heading.kr-in .kr-char,
[data-kr-armed] .kr-heading.kr-in .kr-run {
  opacity: 1;
  transform: scale(1) translateY(0);
}

[data-kr-armed] .kr-item {
  opacity: 0;
  transform: scale(var(--kr-scale)) translateY(2px);
  transition: opacity .4s cubic-bezier(.22,.61,.36,1),
              transform .4s cubic-bezier(.22,.61,.36,1);
}

[data-kr-armed] .kr-item.kr-in {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* Replaces the stripped GSAP `.mask`/`.line` pair on headings we take over: same one-line-per-
   `.kr-line` block layout, but overflow VISIBLE (not clip) so the 5px blur is never cut off. */
.kr-lines { display: block; }
.kr-lines .kr-line { display: block; }

/* Block 3 (statement): scroll-SCRUBBED, not entry-fired — the one place kora's own mechanism
   genuinely differs (measured: its equivalent line is scroll-progress-linked, not a one-shot
   entry animation). kora-reveal.js writes --kr-p (0..1) on each existing `.clause` span every
   scroll frame; this is a continuous read of that value, never a class-toggled transition. */
[data-kr-armed] .kr-scrub {
  opacity: var(--kr-p, 0);
  /* PERF (issue #28): filter dropped here too — this custom property is written every scroll
     frame (kora-reveal.js), so a blur() here forced a full-layer repaint on every single frame of
     scroll through block 3, not just once per unit like the other atoms above. */
  transform: scale(calc(.95 + .05 * var(--kr-p, 0))) translateY(calc(2px * (1 - var(--kr-p, 0))));
  transition: none;
}

/* RULING 6 (non-negotiable, battery-asserted): reduced motion shows the finished state
   immediately. kora-reveal.js already skips the split/observer/scroll-scrub entirely under
   reduced motion, this is the CSS-level backstop in case markup was ever armed some other way. */
@media (prefers-reduced-motion: reduce) {
  [data-kr-armed] .kr-char,
  [data-kr-armed] .kr-run,
  [data-kr-armed] .kr-item,
  [data-kr-armed] .kr-scrub {
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
    transition: none !important;
  }
}
