/* Hand-built figures for lesson 23, Looking inside the model. */

/* shared: two columns that stack on a phone, planes, arrows, handles, small text, feature colours */
.ip-two { display: grid; gap: 22px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 760px) { .ip-two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.ip-plane { width: 100%; max-width: 360px; margin: 0 auto; touch-action: none; display: block; }
.ip-grid { stroke: var(--line); }
.ip-axis { stroke: var(--ink-3); stroke-width: 1.2; }
.ip-tick { font: 11.5px var(--f-mono); fill: var(--ink-3); }
.ip-vec { stroke-linecap: round; }
.ip-head { stroke: none; }
.ip-vec.state, .ip-head.state { stroke: var(--c2); fill: var(--c2); }
.ip-handle { fill: var(--ink); fill-opacity: 0.1; stroke: var(--ink-2); stroke-width: 1.5; cursor: grab; }
.ip-handle:focus-visible { outline: none; stroke: var(--gold); stroke-width: 3; }
.ip-side .kicker { margin: 0 0 6px; }
.ip-side .slider { font-size: 0.85rem; margin: 6px 0; }
.ip-check { display: flex; gap: 8px; align-items: flex-start; font-size: 0.85rem; color: var(--ink-2); margin: 8px 0; }
.ip-check input { margin-top: 3px; }
.ip-table { border-collapse: collapse; font-size: 0.85rem; margin: 4px 0 8px; font-variant-numeric: tabular-nums; }
.ip-table th { font: 500 0.72rem var(--f-mono); color: var(--ink-3); text-align: left; padding: 3px 14px 3px 0; text-transform: uppercase; letter-spacing: 0.04em; }
.ip-table td { padding: 3px 14px 3px 0; color: var(--ink-2); }
.ip-table b { color: var(--ink); }
.ip-table tr.on td { color: var(--ink); }
.ip-table tr.on td:first-child { box-shadow: inset 3px 0 0 var(--gold); padding-left: 8px; }
.good { color: var(--good); } .bad { color: var(--bad); }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 6px; }
.ip-k0 { --k: var(--c1); } .ip-k1 { --k: var(--c3); } .ip-k2 { --k: var(--c4); } .ip-k3 { --k: var(--c5); }
.ip-k4 { --k: var(--c6); } .ip-k5 { --k: var(--c7); } .ip-k6 { --k: var(--gold); }

/* hero */
.hi { width: 100%; height: auto; display: block; margin: 0 auto; max-width: 820px; }
.hi-ring { fill: none; stroke: var(--line-2); stroke-dasharray: 3 6; }
.hi-axis { stroke: var(--ink-3); stroke-width: 1; opacity: 0.6; }
.hi-lbl { font: 500 15px var(--f-ui); fill: var(--ink-3); }
@media (max-width: 600px) { .hi-lbl { font-size: 24px; } }
.hi-arrow { opacity: 0.35; transition: opacity 0.5s; }
.hi-arrow.on { opacity: 1; }
.hi-shaft { stroke: var(--k); stroke-width: 4; stroke-linecap: round; }
.hi-tip { fill: var(--k); }
.hi-slot { fill: var(--surface); stroke: var(--line-2); }
.hi-fill { fill: var(--k); opacity: 0; transition: opacity 0.5s; }
.hi-fill.on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .hi-arrow, .hi-fill { transition: none; } }

/* 1: features as directions */
.fd-track { stroke-width: 1; stroke-dasharray: 2 5; opacity: 0.7; }
.fd-track.pos, .fd-drop.pos { stroke: var(--c1); } .fd-track.past, .fd-drop.past { stroke: var(--c3); }
.fd-drop { stroke-width: 1.5; stroke-dasharray: 3 4; }
.fd-foot.pos { fill: var(--c1); } .fd-foot.past { fill: var(--c3); }
.ip-vec.pos, .ip-head.pos { stroke: var(--c1); fill: var(--c1); } .ip-vec.past, .ip-head.past { stroke: var(--c3); fill: var(--c3); }
.fd-lbl { font: 600 13px var(--f-ui); } .fd-lbl.pos { fill: var(--c1); } .fd-lbl.past { fill: var(--c3); }
.sw.pos { background: var(--c1); } .sw.past { background: var(--c3); }
.fd-read { min-height: 12em; margin-top: 10px; }
.fd-big { font: 400 1.7rem/1.1 var(--f-display); margin: 0 0 14px; color: var(--c2); }
.fd-verdict { font-size: 0.88rem; font-weight: 600; margin: 6px 0 0; min-height: 2.8em; }
.fd-verdict.good { color: var(--good); } .fd-verdict.warn { color: var(--gold); }

/* 2: probes */
.pl { display: grid; gap: 26px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .pl { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } }
.pl .seg { margin: 4px 0 6px; flex-wrap: wrap; }
.pl .slider { font-size: 0.85rem; margin: 6px 0; }
.pl-strip { width: 100%; height: auto; display: block; max-width: 420px; }
.pl-flip { width: 100%; height: auto; display: block; max-width: 340px; }
.pl-zero { stroke: var(--ink-2); stroke-width: 1.2; stroke-dasharray: 4 4; }
.pl-row { font: 500 12px var(--f-ui); fill: var(--ink-2); }
.pl-dot { stroke-width: 1.4; }
.pl-dot.yes { fill: var(--c1); stroke: var(--c1); }
.pl-dot.no { fill: none; stroke: var(--c2); }
.pl-before { fill: none; stroke: var(--ink-3); stroke-width: 1.5; }
.pl-after { fill: var(--c1); }
.pl-move-line { stroke: var(--c1); stroke-width: 1.5; opacity: 0.6; }
.pl-move { font-size: 0.88rem; color: var(--ink-2); min-height: 3em; margin: 6px 0 0; }
.pl-move b { color: var(--ink); }

/* 3: the logit lens */
.ld-region { stroke: none; }
.ld-region.paris { fill: var(--c1); fill-opacity: 0.13; } .ld-region.london { fill: var(--c3); fill-opacity: 0.13; } .ld-region.rome { fill: var(--gold); fill-opacity: 0.13; }
.ld-rlbl { font: 600 13px var(--f-ui); }
.ld-rlbl.paris { fill: var(--c1); } .ld-rlbl.london { fill: var(--c3); } .ld-rlbl.rome { fill: var(--gold); }
.ip-vec.w1, .ip-head.w1 { stroke: var(--c5); fill: var(--c5); } .ip-vec.w2, .ip-head.w2 { stroke: var(--c7); fill: var(--c7); }
.ld-dot { stroke: var(--bg); stroke-width: 1.5; }
.ld-plane .ip-vec, .ld-plane .ip-head, .ld-dot { pointer-events: none; }
.ld-dot.d0 { fill: var(--ink-3); } .ld-dot.d1 { fill: var(--c5); } .ld-dot.d2 { fill: var(--c7); }
.ld-key { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 7px; }
.ld-key.d0 { background: var(--ink-3); } .ld-key.d1 { background: var(--c5); } .ld-key.d2 { background: var(--c7); }
.ld-row { margin: 0 0 12px; }
.ld-name { font-size: 0.86rem; color: var(--ink-2); margin: 0 0 4px; }
.ld-name b { color: var(--ink); }
.ld-bar { display: grid; grid-template-columns: 4.2em minmax(0, 1fr) 3em; gap: 8px; align-items: center; font-size: 0.8rem; margin: 2px 0; }
.ld-word { color: var(--ink-2); }
.ld-track { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.ld-track i { display: block; height: 100%; border-radius: 5px; }
.ld-track i.paris { background: var(--c1); } .ld-track i.london { background: var(--c3); } .ld-track i.rome { background: var(--gold); }
.ld-num { font: 0.8rem var(--f-mono); color: var(--ink); text-align: right; }
.ld-res { font: 0.75rem var(--f-mono); margin: 2px 0 0; }

/* 4: activation patching */
.pb-prompts p { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 10px; font-size: 0.9rem; }
.pb-tag { font: 600 0.7rem var(--f-mono); text-transform: uppercase; letter-spacing: 0.05em; padding: 3px 8px; border-radius: 999px; }
.pb-tag.clean { background: var(--accent-soft); color: var(--accent-ink); } .pb-tag.corrupt { background: var(--gold-soft); color: var(--gold); }
.pb-ld { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pb-ld b { color: var(--ink); }
.pb-prompts .seg { flex-wrap: wrap; }
.pb-body { display: grid; gap: 22px; grid-template-columns: 1fr; margin-top: 10px; }
@media (min-width: 820px) { .pb-body { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }
.pb-grid { display: grid; grid-template-columns: minmax(5.5em, 1.1fr) repeat(3, minmax(0, 1fr)); gap: 6px; align-items: center; }
.pb-col { font: 0.7rem/1.3 var(--f-mono); color: var(--ink-3); text-align: center; }
.pb-rowlbl { font-size: 0.78rem; line-height: 1.3; color: var(--ink-2); }
.pb-cell { height: 56px; border-radius: 10px; border: 1px solid var(--line-2); font: 600 0.95rem var(--f-mono); color: var(--ink-3); cursor: pointer;
  background: color-mix(in oklch, var(--good) calc(var(--v) * 70%), var(--surface-2)); }
.pb-cell.done { color: var(--ink); }
.pb-cell.sel { box-shadow: 0 0 0 2px var(--gold); }
.pb-side { min-height: 15em; font-size: 0.88rem; color: var(--ink-2); }
.pb-side p { margin: 0 0 8px; }
.pb-side b { color: var(--ink); }
.pb-work { font: 0.82rem/1.5 var(--f-mono); overflow-wrap: anywhere; }
.pb-big { font: 400 2rem/1.1 var(--f-display); color: var(--good); }
.pb-lens { border-top: 1px solid var(--line); padding-top: 8px; }

/* 5: superposition */
.ip-vec.feat, .ip-head.feat { stroke: var(--k); fill: var(--k); opacity: 0.45; }
.ip-vec.feat.on, .ip-head.feat.on { opacity: 1; }
.sq-lbl { font: 600 12px var(--f-mono); fill: var(--k); }
.sq-toggles { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.sq-btn { min-width: 44px; height: 34px; border-radius: 8px; border: 1.5px solid var(--k); background: transparent; color: var(--ink-2); font: 600 0.85rem var(--f-mono); cursor: pointer; }
.sq-btn[aria-pressed="true"] { background: var(--k); color: var(--bg); }
.sq-bars { width: 100%; height: auto; display: block; max-width: 400px; margin-top: 6px; }
.sq-fill { fill: var(--k); opacity: 0.85; }
.sq-small { font-size: 9px; }
.sq-true { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 4 3; }
.sq-verdict { font-size: 0.86rem; color: var(--ink-2); min-height: 4.4em; margin: 6px 0 0; }

/* 6: sparse autoencoders */
.sa-dots circle { fill: var(--ink-3); opacity: 0.45; }
.sa-planted { stroke: var(--ink-3); stroke-width: 9; stroke-linecap: round; opacity: 0.25; }
.ip-vec.learned, .ip-head.learned { stroke: var(--c2); fill: var(--c2); }
.sa-read { min-height: 5.2em; margin: 8px 0; }
.sa-stat { font-size: 0.88rem; color: var(--ink-2); margin: 0 0 6px; }
.sa-stat b { color: var(--ink); font-variant-numeric: tabular-nums; }
.sw.match { background: var(--c1); } .sw.lost { background: var(--c2); }
.sa-sweep { width: 100%; height: auto; display: block; max-width: 400px; }
.sa-line { fill: none; stroke-width: 2; }
.sa-line.match { stroke: var(--c1); } .sa-line.lost { stroke: var(--c2); }
.sa-pt.match { fill: var(--c1); } .sa-pt.lost { fill: var(--c2); }

/* 7: the evidence ladder */
.el-rungs { display: grid; grid-template-columns: 1fr; gap: 6px; margin-bottom: 16px; }
@media (min-width: 700px) { .el-rungs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.el-rung { border-radius: 10px; padding: 8px 12px; background: var(--surface-2); border-left: 4px solid var(--ink-3); font-size: 0.85rem; display: flex; flex-direction: column; gap: 2px; }
.el-rung span { color: var(--ink-2); }
.el-rung.corr { border-color: var(--c1); } .el-rung.int { border-color: var(--gold); } .el-rung.mech { border-color: var(--good); }
.el-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.el-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.el-claim { margin: 0 0 8px; }
.el-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.el-btns .btn[aria-pressed="true"] { border-color: var(--ink); }
.el-btns .btn.right[aria-pressed="true"], .el-btns .btn.right { border-color: var(--good); color: var(--good); }
.el-btns .btn.wrong { border-color: var(--bad); color: var(--bad); }
.el-why { font-size: 0.85rem; color: var(--ink-2); margin: 8px 0 0; }
.el-why:empty { display: none; }
.el-score { font-size: 0.9rem; color: var(--ink-2); margin: 14px 0 0; }
