/* Hand-built figures for lesson 27, Making embeddings smaller. */

/* shared */
.cx-seg { flex-wrap: wrap; border-radius: 18px; }
.cx-ctl { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; margin-bottom: 18px; font-size: 0.85rem; }
.cx-field { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.cx-lab { font: 500 0.78rem var(--f-ui); color: var(--ink-3); margin: 0 0 6px; }
.cx-field .cx-lab { margin: 0; }
.cx-check { display: flex; gap: 8px; align-items: center; color: var(--ink-2); }
.cx-check input { accent-color: var(--accent); }
.cx-work { font: 0.9rem/1.6 var(--f-ui); color: var(--ink-2); margin: 16px 0 0; font-variant-numeric: tabular-nums; }
.cx-work b { color: var(--ink); }
.cx-axis { stroke: var(--ink-3); stroke-width: 1.2; }
.cx-grid { stroke: var(--line-2); stroke-width: 1; }
.cx-tick { font: 13px var(--f-mono); fill: var(--ink-3); }
.cx-tick.on { fill: var(--gold); font-weight: 600; }
.cx-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.8rem; color: var(--ink-3); margin: 10px 0 0; }
.cx-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cx-legend i { display: inline-block; width: 18px; height: 10px; border-radius: 3px; }
.cx-legend .k-vec { background: var(--accent); }
.cx-legend .k-link { background: var(--gold); }
.cx-legend .k-ram { width: 0; height: 14px; border-left: 2px dashed var(--ink); border-radius: 0; }
.cx-legend .k-imp { height: 3px; background: var(--gold); }
.cx-legend .k-plain { height: 3px; background: var(--ink-3); }

/* horizontal bars, one per row */
.cx-rows { display: grid; gap: 14px; }
.cx-row { display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 1fr) minmax(0, 8.5rem); gap: 6px 14px; align-items: center; }
.cx-rl { margin: 0; font: 0.85rem/1.3 var(--f-ui); color: var(--ink-2); }
.cx-rl b { color: var(--ink); font-weight: 600; }
.cx-rl span { display: block; font-size: 0.78rem; color: var(--ink-3); }
.cx-track { position: relative; height: 22px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line); display: flex; }
.cx-fill { display: block; height: 100%; background: var(--accent); border-radius: 5px 0 0 5px; transition: width 0.25s var(--ease); }
.cx-link { display: block; height: 100%; background: var(--gold); transition: width 0.25s var(--ease); }
.cx-ram { position: absolute; top: -5px; bottom: -5px; width: 0; border-left: 2px dashed var(--ink); }
.cx-rv { margin: 0; font: 0.9rem var(--f-ui); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cx-rv b { font: 600 1rem var(--f-mono); color: var(--ink); }
.cx-verdict { display: block; font-size: 0.8rem; }
.cx-verdict.ok { color: var(--good); }
.cx-verdict.no { color: var(--bad); }
@media (max-width: 640px) {
  .cx-row { grid-template-columns: minmax(0, 1fr) auto; }
  .cx-row .cx-track { grid-column: 1 / -1; grid-row: 2; }
  .cx-rv { text-align: right; }
}

/* hero */
.hcx { display: block; width: 100%; max-width: 900px; margin: 0 auto; }
.hcx-axis { stroke: var(--ink-3); stroke-width: 1.5; }
.hcx-s { opacity: 0; transition: opacity 0.5s; }
.hcx-s.in { opacity: 1; }
.hcx-b { fill: var(--accent); }
.hcx-b.keep { fill: var(--gold); }
.hcx-b.ghost { fill: none; stroke: var(--ink-3); stroke-dasharray: 3 3; }
.hcx-b.step { fill: var(--c6); }
.hcx-b.bit { fill: var(--gold); }
.hcx-l { font: 26px var(--f-mono); fill: var(--ink-2); }
@media (max-width: 600px) { .hcx-l { font-size: 40px; } }

/* overview: three ways */
.cx3-svg { display: block; width: 100%; max-width: 640px; margin: 4px auto 0; }
.cx3-ghost { fill: none; stroke: var(--ink-3); stroke-dasharray: 3 3; }
.cx3-bar { fill: var(--accent); }
.cx3-bar.fewer { fill: var(--gold); }
.cx3-bar.round { fill: var(--accent); }
.cx3-bar.bits { fill: var(--gold); }
.cx3-bit { font: 600 15px var(--f-mono); fill: var(--ink); }
@media (max-width: 600px) { .cx3-bit { font-size: 24px; } }
.cx3-read { display: flex; flex-wrap: wrap; gap: 10px 36px; align-items: baseline; margin-top: 10px; }
.cx-stat { margin: 0; display: grid; gap: 2px; }
.cx-stat span { font-size: 0.78rem; color: var(--ink-3); }
.cx-stat b { font: 400 1.7rem/1.1 var(--f-display); color: var(--ink); }
.cx-stat i { font-style: normal; font-size: 0.85rem; color: var(--gold); }
.cx3-note { flex-basis: 100%; margin: 4px 0 0; font-size: 0.88rem; color: var(--ink-2); min-height: 2.8em; }

/* Matryoshka: cut and turn */
.mc { display: grid; gap: 22px; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 820px) { .mc { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); } }
.mc-cols { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .mc-cols { grid-template-columns: 1fr 1fr; } }
.mc-bars { display: grid; gap: 6px; }
.mc-row { display: grid; grid-template-columns: 2.2em minmax(0, 1fr) 4.6em; gap: 8px; align-items: center; font: 0.85rem var(--f-mono); color: var(--ink-2); }
.mc-row.off { color: var(--ink-3); }
.mc-row.off .mc-v { font: 0.75rem var(--f-ui); }
.mc-i { font-style: italic; }
.mc-track { height: 16px; border-radius: 4px; background: var(--bg-2); border: 1px solid var(--line); overflow: hidden; }
.mc-track i { display: block; height: 100%; transition: width 0.25s var(--ease); }
.mc-full { background: var(--accent); }
.mc-row.off .mc-full { background: var(--ink-3); opacity: 0.5; }
.mc-cut { background: var(--gold); }
.mc-v { text-align: right; font-variant-numeric: tabular-nums; }
.mc-dial { display: block; width: 100%; max-width: 260px; margin: 0 auto; }
.mc-arc { fill: none; stroke: var(--line-2); stroke-dasharray: 3 4; }
.mc-full-arrow { stroke: var(--accent); stroke-width: 4; stroke-linecap: round; }
.mc-cut-arrow { stroke: var(--gold); stroke-width: 4; stroke-linecap: round; }
.mc-tip { fill: var(--gold); }
.mc-ang { fill: none; stroke: var(--ink-2); stroke-width: 1.5; }
.mc-ang-t { font: 600 15px var(--f-mono); fill: var(--ink); }

/* recall@k */
.rl { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .rl { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); } }
.rl-q { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; font-size: 0.88rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.rl-q span { min-width: 9.5em; text-align: center; }
.rl-chips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-bottom: 14px; }
.rl-chip { padding: 5px 2px; border-radius: 7px; text-align: center; font: 0.8rem var(--f-mono); color: var(--ink-3); border: 1px dashed var(--line-2); white-space: nowrap; }
.rl-chip.hit { color: var(--ink); background: var(--gold-soft); border: 1px solid var(--gold); }
.rl-big { font-size: 0.92rem; color: var(--ink-2); margin: 4px 0 0; min-height: 2.9em; font-variant-numeric: tabular-nums; }
.rl-big b { color: var(--ink); }
.rl-chart { display: block; width: 100%; max-width: 380px; }
.rl-line { fill: none; stroke-width: 2.5; }
.rl-line.imp { stroke: var(--gold); }
.rl-line.plain { stroke: var(--ink-3); stroke-dasharray: 5 4; }
.rl-dot.imp { fill: var(--gold); }
.rl-dot.plain { fill: var(--ink-3); }
.rl-dot.on { stroke: var(--ink); stroke-width: 2; }
@media (max-width: 600px) { .rl-chart .cx-tick { font-size: 16px; } }

/* scalar quantization: the ruler */
.ir-svg { display: block; width: 100%; max-width: 680px; margin: 0 auto; }
.ir-out { stroke: var(--line-2); stroke-width: 3; stroke-dasharray: 4 5; }
.ir-in { stroke: var(--ink-3); stroke-width: 3; }
.ir-mark { stroke: var(--ink-2); stroke-width: 1.5; }
.ir-mark.fine { stroke-width: 0.7; }
.ir-mark.on { stroke: var(--gold); stroke-width: 3; }
.ir-x { fill: var(--gold); }
.ir-xl { font: italic 600 17px var(--f-body); fill: var(--gold); }
.ir-back { fill: var(--accent); }
.ir-err { fill: var(--bad); opacity: 0.35; }
@media (max-width: 600px) { .ir-svg .cx-tick { font-size: 22px; } .ir-xl { font-size: 26px; } }

/* binary: signs, bits, differences */
.sb { display: grid; grid-template-columns: 4.6em repeat(8, minmax(0, 2.8em)) 3.2em; gap: 6px 5px; align-items: center; justify-content: start; }
.sb-l { font-size: 0.78rem; color: var(--ink-3); }
.sb-e { font: 600 0.9rem var(--f-mono); color: var(--ink); padding-left: 4px; white-space: nowrap; }
.sb-n, .sb-b, .sb-x { height: 34px; display: grid; place-items: center; border-radius: 7px; font: 500 0.85rem var(--f-mono); border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink-2); padding: 0; min-width: 0; }
button.sb-n, button.sb-b { cursor: pointer; }
button.sb-n:disabled { cursor: default; opacity: 0.7; }
.sb-b.one { background: var(--accent-soft); color: var(--ink); border-color: var(--accent); }
.sb-x { border-style: dashed; color: var(--ink-3); background: transparent; }
.sb-x.on { border: 1px solid var(--bad); color: var(--bad); font-weight: 700; }
@media (max-width: 480px) {
  /* On a phone each row's label sits on its own line above the row, so the eight cells get the width. */
  .sb { grid-template-columns: repeat(8, minmax(0, 1fr)) 3.6em; gap: 4px 3px; }
  .sb-l { grid-column: 1 / -1; font-size: 0.72rem; margin-top: 4px; }
  .sb-n { font-size: 0.72rem; }
  .sb-e { font-size: 0.82rem; padding-left: 2px; }
}

/* shortlist, then check */
.sc-flow { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin-bottom: 18px; font-size: 0.85rem; color: var(--ink-3); }
.sc-flow span { color: var(--ink-2); }
.sc-flow b { color: var(--ink); font: 600 0.95rem var(--f-mono); }
.sc-flow i { font-style: normal; }
.cx-fill.sc-a { background: var(--ink-3); border-radius: 5px; }
.cx-fill.sc-b { background: var(--gold); border-radius: 5px; }
