/* ============================================================
   GPAI — motion layer
   Restrained but noticeable engineering-grade animation.
   Honors prefers-reduced-motion (disabled at bottom).
   ============================================================ */

:root{ --ease:cubic-bezier(.22,.61,.36,1) }

/* ---------- theme switcher ---------- */
.theme-switch{position:fixed;right:18px;bottom:18px;z-index:115;display:flex;align-items:center;gap:3px;
  padding:5px 6px 5px 11px;border:1px solid var(--line);border-radius:100px;
  background:rgba(10,14,18,.72);backdrop-filter:blur(12px)}
.ts-label{font-family:var(--mono);font-size:9px;letter-spacing:.16em;color:var(--ink-3);margin-right:7px}
.theme-switch button{width:24px;height:24px;border:0;border-radius:50%;background:transparent;
  color:var(--ink-2);font-family:var(--mono);font-size:11px;cursor:pointer;transition:.2s}
.theme-switch button:hover{color:var(--ink)}
.theme-switch button.on{background:var(--brand);color:#fff;box-shadow:0 0 12px rgba(11,156,148,.35)}

/* ---------- abstract mocap point-cloud field (no text) ---------- */
.hero-field{position:absolute;inset:-4%}
.hero-field svg{width:100%;height:100%;display:block;overflow:visible}
.hero-field .stop-a{stop-color:var(--brand-bright)}
.hero-field .stop-b{stop-color:var(--accent)}
.mf-glow{opacity:.8;animation:mfGlowBreath 7s ease-in-out infinite}
.mf-rings circle{fill:none;stroke:var(--brand-bright);stroke-width:1;opacity:.4;
  stroke-dasharray:2 10;transform-origin:300px 300px;animation:mfSpin 34s linear infinite}
.mf-rings circle:nth-child(1){stroke-dasharray:none;opacity:.22;animation-duration:26s}
.mf-rings circle:nth-child(2){animation-duration:22s;animation-direction:reverse;opacity:.5}
.mf-rings circle:nth-child(3){stroke:var(--accent);opacity:.3;animation-duration:40s;animation-direction:reverse}
.mf-rings circle:nth-child(4){opacity:.18;animation-duration:52s}
.mf-orbit{transform-origin:300px 300px;animation:mfSpin 16s linear infinite}
.mf-orbit circle{fill:var(--brand-bright);opacity:.9;filter:drop-shadow(0 0 5px var(--brand-bright))}
.mf-orbit-rev{animation-duration:12s;animation-direction:reverse}
.mf-orbit-rev circle{fill:var(--accent);filter:drop-shadow(0 0 5px var(--accent))}
/* blueprint HUD layer */
.mf-hud line{stroke:rgba(79,224,176,.07);stroke-width:.5}
.mf-hud path{fill:none;stroke:rgba(79,224,176,.45);stroke-width:1}
.mf-code{fill:var(--accent);font-family:var(--mono);font-size:13px;letter-spacing:2px}
.mf-label{fill:var(--brand-bright);font-family:var(--mono);font-size:11px;letter-spacing:1.5px}
.mf-micro{fill:var(--ink-3);font-family:var(--mono);font-size:9px;letter-spacing:1px}
.mf-ticks line{stroke:rgba(79,224,176,.3);stroke-width:.8}
.mf-ticks line:nth-child(6n+1){stroke:rgba(79,224,176,.5);stroke-width:1}
.mf-skel line{stroke:var(--brand-bright);stroke-width:1.5;opacity:.5;
  stroke-dasharray:none;animation:none}
.mf-skel line.detail{stroke:var(--brand-bright);stroke-width:.7;opacity:.22;stroke-dasharray:3 5}
.mf-skel line.link{stroke:var(--accent);opacity:.45;stroke-dasharray:5 9;animation:mfDash 3.4s linear infinite}
.mf-skel circle.joint-ring{fill:none;stroke:var(--accent);stroke-width:.9;opacity:.55}
.mf-skel circle.joint-core{fill:var(--accent);opacity:1;filter:drop-shadow(0 0 4px var(--accent))}
.mf-skel circle.head-ring{fill:none;stroke:var(--brand-bright);stroke-width:1;opacity:.4;stroke-dasharray:2 4}
.mf-cloud .pt{fill:var(--brand-bright);opacity:.65;transform-box:fill-box;transform-origin:center;
  animation:mfTwinkle 4.2s ease-in-out infinite}
.mf-cloud .pt.amb{fill:var(--accent);opacity:.35}
.mf-figure{transform-origin:300px 300px;animation:mfBreathe 6.5s ease-in-out infinite}
.mf-trails path{fill:none;stroke:url(#mfTrail);stroke-width:1.2;stroke-dasharray:4 9;
  opacity:.8;animation:mfDash 3.2s linear infinite}
.mf-pulse circle{fill:var(--accent);filter:drop-shadow(0 0 7px var(--accent))}
.mf-core circle:first-child{fill:var(--accent);filter:drop-shadow(0 0 9px var(--accent))}
.mf-core .core-ring{fill:none;stroke:var(--brand-bright);stroke-width:1;opacity:.7;
  transform-box:fill-box;transform-origin:center;animation:mfCorePulse 3s ease-out infinite}
@keyframes mfSpin{to{transform:rotate(360deg)}}
@keyframes mfDash{to{stroke-dashoffset:-44}}
@keyframes mfTwinkle{0%,100%{opacity:.18;transform:scale(.6)}50%{opacity:1;transform:scale(1.5)}}
@keyframes mfBreathe{0%,100%{transform:scale(1)}50%{transform:scale(1.085)}}
@keyframes mfGlowBreath{0%,100%{opacity:.5;transform:scale(.95)}50%{opacity:1;transform:scale(1.09)}}
@keyframes mfCorePulse{0%{opacity:.9;transform:scale(.6)}100%{opacity:0;transform:scale(2.6)}}
.mf-glow{transform-origin:300px 300px}

/* hero frame more present */
@media(min-width:1081px){ .hero-frame{opacity:.85} }

/* ---------- scroll progress ---------- */
.scroll-progress{position:fixed;left:0;top:0;height:2px;width:0;z-index:130;pointer-events:none;
  background:linear-gradient(90deg,var(--brand),var(--accent));box-shadow:0 0 12px rgba(76,141,218,.45);
  transition:width .09s linear}
.nav.scrolled{border-bottom-color:rgba(76,141,218,.22);box-shadow:0 8px 30px rgba(0,0,0,.35)}

/* ---------- hero entrance ---------- */
.hero .hero-kicker,.hero h1,.hero .hero-lede,.hero .hero-actions,.hero .hero-meta{opacity:0}
body.hero-in .hero-kicker{animation:heroUp .85s var(--ease) .05s forwards}
body.hero-in .hero h1{animation:heroUp .95s var(--ease) .14s forwards}
body.hero-in .hero .hero-lede{animation:heroUp .85s var(--ease) .26s forwards}
body.hero-in .hero .hero-actions{animation:heroUp .85s var(--ease) .36s forwards}
body.hero-in .hero .hero-meta{animation:heroUp .85s var(--ease) .46s forwards}
@keyframes heroUp{from{opacity:0;transform:translateY(20px)}to{opacity:1;transform:none}}

/* scroll hint drip */
.scroll-hint i{animation:hintDrip 2.6s var(--ease) infinite}
@keyframes hintDrip{0%{transform:scaleY(0);transform-origin:top;opacity:0}
  45%{transform:scaleY(1);transform-origin:top;opacity:1}
  55%{transform:scaleY(1);transform-origin:bottom;opacity:1}
  100%{transform:scaleY(0);transform-origin:bottom;opacity:0}}

/* ---------- staggered reveals ---------- */
.reveal.in > .card,.reveal.in > .cap,.reveal.in > .stat,.reveal.in > .step{animation:riseIn .62s var(--ease) backwards}
.reveal.in > *:nth-child(1){animation-delay:.03s}
.reveal.in > *:nth-child(2){animation-delay:.09s}
.reveal.in > *:nth-child(3){animation-delay:.15s}
.reveal.in > *:nth-child(4){animation-delay:.21s}
.reveal.in > *:nth-child(5){animation-delay:.27s}
.reveal.in > *:nth-child(6){animation-delay:.33s}
@keyframes riseIn{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}

/* ---------- card spotlight ---------- */
.card:after{content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;opacity:0;
  transition:opacity .4s ease;background:radial-gradient(300px circle at var(--mx,50%) var(--my,50%),rgba(76,141,218,.11),transparent 62%)}
.card:hover:after{opacity:1}

/* ---------- number tick flash ---------- */
.stat .n{position:relative}
.stat .n.tick:after{content:"";position:absolute;right:-10px;top:6px;width:4px;height:4px;border-radius:50%;
  background:var(--brand-bright);box-shadow:0 0 10px var(--brand-bright);animation:tickFade .9s ease forwards}
@keyframes tickFade{0%{opacity:1}100%{opacity:0}}

/* ---------- map ---------- */
.map-shell .pin .halo{animation:pinHalo 4s ease-out infinite}
@keyframes pinHalo{0%,100%{opacity:.35}50%{opacity:.8}}
.map-wave{fill:none;stroke:var(--accent);stroke-width:1;opacity:0;animation:pinWave 4s ease-out infinite}
@keyframes pinWave{0%{r:7;opacity:.55}70%{r:30;opacity:0}100%{r:30;opacity:0}}
.map-link line{stroke:rgba(76,141,218,.32);stroke-width:1;stroke-dasharray:5 7;
  animation:linkFlow 1.4s linear infinite}
@keyframes linkFlow{to{stroke-dashoffset:-24}}

/* ---------- player ---------- */
.player-scan{position:absolute;left:0;right:0;top:0;height:2px;pointer-events:none;opacity:0;z-index:4;
  background:linear-gradient(90deg,transparent,rgba(18,201,190,.8),transparent);
  box-shadow:0 0 16px rgba(18,201,190,.55)}
[data-player].playing .player-scan{opacity:.85;animation:playerScan 3.4s linear infinite}
@keyframes playerScan{0%{top:12%}100%{top:88%}}
.player-bbox{animation:bboxFloat 4.5s ease-in-out infinite}
.player-bbox:nth-of-type(2){animation-delay:-1.5s}
.player-bbox:nth-of-type(3){animation-delay:-3s}
@keyframes bboxFloat{0%,100%{margin-top:0}50%{margin-top:5px}}

/* ---------- eyebrow sweep ---------- */
.eyebrow:after{content:"";position:absolute;left:0;bottom:-6px;height:1px;width:0;background:var(--brand);
  transition:width .6s var(--ease)}
.eyebrow{position:relative}
.reveal.in .eyebrow:after{width:34px}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion:reduce){
  *,*:before,*:after{animation:none!important;transition-duration:.001ms!important}
  .hero .hero-kicker,.hero h1,.hero .hero-lede,.hero .hero-actions,.hero .hero-meta{opacity:1!important}
  .reveal{opacity:1!important;transform:none!important}
  .scroll-progress{display:none}
  .mf-pulse{display:none}
}
