/* HERO — scoped .m-* only. Generated copies: landing/public/motion/motion.css, web/app/motion.css (build.mjs).
   Animated properties: transform, opacity. prefers-reduced-motion: no transitions at all. */
.m-loop { --m-dur: .35s; position: relative; }
.m-loop .sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.m-src code { font-size:13px; }
.m-rec { display:inline-block; border:1px solid var(--accent); color:var(--accent); border-radius:2px; padding:0 6px; font-size:12px; line-height:1.6; text-transform:uppercase; letter-spacing:.04em; }
.m-grid { display:grid; grid-template-columns: minmax(0,1.45fr) minmax(0,1fr); gap:24px 32px; margin-top:16px; align-items:start; }
/* stage: the 3D render (fixed aspect — no layout shift while the wasm loads) + the two camera frames as sent */
.m-stage { display:flex; flex-direction:column; gap:12px; min-width:0; }
.m-3d { position:relative; aspect-ratio:16/10; border:1px solid var(--line); border-radius:2px; background:#07070a; overflow:hidden; }
.m-stage.on .m-3d { border-color:var(--accent); }
.m-canvas { display:block; width:100%; height:100%; }
.m-3d-note { position:absolute; left:12px; bottom:8px; margin:0; font-size:12px; color:var(--muted); pointer-events:none; }
.m-3d-note:empty { display:none; }
.m-cams { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.m-cam { margin:0; min-width:0; position:relative; }
.m-frame { display:block; width:100%; height:auto; aspect-ratio:4/3; object-fit:cover; border:1px solid var(--line); border-radius:2px; background:#0a0a0a; }
.m-cam figcaption { font-size:12px; line-height:1.6; color:var(--muted); font-variant-numeric:tabular-nums; }
.m-cam figcaption b { color:var(--fg); font-weight:500; }
.m-cam::after { content:""; position:absolute; inset:0 0 auto 0; aspect-ratio:4/3; background:#fff; opacity:0; pointer-events:none; border-radius:2px; }
.m-cam.snap::after { animation:m-snap .28s ease-out; }
@keyframes m-snap { from { opacity:.85; } to { opacity:0; } }
/* steps */
.m-steps { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:14px; min-width:0; }
.m-step { position:relative; display:flex; flex-direction:column; gap:6px; padding-top:12px; min-width:0; }
.m-rail { position:absolute; top:0; left:0; right:0; height:1px; background:var(--line); overflow:hidden; }
.m-rail i { position:absolute; inset:0; background:var(--accent); transform-origin:0 50%; transform:scaleX(0); will-change:transform; }
.m-n { margin:0; font-size:14px; line-height:1.5; color:var(--muted); transition:color var(--m-dur); }
.m-step.on .m-n { color:var(--fg); }
.m-t { margin:0; font-size:14px; line-height:1.6; color:var(--muted); overflow-wrap:anywhere; font-variant-numeric:tabular-nums; }
.m-t .m-rtt, .m-t .m-pol, .m-t .m-sent, .m-t .m-ahead, .m-t .m-row, .m-t .m-cost { color:var(--fg); }
.m-state { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:6px; }
.m-sv { color:var(--fg); font-size:13px; }
.m-hdr { margin:0; padding:8px 10px; border:1px solid var(--line); border-radius:2px; background:rgba(255,255,255,.02); font-size:12.5px; line-height:1.5; color:var(--muted); overflow:hidden; max-height:calc(4.5em + 18px); } /* DESIGN D4/D7: exactly three lines (3 × 1.5em + padding + border), never a half-cut line; 12.5 px = .m-path */
.m-hdr code { white-space:pre-wrap; overflow-wrap:anywhere; font-family:inherit; }
.m-step.on .m-hdr { color:var(--fg); border-color:var(--accent); }
.m-vis { display:flex; align-items:center; }
.m-vis svg { display:block; width:100%; height:auto; overflow:visible; }
.m-wire svg { max-width:200px; }
.m-loop .z { stroke:var(--line); stroke-width:1; fill:none; vector-effect:non-scaling-stroke; }
.m-pkt { fill:var(--accent); opacity:.25; transition:opacity var(--m-dur); }
.m-step.on .m-pkt { opacity:1; }
.m-path { margin:0; display:flex; align-items:center; gap:8px; font-size:12.5px; color:var(--muted); overflow-wrap:anywhere; min-width:0; }
.m-path span { white-space:nowrap; } .m-path span:nth-child(3) { white-space:normal; min-width:0; }
.m-step.on .m-path span { color:var(--fg); }
.m-hop { flex:1 1 24px; height:1px; min-width:16px; background:linear-gradient(90deg, var(--accent) calc(var(--p,0) * 100%), var(--line) calc(var(--p,0) * 100%)); }
.m-ret { cursor:col-resize; touch-action:none; }
.m-chunks polyline { fill:none; stroke-width:1.25; vector-effect:non-scaling-stroke; }
.m-chunks polyline.j { stroke:var(--fg); stroke-opacity:.8; } .m-chunks polyline.g { stroke:var(--accent); }
.m-chunk { opacity:0; transition:opacity var(--m-dur); }
.m-chunk.on { opacity:1; }
.m-head { stroke:var(--accent); stroke-width:1; vector-effect:non-scaling-stroke; }
.m-fps::after { content:attr(data-fps) " fps"; color:var(--muted); } .m-fps[data-fps]::before { content:" · "; color:var(--muted); }
/* controls */
.m-ctl { display:flex; flex-wrap:wrap; align-items:center; gap:12px 20px; border-top:1px solid var(--line); padding-top:20px; margin-top:20px; }
.m-play:disabled, .m-scrub:disabled { opacity:.45; cursor:default; }
.m-play { min-height:44px; min-width:56px; font-size:16px; padding:10px 16px; background:transparent; color:var(--fg); border:1px solid var(--fg); border-radius:2px; font:inherit; font-size:14px; cursor:pointer; transition:transform .12s, background-color .12s, color .12s; }
.m-play:hover { background:var(--fg); color:var(--bg); }
.m-play:active { transform:scale(.97); }
.m-play:focus-visible, .m-scrub:focus-visible { outline:2px solid var(--accent); outline-offset:4px; }
.m-scrub { flex:1 1 240px; min-width:0; height:44px; margin:0; accent-color:var(--accent); background:transparent; cursor:pointer; }
.m-read { flex:1 1 100%; font-size:14px; line-height:1.6; color:var(--muted); min-height:3.2em; font-variant-numeric:tabular-nums; }
@media (max-width:1100px) {
  .m-grid { grid-template-columns:minmax(0,1fr); }
}
@media (max-width:560px) {
  .m-cams { gap:8px; }
  .m-state { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .m-path { flex-wrap:wrap; } .m-path span:nth-child(3) { flex:1 1 100%; order:5; }
}
@media (prefers-reduced-motion: reduce) {
  .m-loop *, .m-loop *::before, .m-loop *::after { transition:none !important; animation:none !important; }
}
/* HERO-RUNS: the gallery — the title is the link to the run's public session page; › moves to the next recorded run */
.m-title { color:inherit; text-decoration:none; }
.m-title:hover, .m-title:focus-visible { text-decoration:underline; text-underline-offset:4px; }
.m-runs b { color:var(--fg); font-weight:500; }
.m-next { font:inherit; font-size:16px; line-height:1; min-width:28px; min-height:28px; padding:0 8px; margin-left:2px; position:relative; /* DESIGN D6: the box stays 28 px, the hit area is 44 px (::before) */ background:transparent; color:var(--fg); border:1px solid var(--line); border-radius:2px; cursor:pointer; vertical-align:middle; }
.m-next::before { content:""; position:absolute; inset:-8px -8px; }
.m-next:hover { border-color:var(--fg); }
.m-next:disabled { opacity:.45; cursor:default; }
.m-next:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }

/* MOTION · micro-interactions. Every rule hangs off html.m-micro (added by micro.js), so nothing changes without it.
   transform / opacity / stroke-dashoffset only; prefers-reduced-motion: final states, no transitions. */
/* nav underline grows from the left on hover/focus; the current page keeps it */
.m-micro body > header nav a { position:relative; }
.m-micro body > header nav a:hover { text-decoration:none; color:var(--fg); }
.m-micro body > header nav a::after { content:""; position:absolute; left:0; right:0; bottom:10px; height:1px; background:currentColor; transform:scaleX(0); transform-origin:0 50%; transition:transform .2s cubic-bezier(.2,.7,.2,1); pointer-events:none; }
.m-micro body > header nav a:hover::after, .m-micro body > header nav a:focus-visible::after, .m-micro body > header nav a[aria-current="page"]::after { transform:scaleX(1); }
.m-micro body > header nav a[aria-current="page"] { color:var(--fg); }
/* press: a 1px settle, never a bounce */
.m-micro :is(.btn, .landing-primary, .m-play, .m-copy, .code .copy) { transition:transform .08s ease-out, background-color .12s, color .12s; }
.m-micro :is(.btn, .landing-primary, .m-play, .m-copy, .code .copy):active:not(:disabled) { transform:translateY(1px); }
/* copy → check morph (real clipboard success only) */
.m-copy { display:inline-flex; align-items:center; gap:6px; }
.m-copy-ico { width:14px; height:14px; flex:none; overflow:visible; }
.m-copy-g { fill:none; stroke:currentColor; stroke-width:1.25; transform-origin:8px 8px; transition:opacity .15s, transform .15s; }
.m-copy-ok { fill:none; stroke:var(--accent); stroke-width:1.75; stroke-linecap:round; stroke-linejoin:round; stroke-dasharray:1; stroke-dashoffset:1; transition:stroke-dashoffset .3s ease-out .05s; }
.m-copy[data-m-copied] .m-copy-g { opacity:0; transform:scale(.6); }
.m-copy[data-m-copied] .m-copy-ok { stroke-dashoffset:0; }
/* content that arrives (results, errors) settles in instead of popping */
.m-micro [role="status"] > *, .m-micro [role="alert"] { animation:m-in .22s ease-out both; }
@keyframes m-in { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:none; } }
/* empty states */
.m-empty { display:flex; align-items:flex-start; gap:16px; }
.m-empty svg { flex:none; width:48px; height:32px; overflow:visible; }
.m-empty .s1 { fill:none; stroke:var(--muted); stroke-width:1.25; stroke-linecap:round; stroke-linejoin:round; stroke-dasharray:1; stroke-dashoffset:0; }
.m-empty .s2 { fill:var(--accent); }
.m-micro .m-empty .s1 { animation:m-draw-in .6s ease-out both; }
@keyframes m-draw-in { from { stroke-dashoffset:1; } to { stroke-dashoffset:0; } }
@media (prefers-reduced-motion: reduce) {
  .m-micro *, .m-micro *::before, .m-micro *::after { transition:none !important; animation:none !important; }
  .m-copy-ok { transition:none; }
}
