/* ============================================================
   SPTech24 — animations.css
   Keyframes + reveal. Только transform/opacity (GPU).
   ============================================================ */

@keyframes diode-pulse{
  0%{box-shadow:0 0 0 0 var(--glow)}
  70%{box-shadow:0 0 0 7px transparent}
  100%{box-shadow:0 0 0 0 transparent}
}

@keyframes marquee-scroll{
  from{transform:translate3d(0,0,0)}
  to{transform:translate3d(-50%,0,0)}   /* трек = 2 одинаковые группы */
}

/* токи бегут по дорожкам платы */
@keyframes trace-flow{
  to{stroke-dashoffset:-340}
}
/* пульсация узлов-точек */
@keyframes node-pulse{
  0%,100%{opacity:.7;transform:scale(1)}
  50%{opacity:1;transform:scale(1.4)}
}
/* медленный дрейф всей платы — «дышит» */
@keyframes circuit-breathe{
  0%,100%{transform:translateY(-50%) scale(1)}
  50%{transform:translateY(-51.5%) scale(1.012)}
}

/* появление H1 по словам */
@keyframes char-up{
  from{opacity:0;transform:translateY(0.5em) rotate(2deg)}
  to{opacity:1;transform:none}
}

/* reveal-on-scroll (усиливает уже видимый дефолт) */
[data-reveal]{opacity:0;transform:translateY(18px);transition:opacity .6s var(--ease-out),transform .6s var(--ease-out);transition-delay:var(--reveal-delay,0ms)}
[data-reveal].is-in{opacity:1;transform:none}

/* ---------- CIRCUIT (живая схема) ---------- */
.hero__circuit{animation:circuit-breathe 9s ease-in-out infinite}
.circuit .trace{
  fill:none;stroke:var(--accent);stroke-width:1.7;
  opacity:.32;
  stroke-linecap:round;stroke-linejoin:round;
}
.circuit .spark{
  fill:none;stroke:var(--accent-hi);stroke-width:2.6;
  stroke-linecap:round;
  stroke-dasharray:30 310;
  filter:drop-shadow(0 0 7px var(--glow));
  animation:trace-flow 4.5s linear infinite;
}
.circuit .node{
  fill:var(--accent);
  transform-box:fill-box;transform-origin:center;
  filter:drop-shadow(0 0 4px color-mix(in oklab,var(--accent) 30%,transparent));
  animation:node-pulse 3.6s var(--ease-out) infinite;
}
.circuit .node--hot{fill:var(--accent-hi);filter:drop-shadow(0 0 8px var(--glow))}
.circuit .chip{fill:none;stroke:var(--accent);stroke-width:1.6;opacity:.42}

/* H1 word-reveal hookup */
.js .hero__h1 .word{display:inline-block;opacity:0}
.hero__h1.is-revealed .word{animation:char-up .7s var(--ease-out) forwards;animation-delay:var(--d,0ms)}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce){
  .marquee__track{animation:none}
  .circuit .spark{animation:none;stroke-dasharray:none;opacity:.5}
  .circuit .node{animation:none}
  .hero__circuit{animation:none !important}
  .diode-dot{animation:none}
  [data-reveal]{opacity:1 !important;transform:none !important;transition:none}
  .js .hero__h1 .word{opacity:1}
  .hero__h1.is-revealed .word{animation:none}
}
