/* The printed edge travels across the artwork; the type stays on its baseline.
   Without scroll measurements both stages default to the finished poster. */
@media screen and (prefers-reduced-motion: no-preference) {
  .studio-scroll-ready [data-service-poster] {
    --ink-open: var(--poster-art, 1);
    --caption-open: var(--poster-caption, 1);
    --ink-top: calc(var(--ink-open) * 118% - 18%);
    --ink-bottom: calc(var(--ink-open) * 118%);
    --ink-edge: min(calc(var(--ink-open) * 20px), calc((1 - var(--ink-open)) * 20px), 4px);
    background: transparent;
    /* Only the printed area responds to a pointer. Tab still reaches the
       whole link and immediately reveals it with a full focus outline. */
    pointer-events: none;
  }

  .studio-scroll-ready [data-service-poster] .affiche-service__image {
    background: #ff87c5;
    clip-path: polygon(0 0, max(0%, var(--ink-top)) 0, min(100%, var(--ink-bottom)) 100%, 0 100%);
    pointer-events: auto;
  }

  .studio-scroll-ready [data-service-poster] .affiche-service__image::after {
    position: absolute;
    inset: 0;
    background: #ff9fce;
    clip-path: polygon(
      calc(var(--ink-top) - var(--ink-edge)) 0, var(--ink-top) 0,
      var(--ink-bottom) 100%, calc(var(--ink-bottom) - var(--ink-edge)) 100%
    );
    content: '';
    pointer-events: none;
  }

  .studio-scroll-ready [data-service-poster] .affiche-service__texte {
    clip-path: inset(0 0 calc((1 - var(--caption-open)) * 100%) 0);
    pointer-events: auto;
  }

  .studio-scroll-ready [data-service-poster]:is(:focus-visible, :target) {
    --ink-open: 1;
    --caption-open: 1;
  }
}
