/* Inseawo v4 — motion. Everything here runs only under html.mo (set in <head> unless prefers-reduced-motion; ?motion=1 forces it).
   Without .mo every graphic renders in its static end state. Timings follow the workbench playbook motion.md. */

/* Panels slide in 24–40px over 280–360ms, staggered 40–60ms */
.mo .rv { opacity: 0; transform: translateY(28px); transition: opacity .32s var(--ease), transform .32s var(--ease); transition-delay: var(--d, 0ms); }
.mo .rv.in { opacity: 1; transform: none; }
.mo .card.rv.in:hover { transform: translateY(-3px); transition-delay: 0ms; transition-duration: .16s; }

/* Dots travelling along a path: density = traffic */
.mo .dot { animation: travel var(--dur, 4s) linear infinite; animation-delay: var(--dl, 0s); }
@keyframes travel { from { offset-distance: 0%; } to { offset-distance: 100%; } }
.dot { offset-rotate: 0deg; }

/* Lines that keep growing */
.mo .grow { stroke-dasharray: 1 1; animation: grow 7s var(--ease) infinite; animation-delay: var(--dl, 0s); }
@keyframes grow { 0% { stroke-dashoffset: 1; } 55%, 92% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: .25; } }

/* Grid cells light up one by one */
.mo .cell { animation: light 4.8s var(--ease) infinite; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes light { 0% { opacity: .25; } 12%, 70% { opacity: 1; } 100% { opacity: .25; } }

/* Bars, segments and fill bars grow once when their panel enters */
.bar, .seg, .fillbar, .pop, .pulse { transform-box: fill-box; }
.bar { transform-origin: 50% 100%; } .seg, .fillbar { transform-origin: 0 50%; } .pulse { transform-origin: 50% 50%; }
.mo .rv .bar { transform: scaleY(0); } .mo .rv .seg, .mo .rv .fillbar { transform: scaleX(0); } .mo .rv .pop { opacity: 0; transform: translateY(12px); }
.mo .rv.in .bar { animation: up .5s var(--spring) both; animation-delay: calc(var(--i, 0) * 50ms + .15s); }
.mo .rv.in .seg, .mo .rv.in .fillbar { animation: wide .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms + .15s); }
.mo .rv.in .pop { animation: pop .34s var(--spring) both; animation-delay: calc(var(--i, 0) * 50ms + .1s); }
.mo .rv.in .ring { animation: ring .9s var(--ease) both .2s; }
.mo .pulse { animation: pulse 2.6s var(--ease) infinite; }
@keyframes up { from { transform: scaleY(0); } to { transform: none; } }
@keyframes wide { from { transform: scaleX(0); } to { transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes ring { from { stroke-dasharray: 0 100; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }

/* Event log: newest line rolls in */
.mo .evlog li.new { animation: rollin .32s var(--ease) both; }
@keyframes rollin { from { opacity: 0; transform: translateY(-24px); } to { opacity: 1; transform: none; } }

/* Stepper description swaps in place */
.mo .stp-d.on { animation: fadein .28s var(--ease) both; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Ripple on primary buttons */
.btn { position: relative; overflow: hidden; }
.ripple { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .35); transform: scale(0); animation: ripple .6s var(--ease); pointer-events: none; }
@keyframes ripple { to { transform: scale(2.4); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  html:not(.mo) { scroll-behavior: auto; }
  html:not(.mo) *, html:not(.mo) *::before, html:not(.mo) *::after { transition-duration: 0s !important; animation: none !important; }
}

/* Odometer digits (built by viz.js only under .mo) */
.od { line-height: 1.3; white-space: nowrap; }
.dg { display: inline-block; height: 1.3em; overflow: hidden; vertical-align: top; }
.dg-c { display: block; transition: transform .9s var(--ease); }
.dg-c span { display: block; height: 1.3em; line-height: 1.3em; }
