/**
 * RYME scroll animations.
 * Subtle reveal effects for the storefront and Store Admin.
 * The effects never take over native wheel/touch scrolling.
 */

html {
  scroll-behavior: smooth;
}

/* JS adds .ryme-scroll-animations-ready only after IntersectionObserver exists,
   so content stays fully visible if JavaScript is unavailable. */
.ryme-scroll-animations-ready .ryme-scroll-reveal {
  opacity: 0;
  transform: translate3d(0, 26px, 0) scale(.992);
  transition:
    opacity 620ms cubic-bezier(.22, 1, .36, 1),
    transform 620ms cubic-bezier(.22, 1, .36, 1),
    filter 520ms ease;
  transition-delay: var(--ryme-reveal-delay, 0ms);
  will-change: opacity, transform, filter;
}

.ryme-scroll-animations-ready .ryme-scroll-reveal.ryme-scroll-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  will-change: auto;
}

/* Hero content starts slightly softer so the first screen feels intentional. */
.ryme-scroll-animations-ready .hero.ryme-scroll-reveal,
.ryme-scroll-animations-ready .ryme-about-hero.ryme-scroll-reveal {
  transform: translate3d(0, 18px, 0) scale(.997);
}

/* Product cards and small tiles use a slightly tighter movement. */
.ryme-scroll-animations-ready :is(
  .product-card,
  .woocommerce ul.products li.product,
  .feature,
  .ryme-product-card,
  .ryme-admin-card,
  .stat-card,
  .table-card
).ryme-scroll-reveal {
  transform: translate3d(0, 20px, 0) scale(.988);
}

.ryme-scroll-animations-ready :is(
  .product-card,
  .woocommerce ul.products li.product,
  .feature,
  .ryme-product-card,
  .ryme-admin-card,
  .stat-card,
  .table-card
).ryme-scroll-reveal.ryme-scroll-visible {
  transform: translate3d(0, 0, 0) scale(1);
}

/* Avoid animating hidden modal/drawer content before it is actually opened. */
[hidden].ryme-scroll-reveal,
[aria-hidden="true"].ryme-scroll-reveal {
  opacity: inherit;
  transform: none;
  filter: none;
}

/* Accessibility: no motion for people who request reduced motion. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }

  .ryme-scroll-animations-ready .ryme-scroll-reveal,
  .ryme-scroll-animations-ready .ryme-scroll-reveal.ryme-scroll-visible {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }
}
