/* ============================================================
   IRIDIUM BRIDGE — MOTION
   ============================================================ */

/* Reveal primitive: triggered by IntersectionObserver in motion.js */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur-md) var(--ease-out), transform var(--dur-md) var(--ease-out);
  will-change: opacity, transform;
}
.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur-md) var(--ease-out), transform var(--dur-md) var(--ease-out);
}
.reveal-stagger.is-in > * { opacity: 1; transform: translateY(0); }
.reveal-stagger.is-in > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger.is-in > *:nth-child(2) { transition-delay: 80ms; }
.reveal-stagger.is-in > *:nth-child(3) { transition-delay: 160ms; }
.reveal-stagger.is-in > *:nth-child(4) { transition-delay: 240ms; }
.reveal-stagger.is-in > *:nth-child(5) { transition-delay: 320ms; }
.reveal-stagger.is-in > *:nth-child(6) { transition-delay: 400ms; }
.reveal-stagger.is-in > *:nth-child(7) { transition-delay: 480ms; }
.reveal-stagger.is-in > *:nth-child(8) { transition-delay: 560ms; }
.reveal-stagger.is-in > *:nth-child(9) { transition-delay: 640ms; }

/* Language toggle swap */
body.lang-swapping main { opacity: 0.45; transition: opacity 160ms var(--ease-out); }
body.lang-swapping main * { transition: none !important; }

/* Hero orb pulse on the logo monogram (decorative) */
@keyframes orb-pulse {
  0%, 100% { transform: scale(1); filter: hue-rotate(0deg); }
  50%      { transform: scale(1.04); filter: hue-rotate(8deg); }
}
.orb-pulse { animation: orb-pulse 4800ms var(--ease-in-out) infinite; transform-origin: center; }

/* Page entry global fade (used as the master gate).
   A CSS-only animation fallback ensures the body always becomes visible
   even if JS fails to add `.is-ready` — critical for SEO crawlers and
   First Contentful Paint (Lighthouse NO_FCP). */
body { opacity: 0; animation: body-reveal 240ms var(--ease-out) 600ms forwards; }
body.is-ready { opacity: 1; animation: none; transition: opacity 240ms var(--ease-out); }
@keyframes body-reveal { to { opacity: 1; } }

/* Number count-up uses opacity transition for the unit, motion.js animates the digits */

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
  }
  .reveal, .reveal-stagger > * { opacity: 1 !important; transform: none !important; }
  .hero__title .word > span { transform: none !important; opacity: 1 !important; }
  .hero__bridge-arc path { stroke-dashoffset: 0 !important; }
  .orb-pulse { animation: none !important; }
  /* Ensure page is immediately visible for users who prefer reduced motion */
  body { opacity: 1 !important; animation: none !important; animation-delay: 0ms !important; }
}
