/* Scroll + page-load reveal (assets/js/scroll-reveal.js), tuned to atombeat.com. Loaded on every page. */

/* Scroll reveal (assets/js/scroll-reveal.js), measured on atombeat.com: 100px rise + fade, ~600ms,
   ease-out cubic (≈15% at 50ms, ≈78% at 250ms, same as theirs). Blocks below the fold start hidden. */
.reveal {
  transition: opacity 650ms cubic-bezier(0.33, 1, 0.68, 1), transform 650ms cubic-bezier(0.33, 1, 0.68, 1);
}

.reveal-pending {
  opacity: 0;
  transform: translateY(100px);
}

/* Re-entering from the top (scrolling up): comes down instead of up. */
.reveal-pending.reveal-from-above {
  transform: translateY(-100px);
}

/* Page load: blocks already on screen play the same rise + fade from the first frame (CSS, so no flash).
   Blocks further down are hidden by scroll-reveal.js and animate when scrolled to. */
@keyframes reveal-on-load {
  from {
    opacity: 0;
    transform: translateY(100px);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .home-contact__inner,
  .home-products > .container,
  .story__inner,
  .page-lead,
  .page-card,
  .woocommerce-products-header,
  .shop-layout,
  .product .summary,
  .product .woocommerce-product-gallery {
    animation: reveal-on-load 650ms cubic-bezier(0.33, 1, 0.68, 1) backwards;
  }

  .shop-layout,
  .page-card:nth-child(2),
  .product .summary {
    animation-delay: 80ms;
  }

  /* Variant switch (assets/js/product-soft-navigation.js): the swapped product shows at once, no fade. */
  .is-soft-nav .product .summary,
  .is-soft-nav .product .woocommerce-product-gallery {
    animation: none;
  }
}
