/* ===== Анимации раздела AI (по образцу страниц клиентов) ===== */
html.lenis, html.lenis body{ height: auto; }
.lenis.lenis-smooth{ scroll-behavior: auto !important; }
.lenis.lenis-stopped{ overflow: hidden; }

/* reading progress */
.ai-page .ai-progress{
  position: fixed; left: 0; top: 0; z-index: 60; width: 100%; height: 3px;
  transform-origin: 0 50%; transform: scaleX(0); pointer-events: none;
  background: linear-gradient(90deg, #7FB0FF, var(--accent));
}

/* reveal / split (только когда работает JS) */
.fx .ai-page [data-reveal]{ opacity: 0; transform: translateY(40px); transition: opacity 1s var(--ease), transform 1.1s var(--ease); transition-delay: calc(var(--d, 0) * 1ms); }
.fx .ai-page [data-reveal].in{ opacity: 1; transform: none; }
.fx .ai-page .ai-card[data-reveal].in{ transition: opacity 1s var(--ease), transform .5s var(--ease), box-shadow .5s var(--ease); transition-delay: calc(var(--d, 0) * 1ms), 0s, 0s; }
.ai-page .split .w{ display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.ai-page .split .w > span{ display: inline-block; transform: translateY(105%) rotate(4deg); transform-origin: 0 100%; transition: transform 1.1s var(--ease); transition-delay: calc(var(--i) * 45ms + var(--d, 0) * 1ms); }
.ai-page .split.in .w > span{ transform: none; }
.ai-page .magnet{ will-change: transform; }

/* hero: binary background */
.fx .ai-page .ai-bin__scan{ animation: ai-scan 7s linear infinite; }
@keyframes ai-scan { from { transform: translateY(-160px); } to { transform: translateY(var(--scan-h, 900px)); } }
.fx .ai-page .ai-bin__field{ transition: opacity 1.6s; }

/* hero / tool scenes: pieces appear one by one */
.fx .ai-page .ai-viz .ai-pop{ opacity: 0; transform: translateY(16px) scale(.97); transition: opacity .8s var(--ease), transform 1s var(--ease); transition-delay: calc(.35s + var(--ci, 0) * .12s); }
.fx .ai-page .ai-viz.in .ai-pop{ opacity: 1; transform: none; }
.fx .ai-page .ai-viz .ai-links{ opacity: 0; transition: opacity 1s .9s; }
.fx .ai-page .ai-viz.in .ai-links{ opacity: 1; }
.ai-page .ai-viz .ai-pop > *{ transition: translate .9s var(--ease); }
.ai-page .ai-pulse::after{ content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 0 rgba(0, 102, 255, .45); animation: ai-ping 2.6s 1.6s infinite; pointer-events: none; }
@keyframes ai-ping { 0% { box-shadow: 0 0 0 0 rgba(0, 102, 255, .45); } 70% { box-shadow: 0 0 0 26px rgba(0, 102, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(0, 102, 255, 0); } }
.ai-page .ai-spin{ animation: ai-spin 40s linear infinite; transform-origin: 50% 50%; transform-box: fill-box; }
@keyframes ai-spin { to { rotate: 360deg; } }

/* mocks: rows / messages appear in order */
.fx .ai-page .ai-seq{ opacity: 0; translate: 0 12px; transition: opacity .6s var(--ease), translate .8s var(--ease); transition-delay: calc(.5s + var(--si, 0) * .45s); }
.fx .ai-page .in .ai-seq{ opacity: 1; translate: 0 0; }
.ai-page .ai-viz.is-live .ai-wait{ animation: ai-wait 1.8s ease-in-out infinite; }
@keyframes ai-wait { 50% { box-shadow: 0 0 0 6px rgba(0, 102, 255, .14); } }

/* cards: dotted glow follows the pointer */
.ai-page .ai-glow{ isolation: isolate; }
.ai-page .ai-glow::before{
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; opacity: 0; pointer-events: none; transition: opacity .4s;
  background-image: radial-gradient(circle, var(--accent) 1.4px, transparent 1.7px); background-size: 14px 14px;
  -webkit-mask-image: radial-gradient(200px circle at var(--mx, 100%) var(--my, 0%), rgba(0, 0, 0, .45), transparent 70%);
  mask-image: radial-gradient(200px circle at var(--mx, 100%) var(--my, 0%), rgba(0, 0, 0, .45), transparent 70%);
}
.ai-page .ai-glow:hover::before{ opacity: 1; }
.ai-page .ai-card.ai-glow:hover{ transform: translateY(-4px); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, var(--line)), 0 24px 50px -28px rgba(0, 102, 255, .4); }
.ai-page .ai-card--soft.ai-glow:hover{ box-shadow: 0 24px 50px -28px rgba(0, 102, 255, .35); }
.ai-page .ai-tool.ai-glow:hover, .ai-page .ai-tool.is-cur{ box-shadow: inset 0 0 0 2px var(--accent), var(--shadow); }
.ai-page .ai-proc.ai-glow:hover{ box-shadow: inset 0 0 0 2px var(--accent), var(--shadow); }
.ai-page .ai-ib{ transition: transform .5s var(--ease), background-color .3s, color .3s; }
.ai-page .ai-glow:hover .ai-ib{ transform: translateY(-3px) rotate(-6deg); }

/* steps: line grows, numbers light up */
.fx .ai-page .ai-steps .ai-step__line{ transform: scaleX(0); transition: transform .9s var(--ease); transition-delay: calc(var(--k, 0) * .28s + .2s); }
.fx .ai-page .ai-steps.in .ai-step__line{ transform: none; }
.fx .ai-page .ai-steps .ai-step:first-child .ai-step__num{ background: transparent; color: var(--accent); }
.fx .ai-page .ai-steps .ai-step.is-on .ai-step__num{ background: var(--accent); color: var(--white); }

/* anchor menu */
.ai-page .ai-anchor{ transition: box-shadow .3s; }
.ai-page .ai-anchor.is-stuck{ box-shadow: inset 0 -1px 0 var(--line), 0 12px 30px -20px rgba(8, 26, 89, .25); }

/* CTA */
.ai-page .ai-cta__field div{ animation: ai-rise 30s linear infinite; }
@keyframes ai-rise { to { transform: translateY(-50%); } }

/* dark example glow drifts */
.ai-page .ai-dark__glow{ animation: ai-drift 14s ease-in-out infinite alternate; }
@keyframes ai-drift { to { translate: -80px 60px; scale: 1.08; } }

@media (max-width: 768px) {
  .fx .ai-page .ai-steps .ai-step__line{ transform: scaleY(0); transform-origin: 50% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .fx .ai-page [data-reveal], .ai-page .split .w > span, .fx .ai-page .ai-viz .ai-pop, .fx .ai-page .ai-seq, .fx .ai-page .ai-viz .ai-links{ opacity: 1 !important; transform: none !important; translate: none !important; }
  .ai-page .ai-bin__scan, .ai-page .ai-cta__field div, .ai-page .ai-dark__glow, .ai-page .ai-pulse::after, .ai-page .ai-spin{ animation: none !important; }
}
