/* ==========================================================================
   AVAND Coffee Roasters — GPU-Accelerated Editorial Motion System
   Transforms & Opacity Only | Mobile-Light | Full prefers-reduced-motion
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Live Batch Pulse Indicator
   -------------------------------------------------------------------------- */
@keyframes av-live-pulse {
  0% {
    transform: scale(0.95);
    opacity: 0.85;
  }
  70% {
    transform: scale(1.95);
    opacity: 0;
  }
  100% {
    transform: scale(1.95);
    opacity: 0;
  }
}

.av-live-dot::after {
  animation: av-live-pulse 2.4s var(--ease-editorial) infinite;
  will-change: transform, opacity;
}

/* --------------------------------------------------------------------------
   2. Staggered Scroll Reveals (.reveal-on-scroll)
   -------------------------------------------------------------------------- */
.reveal-on-scroll {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  transition:
    opacity var(--dur-slow) var(--ease-editorial),
    transform var(--dur-slow) var(--ease-editorial);
  will-change: opacity, transform;
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  will-change: auto;
}

.reveal-delay-1 {
  transition-delay: 75ms;
}

.reveal-delay-2 {
  transition-delay: 150ms;
}

.reveal-delay-3 {
  transition-delay: 225ms;
}

.reveal-delay-4 {
  transition-delay: 300ms;
}

/* --------------------------------------------------------------------------
   3. Horizontal Hairline Drawing (.hairline-draw, RTL Right-to-Left)
   -------------------------------------------------------------------------- */
.hairline-draw {
  transform-origin: right center;
  transform: scaleX(0);
  transition: transform 720ms var(--ease-editorial);
  will-change: transform;
}

.hairline-draw.is-visible {
  transform: scaleX(1);
  will-change: auto;
}

/* --------------------------------------------------------------------------
   4. Mega-Menu Column Stagger Entrance
   -------------------------------------------------------------------------- */
.av-megamenu .av-megamenu__col,
.av-megamenu .av-megamenu__card {
  opacity: 0;
  transform: translate3d(0, 10px, 0);
  transition:
    opacity 280ms var(--ease-editorial),
    transform 340ms var(--ease-editorial);
}

.av-megamenu.is-open .av-megamenu__col,
.av-megamenu.is-open .av-megamenu__card {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.av-megamenu.is-open .av-megamenu__col:nth-child(1) {
  transition-delay: 40ms;
}

.av-megamenu.is-open .av-megamenu__col:nth-child(2) {
  transition-delay: 80ms;
}

.av-megamenu.is-open .av-megamenu__col:nth-child(3) {
  transition-delay: 120ms;
}

.av-megamenu.is-open .av-megamenu__col:nth-child(4) {
  transition-delay: 160ms;
}

.av-megamenu.is-open .av-megamenu__card {
  transition-delay: 140ms;
}

/* --------------------------------------------------------------------------
   5. Badge Pop Micro-Interaction (Cart / Wishlist Update)
   -------------------------------------------------------------------------- */
@keyframes av-badge-bump {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.24);
  }
  100% {
    transform: scale(1);
  }
}

.av-tool-badge.is-bumped {
  animation: av-badge-bump 320ms var(--ease-snappy);
}

/* --------------------------------------------------------------------------
   6. Editorial Card & Link Micro-Interactions (Hover-Capable Devices Only)
   -------------------------------------------------------------------------- */
.av-card-motion {
  transition:
    transform var(--dur-med) var(--ease-editorial),
    border-color var(--dur-fast) var(--ease-editorial);
}

.av-card-motion img {
  transition: transform var(--dur-slow) var(--ease-editorial);
}

.av-link-sweep {
  position: relative;
}

.av-link-sweep::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background-color: currentColor;
  transform-origin: right center;
  transform: scaleX(0);
  transition: transform var(--dur-med) var(--ease-editorial);
}

@media (hover: hover) and (pointer: fine) {
  .av-card-motion:hover {
    transform: translate3d(0, -4px, 0);
  }

  .av-card-motion:hover img {
    transform: scale(1.035);
  }

  .av-link-sweep:hover::after {
    transform: scaleX(1);
  }

  .av-btn:active {
    transform: translate3d(0, 1px, 0);
  }
}

/* Lighter Reveal Travel on Small Mobile Screens */
@media (max-width: 639px) {
  .reveal-on-scroll {
    transform: translate3d(0, 14px, 0);
    transition-duration: 380ms;
  }
}

/* --------------------------------------------------------------------------
   7. Strict Accessibility: Reduced Motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }

  .reveal-on-scroll,
  .hairline-draw,
  .av-megamenu .av-megamenu__col,
  .av-megamenu .av-megamenu__card {
    opacity: 1 !important;
    transform: none !important;
  }
}


/* ==========================================================================
   STEP 6 — Hero Slider, Quick-Buy Pill, Card Entrance & Accordion Motion
   ========================================================================== */

/* --------------------------------------------------------------------------
   8. Cinematic Hero: clip-path reveal (right-to-left) + Ken-Burns settle
   -------------------------------------------------------------------------- */
@keyframes av-hero-reveal {
  from {
    clip-path: inset(0 0 0 100%);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

@keyframes av-hero-settle {
  from {
    transform: scale3d(1.08, 1.08, 1);
  }
  to {
    transform: scale3d(1, 1, 1);
  }
}

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

.av-hero__slide.is-active .av-hero__media {
  animation: av-hero-reveal 900ms var(--ease-editorial) both;
}

.av-hero__slide.is-active .av-hero__media img {
  animation: av-hero-settle 6800ms var(--ease-editorial) both;
  will-change: transform;
}

.av-hero__content > * {
  opacity: 0;
  transform: translate3d(28px, 0, 0);
  transition:
    opacity 520ms var(--ease-editorial),
    transform 640ms var(--ease-editorial);
}

.av-hero__slide.is-active .av-hero__content > * {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.av-hero__slide.is-active .av-hero__content > *:nth-child(1) {
  transition-delay: 220ms;
}

.av-hero__slide.is-active .av-hero__content > *:nth-child(2) {
  transition-delay: 320ms;
}

.av-hero__slide.is-active .av-hero__content > *:nth-child(3) {
  transition-delay: 420ms;
}

/* --------------------------------------------------------------------------
   9. Quick-Buy Pill Swap
   -------------------------------------------------------------------------- */
@keyframes av-pill-swap {
  from {
    opacity: 0;
    transform: translate3d(0, 10px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.av-hero__pill.is-swapping {
  animation: av-pill-swap 460ms var(--ease-editorial) both;
}

/* --------------------------------------------------------------------------
   10. Shop Card Entrance (filter / sort changes)
   -------------------------------------------------------------------------- */
@keyframes av-card-enter {
  from {
    opacity: 0;
    transform: translate3d(0, 14px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* --------------------------------------------------------------------------
   11. Step-6 Reduced Motion Safeguards
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .av-hero__content > *,
  .av-faq__panel-inner {
    transform: none !important;
  }

  .av-hero__slide.is-active .av-hero__media,
  .av-hero__slide.is-active .av-hero__media img {
    animation: none !important;
    clip-path: none !important;
  }
}
