/* Preview figures from explain.js: the 12 × 12 strip, the 144-head ranking, the score example and the induction-head
   walk-through. Blue is an induction head and orange a previous-token head, as in the heads grid. */
figure.fx { margin: 22px 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  --blue: #46d1fc; --orange: #d27a3a; }
figure.fx figcaption { margin: 12px 0 0; color: var(--muted); font-size: 0.86em; line-height: 1.45; }
.fx .hit { color: var(--blue); font-weight: 600; }
.fx-chart, .fx-strip { display: block; width: 100%; height: auto; }
.fx-chart text, .fx-strip text { font-family: var(--mono); }
.fx-tick { font-size: 11px; fill: var(--muted); }
.fx-tick.cut { fill: var(--blue); font-weight: 700; }
.fx-grid { stroke: var(--line); stroke-width: 1; }
.fx-hit { font-size: 13px; font-weight: 700; fill: var(--blue); }
.fx-note { font-size: 12px; fill: var(--muted); white-space: pre; }
.fx-note.on { fill: var(--ink); }

/* the strip (a port of the companion site's) */
.fx-stream { stroke: var(--line); stroke-width: 1.2; }
.fx-block { fill: #1c2128; stroke: #7a6a42; stroke-width: 1.2; }
.fx-attn { fill: #3a3022; stroke: #ffb84d; stroke-width: 1.2; }
.fx-head { fill: #3d9fb0; }
.fx-head.ind { fill: var(--blue); }
.fx-head.prev { fill: var(--orange); }
.fx-label { font-size: 10.5px; fill: var(--muted); }
.fx-legend { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 10px 0 0; font-size: 0.86em; color: var(--muted); }
.fx-legend span { display: inline-flex; align-items: center; gap: 8px; }
.fx-legend i { display: inline-block; }
.lg-block { width: 16px; height: 13px; border-radius: 4px; background: #1c2128; border: 1.2px solid #7a6a42; }
.lg-attn { width: 13px; height: 13px; border-radius: 3px; background: #3a3022; border: 1.5px solid #ffb84d; }
.lg-head { width: 9px; height: 9px; border-radius: 2px; background: #3d9fb0; }
.lg-head.ind { background: var(--blue); }
.lg-head.prev { background: var(--orange); }
.fx-who { margin: 0 0 6px; }

/* bars, dots, scale */
.fx-bar { fill: #4a5563; }
.fx-bar.near { fill: #2e8ba8; }
.fx-bar.on { fill: var(--blue); }
.fx-cut { stroke: var(--blue); stroke-width: 1.4; stroke-dasharray: 5 4; }
.fx-cut-label { font-size: 12px; font-weight: 700; fill: var(--blue); }
.fx-dot { fill: #4a5563; }
.fx-dot.on { fill: var(--blue); r: 4; }
.fx-avg { stroke: var(--ink); stroke-width: 1.4; stroke-dasharray: 5 4; }
.fx-avg-label { font-size: 12px; font-weight: 700; fill: var(--ink); }
.fx-no { fill: #2a313b; }
.fx-yes { fill: #144a5c; }
.fx-mark { fill: var(--blue); }

.fx-score .fx-lead { margin: 0 0 10px; font-size: 0.95em; }
.fx-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.fx-tabs button { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink);
  font: 600 13px/1.2 var(--mono); cursor: pointer; }
.fx-tabs button:hover { border-color: var(--blue); }
.fx-tabs button[aria-selected="true"] { background: var(--blue); border-color: var(--blue); color: #0a0c10; }
.fx-tabs button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.post-body .fx-step1 { margin: 14px 0 4px; font-size: 0.93em; color: var(--ink); }
.post-body .fx-read1, .post-body .fx-read2 { margin: 4px 0 0; font-size: 0.9em; color: var(--ink-soft, var(--muted)); }

/* the walk-through */
.fx-induct .fx-stage { margin: 4px 0 0; }
.fx-word { fill: #16202b; stroke: transparent; stroke-width: 2; }
.fx-word.now { stroke: var(--orange); }
.fx-word.hot { fill: #123a49; stroke: var(--blue); }
.fx-word.ask { stroke: var(--blue); stroke-dasharray: 4 3; }
.fx-wt { font-size: 13.5px; fill: var(--ink); }
.fx-word.unread { fill: #121a23; opacity: 0.55; }
.fx-wt.unread { opacity: 0.45; }
.fx-arc { fill: none; stroke-linecap: round; }
.fx-arc.prev { stroke: var(--orange); opacity: 0.55; }
.fx-arc.prev.now { opacity: 1; }
.fx-arc.ind { stroke: var(--blue); opacity: 0.55; }
.fx-arc.ind.main { opacity: 1; }
.fx-pct { font-size: 12px; font-weight: 700; }
.fx-pct.prev { fill: var(--orange); }
.fx-pct.ind { fill: var(--blue); }
.fx-tag { fill: var(--orange); }
.fx-tag.big { r: 5; }
.fx-box { fill: #16202b; stroke-width: 2; }
.fx-box.ind { stroke: var(--blue); }
.fx-box-t { font: 600 12px var(--sans); fill: var(--ink); }
.fx-box-s { font: 400 10px var(--sans); fill: var(--muted); }
.fx-arrow { stroke: var(--blue); stroke-width: 2; fill: none; }
.fx-pred { fill: none; stroke: var(--blue); stroke-width: 2; stroke-dasharray: 5 4; }
.fx-pred-t { font: 700 14px var(--mono); fill: var(--blue); }
.post-body .fx-say { min-height: 5.6em; margin: 6px 0 12px; font-size: 0.93em; line-height: 1.5; }
.fx-induct .fig-controls { margin-bottom: 0; }
.fx-induct .fig-step { min-width: 11ch; }

@media (max-width: 560px) {
  figure.fx { padding: 12px; }
  .post-body .fx-say { min-height: 8.5em; }
}
@media (prefers-reduced-motion: no-preference) {
  .fx-arc { transition: opacity 0.3s; }
}

.fx-box.ghost { opacity: 0.3; stroke-dasharray: 4 3; }
.fx-box-t.ghost { opacity: 0.4; }
.fx-link { stroke: var(--blue); stroke-width: 1.4; stroke-dasharray: 3 4; fill: none; opacity: 0.8; }
.fx-chip { fill: #16202b; stroke-width: 1.5; }
.fx-chip.prev { stroke: var(--orange); }
.fx-chip.ind { stroke: var(--blue); stroke-dasharray: 4 3; }
.fx-chip.ind.pred { stroke-dasharray: none; fill: #123a49; }
.fx-chip-t { font: 600 11.5px var(--mono); }
.fx-chip-t.prev { fill: var(--orange); }
.fx-chip-t.ind { fill: var(--blue); }

/* the two-head walk-through */
.fx-heads .fx-stage { margin: 0; }
.fx-hd .fx-box { fill: #16202b; stroke-width: 2.4; }
.fx-box.prev { stroke: var(--orange); }
.fx-eye { fill: none; stroke-width: 2; }
.fx-eye.prev { stroke: var(--orange); } .fx-eye.ind { stroke: var(--blue); }
.fx-pupil.prev { fill: var(--orange); } .fx-pupil.ind { fill: var(--blue); }
.fx-arc.thin { opacity: 0.9; }
.fx-tip { fill: var(--orange); }
.fx-arc.prev[data-line] { opacity: 1; }
.fx-nw { font: 400 13px var(--sans); fill: var(--ink); }
.fx-nw-l { fill: var(--muted); }
.fx-word, .fx-wt, .fx-tag { transition: fill 0.4s, stroke 0.4s, opacity 0.4s; }
.fx-tag { opacity: 0; } .fx-tag.on { opacity: 1; }
.fx-heads .fx-word.unread { opacity: 0.55; }
.fx-chipg .fx-chip { stroke-dasharray: none; }
.fx-chipg.want .fx-chip { stroke-dasharray: 4 3; }
.fx-heads .o { color: var(--orange); } .fx-heads .b { color: var(--blue); }
.post-body .fx-heads .fx-say { min-height: 5.6em; margin: 4px 0 8px; }
.fx-meter-box { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: var(--bg); min-height: 7.4em; }
.post-body .fx-mtitle { margin: 0 0 8px; font: 600 12.5px/1.35 var(--sans); color: var(--ink); }
.post-body .fx-mnote { margin: 0; font-size: 0.9em; color: var(--muted); }
.fx-mrow { display: grid; grid-template-columns: minmax(8em, 15em) 1fr 3.4em; align-items: center; gap: 10px; margin: 4px 0; font: 400 12.5px var(--mono); color: var(--muted); }
.fx-mrow i { display: block; height: 10px; border-radius: 5px; background: #4a5563; transition: width 0.5s; }
.fx-mrow i.prev { background: var(--orange); } .fx-mrow i.ind { background: var(--blue); }
.fx-mrow b { text-align: right; color: var(--ink); font-weight: 600; }
@media (max-width: 560px) { .fx-mrow { grid-template-columns: 1fr 3.4em; } .fx-mrow i { grid-column: 1 / -1; grid-row: 2; } .fx-mrow span { grid-column: 1; } .fx-mrow b { grid-column: 2; grid-row: 1; } .post-body .fx-heads .fx-say { min-height: 9em; } }

.fx-hnum { font: 600 8.5px var(--mono); fill: #0a0c10; pointer-events: none; }

.fx-block.pick { stroke: var(--ink); stroke-width: 2.2; }
.fx-label.pick { fill: var(--ink); font-weight: 700; }
/* the strip: grey heads so blue and orange stand out, and the residual stream */
.fx-combo-svg .fx-head { fill: #4b5563; }
.fx-combo-svg .fx-head.ind { fill: var(--blue); }
.fx-combo-svg .fx-head.prev { fill: var(--orange); }
.fx-hnum.dim { fill: #d5dce6; }
.fx-bus { stroke: #9aa5b4; stroke-width: 2.4; fill: none; }
.fx-bus-wrap { stroke-dasharray: 5 5; stroke-width: 1.6; }
.fx-bus-tip { fill: #9aa5b4; }
.fx-bus-label { font: 600 12px var(--sans); fill: #c0c8d4; }
.fx-stub { stroke: #9aa5b4; stroke-width: 1.4; fill: none; }
.fx-stub-tip { fill: #9aa5b4; }
.lg-head.grey { background: #4b5563; }
.lg-bus { width: 22px; height: 0; border-top: 2.4px solid #9aa5b4; }
.fx-combo-svg .fx-label { font-size: 11px; }
.fx-combo-svg .fx-label { paint-order: stroke; stroke: #12161c; stroke-width: 4px; stroke-linejoin: round; }

/* blocks 5 and 6 with a residual stream for every word */
.fx-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.fx-scroll .fx-flow-svg { min-width: 540px; }
.fx-band { stroke-width: 1.4; }
.fx-band.ind { fill: rgba(70, 209, 252, 0.05); stroke: rgba(70, 209, 252, 0.4); }
.fx-band.prev { fill: rgba(210, 122, 58, 0.06); stroke: rgba(210, 122, 58, 0.45); }
.fx-band-t { font: 600 12px var(--sans); fill: var(--ink); }
.fx-band-s { font: 400 11px var(--sans); fill: var(--muted); }
.fx-gap-t { font: 400 11px var(--sans); fill: var(--muted); }
.fx-minihead { fill: #4b5563; }
.fx-minihead.prev { fill: var(--orange); } .fx-minihead.ind { fill: var(--blue); }
.fx-col { stroke: #3a4350; stroke-width: 1.6; fill: none; transition: stroke 0.4s; } .fx-col.read { stroke: #8a95a5; }
.fx-col-tip { fill: #3a4350; }
.fx-wt-s { font-size: 12px; }
.fx-flow-svg .fx-tag { transform-box: fill-box; transition: transform 0.8s ease, opacity 0.4s; opacity: 0; }
.fx-flow-svg .fx-tag.on { opacity: 1; }
.fx-flow-svg .fx-tag.mid { transform: translateY(-144px); }
.fx-flow-svg .fx-tag.low { transform: translateY(0); }
.fx-flow-svg .fx-tag.up { transform: translateY(-190px); }
.fx-flow-svg .fx-tag.big { r: 6; }
.fx-flow-svg .fx-chip-t { font-size: 11.5px; }
.fx-chip.pred { stroke-dasharray: none; fill: #123a49; }
@media (prefers-reduced-motion: reduce) { .fx-flow-svg .fx-tag { transition: none; } }

/* a halo so a line behind a label never hides it */
.fx-band-t, .fx-band-s, .fx-gap-t, .fx-flow-svg .fx-pct, .fx-chip-t { paint-order: stroke; stroke: #12161c; stroke-width: 3.5px; stroke-linejoin: round; }
.fx-chip-t.prev, .fx-chip-t.ind { stroke-width: 0; }

@media (max-width: 560px) { .fx-scroll { -webkit-mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent); mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent); } }

.fx-induct-svg .fx-pct { paint-order: stroke; stroke: #12161c; stroke-width: 3.5px; stroke-linejoin: round; }

/* a word of the sentence inside the explanation, like the chips in the figure */
.post-body .fx-say .tk { display: inline-block; padding: 0 7px; border: 2px solid transparent; border-radius: 6px; background: #16202b; font: 400 0.9em/1.55 var(--mono); color: var(--ink); white-space: nowrap; }
.post-body .fx-say .tk.now { border-color: var(--orange); }
.post-body .fx-say .tk.hot { border-color: var(--blue); background: #123a49; }
.post-body .fx-say .tk.ask { border-color: var(--blue); border-style: dashed; }

.post-body .fx-say .nw { white-space: nowrap; }

.fx-flow-svg .fx-tag.none { fill: #12161c; stroke: var(--orange); stroke-width: 1.8; }





.fx-mininum { font: 600 9px var(--mono); fill: #d5dce6; pointer-events: none; }
.fx-mininum.on { fill: #0a0c10; }
.fx-minihead.faint { stroke: var(--blue); stroke-width: 1.4; stroke-dasharray: 2 2; }

/* what a tag is */
.fx-vecrow { display: flex; justify-content: center; align-items: flex-start; gap: 6px; }
.fx-veccol p, .fx-vecmid p { margin: 0 0 6px; min-height: 2.8em; text-align: center; font-size: 0.8em; line-height: 1.35; color: var(--ink); }
.fx-vec { display: grid; padding: 2px 8px; border-left: 2px solid var(--muted); border-right: 2px solid var(--muted); border-radius: 6px; font: 400 14px/28px var(--mono); }
.fx-vec span, .fx-vec em { height: 28px; text-align: right; white-space: pre; color: var(--ink); }
.fx-vec span.neg { color: #c9b8ff; }
.fx-vec .more { text-align: center; color: var(--muted); }
.fx-vec em { text-align: center; font: 400 11.5px/20px var(--sans); color: var(--muted); height: 20px; }
.fx-vecmid div { display: grid; padding-top: 2px; font: 400 18px/28px var(--mono); color: var(--muted); text-align: center; min-width: 1.4em; }
.fx-vecmid div span { height: 28px; }
.fx-vecmid.arr div { padding-top: 70px; } .fx-vecmid.arr small { font: 400 10.5px/1.2 var(--sans); color: var(--muted); display: block; max-width: 7em; margin: 0 auto; }
.post-body .fx-tagtext { margin: 14px 0 0; font-size: 0.9em; }
.fx-tagread { margin: 14px 0 6px; padding: 10px 12px; border-radius: 10px; background: var(--bg); }
@media (max-width: 460px) { .fx-vec { font-size: 12px; padding: 2px 5px; } .fx-veccol p, .fx-vecmid p { font-size: 0.72em; } .fx-vecrow { gap: 3px; } .fx-vecmid div { font-size: 14px; min-width: 1em; } }

.fx-flow-svg .fx-link { fill: none; stroke: var(--blue); stroke-width: 1.6; stroke-dasharray: 3 4; opacity: 0; }

.post-body .fx-tagsteps { margin: 14px 0 0; padding-left: 1.3em; font-size: 0.9em; line-height: 1.55; }
.post-body .fx-tagsteps li { margin: 0 0 6px; }

/* the step controls stay at the top, in view with the heads, while the figure is on screen */
.fx-flow .fig-controls { position: sticky; top: 70px; z-index: 6; margin: 0 0 10px; padding: 8px 0; background: var(--surface); }
@media (max-width: 560px) { .fx-flow .fig-controls { top: 62px; } }

@media (max-width: 560px) {
  .fx-flow .fig-controls { grid-template-columns: auto minmax(0, 1fr); gap: 6px 10px; padding: 6px 0; }
  .fx-flow .fig-controls .fig-slider { grid-column: 1 / -1; grid-row: 2; }
  .fx-flow .fig-controls .fig-step { min-width: 0; text-align: right; font-size: 13px; }
}

/* on a wide screen the animation steps out of the text column a little, so its labels are not drawn tiny */
@media (min-width: 900px) {
  figure.fx-flow { width: min(840px, calc(100vw - 48px)); max-width: none; margin-left: calc(50% - min(420px, 50vw - 24px)); }
}
