/* ========================================
   AZULA BADU — Animations
   ======================================== */

/* ---- Scroll Reveal Animations ---- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s var(--ease-smooth), transform 0.9s var(--ease-smooth);
}

.reveal--left {
  transform: translateX(-24px);
}

.reveal--right {
  transform: translateX(24px);
}

.reveal--scale {
  transform: scale(0.97);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Stagger delay for grid items */
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ---- Fade In/Out ---- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

/* ---- Floating Particles (for secret page) ---- */
@keyframes floatUp {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0);
  }
  10% {
    opacity: 1;
    transform: scale(1);
  }
  90% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-100vh) scale(0.5);
  }
}

.particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.particle {
  position: absolute;
  bottom: -10px;
  width: 3px;
  height: 3px;
  background: var(--gold);
  border-radius: 50%;
  animation: floatUp linear infinite;
  opacity: 0;
}

.particle:nth-child(1) { left: 10%; animation-duration: 12s; animation-delay: 0s; }
.particle:nth-child(2) { left: 25%; animation-duration: 15s; animation-delay: 2s; }
.particle:nth-child(3) { left: 40%; animation-duration: 11s; animation-delay: 4s; }
.particle:nth-child(4) { left: 55%; animation-duration: 14s; animation-delay: 1s; }
.particle:nth-child(5) { left: 70%; animation-duration: 13s; animation-delay: 3s; }
.particle:nth-child(6) { left: 85%; animation-duration: 16s; animation-delay: 5s; }
.particle:nth-child(7) { left: 15%; animation-duration: 10s; animation-delay: 6s; width: 2px; height: 2px; }
.particle:nth-child(8) { left: 60%; animation-duration: 17s; animation-delay: 7s; width: 2px; height: 2px; }
.particle:nth-child(9) { left: 80%; animation-duration: 12s; animation-delay: 8s; width: 4px; height: 4px; }
.particle:nth-child(10) { left: 35%; animation-duration: 14s; animation-delay: 9s; }

/* ---- Scroll Down Indicator ---- */
@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(10px); opacity: 1; }
}

/* scroll-indicator styles moved to index.css */

/* ---- Pulse Glow (for tiki) ---- */
@keyframes pulseGlow {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(201, 168, 76, 0)); }
  50% { filter: drop-shadow(0 0 8px rgba(201, 168, 76, 0.4)); }
}

/* ---- Shake (error feedback) ---- */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

.shake {
  animation: shake 0.5s ease-in-out;
}

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

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(201, 168, 76, 0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ---- Compass Ship-Sway Animation ---- */
@keyframes compassSearch {
  0%    { transform: rotate(0deg); }
  25%   { transform: rotate(10deg); }
  50%   { transform: rotate(-3deg); }
  75%   { transform: rotate(-10deg); }
  87.5% { transform: rotate(3deg); }
  100%  { transform: rotate(0deg); }
}

@keyframes compassGlow {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(201,168,76,0.35)); }
  50%       { filter: drop-shadow(0 0 22px rgba(201,168,76,0.7)); }
}

.compass-animated {
  animation:
    compassSearch 18s ease-in-out infinite,
    compassGlow   9s ease-in-out infinite;
  transform-origin: center center;
  display: block;
}

/* ---- Reduce motion for accessibility ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  html {
    scroll-behavior: auto;
  }
}
