/* ============================================
   ANIMATIONS
   Scroll-triggered, keyframes, reduced-motion
   ============================================ */

/* --- Scroll-triggered animation base --- */
.animate-on-scroll {
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: none;
}

/* Direction variants */
.fade-up {
  transform: translateY(40px);
}

.fade-down {
  transform: translateY(-20px);
}

.fade-left {
  transform: translateX(-40px);
}

.fade-right {
  transform: translateX(40px);
}

.scale-in {
  transform: scale(0.95);
}

/* --- Stagger delays --- */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }

/* --- Hero entrance animation (CSS-driven, plays on load) --- */
.hero-animate {
  opacity: 0;
  transform: translateY(30px);
  animation: heroEntrance 0.8s ease forwards;
}

.hero-animate:nth-child(1) { animation-delay: 0s; }
.hero-animate:nth-child(2) { animation-delay: 0.15s; }
.hero-animate:nth-child(3) { animation-delay: 0.3s; }
.hero-animate:nth-child(4) { animation-delay: 0.45s; }
.hero-animate:nth-child(5) { animation-delay: 0.6s; }
.hero-animate:nth-child(6) { animation-delay: 0.75s; }

@keyframes heroEntrance {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Utility keyframes --- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-100%); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  .animate-on-scroll {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

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

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