/* ==========================================================================
   MEDITIME — ANIMATIONS
   ========================================================================== */

/* --------------------------------------------------------------------------
   Base scroll-in animation
   Elements with [data-animate] start hidden, become visible when intersected.
   -------------------------------------------------------------------------- */
[data-animate] {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: opacity, transform;
}

[data-animate].visible {
  opacity: 1;
  transform: translateY(0);
}

/* Variant: animate from left */
[data-animate="from-left"] {
  transform: translateX(-32px);
}

[data-animate="from-left"].visible {
  transform: translateX(0);
}

/* Variant: animate from right */
[data-animate="from-right"] {
  transform: translateX(32px);
}

[data-animate="from-right"].visible {
  transform: translateX(0);
}

/* Variant: scale-in */
[data-animate="scale"] {
  transform: scale(0.96);
}

[data-animate="scale"].visible {
  transform: scale(1);
}

/* --------------------------------------------------------------------------
   Hero stagger sequence
   -------------------------------------------------------------------------- */
.hero-content > * {
  opacity: 0;
  transform: translateY(24px);
  animation: hero-fade-up 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.hero-content > *:nth-child(1) { animation-delay: 0.1s; }
.hero-content > *:nth-child(2) { animation-delay: 0.3s; }
.hero-content > *:nth-child(3) { animation-delay: 0.5s; }
.hero-content > *:nth-child(4) { animation-delay: 0.7s; }
.hero-content > *:nth-child(5) { animation-delay: 0.9s; }

.scroll-indicator {
  opacity: 0;
  animation: hero-fade-up 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) 1.1s forwards;
}

@keyframes hero-fade-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Compact hero stagger */
.hero-compact-content > * {
  opacity: 0;
  transform: translateY(16px);
  animation: hero-fade-up 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.hero-compact-content > *:nth-child(1) { animation-delay: 0.15s; }
.hero-compact-content > *:nth-child(2) { animation-delay: 0.3s; }

/* --------------------------------------------------------------------------
   Stagger children (set by JS via [data-stagger])
   -------------------------------------------------------------------------- */
[data-stagger] > * {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

[data-stagger] > *.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  [data-animate] {
    opacity: 1;
    transform: none;
  }

  .marquee-track {
    animation: none;
  }
}
