/* BreadBowl-Embed v1.3 release post: the figures drawn by figs.js (pareto, grad, jump).
   Colors are blog.css tokens only, so light and dark follow the theme with no script.
   v1.3 is drawn in the value green, as in the hero's v1.3 lane and the latency bar. To draw it
   in the cost orange instead, point the four --figs-hero* properties at the --cost* tokens. */

[data-fig] {
  --figs-hero: var(--val);
  --figs-hero-ink: var(--val-ink);
  --figs-hero-soft: var(--val-soft);
  --figs-hero-rgb: var(--val-rgb);
}

/* ------------------------------------------------------------------ shared */
.fg-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 22px; margin-bottom: 16px; }
.fg-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font: 500 12px/1.3 var(--font-sans); color: var(--muted); }
.fg-legend li { margin: 0; display: inline-flex; align-items: center; gap: 6px; }
.fg-sw { display: block; flex: none; overflow: visible; }
.fg-plot { position: relative; min-width: 0; }
.fg-svg { display: block; max-width: 100%; height: auto; overflow: visible; font-family: var(--font-sans); -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.fg-svg text { fill: var(--muted); font-size: 11px; }
/* figs.js sizes text to fit by measuring it; under blog.css's reduced-motion rule a size change would
   otherwise run as a 0.01 ms transition and measure stale. Rules below re-enable only what they need. */
.fg-svg text, .fg-svg tspan { transition-property: none; }
.fg-grid line { stroke: rgba(var(--ink-rgb), 0.08); stroke-width: 1; shape-rendering: crispEdges; }
.fg-ax text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.fg-svg .fg-axt { fill: var(--ink-2); font-size: 11.5px; font-weight: 650; font-variant-numeric: normal; }
.fg-base { stroke: rgba(var(--ink-rgb), 0.32); stroke-width: 1; shape-rendering: crispEdges; }
.fg-tk { stroke: rgba(var(--ink-rgb), 0.32); stroke-width: 1; shape-rendering: crispEdges; }
.fg-tk.minor { stroke: rgba(var(--ink-rgb), 0.2); }
.fg-tip > div + div { margin-top: 3px; }
.fg-tip .fg-dim { opacity: 0.8; }

/* ------------------------------------------------------------------ 01 pareto */
.pf-gutter { fill: rgba(var(--ink-rgb), 0.035); }
.pf-band { fill: rgba(var(--ink-rgb), 0.045); }
.pf-svg .pf-gl { fill: var(--muted); font-size: 11px; font-weight: 600; }
.pf-svg .pf-bn { fill: var(--ink-2); font-size: 12px; font-weight: 650; }
.pf-svg .pf-bs, .pf-svg .pf-bn .pf-bs { fill: var(--muted); font-size: 11px; font-weight: 500; }
.pf-lead { stroke: rgba(var(--ink-rgb), 0.28); stroke-width: 1; }
.pf-yt.is-moving text { transition: opacity 150ms ease; }   /* at rest a label under the score pill is simply hidden */
.pf-guide { stroke: var(--figs-hero); stroke-width: 1.25; stroke-dasharray: 5 4; opacity: 0.85; }
.pf-dim { fill: none; stroke: var(--ink-2); stroke-width: 1.2; }
.pf-conn { stroke: var(--ink-2); stroke-width: 1.2; stroke-dasharray: 2 3; }
.pf-svg .pf-annt { fill: var(--ink-2); font-size: 12.5px; font-weight: 500; }
.pf-svg .pf-annt .b { fill: var(--ink); font-weight: 750; }
.pf-svg .pf-hl1 { fill: var(--ink); font-size: 13px; font-weight: 700; letter-spacing: -0.01em; }
.pf-svg .pf-hl2 { fill: var(--muted); font-size: 11.5px; font-weight: 500; }
.pf-tag rect { fill: var(--figs-hero-soft); stroke: var(--figs-hero); stroke-width: 1; }
.pf-svg .pf-tag text { fill: var(--figs-hero-ink); font-size: 11px; font-weight: 750; font-variant-numeric: tabular-nums; }
.pf-mark { stroke-linejoin: round; }
.pf-mark.k-lvl { fill: var(--paper); stroke: var(--ink-2); stroke-width: 2; }
.pf-mark.k-up, .pf-mark.k-down { fill: var(--ink-2); stroke: var(--paper); stroke-width: 1.5; }
.pf-mark.k-hero { fill: var(--figs-hero); stroke: var(--paper); stroke-width: 2; }
.is-alone .pf-mark.k-lvl { stroke: var(--neutral-mark); }
.is-alone .pf-mark.k-up, .is-alone .pf-mark.k-down { fill: var(--neutral-mark); }
.pf-halo { fill: rgba(var(--figs-hero-rgb), 0.18); }
.pf-pt { outline: none; }
.pf-ring { fill: none; stroke: var(--ink); stroke-width: 1.5; opacity: 0; transition: opacity 120ms ease; }
.pf-pt.on .pf-ring, .pf-pt:focus-visible .pf-ring { opacity: 1; }

/* ------------------------------------------------------------------ 03 grad */
.gd-legend { gap: 6px 14px; }
.gd-box { stroke-width: 1; transition: stroke 300ms ease var(--d, 0s), stroke-width 300ms ease var(--d, 0s); }
.gd-param.r-base .gd-box { fill: var(--paper-2); stroke: rgba(var(--ink-rgb), 0.2); }
.gd-param.r-rt .gd-box { fill: var(--rt-soft); stroke: rgba(var(--rt-rgb), 0.45); }
.gd-param.r-val .gd-box { fill: var(--val-soft); stroke: rgba(var(--val-rgb), 0.45); }
.gd-var .gd-box { fill: var(--paper); stroke: rgba(var(--ink-rgb), 0.2); }
.gd-var.r-rt .gd-box { stroke: rgba(var(--rt-rgb), 0.5); }
.gd-var.r-val .gd-box { stroke: rgba(var(--val-rgb), 0.5); }
.gd-loss .gd-box { fill: var(--paper); stroke: rgba(var(--ink-rgb), 0.38); stroke-width: 1.25; }
.gd-teach .gd-box { fill: var(--paper); stroke: rgba(var(--cost-rgb), 0.6); stroke-dasharray: 4 3; }
.gd-rep .gd-box { fill: var(--paper); stroke: rgba(var(--rt-rgb), 0.55); stroke-dasharray: 4 3; }
.gd-n.hot .gd-box { stroke: var(--cost); stroke-width: 2; }
.gd-hatch { opacity: 0; transition: opacity 300ms ease; }
.gd-n.frozen .gd-hatch { opacity: 1; }
.gd-hatch-l { stroke: rgba(var(--ink-rgb), 0.12); stroke-width: 2.4; }
.gd-svg .gd-t { fill: var(--ink); font-size: 13px; font-weight: 650; letter-spacing: -0.005em; transition: fill 300ms ease; }
.gd-svg .gd-s { fill: var(--muted); font-size: 11px; font-weight: 500; }
.gd-svg .gd-k { fill: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; }
.gd-n.frozen .gd-t { fill: var(--muted); }
.gd-rep .gd-t { fill: var(--rt-ink); font-size: 12.5px; }
.gd-svg .gd-tag { fill: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: 0.02em; transition: fill 300ms ease var(--d, 0s); }
.gd-svg .gd-n.hot .gd-tag { fill: var(--cost-ink); }
.gd-lock { opacity: 0; transition: opacity 300ms ease; }
.gd-n.frozen .gd-lock { opacity: 1; }
.gd-lock-s { fill: none; stroke: var(--muted); stroke-width: 1.4; }
.gd-lock-b { fill: var(--muted); }
.gd-svg .gd-math { fill: var(--ink); font-family: var(--font-serif); font-size: 15px; }
.gd-svg .gd-el { fill: var(--ink-2); }   /* V_d, V_q: which value vectors an edge carries */
.gd-m-it { font-style: italic; }
.gd-m-up, .gd-m-sub, .gd-m-sup { font-style: normal; }

/* forward pass: thin neutral arrows; retrieval replay: quiet dashed routing blue */
.gd-line { fill: none; stroke: rgba(var(--ink-rgb), 0.42); stroke-width: 1.3; }
.gd-head { fill: rgba(var(--ink-rgb), 0.5); }
.gd-aux { stroke-dasharray: 3 3; }
.gd-rep-line { fill: none; stroke: var(--rt); stroke-width: 1.3; stroke-dasharray: 4 3.5; opacity: 0.7; }
.gd-rep-head { fill: var(--rt); opacity: 0.7; }

/* ranking gradient: a wide translucent band under the arrow, with a dashed core that runs backward */
.gd-band { fill: none; stroke: var(--cost); stroke-width: 9; stroke-linecap: round; opacity: 0; stroke-dasharray: 1 1; stroke-dashoffset: -1;
  transition: stroke-dashoffset 420ms ease var(--d, 0s), opacity 200ms ease var(--d, 0s); }
.gd-e.lit .gd-band { opacity: 0.26; stroke-dashoffset: 0; }
.gd-core { fill: none; stroke: var(--cost); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 2.5 5.5; opacity: 0; transition: opacity 250ms ease calc(var(--d, 0s) + 0.3s); }
.gd-e.lit .gd-core { opacity: 1; }
.gd-svg.flowing .gd-e.lit .gd-core { animation: gd-flow 900ms linear 5; }
@keyframes gd-flow { to { stroke-dashoffset: 8; } }

/* stop-gradient: two bars across the edge, shown in v1.2 */
.gd-stop { opacity: 0; transition: opacity 250ms ease; }
.gd-svg.is-12 .gd-stop { opacity: 1; }
.gd-stop-bg { fill: var(--paper); }
.gd-stop-bar { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.gd-svg .gd-stop-t { fill: var(--ink-2); font-size: 11px; font-weight: 650; }

.gd-band-sw { fill: none; stroke: var(--cost); stroke-width: 9; stroke-linecap: round; opacity: 0.26; }
.gd-core-sw { fill: none; stroke: var(--cost); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 2.5 4.5; }
.gd-sw-box { fill: var(--paper-2); stroke: rgba(var(--ink-rgb), 0.2); }
.gd-sw-hatch { stroke: rgba(var(--ink-rgb), 0.22); stroke-width: 1.6; }

.gd-say { margin: 16px 0 0; min-height: 3.1em; font: 500 14px/1.55 var(--font-sans); color: var(--ink-2); }
.gd-say b { color: var(--ink); font-weight: 750; }
.gd-mi { font-family: var(--font-serif); font-size: 1.1em; }
.gd-mi sub { font-style: normal; font-size: 0.7em; }
@media (max-width: 760px) { .gd-say { min-height: 6.2em; } }

/* ------------------------------------------------------------------ 03 jump */
.jp-svg .jp-key text { fill: var(--ink-2); font-size: 11.5px; font-weight: 600; }
.jp-svg .jp-gh { fill: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; }
.jp-a { fill: var(--neutral-mark); stroke: var(--paper); stroke-width: 2; }
.jp-b { fill: var(--figs-hero); stroke: var(--paper); stroke-width: 2; }
.jp-bar { stroke: var(--figs-hero); stroke-width: 4; stroke-linecap: round; opacity: 0.38; }
.jp-row.hot .jp-bar { stroke-width: 5; opacity: 0.85; }
.jp-wash { fill: var(--figs-hero-soft); opacity: 0.75; }
.jp-svg .jp-name { fill: var(--ink-2); font-size: 13px; font-weight: 600; }
.jp-svg .jp-row.hot .jp-name { fill: var(--ink); font-weight: 750; }
.jp-svg .jp-name2 { fill: var(--muted); font-size: 11.5px; font-weight: 500; }
.jp-svg .jp-va { fill: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.jp-svg .jp-vb { fill: var(--ink); font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
.jp-svg .jp-gain { fill: var(--ink-2); font-size: 15px; font-weight: 650; }
.jp-svg .jp-row.hot .jp-gain { fill: var(--figs-hero-ink); font-size: 22px; font-weight: 750; letter-spacing: -0.02em; }
.jp-svg.is-narrow .jp-gain { font-size: 13.5px; }
.jp-svg.is-narrow .jp-row.hot .jp-gain { font-size: 18px; }

/* ------------------------------------------------------------------ motion and print */
@media (prefers-reduced-motion: reduce) {
  .gd-svg .gd-core { animation: none !important; }
}
@media print {
  .fg-top .seg { display: none; }
}
