/* VanillaTiers Store — Studio Motion Choreography
   60fps GPU-composited spring physics, scroll reveals, hero timeline, fluid modals, reduced-motion safe. */

@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 0.22s; }

/* ---------- Keyframes ---------- */
@keyframes pulse-ring {
  0% { transform: scale(0.85); opacity: 0.7; }
  70% { transform: scale(2.15); opacity: 0; }
  100% { transform: scale(2.15); opacity: 0; }
}

@keyframes rail-progress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes sweep-gleam {
  0%, 72% { transform: translateX(-130%); }
  100% { transform: translateX(130%); }
}

@keyframes eq-bars {
  0%, 100% { transform: scaleY(0.32); }
  50% { transform: scaleY(1); }
}

@keyframes hero-enter {
  from {
    opacity: 0;
    transform: translateY(14px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

@keyframes stage-swap {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes shelf-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes bump {
  0% { transform: scale(1); }
  45% { transform: scale(1.28); }
  100% { transform: scale(1); }
}

@keyframes qty-tick {
  0% { transform: scale(0.82); opacity: 0.5; }
  65% { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes modal-out {
  from {
    opacity: 1;
    transform: none;
  }
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

@keyframes drawer-in {
  from {
    opacity: 0;
    transform: translateX(32px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes drawer-out {
  from {
    opacity: 1;
    transform: none;
  }
  to {
    opacity: 0;
    transform: translateX(28px);
  }
}

@keyframes toast-life {
  0% { opacity: 0; transform: translateY(12px) scale(0.96); }
  8%, 88% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(6px) scale(0.98); }
}

/* ---------- Hero Immediate Staggered Entrance ---------- */
.hero-head__left { animation: hero-enter 0.6s var(--spring) both; }
.hero-stats { animation: hero-enter 0.6s var(--spring) 0.08s both; }
.hero-carousel-wrap { animation: hero-enter 0.72s var(--spring) 0.12s both; }
.page-head { animation: hero-enter 0.55s var(--spring) both; }
.filter-bar { animation: hero-enter 0.55s var(--spring) 0.08s both; }

/* Stage text cross-swap on clip switch */
.stage__copy.is-swapping { animation: stage-swap 0.38s var(--spring) both; }

/* Shelf filter transition & cosmetic toggle wave */
.sec-block.is-entering,
.picks__grid.is-entering,
.clip-row.is-entering { animation: shelf-in 0.34s var(--spring) both; }
.picks__grid.is-entering > *,
.clip-row.is-entering > * {
  animation: shelf-in 0.42s var(--spring) both;
}
.picks__grid.is-entering > :nth-child(2),
.clip-row.is-entering > :nth-child(2) { animation-delay: 45ms; }
.picks__grid.is-entering > :nth-child(3),
.clip-row.is-entering > :nth-child(3) { animation-delay: 90ms; }
.picks__grid.is-entering > :nth-child(4),
.clip-row.is-entering > :nth-child(4) { animation-delay: 135ms; }

/* ---------- Scroll-Triggered Staggered Reveal ---------- */
html.has-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.58s var(--spring),
    transform 0.58s var(--spring);
  transition-delay: var(--delay, 0ms);
}
html.has-reveal [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* ---------- Micro-Interaction Feedback ---------- */
.bag__n.bump { animation: bump 0.34s var(--spring); }
.qty__n.tick { animation: qty-tick 0.24s var(--spring); }

/* Smooth native CSS accordion disclosure */
:root { interpolate-size: allow-keywords; }
.faq details::details-content {
  height: 0;
  overflow: clip;
  transition: height 0.28s var(--spring), content-visibility 0.28s allow-discrete;
}
.faq details[open]::details-content { height: auto; }

/* ---------- Respect Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.has-reveal [data-reveal] { opacity: 1 !important; transform: none !important; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
