/* =========================================================
   AUMFIG — Motion
   All motion is progressive: content is fully visible without
   JS (reveals only arm when <html class="js">) and collapses to
   static final states under prefers-reduced-motion.
   ========================================================= */

/* ---------- Keyframes ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ping { 0% { transform: scale(.6); opacity: .5; } 80%, 100% { transform: scale(2.2); opacity: 0; } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@keyframes typing { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
@keyframes dash-flow { to { stroke-dashoffset: -22; } }
@keyframes marquee { to { transform: translateX(-100%); } }
@keyframes float-y { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
@keyframes bar-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes tab-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes glow-drift { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-30px, 24px); } }
@keyframes step-on {
  from { background-color: #fff; color: var(--ink-400); border-color: var(--line); box-shadow: none; }
  to { background-color: var(--blue-500); color: #fff; border-color: transparent; box-shadow: 0 8px 20px rgba(47, 91, 255, .3); }
}
@keyframes card-on { from { background-color: var(--surface-2); border-color: var(--line); } to { background-color: #fff; border-color: rgba(47, 91, 255, .28); } }
@keyframes connector-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes connector-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes check-pop { 0% { transform: scale(0); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }

/* ---------- Scroll reveal ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 26px, 0);
  transition: opacity .8s var(--ease), transform .9s var(--ease);
  transition-delay: calc(var(--stagger, 0) * 80ms);
}
.js [data-reveal="zoom"] { transform: translate3d(0, 20px, 0) scale(.96); }
.js [data-reveal="left"] { transform: translate3d(-28px, 0, 0); }
.js [data-reveal="right"] { transform: translate3d(28px, 0, 0); }
.js [data-reveal="up"] { transform: translate3d(0, 36px, 0); }
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* Hero copy: visible from the first paint (fast LCP); only a light slide-in */
.js .hero-copy [data-reveal] { opacity: 1; transform: translate3d(0, 10px, 0); transition: transform .7s var(--ease); }
.js .hero-copy [data-reveal].is-visible { transform: none; }
.hero-copy [data-reveal]:nth-child(1) { --stagger: 0; }
.hero-copy [data-reveal]:nth-child(2) { --stagger: 1; }
.hero-copy [data-reveal]:nth-child(3) { --stagger: 2; }
.hero-copy [data-reveal]:nth-child(4) { --stagger: 3; }
.hero-copy [data-reveal]:nth-child(5) { --stagger: 4; }
.hero-visual .dash { --stagger: 2; }
.hero-visual .fc-agent { --stagger: 6; }
.hero-visual .fc-wa { --stagger: 8; }
.hero-visual .fc-erp { --stagger: 10; }

/* ---------- Hero ambience ---------- */
.hero-bg .glow-a { animation: glow-drift 18s ease-in-out infinite; }
.hero-bg .glow-b { animation: glow-drift 22s ease-in-out infinite reverse; }

.dash .bars i { transform: scaleY(0); }
.dash.is-visible .bars i { animation: bar-grow 1s var(--ease) both; }
.dash.is-visible .bars i:nth-child(1) { animation-delay: .5s; }
.dash.is-visible .bars i:nth-child(2) { animation-delay: .56s; }
.dash.is-visible .bars i:nth-child(3) { animation-delay: .62s; }
.dash.is-visible .bars i:nth-child(4) { animation-delay: .68s; }
.dash.is-visible .bars i:nth-child(5) { animation-delay: .74s; }
.dash.is-visible .bars i:nth-child(6) { animation-delay: .8s; }
.dash.is-visible .bars i:nth-child(7) { animation-delay: .86s; }
.dash.is-visible .bars i:nth-child(8) { animation-delay: .92s; }
.dash.is-visible .bars i:nth-child(9) { animation-delay: .98s; }
.dash.is-visible .bars i:nth-child(10) { animation-delay: 1.04s; }
html:not(.js) .dash .bars i { transform: none; }

/* Pause ambient loops while offscreen (class toggled by main.js) */
.is-paused, .is-paused *, .is-paused *::before, .is-paused *::after { animation-play-state: paused !important; }

/* ---------- Solutions pipeline sequence ---------- */
.sol-panel.is-running .pipe-step { animation: card-on .5s var(--ease) both; animation-delay: calc(var(--d) * .75s + .1s); }
.sol-panel.is-running .pipe-ic { animation: step-on .5s var(--ease) both; animation-delay: calc(var(--d) * .75s + .1s); }
.sol-panel.is-running .pipe-check { animation: check-pop .45s var(--ease) both; animation-delay: calc(var(--d) * .75s + .45s); }
.sol-panel.is-running .pipe-step:not(:last-child)::after { animation: connector-x .4s var(--ease) both; animation-delay: calc(var(--d) * .75s + .55s); }
@media (max-width: 640px) {
  .sol-panel.is-running .pipe-step:not(:last-child)::after { animation-name: connector-y; }
}

/* ---------- Micro-interactions ---------- */
.btn-primary::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .28) 50%, transparent 70%);
  background-size: 250% 100%; background-position: 150% 0; transition: background-position .8s var(--ease);
}
.btn-primary:hover::after { background-position: -50% 0; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
  .flow-pulses { display: none; }
  .flow-path { stroke-dasharray: none; }
  .marquee-row { animation: none !important; }
  .marquee-track { -webkit-mask-image: none; mask-image: none; flex-wrap: wrap; }
  .marquee-row[aria-hidden="true"] { display: none; }
  .marquee-row { flex-wrap: wrap; gap: 12px 28px; }
  .marquee-row li { gap: 28px; }
  .dash .bars i { transform: none; }
  .float-card.is-visible { animation: none; }
  .live-dot::after { display: none; }
}

/* ---------- Touch devices & small screens: keep scrolling smooth ---------- */
@media (max-width: 1080px), (pointer: coarse) {
  .hero-bg .glow-a, .hero-bg .glow-b { animation: none; }
  .glow { filter: blur(48px); opacity: .8; }
  .site-header.is-scrolled { -webkit-backdrop-filter: none; backdrop-filter: none; background: #fff; }
  .svc-nav { -webkit-backdrop-filter: none; backdrop-filter: none; background: #fff; }
  .dash, .float-card, .pill { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .dash { background: #fff; }
  .float-card.is-visible { animation: none; }
  .service-card:hover, .project-card:hover, .industry-card:hover, .post-card:hover { transform: none; }
}
