/* llm.supples.org: a datasheet for one GPU.
   One family (Archivo) used across its width axis: expanded for headings, normal for reading,
   condensed for tables and figure labels. One signal colour: ultramarine means "on the GPU". */

:root {
  color-scheme: light;
  --paper: #eceff3;
  --sheet: #ffffff;
  --ink: #17213f;
  --ink-2: #4c5677;
  --ink-3: #747d99;
  --rule: #cdd3df;
  --gpu: #2e3fd0;
  --cpu: #a3aabb;
  --code-bg: #e2e6ee;
  --m-qwen: #2a78d6;
  --m-gemma: #eb6834;
  --m-flint: #1baf7a;
  --m-glm: #eda100;
  --auto: #a8a7a0;
  --good: #0a7d0a;
  --warn: #9a6a00;
  --bad: #c03434;
  --font: "Archivo", system-ui, sans-serif;
  --measure: 68ch;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0d1120;
    --sheet: #141a2d;
    --ink: #e4e8f3;
    --ink-2: #aab2ca;
    --ink-3: #7f88a3;
    --rule: #2a3250;
    --gpu: #7d8cff;
    --cpu: #4d5570;
    --code-bg: #1d2440;
    --m-qwen: #3987e5;
    --m-gemma: #d95926;
    --m-flint: #199e70;
    --m-glm: #c98500;
    --auto: #6b6a64;
    --good: #3cc23c;
    --warn: #e0a520;
    --bad: #e66767;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0d1120;
  --sheet: #141a2d;
  --ink: #e4e8f3;
  --ink-2: #aab2ca;
  --ink-3: #7f88a3;
  --rule: #2a3250;
  --gpu: #7d8cff;
  --cpu: #4d5570;
  --code-bg: #1d2440;
  --m-qwen: #3987e5;
  --m-gemma: #d95926;
  --m-flint: #199e70;
  --m-glm: #c98500;
  --auto: #6b6a64;
  --good: #3cc23c;
  --warn: #e0a520;
  --bad: #e66767;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 18px/1.6 var(--font);
  font-variation-settings: "wdth" 100;
  font-variant-numeric: tabular-nums;
}
a { color: var(--gpu); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--gpu); outline-offset: 2px; border-radius: 2px; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.82em; }
code { background: var(--code-bg); padding: 0.1em 0.3em; border-radius: 3px; overflow-wrap: anywhere; }
pre { background: var(--sheet); border: 1px solid var(--rule); padding: 16px 18px; border-radius: 3px; overflow-x: auto; line-height: 1.55; }
pre code { background: none; padding: 0; }
strong { font-weight: 650; }

/* Page frame: reading column with figures allowed to run wider */
.page { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.page > *, section > * { max-width: var(--measure); }
.page > .wide, section > .wide, .page > section { max-width: none; }

.masthead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 18px 0; border-bottom: 2px solid var(--ink); max-width: none; }
.masthead a { color: var(--ink); text-decoration: none; font-weight: 700; font-variation-settings: "wdth" 125; letter-spacing: -0.01em; }
.theme-btn { font: 500 14px var(--font); font-variation-settings: "wdth" 75; color: var(--ink-2); background: none; border: 0; padding: 4px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.theme-btn:hover { color: var(--ink); }

.disclaimer { margin: 20px 0 0; padding: 14px 18px; background: var(--sheet); border: 1px solid var(--rule); border-left: 4px solid var(--ink); font-size: 16px; line-height: 1.55; color: var(--ink-2); }
.disclaimer p { margin: 0; }
.disclaimer p + p { margin-top: 8px; }
.disclaimer strong { color: var(--ink); }

/* Headline: the type itself is the hero's other half, set wide and tight */
h1 {
  font-size: clamp(36px, 6.4vw, 66px);
  line-height: 0.98;
  font-weight: 800;
  font-variation-settings: "wdth" 125;
  letter-spacing: -0.035em;
  margin: 56px 0 20px;
  max-width: 21ch;
}
.lede { font-size: 20px; line-height: 1.5; color: var(--ink-2); margin: 0 0 32px; }

/* Layer map: the signature figure */
.layermap { background: var(--sheet); border: 1px solid var(--rule); border-top: 4px solid var(--gpu); padding: 20px 20px 16px; margin: 0 0 12px; }
.lm-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 18px; }
.lm-toggle { display: inline-flex; border: 1px solid var(--ink); border-radius: 3px; overflow: hidden; }
.lm-toggle button {
  font: 600 15px var(--font); font-variation-settings: "wdth" 85; color: var(--ink); background: var(--sheet);
  border: 0; padding: 8px 14px; cursor: pointer;
}
.lm-toggle button + button { border-left: 1px solid var(--ink); }
.lm-toggle button[aria-pressed="true"] { background: var(--ink); color: var(--sheet); }
.lm-readout { text-align: right; }
.lm-speed { font-size: clamp(34px, 5vw, 52px); line-height: 1; font-weight: 800; font-variation-settings: "wdth" 125; letter-spacing: -0.03em; }
.lm-speed small { font-size: 0.36em; font-weight: 500; font-variation-settings: "wdth" 85; letter-spacing: 0; color: var(--ink-2); margin-left: 4px; }
.lm-sub { font-size: 14px; font-variation-settings: "wdth" 85; color: var(--ink-2); }
.lm-grid { display: grid; grid-template-columns: 74px 1fr; gap: 6px 10px; align-items: center; }
.lm-rowlabel { font-size: 13px; font-weight: 600; font-variation-settings: "wdth" 75; color: var(--ink-2); }
.lm-cells { display: grid; grid-template-columns: repeat(40, 1fr); gap: 2px; }
.lm-cells span { height: 34px; border-radius: 1px; background: var(--gpu); transition: background-color .35s ease, box-shadow .35s ease; transition-delay: calc(var(--i) * 12ms); }
.lm-cells span.cpu { background: repeating-linear-gradient(135deg, var(--cpu) 0 2px, transparent 2px 5px); box-shadow: inset 0 0 0 1px var(--cpu); }
.lm-axis { grid-column: 2; display: flex; justify-content: space-between; font-size: 12px; font-variation-settings: "wdth" 75; color: var(--ink-3); }
.lm-foot { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 14px; font-size: 14px; font-variation-settings: "wdth" 85; color: var(--ink-2); }
.lm-foot i { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; margin-right: 6px; border-radius: 1px; }
.lm-foot .k-gpu { background: var(--gpu); }
.lm-foot .k-cpu { background: repeating-linear-gradient(135deg, var(--cpu) 0 2px, transparent 2px 5px); box-shadow: inset 0 0 0 1px var(--cpu); }
.lm-caption { font-size: 15px; color: var(--ink-2); margin: 10px 0 0; max-width: var(--measure); }
@media (prefers-reduced-motion: reduce) { .lm-cells span { transition: none; } }

nav.toc { margin: 40px 0 0; font-size: 15px; font-variation-settings: "wdth" 85; max-width: none; }
nav.toc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 20px; }
nav.toc a { color: var(--ink-2); }
nav.toc a:hover { color: var(--gpu); }

section { margin-top: 72px; }
h2 {
  font-size: clamp(26px, 3.6vw, 36px);
  line-height: 1.1;
  font-weight: 750;
  font-variation-settings: "wdth" 120;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  padding-top: 18px;
  border-top: 2px solid var(--ink);
  max-width: none;
}
.sub { font-size: 19px; color: var(--ink-2); margin: 0 0 24px; }
h3 { font-size: 20px; font-weight: 700; font-variation-settings: "wdth" 110; margin: 36px 0 8px; }
p, ul, ol { margin: 0 0 16px; }
li { margin-bottom: 8px; }
li::marker { color: var(--ink-3); }

/* Tables read like spec sheets: condensed headers, ruled rows, no boxes */
.table-wrap { overflow-x: auto; margin: 0 0 24px; }
table { border-collapse: collapse; width: 100%; font-size: 15.5px; line-height: 1.45; }
th, td { text-align: left; padding: 9px 14px 9px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th { font-weight: 650; font-variation-settings: "wdth" 75; font-size: 14px; color: var(--ink-2); border-bottom: 2px solid var(--ink); white-space: nowrap; }
tbody th { font-weight: 600; font-variation-settings: "wdth" 85; color: var(--ink-2); white-space: nowrap; }
td.num, th.num { text-align: right; white-space: nowrap; font-variation-settings: "wdth" 85; }
tr.chosen td { font-weight: 650; color: var(--gpu); }
tr.failed td { color: var(--ink-3); }
caption { caption-side: bottom; text-align: left; font-size: 14px; color: var(--ink-3); padding-top: 10px; }

.rule-note { border-left: 4px solid var(--gpu); padding: 2px 0 2px 16px; margin: 0 0 24px; font-weight: 600; font-variation-settings: "wdth" 110; font-size: 19px; }

figure.chart { margin: 8px 0 28px; background: var(--sheet); border: 1px solid var(--rule); padding: 18px 18px 14px; }
figure.chart figcaption { font-weight: 700; font-variation-settings: "wdth" 110; margin-bottom: 4px; }
figure.chart .note { font-size: 14px; color: var(--ink-3); margin-top: 6px; max-width: var(--measure); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; font-variation-settings: "wdth" 85; color: var(--ink-2); margin: 4px 0 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }
svg text { font-family: var(--font); }
.tip {
  position: fixed; pointer-events: none; z-index: 10; background: var(--ink); color: var(--sheet);
  font-size: 14px; line-height: 1.4; padding: 8px 10px; border-radius: 3px; max-width: 260px; opacity: 0;
}
.tip.on { opacity: 1; }

.tabs { display: flex; flex-wrap: wrap; gap: 0 22px; margin: 0 0 8px; border-bottom: 1px solid var(--rule); }
.tabs button {
  font: 600 15px var(--font); font-variation-settings: "wdth" 85; background: none; color: var(--ink-2); border: 0;
  border-bottom: 3px solid transparent; padding: 8px 0 6px; margin-bottom: -1px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
}
.tabs button i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }

.score { white-space: nowrap; font-weight: 700; }
.s2 { color: var(--good); } .s1 { color: var(--warn); } .s0 { color: var(--bad); } .sx { color: var(--ink-3); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: 0; }
#score-table td { white-space: nowrap; }

.log { list-style: none; padding: 0; }
.log li { display: grid; grid-template-columns: 120px 1fr; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--rule); margin: 0; }
.log time { font-weight: 600; font-variation-settings: "wdth" 85; color: var(--ink-2); }

footer { border-top: 2px solid var(--ink); margin-top: 80px; padding: 18px 0 56px; font-size: 15px; color: var(--ink-3); max-width: none; }

@media (max-width: 640px) {
  body { font-size: 17px; }
  h1 { margin-top: 36px; }
  .layermap { padding: 16px 12px 12px; }
  .lm-grid { grid-template-columns: 1fr; }
  .lm-axis { grid-column: 1; }
  .lm-cells { gap: 1px; }
  .lm-cells span { height: 26px; }
  .lm-readout { text-align: left; }
  .log li { grid-template-columns: 1fr; gap: 2px; }
}
