/* ══════════════════════════════════════════════════════════════════
   animations.css · motion library
   Orchestrated load, scroll reveals, 3D micro-interactions
   ══════════════════════════════════════════════════════════════════ */

/* ── Keyframes ─────────────────────────────────────────────────── */
@keyframes float-slow   { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-16px) } }
@keyframes spin-slow    { to { transform: rotate(360deg) } }
@keyframes spin-rev     { to { transform: rotate(-360deg) } }
@keyframes pulse-dot    { 0%,100% { opacity:1; transform:scale(1) } 50% { opacity:.45; transform:scale(.7) } }
@keyframes shimmer      { 0% { background-position: -200% 0 } 100% { background-position: 200% 0 } }
@keyframes glow-breathe { 0%,100% { opacity:.55 } 50% { opacity:1 } }
@keyframes rise-fade    { from { opacity:0; transform: translateY(40px) } to { opacity:1; transform:none } }
@keyframes scale-in     { from { opacity:0; transform: scale(.9) } to { opacity:1; transform:none } }
@keyframes loader-sweep { 0% { left:-40% } 100% { left:100% } }

/* facet assemble — the 3D pieces snap into place on load */
@keyframes facet-in {
  from { opacity:0; transform: translate3d(0,30px,-120px) rotateX(40deg); filter: blur(8px); }
  to   { opacity:1; transform: none; filter: none; }
}

/* ── Page-load orchestration ───────────────────────────────────── */
.load-seq > * { opacity: 0; animation: rise-fade 0.9s var(--ease) forwards; }
.load-seq > *:nth-child(1) { animation-delay: 0.15s; }
.load-seq > *:nth-child(2) { animation-delay: 0.30s; }
.load-seq > *:nth-child(3) { animation-delay: 0.45s; }
.load-seq > *:nth-child(4) { animation-delay: 0.60s; }
.load-seq > *:nth-child(5) { animation-delay: 0.75s; }

/* ── Scroll reveal (driven by IntersectionObserver in ui.js) ───── */
.reveal {
  opacity: 0;
  transform: translateY(46px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  will-change: opacity, transform;
}
.reveal.visible { opacity: 1; transform: none; }
.reveal-delay-1.visible { transition-delay: 0.10s; }
.reveal-delay-2.visible { transition-delay: 0.20s; }
.reveal-delay-3.visible { transition-delay: 0.30s; }
.reveal-delay-4.visible { transition-delay: 0.40s; }

/* ── 3D tilt micro-interaction (cards) ─────────────────────────── */
.tilt {
  transform-style: preserve-3d;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

/* ── Ambient floating geometry ─────────────────────────────────── */
.float   { animation: float-slow 7s ease-in-out infinite; }
.float-2 { animation: float-slow 9s ease-in-out infinite reverse; }

/* ══════════════════════════════════════════════════════════════
   Reduced motion — honour the OS setting everywhere
   ══════════════════════════════════════════════════════════════ */
@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;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
  .load-seq > * { opacity: 1 !important; }
}
