/* ==========================================================================
   ANIMATIONS - AKA Plumbing Spark Theme
   Keyframes and scroll-triggered animation utilities
   ========================================================================== */

/* --- Keyframes --- */

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

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

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

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

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

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px hsl(15 100% 53% / 0.3); }
  50% { box-shadow: 0 0 40px hsl(15 100% 53% / 0.5); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* --- Scroll-triggered animation classes --- */

.animate-on-scroll {
  opacity: 0;
  transition-property: opacity, transform;
  transition-duration: 0.6s;
  transition-timing-function: cubic-bezier(0.16, 1, 0.32, 1);
}

.animate-on-scroll.fade-in {
  transform: translateY(20px);
}

.animate-on-scroll.fade-in-up {
  transform: translateY(30px);
  transition-duration: 0.8s;
}

.animate-on-scroll.slide-in-left {
  transform: translateX(-30px);
}

.animate-on-scroll.slide-in-right {
  transform: translateX(30px);
}

.animate-on-scroll.scale-in {
  transform: scale(0.9);
  transition-duration: 0.5s;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0) translateX(0) scale(1);
}

/* --- Continuous animations --- */

.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animate-bounce-soft {
  animation: bounceSoft 2s ease-in-out infinite;
}

.animate-pulse-glow {
  animation: pulseGlow 2s ease-in-out infinite;
}

.animate-shimmer {
  animation: shimmer 2s linear infinite;
}

/* --- Reduced motion --- */

@media (prefers-reduced-motion: reduce) {
  .animate-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .animate-float,
  .animate-bounce-soft,
  .animate-pulse-glow,
  .animate-shimmer,
  .hero-orb,
  .scroll-indicator svg {
    animation: none;
  }
}
