/* ==========================================================================
   RMarin · Motion
   Parallax and global reduced-motion preferences. Load after the components.
   ========================================================================== */

/* ---------- Parallax ---------- */
/* js/main.js writes --py (offset) and --ps (scale that covers the offset
   so no edges show). --hover-scale lets hover effects combine with the
   movement. Without JS or with reduced motion, the image stays in place. */
@property --hover-scale {
  syntax: "<number>";
  inherits: false;
  initial-value: 1;
}

[data-parallax] {
  transform: translate3d(0, var(--py, 0px), 0) scale(calc(var(--ps, 1) * var(--hover-scale)));
  will-change: transform;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  [data-parallax] {
    --hover-scale: 1;
    will-change: auto;
  }
}
