/* Live schematics: what moves inside a diagram, and the figure controls.
   Loads beside site.css on every page that runs assets/live.js. */

/* What moves inside a diagram: a lit stroke that follows a traveling dot, in
   the same tones as the drawing. The dot carries a white ring, as in the
   videos, so it reads over any stroke it crosses. */

.lv-glow { stroke-width: 3.5; stroke-linecap: round; fill: none; }
.lv-halo { stroke-width: 12; stroke-linecap: round; fill: none; opacity: 0.16; }
.lv-ping { stroke-width: 3; fill: none; }
.lv-amber   { stroke: var(--accent); }
.lv-done    { stroke: var(--sig-done); }
.lv-issue   { stroke: var(--sig-issue); }
.lv-clarify { stroke: var(--sig-clarify); }
.lv-note    { stroke: var(--sig-note); }
.lv-dot { stroke: var(--surface); stroke-width: 4; }
.lv-f-amber   { fill: var(--accent); }
.lv-f-done    { fill: var(--sig-done); }
.lv-f-issue   { fill: var(--sig-issue); }
.lv-f-clarify { fill: var(--sig-clarify); }
.lv-f-note    { fill: var(--sig-note); }

/* Figure controls: the steps of the system as a rail, the way the video
   explainers mark where they are, plus one play button. */
.lv-ctl {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 14px 0 0; font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em;
}
.lv-ctl button {
  font: inherit; color: var(--text-2); background: var(--surface); cursor: pointer;
  border: 1px solid var(--line-2); border-radius: 999px; min-height: 44px; padding: 0 16px;
  display: inline-flex; align-items: center; gap: 8px;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}
.lv-ctl button:active { transform: scale(0.97); }
.lv-ctl button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .lv-ctl button:hover { border-color: var(--accent-edge); color: var(--text-hi); }
}
.lv-ctl .lv-play { color: var(--accent); border-color: var(--accent-edge); }
.lv-rail { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.lv-rail i {
  font-style: normal; width: 20px; height: 20px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--line); color: var(--text-3); font-size: 12px;
}
.lv-rail .on button { color: var(--surface); border-color: var(--accent); background: var(--accent); }
.lv-rail .on i { background: var(--surface); color: var(--accent); }
.lv-rail .done button { color: var(--text-2); }
.lv-rail .done i { background: var(--accent); color: var(--surface); }
.lv-rail .done button { border-color: var(--accent-edge); color: var(--accent); }

/* Phones: the rail is one row that scrolls sideways, and the engine keeps the
   lit step in view, instead of wrapping into a stack of buttons. */
@media (max-width: 620px) {
  .lv-ctl { flex-wrap: nowrap; align-items: stretch; }
  .lv-rail {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    scroll-snap-type: x proximity; min-width: 0; flex: 1;
  }
  .lv-rail::-webkit-scrollbar { display: none; }
  .lv-rail li { flex: none; scroll-snap-align: start; }
  .lv-ctl button { white-space: nowrap; }
}

/* An HTML stage: laid out at its own fixed size (data-w x data-h) and scaled
   by live.js to fit the wrapper, so its text and cards keep their proportions
   at any width. The wrapper gives it a shape and clips it. */
[data-scene] > .stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.wk-sch:has(> .stage) { position: relative; overflow: hidden; aspect-ratio: 16 / 9; }
.stage .layer { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }

