/* Component „scroll-effects”: scroll-driven parallax of a frame's photo (data-parallax) and a headline's spans
   filling (data-fill). The layer order is the base's (kit.css), so this file's place among the links does not matter,
   and the Site's own site.css wins over it. */
@layer motion {
  @media (prefers-reduced-motion: no-preference) {
    /* Photos drift a little against the scroll (scroll-driven: composited, no script) */
    @supports (animation-timeline: view()) {
      [data-parallax] img { animation: parallax linear both; animation-timeline: view(); scale: 1.14; }
    }
    @keyframes parallax { from { translate: 0 -6%; } to { translate: 0 6%; } }

    /* Text that lights up word by word as it scrolls through the view */
    @supports (animation-timeline: view()) {
      [data-fill] > * { animation: fill-in linear both; animation-timeline: view(); animation-range: cover 5% cover 35%; }
      [data-fill] > :nth-child(2) { animation-range: cover 10% cover 40%; }
      [data-fill] > :nth-child(3) { animation-range: cover 15% cover 45%; }
      [data-fill] > :nth-child(4) { animation-range: cover 20% cover 50%; }
    }
    @keyframes fill-in { from { opacity: 0.18; } }
  }
}
