/**
 * Digivayu Theme - Animations Stylesheet
 *
 * Smooth, restrained entrance animations, scroll-triggered visual feedback,
 * staggered delays, floating elements, and accessibility reduced-motion compliance.
 *
 * @package Digivayu
 * @version 1.0.0
 */

/* ==========================================================================
   1. Keyframe Definitions
   ========================================================================== */

/* Fade in with upward motion */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Subtle fade in */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Slide in from the left */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Slide in from the right */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Subtle scale in */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Hero gentle float */
@keyframes gentleFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* Ambient glow pulsation */
@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 15px rgba(128, 174, 232, 0.2);
  }
  50% {
    box-shadow: 0 0 25px rgba(128, 174, 232, 0.45);
  }
}

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

/* ==========================================================================
   2. Scroll-Triggered Animation Classes
   ========================================================================== */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

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

/* Slide In Variations for Scroll */
.animate-on-scroll.slide-left {
  transform: translateX(-24px);
}

.animate-on-scroll.slide-left.visible {
  transform: translateX(0);
}

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

.animate-on-scroll.slide-right.visible {
  transform: translateX(0);
}

.animate-on-scroll.scale-up {
  transform: scale(0.94);
}

.animate-on-scroll.scale-up.visible {
  transform: scale(1);
}

/* ==========================================================================
   3. Stagger Transition Delays
   ========================================================================== */
.animate-delay-1 {
  transition-delay: 0.1s;
  animation-delay: 0.1s;
}

.animate-delay-2 {
  transition-delay: 0.2s;
  animation-delay: 0.2s;
}

.animate-delay-3 {
  transition-delay: 0.3s;
  animation-delay: 0.3s;
}

.animate-delay-4 {
  transition-delay: 0.4s;
  animation-delay: 0.4s;
}

.animate-delay-5 {
  transition-delay: 0.5s;
  animation-delay: 0.5s;
}

.animate-delay-6 {
  transition-delay: 0.6s;
  animation-delay: 0.6s;
}

/* ==========================================================================
   4. Standalone Animation Helper Classes
   ========================================================================== */
.fade-in {
  animation: fadeIn 0.5s ease-in-out forwards;
}

.fade-in-up {
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.float-slow {
  animation: gentleFloat 5s ease-in-out infinite;
}

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

/* ==========================================================================
   5. Reduced Motion Override
   ========================================================================== */
@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;
  }

  .animate-on-scroll {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .float-slow,
  .pulse-glow {
    animation: none !important;
  }
}
