/* ============================================================================
   Scroll-Triggered Animations
   Used with IntersectionObserver in animations.js
   ============================================================================ */

/* Base animation class — hidden state */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Visible state — triggered by IntersectionObserver */
.animate-on-scroll.animate-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays for grid items */
.animate-on-scroll.delay-1 { transition-delay: 0.1s; }
.animate-on-scroll.delay-2 { transition-delay: 0.2s; }
.animate-on-scroll.delay-3 { transition-delay: 0.3s; }
.animate-on-scroll.delay-4 { transition-delay: 0.4s; }
.animate-on-scroll.delay-5 { transition-delay: 0.5s; }
.animate-on-scroll.delay-6 { transition-delay: 0.6s; }

/* Slide from left */
.animate-slide-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-slide-left.animate-visible {
  opacity: 1;
  transform: translateX(0);
}

/* Slide from right */
.animate-slide-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-slide-right.animate-visible {
  opacity: 1;
  transform: translateX(0);
}

/* Scale in */
.animate-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-scale.animate-visible {
  opacity: 1;
  transform: scale(1);
}

/* Fade in only (no transform) */
.animate-fade {
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-fade.animate-visible {
  opacity: 1;
}

/* Section headers — slight zoom + fade */
.animate-zoom-fade {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-zoom-fade.animate-visible {
  opacity: 1;
  transform: scale(1);
}

/* Reduced motion: skip animations */
@media (prefers-reduced-motion: reduce) {
  .animate-on-scroll,
  .animate-slide-left,
  .animate-slide-right,
  .animate-scale,
  .animate-fade,
  .animate-zoom-fade {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
