/* Iris reveal · Scroll Story Kit
   Static (no JS, reduced motion): the heading, then the scene as a rounded picture with the lead under it.
   Motion: the section pins for --sk-iris-len of scroll. The scene sits on top of the page inside a circular clip that
   grows from a dot in the middle until it covers the screen. The heading is printed twice in the same place: the real
   one in ink under the scene, and an aria-hidden copy in paper colour inside it, so the letters change colour as the
   edge of the circle sweeps across them. The lead rises in once the circle is full. */
.sk-iris { --sk-iris-len: 320vh; text-align: center; }
.sk-iris-pin { max-width: var(--sk-max); margin: 0 auto; }
.sk-iris-words { width: 100%; max-width: 980px; margin: 0 auto; }
.sk-iris-words .sk-h1 { font-size: clamp(2.6rem, 1rem + 6.4vw, 6.4rem); }
/* the inside copy only shows with motion: tucked away (never display:none, so its box stays put) */
:root:not(.sk-on) .sk-iris-words--in { position: absolute; width: 1px; height: 1px; overflow: clip; clip-path: inset(50%); white-space: nowrap; }
.sk-iris-in { margin-top: clamp(32px, 5vw, 56px); }
.sk-iris-scene { margin: 0; aspect-ratio: 16 / 9; border-radius: var(--sk-radius); overflow: clip; box-shadow: var(--sk-shadow); }
.sk-iris-scene svg { display: block; width: 100%; height: 100%; }
.sk-iris-lead { max-width: 46ch; margin-inline: auto; }
@media (max-width: 640px) {
  .sk-iris-scene { aspect-ratio: 4 / 5; }
}

/* motion */
:root.sk-on .sk-iris { height: var(--sk-iris-len); padding: 0; }
:root.sk-on .sk-iris-pin {
  --sk-iris-e: clamp(0, (var(--sk-p) - .04) / .64, 1);
  --sk-iris-t: clamp(0, (var(--sk-p) - .7) / .14, 1);
  position: sticky; top: 0; height: 100vh; height: 100svh; max-width: none; overflow: clip;
}
:root.sk-on .sk-iris-out, :root.sk-on .sk-iris-in {
  position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 0 var(--sk-gutter) 10svh;
}
:root.sk-on .sk-iris-in {
  background: var(--sk-ink);
  clip-path: circle(calc(3.5vmin + var(--sk-iris-e) * var(--sk-iris-e) * 86vmax) at 50% 76%); /* starts as a small dot under the heading, clear of the words */
}
:root.sk-on .sk-iris-scene { position: absolute; inset: 0; aspect-ratio: auto; border-radius: 0; box-shadow: none; transform: scale(calc(1.32 - .32 * var(--sk-iris-e))); }
:root.sk-on .sk-iris-block { position: relative; }
:root.sk-on .sk-iris-words--in, :root.sk-on .sk-iris-words--in .sk-kicker { color: var(--sk-paper); }
:root.sk-on .sk-iris-words--in .sk-kicker { opacity: .8; }
:root.sk-on .sk-iris-lead {
  position: absolute; top: 100%; left: 50%; width: min(46ch, 86vw); margin: 22px 0 0; color: var(--sk-paper);
  opacity: var(--sk-iris-t); transform: translate(-50%, calc((1 - var(--sk-iris-t)) * 18px));
}
@media (max-width: 640px) {
  :root.sk-on .sk-iris-words .sk-h1 { font-size: clamp(2.4rem, 1rem + 8vw, 3.4rem); }
}
