/* =============================================================
   Kathmandu Dairy - Animation Stylesheet
   ============================================================= */

/* ----- Data Attribute Animation Defaults ----- */
[data-animate] {
  opacity: 0;
  will-change: transform, opacity;
}

[data-animate].animated {
  opacity: 1;
}

/* Fade Up */
[data-animate="fade-up"] {
  transform: translateY(40px);
}

[data-animate="fade-up"].animated {
  transform: translateY(0);
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Fade Down */
[data-animate="fade-down"] {
  transform: translateY(-40px);
}

[data-animate="fade-down"].animated {
  transform: translateY(0);
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Fade Left */
[data-animate="fade-left"] {
  transform: translateX(-40px);
}

[data-animate="fade-left"].animated {
  transform: translateX(0);
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Fade Right */
[data-animate="fade-right"] {
  transform: translateX(40px);
}

[data-animate="fade-right"].animated {
  transform: translateX(0);
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Zoom In */
[data-animate="zoom"] {
  transform: scale(0.85);
}

[data-animate="zoom"].animated {
  transform: scale(1);
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scale Up */
[data-animate="scale-up"] {
  transform: scale(0.7);
}

[data-animate="scale-up"].animated {
  transform: scale(1);
  transition: transform 1s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reveal - Clip Path */
[data-animate="reveal"] {
  clip-path: inset(0 100% 0 0);
  opacity: 1;
}

[data-animate="reveal"].animated {
  clip-path: inset(0 0 0 0);
  transition: clip-path 1.2s cubic-bezier(0.77, 0, 0.18, 1);
}

/* Mask Reveal */
[data-animate="mask-reveal"] {
  clip-path: inset(0 0 100% 0);
  opacity: 1;
}

[data-animate="mask-reveal"].animated {
  clip-path: inset(0 0 0 0);
  transition: clip-path 1.4s cubic-bezier(0.77, 0, 0.18, 1);
}

/* ----- Stagger Children ----- */
[data-stagger] > * {
  opacity: 0;
  transform: translateY(30px);
}

[data-stagger].staggered > * {
  opacity: 1;
  transform: translateY(0);
}

/* ----- Parallax ----- */
[data-parallax] {
  will-change: transform;
}

/* ----- Counter ----- */
[data-counter] {
  opacity: 0;
}

[data-counter].counting {
  opacity: 1;
}

/* ----- Split Text Lines ----- */
[data-split-text] .line {
  overflow: hidden;
}

[data-split-text] .line div {
  transform: translateY(100%);
}

[data-split-text].revealed .line div {
  transform: translateY(0);
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ----- Hero Cinematic Scale-In ----- */
@keyframes cinematicScale {
  0% {
    transform: scale(1.3);
    opacity: 0;
  }
  100% {
    transform: scale(1.1);
    opacity: 1;
  }
}

.hero-scale-in {
  animation: cinematicScale 2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ----- Hero Content Fade In ----- */
@keyframes heroContentFade {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-content-fade {
  animation: heroContentFade 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ----- Gradient Animation ----- */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.animate-gradient {
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
}

/* ----- Pulsing Glow ----- */
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(212, 168, 83, 0.2); }
  50% { box-shadow: 0 0 40px rgba(212, 168, 83, 0.4); }
}

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

/* ----- Floating Animation (base) ----- */
@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33% { transform: translateY(-15px) rotate(1deg); }
  66% { transform: translateY(8px) rotate(-0.5deg); }
}

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

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

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

/* ----- Light Ray Animation ----- */
@keyframes lightRay {
  0% { transform: translateX(-100%) rotate(15deg); opacity: 0; }
  20% { opacity: 0.1; }
  80% { opacity: 0.05; }
  100% { transform: translateX(200%) rotate(15deg); opacity: 0; }
}

.light-ray {
  animation: lightRay 8s ease-in-out infinite;
}

/* ----- Spin ----- */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =============================================================
   REDUCED MOTION
   ============================================================= */
@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;
  }

  [data-animate] {
    opacity: 1;
    transform: none !important;
    clip-path: none !important;
  }

  [data-animate="reveal"],
  [data-animate="mask-reveal"] {
    clip-path: none !important;
  }

  [data-stagger] > * {
    opacity: 1;
    transform: none !important;
  }

  [data-parallax] {
    transform: none !important;
  }

  [data-split-text] .line div {
    transform: none !important;
  }

  .hero-scale-in {
    animation: none;
    transform: scale(1);
    opacity: 1;
  }

  .hero-content-fade {
    animation: none;
    opacity: 1;
    transform: none;
  }
}
