/* Interactive figures for the kettei launch post. Rules ported from sqwishai/website
   (archive/src/versions/nov2026/blog/embeds/kettei/kettei.css); the colours are mapped to this site's tokens. */
.kettei-figure {
  --bg: var(--card); --bg-2: var(--bg2); --bg-3: var(--track);
  --fg: var(--ink); --fg-2: var(--ink2); --eyebrow: var(--muted);
  --rule: var(--line); --rule-2: var(--line2);
  /* kettei wears the logo's pink, as on the Models page; --sq-2 is the same hue, deeper, for a second kettei series.
     --mint and --amber are the site's own. Other models wear their own hues or the site's greys, never a logo colour. */
  --sq: var(--pink); --sq-2: #A9528F; --sq-soft: rgba(229, 138, 205, .08);
  --jev: #6B3FA0; --clef: #3F7DD0; --clef-2: #9CBCE8; --liq: #00897B; --vllm: #96611F; --oai: var(--ink2); --base: color-mix(in srgb, var(--muted) 50%, var(--line2));
  --vid-bg: var(--night);
  --body: var(--sans); --display: var(--serif); --nav: var(--sans);
}
/* In the charts that compare models, the script draws Perplexity in --amber and Microsoft in --mint: here those are
   a rust and an olive. With blue, teal and violet the five pass the palette checks on the card, any pair side by side. */
.kettei-benchmarks, .kettei-radar, .kettei-games, .kettei-cascade, .kettei-latency { --amber: #B8432A; --mint: #919216; }
.prose figure.kettei-figure { margin-block: 40px; }
/* The radar draws a halo behind its labels in --bg-2; on this site that must match the frame. */
.kettei-figure.kettei-radar { --bg-2: var(--card); }
.kettei-figure .kf-frame { border: 1px solid var(--line); border-radius: 18px; background: var(--card); padding: 24px 24px 22px; overflow: hidden; }
.kettei-figure figcaption strong { color: var(--ink); font-weight: 600; }
/* Colour is for marks. Words and numbers stay in ink, whatever colour the script gave them. */
.kettei-figure svg text[fill="var(--sq)"] { fill: var(--ink); }
.kettei-figure svg text[fill="var(--mint)"], .kettei-figure svg text[fill="var(--clef)"] { fill: var(--ink2); }
.kettei-figure svg line[stroke="var(--mint)"] { stroke: var(--ink2); stroke-width: 1.5; } /* a reference line, not a series */
/* kettei's own dots take the ink outline of the dots on the Models page */
.kettei-figure svg circle[fill="var(--sq)"]:not([stroke]) { stroke: var(--ink); stroke-width: 1.2; }
.kettei-figure.kettei-loop svg line[stroke="var(--sq)"] { stroke: var(--ink); opacity: .35; }
.kettei-figure.kettei-loop svg circle[r="74"] { fill: var(--pink-t); stroke: var(--ink); stroke-width: 1.5; } /* the agent in the middle: a pink tint in an ink ring, like the drawn diagrams */
/* undo this site's own .btn, .row and prose rules inside a figure */
.kettei-figure .btn { display: inline-block; min-height: 0; font-weight: 400; }
.kettei-figure .seg button, .kettei-figure .btn { font-weight: 600; }
.kettei-figure .kf-frame { font-size: 16px; line-height: 1.5; }
.kettei-figure .kf-frame li + li { margin-top: 0; }
.kettei-figure .kf-frame p, .kettei-figure .kf-frame h4, .kettei-figure .kf-frame ol, .kettei-figure .kf-frame li { max-width: none; }
@media (max-width: 640px) { .kettei-figure .kf-frame { padding: 12px; } }
/* On a phone the densest charts (build.py, KF_SCROLL) keep a width their words can be read at and scroll sideways,
   edge to edge in their card. The edge with more to see fades out (runtime.js keeps data-more up to date). */
@media (max-width: 640px) {
  .kf-scroll { margin: 0 -12px; padding: 0 12px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none; }
  .kf-scroll::-webkit-scrollbar { display: none; }
  .kf-scroll > #pareto { min-width: 620px; }
  .kf-scroll > #radar { min-width: 540px; }
  .kf-scroll > #lenlat { min-width: 680px; }
  .kf-scroll > #cascade { min-width: 800px; }
  .kf-scroll > #loop { min-width: 420px; }
  .kf-scroll[data-more=right] { -webkit-mask-image: linear-gradient(to left, transparent, #000 48px); mask-image: linear-gradient(to left, transparent, #000 48px); }
  .kf-scroll[data-more=left] { -webkit-mask-image: linear-gradient(to right, transparent, #000 48px); mask-image: linear-gradient(to right, transparent, #000 48px); }
  .kf-scroll[data-more=both] { -webkit-mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent); }
}

.kettei-figure .figtitle{font-family:var(--mono); font-size:11px; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); margin:0 0 16px; display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; align-items:center}
.kettei-figure .chart-canvas{width:100%; min-width:0}
.kettei-figure svg text{font-family:var(--body)}
.kettei-figure svg .mono{font-family:var(--mono)}
.kettei-figure .legend{display:flex; flex-wrap:wrap; gap:8px 18px; font-size:13.5px; color:var(--fg-2); margin-top:16px}
.kettei-figure .legend .lg{font:inherit; color:var(--fg-2); background:none; border:0; padding:0; cursor:pointer}
.kettei-figure .legend .lg[aria-pressed="false"]{opacity:.42}
.kettei-figure .legend .lg small{color:var(--muted); font-size:11.5px}
.kettei-figure .legend i{display:inline-block; width:10px; height:10px; border-radius:50%; margin-right:7px; vertical-align:-1px}
.kettei-figure .seg{display:inline-flex; flex-wrap:wrap; gap:6px}
.kettei-figure .seg button{font:600 13px var(--nav); letter-spacing:0; text-transform:none; color:var(--muted); background:none; border:1px solid var(--line2); border-radius:999px; padding:5px 13px; cursor:pointer}
.kettei-figure .seg button:hover{color:var(--fg)}
.kettei-figure .seg button{white-space:nowrap}
.kettei-figure .seg-players{flex-wrap:wrap}
.kettei-figure .seg-players button{padding:6px 9px}
.kettei-figure .seg-players button[data-p="fat"],.kettei-figure .seg-players button[data-p="chub"]{text-transform:none}
.kettei-figure .seg button[hidden]{display:none}
.kettei-figure .seg button[aria-pressed="true"]{background:var(--ink); border-color:var(--ink); color:var(--card)}
.kettei-figure .seg button[aria-pressed="true"]:hover{color:var(--card)}
.kettei-figure .btn{font:600 13px var(--nav); color:var(--muted); background:none; border:1px solid var(--line2); border-radius:999px; padding:5px 13px; cursor:pointer}
.kettei-figure .btn:hover{color:var(--fg)}
.kettei-figure .note{font-size:12.5px; color:var(--eyebrow); line-height:1.55; margin-top:12px}
.kettei-figure .note:empty{display:none}
.kettei-figure .grid2{display:grid; grid-template-columns:repeat(auto-fit, minmax(280px, 1fr)); gap:16px}
.kettei-figure .grid2 > *{min-width:0}
.kettei-figure .panel{background:var(--bg-2); border:1px solid var(--rule); border-radius:12px; padding:16px}
.kettei-figure .panel h4{margin:0 0 4px; font-size:14px; font-weight:600; color:var(--fg)}
.kettei-figure .panel .sub{font-size:12.5px; color:var(--eyebrow); margin:0 0 10px; line-height:1.5}
.kettei-figure .table-units{font-size:13px; color:var(--muted); line-height:1.5; margin:0 0 14px}
.kettei-figure .family{width:100%; table-layout:fixed; border-collapse:collapse; font-size:14px; font-variant-numeric:tabular-nums}
.kettei-figure .family th,.kettei-figure .family td{text-align:left; padding:12px 8px; color:var(--fg-2); border-bottom:1px solid var(--rule); vertical-align:middle; line-height:1.4}
.kettei-figure .family thead th{font-weight:600; font-size:16px; color:var(--fg); border-bottom-color:var(--rule-2)}
.kettei-figure .family th:first-child{width:37%; padding-left:0}
.kettei-figure .family tbody th{font-weight:400}
.kettei-figure .family tr:last-child > *{border-bottom:0}
.kettei-figure .family .table-section > *{border-top:1px solid var(--rule-2)}
.kettei-figure .trace{display:grid; gap:8px}
.kettei-figure .step{display:grid; grid-template-columns:28px minmax(0,1.15fr) minmax(0,1.6fr); gap:14px; align-items:center; border:1px solid var(--rule); border-radius:12px; padding:12px 16px}
.kettei-figure .step .n{font:500 12px var(--mono); color:var(--eyebrow)}
.kettei-figure .step .q{font-size:15.5px; color:var(--fg); line-height:1.35}
.kettei-figure .step .q small{display:block; font:400 11.5px var(--mono); color:var(--eyebrow); letter-spacing:.02em; margin-top:3px}
.kettei-figure .dist{display:grid; gap:3px}
.kettei-figure .dist .row{display:grid; grid-template-columns:minmax(0,1fr) 120px 38px; gap:8px; align-items:center; font-size:12px; color:var(--fg-2)}
.kettei-figure .dist .row span:first-child{overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-family:var(--mono); font-size:11.5px}
.kettei-figure .bar{height:8px; border-radius:4px; background:var(--bg-3); overflow:hidden}
.kettei-figure .k-single{--c:var(--mint); --c-2:var(--mint)}
.kettei-figure .k-binary,.kettei-figure .k-each{--c:var(--sq); --c-2:var(--sq)}
.kettei-figure .bar > i{display:block; height:100%; background:var(--c, var(--sq)); border-radius:4px}
.kettei-figure .dist .row.dim .bar > i{background:var(--c-2, var(--sq-2)); opacity:.55}
.kettei-figure .dist .row b{font:500 11px var(--mono); color:var(--fg-2); text-align:right}
.kettei-figure .dist .row.rest,.kettei-figure .dist .row.rest b{color:var(--muted)}
.kettei-figure .step.k-write{background:var(--bg-2); border-color:transparent}
.kettei-figure .step.k-write .typing{font-family:var(--mono); font-size:12px; color:var(--fg); line-height:1.5}
.kettei-figure .step.k-write .typing span{color:var(--muted)}
.kettei-figure .trace-key{margin-top:16px}
.kettei-figure .trace-key i{background:var(--c)}
.kettei-figure .trace-key i.k-write{width:auto; height:auto; border-radius:0; background:none; font:500 11px/1 var(--mono); font-style:normal; color:var(--muted); vertical-align:0}
@media (max-width:640px){ .kettei-figure .step{grid-template-columns:22px minmax(0,1fr)} .kettei-figure .step .dist, .kettei-figure .step .typing{grid-column:2} .kettei-figure .dist .row{grid-template-columns:minmax(0,1fr) 80px 34px} }
.kettei-figure .vid{position:relative; border-radius:12px; overflow:hidden; background:var(--vid-bg); aspect-ratio:16/9; max-width:100%}
.kettei-figure .vid video{width:100%; height:100%; display:block; object-fit:contain}
.kettei-figure .vid video[hidden]{display:none}
.kettei-figure .grid2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.kettei-figure .dist .row { grid-template-columns: minmax(0,1fr) minmax(34px,80px) 32px; }
.kettei-figure .step { gap: 10px; }
.kettei-figure button:focus-visible, .kettei-figure .scroll-x:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; }
@media (max-width: 480px) { .kettei-figure .panel { padding: 12px; } }

.kettei-figure .ft-chart { padding: 8px 0; }
.kettei-figure .ft-row { display: grid; grid-template-columns: 132px minmax(0, 1fr) 52px; align-items: center; gap: 12px; margin: 22px 0; }
.kettei-figure .ft-label { color: var(--fg); font-size: 15px; }
.kettei-figure .ft-track { height: 14px; background: var(--bg-3); border-radius: 7px; overflow: hidden; }
.kettei-figure .ft-bar { display: block; height: 100%; border-radius: inherit; }
.kettei-figure .ft-value { color: var(--fg); font: 12px var(--mono); text-align: right; }
.kettei-figure .ft-axis { margin-bottom: 0; color: var(--muted); font: 10px var(--mono); }
.kettei-figure .ft-axis > div { display: flex; justify-content: space-between; }
@media (max-width: 480px) {
  .kettei-figure .ft-row { grid-template-columns: 102px minmax(0, 1fr) 45px; gap: 8px; }
  .kettei-figure .ft-label { font-size: 13px; }
  .kettei-figure .ft-value { font-size: 11px; }
}

.kettei-figure .decision-timeline{list-style:none; margin:24px 0 8px; padding:0; --timeline-axis:140px}
.kettei-figure .decision-timeline li{position:relative; display:grid; grid-template-columns:118px minmax(0,1fr); column-gap:44px; padding:0 0 28px}
.kettei-figure .decision-timeline li::before{content:""; position:absolute; left:var(--timeline-axis); top:11px; bottom:-11px; width:1px; background:var(--rule-2)}
.kettei-figure .decision-timeline li::after{content:""; position:absolute; left:calc(var(--timeline-axis) - 4px); top:7px; width:9px; height:9px; border:1px solid var(--muted); border-radius:50%; background:var(--bg)}
.kettei-figure .decision-timeline li:last-child{padding-bottom:0}
.kettei-figure .decision-timeline li:last-child::before{display:none}
.kettei-figure .decision-timeline li:last-child::after{background:var(--sq); border-color:var(--ink); width:11px; height:11px; left:calc(var(--timeline-axis) - 5px); top:6px}
.kettei-figure .decision-timeline time{font:12px var(--mono); color:var(--muted); line-height:1.8; text-align:right}
.kettei-figure .decision-timeline li:last-child time{color:var(--ink); font-weight:500}
.kettei-figure .decision-timeline h4{font-family:var(--display); font-size:22px; line-height:1.2; font-weight:500; margin:0 0 5px; color:var(--fg)}
.kettei-figure .decision-timeline p{font-size:15px; line-height:1.45; color:var(--fg-2); margin:0}
/* The games figure, kept quiet. One row of controls: the game is the switch (pills), whose run to watch is a line of
   plain names beside it. The film is as wide as the figure and the scores sit under it. In the chart only kettei has
   a colour; the other models are grey and the bars have no track. */
.kettei-figure .game-controls{display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px 24px; margin-bottom:22px}
.kettei-figure .game-controls .seg-players{align-items:baseline; gap:4px 18px}
.kettei-figure .game-controls .seg-players::before{content:"Watch"; font:500 11px var(--mono); letter-spacing:.08em; text-transform:uppercase; color:var(--muted)}
.kettei-figure .game-controls .seg-players button{padding:2px 0; border:0; border-radius:0; background:none; color:var(--muted); font-weight:500; text-decoration:underline transparent; text-underline-offset:5px}
.kettei-figure .game-controls .seg-players button:hover{color:var(--ink)}
.kettei-figure .game-controls .seg-players button[aria-pressed="true"],.kettei-figure .game-controls .seg-players button[aria-pressed="true"]:hover{background:none; color:var(--ink); font-weight:600; text-decoration-color:var(--ink)}
.kettei-games{--amber:var(--base); --clef:var(--base); --clef-2:var(--base); --oai:var(--base)}
.kettei-games #games-chart rect[fill="var(--bg-3)"]{display:none}
/* the film takes the full width; the scores sit under it, no wider than they need to read well */
.kettei-games .grid2{grid-template-columns:minmax(0, 1fr); gap:26px}
.kettei-games #games-chart{display:block; max-width:620px; margin:0 auto}
.kettei-calibration .grid2,.kettei-audits .grid2{gap:28px}
.kettei-calibration .panel,.kettei-audits .panel{background:none; border:0; border-radius:0; padding:0}
@media(max-width:480px){
 .kettei-figure .family{font-size:12px}
 .kettei-figure .family th,.kettei-figure .family td{padding:10px 5px}
 .kettei-figure .family thead th{font-size:14px}
 .kettei-figure .family th:first-child{width:37%}
}

@media(max-width:639px){
 .kettei-figure .decision-timeline{--timeline-axis:4px; margin-top:20px}
 .kettei-figure .decision-timeline li{display:block; padding:0 0 24px 27px}
 .kettei-figure .decision-timeline time{display:block; text-align:left; margin-bottom:5px; font-size:11px}
 .kettei-figure .decision-timeline h4{font-size:19px}
}
