/* m7-motion */
/* ma7l motion layer (WP-PQ4). CSS only, zero JS. Timings shared with dashboard-home:
   320ms cubic-bezier(.22,1,.36,1), 60ms stagger up to 6, hero image 1.00→1.04 over 12s.
   Below-fold sections ride a scroll-driven view() timeline; a block already in view at
   load sits at its final frame, so the first paint (LCP) is never delayed. Browsers
   without scroll-driven animations get no motion and see every block fully visible.
   Nothing moves inside forms or the cart sheet. Off under prefers-reduced-motion. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    @keyframes m7-enter {
      from { opacity: 0; transform: translateY(12px); }
      to { opacity: 1; transform: translateY(0); }
    }
    @keyframes m7-zoom {
      from { transform: scale(1); }
      to { transform: scale(1.04); }
    }
    /* sections after the hero: enter as they scroll into view (first 30% of entry) */
    /* :where() keeps the exclusions at zero specificity so the :hover rule below can win */
    [data-ma7l-sec]:where(:not([data-ma7l-sec="hero"]):not(.ma7l-cart-catalog):not(#ma7l-util-strip):not(:has(> form))) {
      animation: m7-enter 320ms cubic-bezier(.22,1,.36,1) both;
      animation-timeline: view();
      animation-range: entry 0% entry 30%;
    }
    /* hero: the wrapper, the headline and the image are painted at once (they are the LCP candidates;
       fading the whole hero measured 772→1576 ms LCP). Only the supporting text and buttons enter,
       in order, 60ms apart, up to the 6th; the rest together. */
    [data-ma7l-sec="hero"] :is(p, a, ul, ol, small):not(p *):not(a *):not(form *):not(:has(h1, h2, h3, img)) {
      animation: m7-enter 320ms cubic-bezier(.22,1,.36,1) both;
    }
    [data-ma7l-sec="hero"] :is(p, a, ul, ol, small):nth-child(2) { animation-delay: 60ms; }
    [data-ma7l-sec="hero"] :is(p, a, ul, ol, small):nth-child(3) { animation-delay: 120ms; }
    [data-ma7l-sec="hero"] :is(p, a, ul, ol, small):nth-child(4) { animation-delay: 180ms; }
    [data-ma7l-sec="hero"] :is(p, a, ul, ol, small):nth-child(5) { animation-delay: 240ms; }
    [data-ma7l-sec="hero"] :is(p, a, ul, ol, small):nth-child(6) { animation-delay: 300ms; }
    [data-ma7l-sec="hero"] :is(p, a, ul, ol, small):nth-child(n+7) { animation-delay: 300ms; }
    /* hero image only: slow, barely-there zoom; clipped by the hero so nothing overflows */
    [data-ma7l-sec="hero"] { overflow: hidden; }
    [data-ma7l-sec="hero"] img, [data-ma7l-sec="hero"] picture {
      animation: m7-zoom 12s ease-out both;
      transform-origin: center;
    }
    /* a block that has entered keeps its own :hover lift (gallery cards, buttons): the finished entrance
       must not pin transform/opacity; before and during the entrance fill-mode has no visible effect */
    [data-ma7l-sec]:hover, [data-ma7l-sec] a:hover { animation-fill-mode: none; }
    /* never inside forms or the cart sheet */
    [data-ma7l-sec] form, [data-ma7l-sec] form *, .ma7l-cart-panel, .ma7l-cart-panel *, .ma7l-cart-catalog * {
      animation: none;
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  [data-ma7l-sec], [data-ma7l-sec] *, [data-ma7l-sec] img {
    animation-duration: 0s;
    animation-delay: 0s;
    transition-duration: 0s;
    opacity: 1;
    transform: none;
  }
}
