/* Mandphiya store: motion and warmth (25 Nov 2026), used together with motion.js.
   Calm, natural movement: soft leaves and a breathing light in the hero, sections rising into
   view, a small leaf burst on Add to cart, a gentle gold-leaf shower when an order is placed.
   Only transform and opacity move (plus one short shadow fade); no layout shifts, nothing is
   ever laid over a button, no text changes.
   Reduced motion: every animation sits inside (prefers-reduced-motion: no-preference), so a
   visitor who asks for less motion sees the page exactly as store.css draws it. Rules that need
   the script are scoped to html.av-motion, which only motion.js sets (never under reduced
   motion): if the script does not run, nothing is hidden and nothing changes. The hero entrance
   is pure CSS on purpose, so it starts with the first paint and always ends fully visible.
   motion.js adds: av-m-wait/av-m-in (reveal), av-m-lit (glow behind the lead pack), av-m-idle
   (hero off screen), av-m-paused (tab hidden) and the aria-hidden av-m-* decoration layers.
   Opt-ins a page may use: .av-reveal (rise into view), img.av-float (slow float);
   [data-no-motion] keeps an element out of the reveal and the cart burst. */
@media (prefers-reduced-motion: no-preference) {
  /* 1. hero entrance: pill, headline, its last line, Hindi line, paragraph, buttons */
  .av-hero-t > .av-pill,
  .av-hero-t > h1,
  .av-hero-t > h1 em,
  .av-hero-t > p,
  .av-hero-t > .av-cta { animation: av-m-up 0.75s cubic-bezier(0.22, 0.8, 0.24, 1) both }
  .av-hero-t > h1 { animation-delay: 0.08s }
  .av-hero-t > h1 em { display: inline-block; animation-delay: 0.34s }
  .av-hero-t > .av-hero-hi { animation-delay: 0.5s }
  .av-hero-t > p:not(.av-hero-hi) { animation-delay: 0.6s }
  .av-hero-t > .av-cta { animation-delay: 0.7s }
  @keyframes av-m-up { from { opacity: 0; transform: translateY(16px) } to { opacity: 1; transform: none } }

  /* 2. hero decoration (layers made by motion.js; aria-hidden, never catch a tap) */
  html.av-motion .av-hero-in,
  html.av-motion .av-hero-t { position: relative; isolation: isolate }
  .av-m-deco { position: absolute; pointer-events: none; overflow: hidden; contain: layout paint }
  .av-m-text { top: 0; right: 0; bottom: 0; left: 0; z-index: -1 } /* behind the hero text */
  .av-m-back { z-index: 0 } /* behind the packs */
  .av-m-front { z-index: 3 } /* the light that passes over the packs */
  .av-m-leaf {
    position: absolute; width: var(--s); height: var(--s); color: var(--c); opacity: var(--o);
    rotate: var(--r);
    translate: calc(var(--av-mx, 0) * var(--d)) calc(var(--av-my, 0) * var(--d));
    transition: translate 1.1s cubic-bezier(0.2, 0.8, 0.2, 1);
    animation: av-m-show 2s ease-out 0.5s both;
  }
  .av-m-leaf svg { display: block; width: 100%; height: 100%; fill: currentColor; animation: av-m-drift-a var(--t) ease-in-out var(--dl) infinite alternate }
  .av-m-leaf.av-m-b svg { animation-name: av-m-drift-b }
  @keyframes av-m-show { from { opacity: 0 } }
  @keyframes av-m-drift-a {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 0.75 }
    50% { transform: translate(12px, -16px) rotate(14deg); opacity: 1 }
    100% { transform: translate(-8px, 10px) rotate(-10deg); opacity: 0.8 }
  }
  @keyframes av-m-drift-b {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 0.85 }
    50% { transform: translate(-14px, -10px) rotate(-16deg); opacity: 0.65 }
    100% { transform: translate(9px, 14px) rotate(9deg); opacity: 1 }
  }
  .av-m-sweep {
    position: absolute; top: -10%; bottom: -10%; left: 0; width: 36%;
    background: linear-gradient(100deg, rgba(255, 255, 255, 0) 15%, rgba(255, 255, 255, 0.32) 50%, rgba(255, 255, 255, 0) 85%);
    transform: translateX(-150%) skewX(-14deg);
    animation: av-m-sweep 9s cubic-bezier(0.45, 0.05, 0.35, 1) 2s infinite;
  }
  @keyframes av-m-sweep { 0% { transform: translateX(-150%) skewX(-14deg) } 40%, 100% { transform: translateX(330%) skewX(-14deg) } }
  /* packs: follow the pointer (desktop) and the scroll by a few px; the lead pack is "nearest" */
  html.av-motion .av-shelf img {
    translate: calc(var(--av-mx, 0) * var(--av-dp, -4px)) calc(var(--av-my, 0) * var(--av-dp, -4px) + var(--av-sy, 0px) + var(--av-lift, 0px));
    transition: translate 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), scale 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  html.av-motion .av-shelf img.is-lead { --av-dp: -9px }
  html.av-motion .av-shelf::after { translate: 0 var(--av-sy, 0px); transition: translate 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) }
  /* breathing glow behind the lead pack (position measured by motion.js) */
  html.av-motion .av-shelf.av-m-lit::before {
    content: ""; position: absolute; z-index: 0; left: var(--av-lx); top: var(--av-ly);
    width: var(--av-lw); height: var(--av-lw); border-radius: 50%; pointer-events: none;
    background: radial-gradient(closest-side, rgba(255, 251, 238, 0.95), rgba(243, 227, 188, 0.62) 52%, rgba(243, 227, 188, 0));
    translate: 0 var(--av-sy, 0px);
    animation: av-m-breathe 6.5s ease-in-out infinite;
  }
  @keyframes av-m-breathe {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(0.9) }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.07) }
  }
  /* rest while the tab is hidden or the hero is off screen */
  html.av-m-paused .av-m-leaf svg, html.av-m-paused .av-m-sweep, html.av-m-paused .av-shelf::before,
  html.av-m-paused .av-gal img[data-main], html.av-m-paused img.av-float,
  .av-m-idle .av-m-leaf svg, .av-m-idle .av-m-sweep, .av-m-idle .av-shelf::before { animation-play-state: paused }

  /* 3. warmth under the pointer (desktop only) */
  @media (hover: hover) and (pointer: fine) {
    html.av-motion .av-shelf img:hover { --av-lift: -10px; scale: 1.025 }
    html.av-motion .av-card { transition: translate 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease }
    html.av-motion .av-card:hover { translate: 0 -4px; box-shadow: 0 16px 34px rgba(68, 22, 18, 0.12) }
    html.av-motion .av-card-ph img, html.av-motion .av-need-ph img { transition: scale 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) }
    html.av-motion .av-card:hover .av-card-ph img, html.av-motion .av-need:hover .av-need-ph img { scale: 1.03 }
    html.av-motion .av-herbs > li { transition: translate 0.2s ease, box-shadow 0.2s ease }
    html.av-motion .av-chip:hover, html.av-motion .av-herbs > li:hover { translate: 0 -2px; box-shadow: 0 6px 14px rgba(68, 22, 18, 0.1) }
    html.av-motion .av-btn:not(.av-btn-off):not([disabled]):not(.is-busy):hover::after { transform: translateX(330%) skewX(-16deg); transition: transform 0.8s cubic-bezier(0.2, 0.7, 0.3, 1) }
  }
  /* buttons: soft press, and a light sheen on hover (drawn under the label) */
  html.av-motion .av-btn { position: relative; isolation: isolate; overflow: hidden; transition: transform 0.15s ease, box-shadow 0.15s ease, scale 0.18s cubic-bezier(0.2, 0.8, 0.2, 1) }
  html.av-motion .av-chip { transition: translate 0.2s ease, box-shadow 0.2s ease, scale 0.18s cubic-bezier(0.2, 0.8, 0.2, 1) }
  html.av-motion .av-btn:not(.av-btn-off):not([disabled]):active, html.av-motion .av-chip:active { scale: 0.97 }
  /* (a busy button keeps store.css's own ::after spinner: .is-busy and [disabled] are left alone) */
  html.av-motion .av-btn:not(.av-btn-off):not([disabled]):not(.is-busy)::after {
    content: ""; position: absolute; z-index: -1; top: 0; bottom: 0; left: -30%; width: 45%; pointer-events: none;
    background: linear-gradient(100deg, rgba(255, 255, 255, 0), var(--av-sheen, rgba(255, 255, 255, 0.28)), rgba(255, 255, 255, 0));
    transform: translateX(-120%) skewX(-16deg);
  }
  html.av-motion .av-btn-gold { --av-sheen: rgba(255, 255, 255, 0.55) }
  html.av-motion .av-btn-line { --av-sheen: rgba(108, 38, 31, 0.1) }
  html.av-motion .av-cart svg { transform-origin: 50% 55% }

  /* 4. product photo: a slow float */
  html.av-motion .av-gal img[data-main], html.av-motion img.av-float { animation: av-m-float 7s ease-in-out infinite alternate }
  @keyframes av-m-float { from { transform: translateY(5px) } to { transform: translateY(-7px) } }

  /* 5. scroll reveal, once; only blocks that started below the screen are ever hidden */
  html.av-motion .av-m-wait { opacity: 0; translate: 0 22px }
  html.av-motion .av-herbs > li.av-m-wait:not(.av-m-in) { translate: 0 12px }
  html.av-motion .av-m-wait.av-m-in {
    opacity: 1; translate: none; scale: none;
    transition: opacity 0.7s ease-out var(--av-m-d, 0ms), translate 0.85s cubic-bezier(0.2, 0.7, 0.2, 1) var(--av-m-d, 0ms), scale 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) var(--av-m-d, 0ms);
  }

  /* 6. phone menu: its blocks and product links slide in one after another */
  html.av-motion .av-drawer.open .av-drawer-in > :not(.av-drawer-hd):not(.av-drawer-nav),
  html.av-motion .av-drawer.open .av-drawer-nav > * { animation: av-m-slide 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both }
  @keyframes av-m-slide { from { opacity: 0; transform: translateX(-14px) } to { opacity: 1; transform: none } }
  html.av-motion .av-drawer.open .av-drawer-in > :nth-child(2) { animation-delay: 0.06s }
  html.av-motion .av-drawer.open .av-drawer-nav > :nth-child(1) { animation-delay: 0.1s }
  html.av-motion .av-drawer.open .av-drawer-nav > :nth-child(2) { animation-delay: 0.13s }
  html.av-motion .av-drawer.open .av-drawer-nav > :nth-child(3) { animation-delay: 0.16s }
  html.av-motion .av-drawer.open .av-drawer-nav > :nth-child(4) { animation-delay: 0.19s }
  html.av-motion .av-drawer.open .av-drawer-nav > :nth-child(5) { animation-delay: 0.22s }
  html.av-motion .av-drawer.open .av-drawer-nav > :nth-child(6) { animation-delay: 0.25s }
  html.av-motion .av-drawer.open .av-drawer-nav > :nth-child(n + 7) { animation-delay: 0.28s }
  html.av-motion .av-drawer.open .av-drawer-in > :nth-child(4) { animation-delay: 0.3s }
  html.av-motion .av-drawer.open .av-drawer-in > :nth-child(5) { animation-delay: 0.34s }
  html.av-motion .av-drawer.open .av-drawer-in > :nth-child(6) { animation-delay: 0.38s }
  html.av-motion .av-drawer.open .av-drawer-in > :nth-child(7) { animation-delay: 0.42s }
  html.av-motion .av-drawer.open .av-drawer-in > :nth-child(n + 8) { animation-delay: 0.46s }

  /* 7. add to cart burst and the order-placed leaf shower (made by motion.js) */
  .av-m-burst { position: fixed; width: 0; height: 0; z-index: 65; pointer-events: none }
  .av-m-burst i, .av-m-burst b { position: absolute; left: 0; top: 0; opacity: 0 }
  .av-m-burst i { width: 14px; height: 14px; margin: -7px 0 0 -7px }
  .av-m-burst b { width: 44px; margin: -11px 0 0 -22px; text-align: center; font: 800 15px/22px Manrope, system-ui, sans-serif; color: #B8862E; text-shadow: 0 1px 0 #fff }
  .av-m-burst svg, .av-m-shower svg { display: block; width: 100%; height: 100%; fill: currentColor }
  .av-m-shower { position: fixed; top: 0; right: 0; bottom: 0; left: 0; overflow: hidden; pointer-events: none; z-index: 66 }
  .av-m-shower i { position: absolute; top: 0; opacity: 0 }

  /* 8. order placed: the tick pops in, then the lines rise (store.js fills [data-done]) */
  html.av-motion .av-done > * { animation: av-m-up 0.7s cubic-bezier(0.22, 0.8, 0.24, 1) both }
  html.av-motion .av-done > .av-ok { animation: av-m-ok 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.2) both, av-m-ring 1.4s ease-out 0.5s 2 }
  html.av-motion .av-done > :nth-child(2) { animation-delay: 0.14s }
  html.av-motion .av-done > :nth-child(3) { animation-delay: 0.22s }
  html.av-motion .av-done > :nth-child(4) { animation-delay: 0.3s }
  html.av-motion .av-done > :nth-child(5) { animation-delay: 0.38s }
  html.av-motion .av-done > :nth-child(n + 6) { animation-delay: 0.46s }
  @keyframes av-m-ok { 0% { opacity: 0; transform: scale(0.6) } 60% { opacity: 1; transform: scale(1.06) } 100% { opacity: 1; transform: none } }
  @keyframes av-m-ring { 0% { box-shadow: 0 0 0 0 rgba(184, 134, 46, 0.4) } 100% { box-shadow: 0 0 0 22px rgba(184, 134, 46, 0) } }
}

@media print {
  .av-m-deco, .av-m-burst, .av-m-shower { display: none !important }
  html.av-motion .av-m-wait { opacity: 1 !important; translate: none !important; scale: none !important }
}
