/**
 * EdyunayWorld Animation System
 * Smooth entrance effects, hover micro-interactions, scroll reveals, and reduced motion
 */

/* ==========================================================================
   KEYFRAME ANIMATIONS
   ========================================================================== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInToast {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes subtleFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes pulseSubtle {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.85;
  }
}

/* ==========================================================================
   HERO LOAD REVEAL
   ========================================================================== */
.hero-reveal {
  opacity: 0;
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-reveal-delay-1 {
  animation-delay: 0.15s;
}

.hero-reveal-delay-2 {
  animation-delay: 0.3s;
}

.hero-reveal-delay-3 {
  animation-delay: 0.45s;
}

.hero-visual-float {
  animation: subtleFloat 6s ease-in-out infinite;
}

/* ==========================================================================
   SCROLL REVEAL UTILITIES (Triggered by IntersectionObserver in JS)
   ========================================================================== */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered Child Reveal */
.stagger-children > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.stagger-children.is-revealed > *:nth-child(1) { transition-delay: 0.05s; opacity: 1; transform: translateY(0); }
.stagger-children.is-revealed > *:nth-child(2) { transition-delay: 0.15s; opacity: 1; transform: translateY(0); }
.stagger-children.is-revealed > *:nth-child(3) { transition-delay: 0.25s; opacity: 1; transform: translateY(0); }
.stagger-children.is-revealed > *:nth-child(4) { transition-delay: 0.35s; opacity: 1; transform: translateY(0); }
.stagger-children.is-revealed > *:nth-child(5) { transition-delay: 0.45s; opacity: 1; transform: translateY(0); }
.stagger-children.is-revealed > *:nth-child(6) { transition-delay: 0.55s; opacity: 1; transform: translateY(0); }
.stagger-children.is-revealed > *:nth-child(7) { transition-delay: 0.65s; opacity: 1; transform: translateY(0); }
.stagger-children.is-revealed > *:nth-child(8) { transition-delay: 0.75s; opacity: 1; transform: translateY(0); }

/* ==========================================================================
   PREFERS REDUCED MOTION (Accessibility requirement)
   ========================================================================== */
@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;
  }

  .reveal-on-scroll,
  .stagger-children > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .hero-reveal {
    opacity: 1 !important;
    animation: none !important;
  }

  .hero-visual-float {
    animation: none !important;
  }
}
