/* ==========================================================================
   animations.css — keyframes, preloader, reveal states, reduced motion
   ========================================================================== */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ping { 0% { transform: scale(0.6); opacity: 0.9; } 80%, 100% { transform: scale(1.8); opacity: 0; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes ring { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.85); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.1); } }
@keyframes pop { 0% { transform: scale(0.5); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes floaty { 0%, 100% { transform: translateY(-50%) translateZ(0); } 50% { transform: translateY(calc(-50% - 14px)); } }

/* Preloader — only rendered when <html> has .ws-intro (first visit in this tab) */
.preloader { display: none; }
.ws-intro .preloader { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: radial-gradient(700px 500px at 50% 45%, #0b1a42 0%, #040915 70%); transition: opacity 0.7s var(--ease), visibility 0s linear 0.7s; }
.ws-intro.is-loaded .preloader { opacity: 0; visibility: hidden; }
.preloader__inner { display: grid; justify-items: center; gap: 14px; }
.preloader__mark { width: 120px; height: 80px; overflow: visible; filter: drop-shadow(0 0 24px rgba(61, 139, 255, 0.55)); }
.preloader__path { stroke-dasharray: 260; stroke-dashoffset: 260; animation: draw 1.1s var(--ease) forwards; }
.preloader__path--s { animation-delay: 0.25s; }
.preloader__brand { font-family: var(--font-display); font-weight: 600; font-size: 1rem; letter-spacing: 0.02em; color: #fff; margin: 6px 0 0; opacity: 0; animation: pop 0.6s var(--ease) 0.5s forwards; }
.preloader__brand span { color: var(--blue-400); font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase; margin-left: 6px; }
.preloader__bar { width: 180px; height: 2px; border-radius: 2px; background: rgba(124, 172, 255, 0.15); overflow: hidden; }
.preloader__bar span { display: block; height: 100%; width: 0; background: var(--grad); box-shadow: 0 0 12px rgba(61, 139, 255, 0.8); transition: width 0.3s var(--ease); }
.preloader__pct { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-3); margin: 0; letter-spacing: 0.1em; }
.ws-intro:not(.is-loaded) body { overflow: hidden; }

/* Reveal-on-scroll initial states (only when JS + motion are available) */
.js.motion-ok [data-reveal] { opacity: 0; transform: translateY(28px); }
.js.motion-ok [data-reveal="media"] { opacity: 0; transform: translateY(40px) scale(0.97); }
.js.motion-ok [data-hero-reveal], .js.motion-ok [data-hero-line] { opacity: 0; }
.js.motion-ok [data-reveal].is-in, .js.motion-ok [data-hero-reveal].is-in, .js.motion-ok [data-hero-line].is-in { opacity: 1; transform: none; transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
/* Safety net: if animation scripts fail, never leave content invisible */
.js.reveal-fallback [data-reveal], .js.reveal-fallback [data-hero-reveal], .js.reveal-fallback [data-hero-line] { opacity: 1 !important; transform: none !important; }

/* Tilt */
[data-tilt] { transform-style: preserve-3d; will-change: transform; }

/* Hero fallback float when no WebGL */
.hero:not(.is-3d) .hero__fallback { animation: floaty 7s ease-in-out infinite; }

/* Reduced motion: no animation, everything visible, static 3D fallback */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  html { scroll-behavior: auto; }
  [data-reveal], [data-hero-reveal], [data-hero-line] { opacity: 1 !important; transform: none !important; }
  .hero__fallback { animation: none !important; }
  .cta__rings { display: none; }
}
