/* =========================================================
   THE LOCAL TEMPERATURE — ANIMATIONS
   ========================================================= */

/* ---------- FILM GRAIN ---------- */
.film-grain { position: relative; }
.film-grain::after {
  content: '';
  position: absolute;
  inset: -10%;
  width: 120%;
  height: 120%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.05;
  pointer-events: none;
  z-index: 1;
  animation: grain 0.6s steps(1) infinite;
}

@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-1%, -2%); }
  20% { transform: translate(-2%, 1%); }
  30% { transform: translate(1%, -1%); }
  40% { transform: translate(-1%, 2%); }
  50% { transform: translate(2%, -1%); }
  60% { transform: translate(-2%, -2%); }
  70% { transform: translate(1%, 2%); }
  80% { transform: translate(-1%, -1%); }
  90% { transform: translate(2%, 1%); }
}

/* ---------- LETTER REVEAL ---------- */
/* (base state rules live in style.css; keyframes/timing helpers below) */

/* ---------- FADE / RISE ---------- */
.fade-up { opacity: 0; transform: translateY(24px); transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out); }
.fade-up.in-view { opacity: 1; transform: translateY(0); }

/* ---------- SCROLL INDICATOR PULSE ---------- */
.scroll-indicator { animation: scrollPulse 2.2s ease-in-out infinite; }
@keyframes scrollPulse {
  0% { opacity: 0.15; transform: translate(-50%, -10px); }
  50% { opacity: 1; transform: translate(-50%, 10px); }
  100% { opacity: 0.15; transform: translate(-50%, -10px); }
}

/* ---------- ULUWATU VIBRANCY — color-cycling divider ---------- */
@keyframes cycleShift {
  0%   { background-position: 0% 0; }
  100% { background-position: 300% 0; }
}

/* ---------- HOMEPAGE HERO — floral petal drift ---------- */
@keyframes petalDrift {
  0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
  25%      { transform: translate(3%, -4%) scale(1.06) rotate(2deg); }
  50%      { transform: translate(-2%, 3%) scale(0.95) rotate(-2deg); }
  75%      { transform: translate(-4%, -2%) scale(1.04) rotate(1deg); }
}

/* ---------- MAP PINS — pulse ---------- */
@keyframes pinPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(200,160,80,0.5); }
  50%      { transform: scale(1.3); box-shadow: 0 0 0 6px rgba(200,160,80,0); }
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .film-grain::after { animation: none; opacity: 0.03; }
  .scroll-indicator { animation: none; }
  .fade-up, .reveal, .letters .letter { transition-duration: 0.01ms !important; }
  .floral-layer .petal { animation: none !important; }
  .rule-cycle { animation: none; background-position: 0 0; }
  .map-pin-dot { animation: none !important; }
  .locked-content { transition-duration: 0.01ms !important; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
