/* ==========================================================================
   Olosho — Animations
   Entrance reveals are progressive enhancements. Elements are only hidden
   once app.js has confirmed it can observe them (it adds `.reveal-ready`).
   Without JS — or if app.js fails to load — every element stays visible.
   ========================================================================== */

.reveal-ready [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  transition:
    opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.reveal-ready [data-reveal="fade-in"]  { transform: none; }
.reveal-ready [data-reveal="scale-in"] { transform: scale(.94); }
.reveal-ready [data-reveal="left"]     { transform: translate3d(-24px, 0, 0); }
.reveal-ready [data-reveal="right"]    { transform: translate3d(24px, 0, 0); }

.reveal-ready [data-reveal].is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  will-change: auto;
}

/* Hero phone mockup gentle float. `--float-base` lets an element keep its
   own static transform (e.g. the fanned side screens) while it drifts. */
@keyframes floaty {
  0%, 100% { transform: var(--float-base, translate3d(0, 0, 0)); }
  50%      { transform: var(--float-base, translate3d(0, 0, 0)) translate3d(0, -10px, 0); }
}
.floaty { animation: floaty 6s var(--ease-in-out) infinite; }
.floaty--slow { animation-duration: 8.5s; }

/* Aurora glow slowly breathes behind the hero. */
@keyframes aurora-drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to   { transform: translate3d(3%, 2%, 0) scale(1.08); }
}

/* Pointer-tracked tilt on feature tiles (set by app.js). */
.bento__tile[data-tilt] { will-change: transform; }

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(31,157,107,.5); }
  70%      { box-shadow: 0 0 0 8px rgba(31,157,107,0); }
}
.phone-float .dot { animation: pulse-dot 2.4s var(--ease-out) infinite; }

/* ---- Counters (numbers animate up to their target once on screen) ---- */
.counter { display: inline-block; font-variant-numeric: tabular-nums; }

/* ---- Cards keep a gentle lift while they are revealed ----------------- */
.reveal-ready .card[data-reveal].is-visible { will-change: auto; }

/* ---- Leaderboard bars ease to each new value when the filter changes -- */
.bar-fill { transition: width var(--dur-slow) var(--ease-out), background-color var(--dur) var(--ease-out); }

/* ---- The world map fades in once its local vector asset has mounted --- */
@keyframes map-in { from { opacity: 0; } to { opacity: 1; } }
.map-stage.is-ready .world-svg { animation: map-in var(--dur-slow) var(--ease-out) both; }

/* ---- Map paths tint smoothly, never as fake activity ------------------ */
.world-svg .geo { transition: fill var(--dur) var(--ease-out), stroke var(--dur) var(--ease-out); }

/* Respect users who prefer less motion: keep content, drop movement. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal-ready [data-reveal] { opacity: 1 !important; transform: none !important; }
  .floaty { animation: none !important; }
  .hero .aurora { animation: none !important; }
  .bento__tile[data-tilt] { transform: none !important; }
}
