/* Explainer figures (/how-it-works/). Drawing rules are the anatomy kit's ISO_CSS (MIT, see
   tools/blazing/figures/kit/LICENSE), scoped to .fx, with every colour taken from the site tokens in base.css.
   Layout: a plate with the figure number and title on top, the drawing, optional controls, then the hint and the
   live readout. No inline styles anywhere (the CSP has no 'unsafe-inline'). */

.fx {
  --anatomy-page: var(--bg);
  --anatomy-card: var(--bg-deep);
  --anatomy-paper: #1a1a17;
  --anatomy-face: var(--surface-raised);
  --anatomy-top: #2a2a27;
  --anatomy-shade-0: #141412;
  --anatomy-shade-1: #191917;
  --anatomy-shade-2: #1e1e1b;
  --anatomy-shade-3: #242421;
  --anatomy-lit-top: #34452a;
  --anatomy-lit-shade: #26321e;
  --anatomy-hi: var(--ink-soft);
  --anatomy-mid: #7d7a73;
  --anatomy-lo: #4b4944;
  --anatomy-faint: #302f2c;
  --anatomy-lit: var(--brand);
  --anatomy-halo: #000;
  --anatomy-halo-opacity: 0.85;
  --anatomy-dot: var(--ink);
  --anatomy-red: var(--danger);
  --anatomy-green: var(--brand);
  --anatomy-blue: #8fb8e8;
  --anatomy-text: var(--muted);
  --anatomy-muted: var(--faint);
  --anatomy-mono: var(--mono);
  --anatomy-weight: 0.6px;
  --anatomy-ease: var(--ease, cubic-bezier(.32,.72,0,1));
  margin: var(--s-40) 0;
  color: var(--muted);
}
.fx-plate {
  position: relative;
  padding: var(--s-16) var(--s-16) var(--s-12);
  background: var(--anatomy-card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg, 20px);
  box-shadow: var(--shadow-1, none);
}
.fx-head, .fx-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-12);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  line-height: 1.4;
}
.fx-head { color: var(--faint); margin-bottom: var(--s-8); }
.fx-num { color: var(--muted); }
.fx-title { text-transform: uppercase; letter-spacing: 0.1em; text-align: right; }
.fx-stage {
  position: relative;
  border-radius: var(--r-md, 14px);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.fx-stage:focus-visible { outline: 2px solid var(--brand); outline-offset: 6px; }
.fx-stage[data-clickable] { cursor: pointer; }
.fx .iso-svg { display: block; width: 100%; height: auto; overflow: visible; margin: 0 auto; }
.fx-foot { margin-top: var(--s-8); flex-wrap: wrap; }
.fx-hint { margin: 0; color: var(--faint); text-transform: uppercase; letter-spacing: 0.1em; }
.fx-readout {
  margin: 0;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  text-align: right;
  margin-left: auto;
}
.fx-readout b { color: var(--brand); font-weight: 500; }
.fx-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-8);
  justify-content: center;
  margin-top: var(--s-12);
}
.fx-controls button {
  min-height: 36px;
  padding: 0 var(--s-16);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 500 0.82rem/1 var(--font);
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.fx-controls button:hover { color: var(--ink); border-color: var(--faint); }
.fx-controls button[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand); }
.fx-controls button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.fx-keys {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-8) var(--s-24);
  margin: var(--s-12) 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.8rem;
  color: var(--faint);
}
.fx-keys li { display: inline-flex; align-items: center; gap: var(--s-8); }
.fx-swatch { width: 14px; height: 10px; border-radius: 2px; border: 1px solid var(--faint); }
.fx-swatch[data-mark="lit"] { border-color: var(--brand); background: var(--brand-soft); }
.fx-swatch[data-mark="hi"] { border-color: var(--ink-soft); }
.fx-swatch[data-mark="dim"] { border-color: #4b4944; }
.fx-caption { margin-top: var(--s-12); font-size: 0.92rem; line-height: 1.6; color: var(--muted); max-width: 68ch; }
.fx-caption strong { color: var(--ink); font-weight: 600; }
.fx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Live text drawn on faces (a screen, a paper strip, a label plate). */
.fx .fx-face { font-family: var(--mono); fill: var(--anatomy-hi); }
.fx .fx-face[data-tone="lit"] { fill: var(--anatomy-lit); }
.fx .fx-face[data-tone="mid"] { fill: var(--anatomy-mid); }
.fx .fx-face[data-tone="lo"] { fill: var(--anatomy-lo); }
/* A solid lit in the accent while it is the part to watch (toggled by the behaviour module). */
.fx .iso-solid[data-glow] > .iso-top { fill: var(--anatomy-lit-top); }
.fx .iso-solid[data-glow] > .iso-shade { fill: var(--anatomy-lit-shade); }
.fx .iso-solid[data-glow] > .iso-edge { stroke: var(--anatomy-lit); }
.fx [data-fade] { transition: opacity .35s var(--anatomy-ease); }
/* Paper (a strip, a sheet): k.solidSvg(paths, { className: 'fx-paper' }); print on it with
   <text class="fx-face" data-tone="ink"> or lineSvg(..., { tone: 'ink' }). */
.fx .fx-paper > .iso-fill, .fx .fx-paper > .iso-top { fill: #d8d4ca; }
.fx .fx-paper > .iso-shade[data-shade="0"] { fill: #8a867d; }
.fx .fx-paper > .iso-shade[data-shade="1"] { fill: #9d998f; }
.fx .fx-paper > .iso-shade[data-shade="2"] { fill: #b0aca2; }
.fx .fx-paper > .iso-shade[data-shade="3"] { fill: #c3bfb5; }
.fx .fx-paper > .iso-edge { stroke: #ece9e2; }
.fx .fx-face[data-tone="ink"] { fill: #23221e; }
.fx .iso-line[data-tone="ink"] { stroke: #7a766d; }
@media (max-width: 560px) {
  .fx-plate { padding: var(--s-12) var(--s-8) var(--s-12); border-radius: var(--r-md, 14px); }
  .fx-head, .fx-foot { font-size: 0.68rem; }
  .fx-foot { flex-direction: column; align-items: flex-start; }
  .fx-readout { text-align: left; margin-left: 0; }
}

/* ---- kit drawing rules ---- */
.fx .iso-svg{display:block;width:100%;height:auto;overflow:visible}
.fx .iso-svg path,.fx .iso-svg circle{vector-effect:non-scaling-stroke}
.fx .iso-fill{fill:var(--anatomy-paper);stroke:none}
.fx .iso-solid[data-lit]>.iso-fill{fill:var(--anatomy-face)}
.fx .iso-shade,.fx .iso-top{stroke:none}
.fx .iso-shade[data-shade="0"]{fill:var(--anatomy-shade-0)}
.fx .iso-shade[data-shade="1"]{fill:var(--anatomy-shade-1)}
.fx .iso-shade[data-shade="2"]{fill:var(--anatomy-shade-2)}
.fx .iso-shade[data-shade="3"]{fill:var(--anatomy-shade-3)}
.fx .iso-top{fill:var(--anatomy-top)}
.fx .iso-solid[data-lit]>.iso-top{fill:var(--anatomy-lit-top)}
.fx .iso-solid[data-lit]>.iso-shade{fill:var(--anatomy-lit-shade)}
.fx .iso-solid[data-seamless]>.iso-shade,.fx .iso-solid[data-seamless]>.iso-top{stroke-width:.4;stroke-linejoin:round}
.fx .iso-solid[data-seamless]>.iso-shade[data-shade="0"]{stroke:var(--anatomy-shade-0)}
.fx .iso-solid[data-seamless]>.iso-shade[data-shade="1"]{stroke:var(--anatomy-shade-1)}
.fx .iso-solid[data-seamless]>.iso-shade[data-shade="2"]{stroke:var(--anatomy-shade-2)}
.fx .iso-solid[data-seamless]>.iso-shade[data-shade="3"]{stroke:var(--anatomy-shade-3)}
.fx .iso-solid[data-seamless]>.iso-top{stroke:var(--anatomy-top)}
.fx .iso-solid[data-seamless][data-lit]>.iso-top{stroke:var(--anatomy-lit-top)}
.fx .iso-solid[data-seamless][data-lit]>.iso-shade{stroke:var(--anatomy-lit-shade)}
.fx .iso-solid[data-lit]>.iso-edge{stroke:var(--anatomy-lit)}
.fx .iso-halo{fill:var(--anatomy-halo);stroke:none;filter:blur(9px);opacity:var(--anatomy-halo-opacity);transform:translateY(3px)}
.fx .iso-line{fill:none;stroke:var(--anatomy-lo);stroke-width:var(--anatomy-weight);stroke-linecap:round;stroke-linejoin:round}
.fx .iso-line[data-tone="hi"]{stroke:var(--anatomy-hi)}
.fx .iso-line[data-tone="mid"]{stroke:var(--anatomy-mid)}
.fx .iso-line[data-tone="lo"]{stroke:var(--anatomy-lo)}
.fx .iso-line[data-tone="faint"]{stroke:var(--anatomy-faint)}
.fx .iso-line[data-tone="lit"]{stroke:var(--anatomy-lit)}
.fx .iso-line[data-tone="red"]{stroke:var(--anatomy-red)}
.fx .iso-line[data-tone="green"]{stroke:var(--anatomy-green)}
.fx .iso-line[data-tone="blue"]{stroke:var(--anatomy-blue)}
.fx .iso-line[data-dotted]{stroke-dasharray:.01 3.5;stroke-width:1}
.fx .iso-line[data-dashed]{stroke-dasharray:3 3}
.fx .iso-line[data-flow]{stroke-dasharray:2 6}
.fx .iso-wire-end{fill:var(--anatomy-paper);stroke:var(--anatomy-lo);stroke-width:var(--anatomy-weight)}
.fx .iso-wire[data-tone="hi"] .iso-wire-end{stroke:var(--anatomy-hi)}
.fx .iso-wire[data-tone="mid"] .iso-wire-end{stroke:var(--anatomy-mid)}
.fx .iso-wire[data-tone="faint"] .iso-wire-end{stroke:var(--anatomy-faint)}
.fx .iso-wire[data-tone="lit"] .iso-wire-end{stroke:var(--anatomy-lit)}
.fx .iso-dots circle{fill:var(--anatomy-dot);stroke:none;opacity:.32}
.fx .iso-dots[data-tone="hi"] circle{opacity:.85}
.fx .iso-dots[data-tone="mid"] circle{opacity:.45}
.fx .iso-dots[data-tone="lo"] circle{opacity:.22}
.fx .iso-dots[data-tone="faint"] circle{opacity:.12}
.fx .iso-face-text{fill:var(--anatomy-mid);font-family:var(--anatomy-mono);letter-spacing:.04em}
.fx .iso-face-text[data-tone="hi"]{fill:var(--anatomy-hi)}
.fx .iso-face-text[data-tone="lo"]{fill:var(--anatomy-lo)}
.fx .iso-face-text[data-tone="faint"]{fill:var(--anatomy-faint)}
.fx .tb-body{fill:var(--anatomy-shade-2);stroke:none}
.fx .tb-shine{fill:var(--anatomy-top);stroke:none}
.fx .tb-shade{fill:var(--anatomy-shade-0);stroke:none}
.fx .tb-ring{fill:none;stroke:var(--anatomy-lo);stroke-width:.45;stroke-linecap:butt;stroke-linejoin:round}
.fx .tb-ring[data-tone="mid"]{stroke:var(--anatomy-mid)}
.fx .tb-ring[data-tone="faint"]{stroke:var(--anatomy-faint)}
.fx .tb-ring[data-tone="hi"]{stroke:var(--anatomy-hi)}
@keyframes fx-flow{to{stroke-dashoffset:-32}}
@keyframes fx-pulse{0%,100%{opacity:.18}12%{opacity:1}40%{opacity:.18}}
.fx .iso-line[data-flow]{animation:fx-flow 1600ms linear infinite}
.fx .iso-dots circle[data-pulse]{animation:fx-pulse 1600ms steps(1,end) infinite;animation-delay:var(--pulse-at,0ms)}

@media (prefers-reduced-motion: reduce) {
  .fx .iso-line[data-flow], .fx .iso-dots circle[data-pulse] { animation: none; }
  .fx [data-fade] { transition: none; }
}
