/* ==========================================================================
   Entrance motion — one shared system.
   Hook: .reveal. Driven by assets/js/motion.js, which plays each element once, in reading order
   (top to bottom, right to left in RTL). Progressive enhancement: nothing is hidden unless <html>
   has .js-ready (set in <head>), and a failsafe shows everything if the script does not run.
   Only transform and opacity animate, so there is no layout shift.
   ========================================================================== */
:root {
  --motion-dur: 600ms;
  --motion-ease: cubic-bezier(.22, 1, .36, 1);
  --motion-step: 90ms;       /* stagger step */
  --motion-max-delay: 540ms; /* stagger cap */
  --motion-dist: 24px;
}

@keyframes sada-rise {
  from { opacity: 0; transform: translateY(var(--motion-dist)); }
  to { opacity: 1; transform: translateY(0); }
}

html.js-ready .reveal:not(.is-in) {
  opacity: 0;
  transform: translateY(var(--motion-dist));
}
html.js-ready .reveal.is-in {
  animation: sada-rise var(--motion-dur) var(--motion-ease) min(calc(var(--i, 0) * var(--motion-step)), var(--motion-max-delay)) backwards;
}

/* Failsafe: the motion script did not run in time. */
html.motion-failsafe .reveal:not(.is-in) { opacity: 1; transform: none; }

/* Reduced motion: content is simply there. */
@media (prefers-reduced-motion: reduce) {
  html.js-ready .reveal:not(.is-in) { opacity: 1; transform: none; }
  html.js-ready .reveal.is-in { animation: none; }
}
