/* dp-motion.css | DNA Protocol shared motion foundation | additive, opt-in hooks, scoped to html[data-product] */
html[data-product]{--mo-instant:90ms;--mo-fast:160ms;--mo-base:240ms;--mo-slow:420ms;--mo-reveal:600ms;--mo-draw:1200ms;--mo-travel:2400ms;--mo-ambient:24s;--mo-stagger:70ms;--mo-ease-out:cubic-bezier(.16,1,.3,1);--mo-ease-settle:cubic-bezier(.22,1,.36,1);--mo-ease-std:ease;--mo-rise:16px;--mo-ix:var(--mo-fast) var(--mo-ease-std);--mo-track:var(--dp-line,currentColor);--mo-lit:var(--dp-accent,currentColor);--mo-play:running}
html[data-product][data-mo-paused],html[data-product][data-motion=paused],html[data-product] .mo-offscreen{--mo-play:paused}

/* strand: static in track tone by default; complete without JS */
html[data-product] .mo-strand{display:block;width:100%;height:24px;overflow:visible;pointer-events:none}
html[data-product] .mo-strand path{fill:none;stroke-linecap:round;stroke-width:1.5}
html[data-product] :is(.mo-front,.mo-back,.mo-rung){vector-effect:non-scaling-stroke;stroke:var(--mo-track)}
html[data-product] .mo-back{opacity:.45}
html[data-product] .mo-rung{stroke-width:1;opacity:.35}
/* signal has no vector-effect on purpose: keeps pathLength dash maths reliable across engines */
html[data-product] .mo-signal{stroke:var(--mo-lit);stroke-width:2;stroke-dasharray:.04 .96;opacity:0}

/* proof states: data-proof-state is written only by real app logic */
html[data-product] [data-proof-state=processing] .mo-signal{opacity:.7;stroke-dasharray:.02 .03}
html[data-product] [data-proof-state=verified] :is(.mo-front,.mo-back,.mo-rung){stroke:var(--mo-lit)}
html[data-product] [data-proof-state=verified] .mo-signal{stroke-dasharray:1.01 1;opacity:0}
html[data-product] [data-proof-state=unavailable] :is(.mo-front,.mo-back,.mo-rung){opacity:0}
html[data-product] [data-proof-state=unavailable] .mo-signal{opacity:1;stroke:var(--mo-track);stroke-width:1.5;stroke-dasharray:.01 .014}
html[data-product] [data-proof-state=unavailable] .mo-signal+.mo-signal{opacity:.45}
/* idle, failed and missing state fall through to the static track: no shake, no flash */

/* ambient aurora: independent of app state, decorative only */
html[data-product] [data-mo=ambient]{display:none}
@supports selector(:has(*)){
:where(html[data-product] [data-shell=main]:has(>[data-mo=ambient])){position:relative;isolation:isolate}
html[data-product] [data-shell=main]>[data-mo=ambient]{display:block;position:absolute;inset:0;z-index:-1;overflow:hidden;pointer-events:none;contain:layout paint}
html[data-product] [data-mo=ambient]::before,html[data-product] [data-mo=ambient]::after{content:'';position:absolute;width:60vmax;height:60vmax;border-radius:50%;background:radial-gradient(closest-side,var(--mo-lit),transparent);opacity:.1}
html[data-product] [data-mo=ambient]::before{top:-25vmax;right:-15vmax}
html[data-product] [data-mo=ambient]::after{bottom:-30vmax;left:10%;opacity:.07}
}
@media (min-width:720px){
html[data-product] [data-mo=ambient]::before{opacity:.16}
html[data-product] [data-mo=ambient]::after{opacity:.1}
}

@media (prefers-reduced-motion:no-preference){
/* interaction: zero specificity so existing transitions (incl. 180ms drawer) always win; focus rings untouched */
:where(html[data-product]) :where(button,[role=tab]){transition:color var(--mo-ix),background-color var(--mo-ix),border-color var(--mo-ix),box-shadow var(--mo-ix)}
:where(html[data-product]) :where(button:not(:disabled):active){scale:.98}

html[data-product] :is(.mo-front,.mo-back,.mo-rung){transition:stroke var(--mo-base) var(--mo-ease-std),opacity var(--mo-base) var(--mo-ease-std)}
html[data-product] .mo-signal{transition:opacity var(--mo-ix)}

/* processing: loops only while the real state says so */
html[data-product] [data-proof-state=processing] .mo-signal{opacity:1;stroke-dasharray:.04 .96;animation:mo-travel var(--mo-travel) linear infinite;animation-play-state:var(--mo-play)}
html[data-product] [data-proof-state=processing] .mo-signal+.mo-signal{animation-delay:calc(var(--mo-travel)/-2)}

/* verified: one-shot only when JS saw the live change (.mo-verified on the state root), then static */
html[data-product] .mo-verified[data-proof-state=verified] .mo-signal{animation:mo-seal calc(var(--mo-draw) + var(--mo-slow)) var(--mo-ease-settle) backwards}
html[data-product] .mo-verified[data-proof-state=verified] :is(.mo-front,.mo-back,.mo-rung){transition:stroke var(--mo-slow) var(--mo-ease-std) var(--mo-draw)}

/* reveal: content is visible by default; .mo-visible only plays an entrance once */
html[data-product] [data-mo-i]{--mo-i:5}
html[data-product] [data-mo-i='0']{--mo-i:0}
html[data-product] [data-mo-i='1']{--mo-i:1}
html[data-product] [data-mo-i='2']{--mo-i:2}
html[data-product] [data-mo-i='3']{--mo-i:3}
html[data-product] [data-mo-i='4']{--mo-i:4}
html[data-product] [data-mo=reveal].mo-visible{animation:mo-rise var(--mo-reveal) var(--mo-ease-out) backwards;animation-delay:calc(var(--mo-i,0)*var(--mo-stagger))}
/* guards: never veil forms, tables, alerts, live or focused regions even if mis-tagged */
html[data-product] [data-mo=reveal]:is(form,table,[role=alert],[role=status],[aria-live],:focus-within){animation:none}
@supports selector(:has(*)){
html[data-product] [data-mo=reveal]:has(input,select,textarea,button,[role=alert],[role=status],[aria-live]){animation:none}
}
}

/* ambient drift runs only once JS reports html[data-mo-ambient=on]; off or no JS keeps the static wash */
html[data-product]:not([data-mo-ambient=on]) [data-mo=ambient]::before,html[data-product]:not([data-mo-ambient=on]) [data-mo=ambient]::after{animation:none}
@media (prefers-reduced-motion:no-preference) and (min-width:720px){
html[data-product] [data-mo=ambient]::before{animation:mo-drift var(--mo-ambient) var(--mo-ease-std) infinite alternate;animation-play-state:var(--mo-play)}
html[data-product] [data-mo=ambient]::after{animation:mo-drift calc(var(--mo-ambient)*1.4) var(--mo-ease-std) infinite alternate-reverse;animation-play-state:var(--mo-play)}
}

@media (prefers-reduced-motion:reduce){
html[data-product] .mo-strand *,html[data-product] [data-mo=ambient]::before,html[data-product] [data-mo=ambient]::after,html[data-product] [data-mo=reveal]{animation:none!important;transition:none!important}
}
@media (forced-colors:active){
html[data-product] [data-mo=ambient],html[data-product] .mo-signal{display:none!important}
html[data-product] :is(.mo-front,.mo-back,.mo-rung){stroke:CanvasText!important}
}
@media print{
html[data-product] [data-mo=ambient]{display:none!important}
html[data-product] .mo-signal{animation:none!important}
}

@keyframes mo-travel{from{stroke-dashoffset:1}to{stroke-dashoffset:0}}
@keyframes mo-seal{0%{stroke-dashoffset:1.01;opacity:1}74%{stroke-dashoffset:0;opacity:1}100%{stroke-dashoffset:0;opacity:0}}
@keyframes mo-rise{from{opacity:0;transform:translateY(var(--mo-rise))}}
@keyframes mo-drift{to{transform:translate3d(-6vmax,4vmax,0)}}

/* Manual pause (existing html[data-motion=paused] control, mirrored by the runtime as html[data-mo-paused=manual]).
   Append to review-dp-motion.css. Freezes every foundation-owned animation in place: loops, the verified one-shot seal,
   in-flight reveals, and site-scoped verification edges drawn on the proof hooks or their pseudo-elements.
   Only play-state changes: no geometry, status, colour or layout is altered, and removing the attribute resumes from the frozen frame.
   Known trade-off: a reveal paused during its stagger delay stays on its opacity:0 first frame until resume. */
html[data-product]:is([data-motion=paused],[data-mo-paused=manual]) :is(.mo-strand,.mo-strand *,[data-mo],[data-proof-state],[data-check-state],[data-proof-row]),
html[data-product]:is([data-motion=paused],[data-mo-paused=manual]) :is([data-mo],[data-proof-state],[data-check-state],[data-proof-row])::before,
html[data-product]:is([data-motion=paused],[data-mo-paused=manual]) :is([data-mo],[data-proof-state],[data-check-state],[data-proof-row])::after{animation-play-state:paused!important}

