/* riff motion styles (MIT). Pairs with motion.js. Tune the variables to match the DNA. */
:root {
  --riff-ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --riff-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --riff-reveal-duration: 900ms;
  --riff-reveal-distance: 40px;
  --riff-pin-top: 0px; /* height of a fixed nav, if the pinned stage should sit below it */
}

/* Content is only hidden once motion.js has run, so the page still works without JS. */
.riff-motion [data-reveal] {
  opacity: 0;
  transition:
    opacity var(--riff-reveal-duration) var(--riff-ease),
    transform var(--riff-reveal-duration) var(--riff-ease-out),
    filter var(--riff-reveal-duration) var(--riff-ease),
    clip-path var(--riff-reveal-duration) var(--riff-ease-out);
  will-change: opacity, transform;
}
.riff-motion [data-reveal=''],
.riff-motion [data-reveal='up'] { transform: translate3d(0, var(--riff-reveal-distance), 0); }
.riff-motion [data-reveal='down'] { transform: translate3d(0, calc(var(--riff-reveal-distance) * -1), 0); }
.riff-motion [data-reveal='left'] { transform: translate3d(var(--riff-reveal-distance), 0, 0); }
.riff-motion [data-reveal='right'] { transform: translate3d(calc(var(--riff-reveal-distance) * -1), 0, 0); }
.riff-motion [data-reveal='scale'] { transform: scale(0.94); }
.riff-motion [data-reveal='blur'] { filter: blur(14px); transform: scale(1.02); }
.riff-motion [data-reveal='clip'] { opacity: 1; clip-path: inset(0 0 100% 0); }

.riff-motion [data-reveal].is-in {
  opacity: 1;
  transform: none;
  filter: none;
}
.riff-motion [data-reveal='clip'].is-in { clip-path: inset(0 0 0 0); }

/* Pinned sections: motion.js sets the section height; the first child sticks. */
.riff-pin-stage {
  position: sticky;
  top: var(--riff-pin-top);
  height: calc(100vh - var(--riff-pin-top));
  height: calc(100svh - var(--riff-pin-top));
  overflow: hidden;
}

[data-scrub] { will-change: transform, opacity; }

@media (prefers-reduced-motion: reduce) {
  .riff-motion [data-reveal] {
    opacity: 1;
    transform: none;
    filter: none;
    clip-path: none;
    transition: none;
  }
}
