/* =====================================================================
   SUMIRAN — Animations
   Smooth, tasteful, respects prefers-reduced-motion.
   ===================================================================== */

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

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

@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes ripple-anim {
  to {
    transform: scale(3.5);
    opacity: 0;
  }
}

@keyframes preloader-slide {
  0% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(120%);
  }
  100% {
    transform: translateX(-100%);
  }
}

@keyframes spin-slow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes flicker {
  0%,
  100% {
    transform: scaleY(1) rotate(-1deg);
    opacity: 1;
  }
  50% {
    transform: scaleY(1.08) rotate(2deg);
    opacity: 0.9;
  }
}

@keyframes floatPetal {
  0% {
    transform: translate3d(0, -10vh, 0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.85;
  }
  90% {
    opacity: 0.7;
  }
  100% {
    transform: translate3d(30px, 110vh, 0) rotate(340deg);
    opacity: 0;
  }
}

@keyframes glowPulse {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(212, 160, 23, 0);
  }
  50% {
    box-shadow: 0 0 28px rgba(212, 160, 23, 0.45);
  }
}

@keyframes raySway {
  0%,
  100% {
    transform: rotate(0deg);
    opacity: 0.35;
  }
  50% {
    transform: rotate(3deg);
    opacity: 0.55;
  }
}

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

@keyframes featherSway {
  0%,
  100% {
    transform: rotate(-3deg) translateY(0);
  }
  50% {
    transform: rotate(3deg) translateY(-6px);
  }
}

/* ---------------- Utility animation classes (triggered via IntersectionObserver) ---------------- */
/* .reveal {
  opacity: 0;
}
.reveal.in-view.fade-up {
  animation: fadeUp 0.8s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}
.reveal.in-view.fade-in {
  animation: fadeIn 0.9s ease forwards;
}
.reveal.in-view.fade-down {
  animation: fadeDown 0.8s ease forwards;
}
.reveal.in-view.zoom-in {
  animation: zoomIn 0.8s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}

.reveal.stagger.in-view > * {
  animation: fadeUp 0.7s ease forwards;
  opacity: 0;
}
.reveal.stagger.in-view > *:nth-child(1) {
  animation-delay: 0.05s;
}
.reveal.stagger.in-view > *:nth-child(2) {
  animation-delay: 0.15s;
}
.reveal.stagger.in-view > *:nth-child(3) {
  animation-delay: 0.25s;
}
.reveal.stagger.in-view > *:nth-child(4) {
  animation-delay: 0.35s;
}
.reveal.stagger.in-view > *:nth-child(5) {
  animation-delay: 0.45s;
}
.reveal.stagger.in-view > *:nth-child(6) {
  animation-delay: 0.55s;
} */

/* ---------------- Preloader elements ---------------- */
.preloader-mandala {
  animation: spin-slow 6s linear infinite;
}
.diya-flame {
  animation: flicker 1.4s ease-in-out infinite;
  transform-origin: bottom center;
}

/* ---------------- Floating petals / particles ---------------- */
.petal-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  overflow: hidden;
}
.petal {
  position: absolute;
  top: -5vh;
  width: 14px;
  height: 14px;
  border-radius: 0 60% 0 60%;
  background: linear-gradient(
    135deg,
    var(--saffron, #f57c00),
    var(--gold, #d4a017)
  );
  animation-name: floatPetal;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  opacity: 0.7;
}

.hero-particles span {
  animation: bob 3.5s ease-in-out infinite;
}
.hero-rays {
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 224, 130, 0.18) 0deg 6deg,
    transparent 6deg 18deg
  );
  animation: raySway 12s ease-in-out infinite;
}

/* ---------------- Glow effects ---------------- */
.glow-hover:hover {
  animation: glowPulse 1.6s ease-in-out infinite;
}
.quote-slide.active .quote-hi {
  animation: glowPulse 3s ease-in-out infinite;
  border-radius: 8px;
}

/* ---------------- Peacock feather decorative element ---------------- */
.feather-deco {
  animation: featherSway 5s ease-in-out infinite;
  transform-origin: bottom center;
}

/* ---------------- Counter number pop ---------------- */
.counter-item.in-view .num {
  animation: zoomIn 0.6s ease forwards;
}

/* ---------------- Navbar / back-to-top transitions already in style.css ---------------- */

/* ---------------- Reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1 !important;
  }
  .petal-layer {
    display: none;
  }
}
