/* sheet.css: v.rustapi.cloud as Viltrum's datasheet set. The demo serves it;
   /fast/ and /blog/ link it from the same origin. Black print on white paper,
   square corners, rules instead of boxes; DESIGN.md has the rules. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/fonts/archivo-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Archivo Narrow";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/static/fonts/archivo-narrow-latin.woff2") format("woff2");
}

:root {
  --ink: #111111;
  --ink-2: #4a4a4a;
  --paper: #ffffff;
  --shade: #ececec;
  --hair: #c4c4c4;
  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --narrow: "Archivo Narrow", "Arial Narrow", "Roboto Condensed", var(--sans);
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  --page: 86rem;
  --gut: clamp(1rem, 3vw, 2.5rem);
  --measure: 68ch;
  /* the head and foot rules run edge to edge; their content lines up with the sheet */
  --edge: max(var(--gut), calc((100% - var(--page)) / 2 + var(--gut)));
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  color: var(--ink);
  background: var(--paper);
  font: 400 1rem/1.55 var(--sans);
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  scrollbar-color: var(--ink) var(--shade);
  accent-color: var(--ink);
  caret-color: var(--ink);
}
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
::selection { background: var(--ink); color: var(--paper); }

a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.btn:focus-visible { outline-offset: 3px; }

h1, h2, h3 { margin: 0; font-family: var(--narrow); font-weight: 600; line-height: 1.1; letter-spacing: -0.01em; text-wrap: balance; }
p { margin: 0 0 0.75em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0; padding: 0; }
img, svg { display: block; max-width: 100%; }
code, kbd, pre { font-family: var(--mono); }
code { font-size: 0.875em; padding: 0.05em 0.25em; background: var(--shade); }
pre code { padding: 0; background: none; font-size: inherit; }
b, strong { font-weight: 600; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.num { font-variant-numeric: tabular-nums; }

/* ---- The title block: every page of the set opens with it ---------------- */

.doc-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  padding: 0.75rem var(--edge);
  border-bottom: 2px solid var(--ink);
}
.mark {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font: 600 1.375rem/1 var(--narrow);
  letter-spacing: -0.01em;
  text-decoration: none;
}
.mark img { width: 2rem; height: 2rem; }
.doc-nav {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
  font: 500 1rem/1 var(--narrow);
}
.doc-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 2.5rem;
  padding: 0 0.75rem;
  text-decoration: none;
  white-space: nowrap;
}
.doc-nav a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.doc-nav a[aria-current] { background: var(--ink); color: var(--paper); }
.doc-nav a[aria-current]:focus-visible { outline-offset: 2px; }
.doc-nav svg { width: 1rem; height: 1rem; }

/* ---- The page foot ------------------------------------------------------- */

.doc-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
  margin-top: 4rem;
  padding: 0.875rem var(--edge) 1.5rem;
  border-top: 2px solid var(--ink);
  font: 500 0.875rem/1.4 var(--narrow);
}
.doc-foot .doc-id { font-weight: 600; }
.doc-foot nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.doc-foot .license { margin-left: auto; color: var(--ink-2); }

/* ---- Sheet, sections, captions ------------------------------------------ */

.sheet { width: 100%; max-width: var(--page); margin: 0 auto; padding: 0 var(--gut); }

.sec-h {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  margin: 3.5rem 0 1.25rem;
  padding-top: 0.625rem;
  border-top: 2px solid var(--ink);
  font-size: 1.5rem;
}
.sec-h .n, .sub-h .n { min-width: 2.25rem; font-variant-numeric: tabular-nums; }
.sub-h { display: flex; gap: 0.75rem; align-items: baseline; margin: 2.5rem 0 0.75rem; font-size: 1.1875rem; }
.sub-h .n { min-width: 2.25rem; }

.cap { margin: 0 0 0.5rem; font: 600 0.9375rem/1.3 var(--narrow); }
.fn { margin-top: 0.625rem; font-size: 0.8125rem; line-height: 1.45; color: var(--ink-2); max-width: var(--measure); }
.fn sup, .tbl sup { font-size: 0.7em; line-height: 0; }
.prose { max-width: var(--measure); }

/* ---- Tables -------------------------------------------------------------- */

.tbl-wrap { overflow-x: auto; }
.tbl {
  width: 100%;
  border-collapse: collapse;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  font-size: 0.9375rem;
  line-height: 1.4;
}
.tbl caption { caption-side: top; text-align: left; padding-bottom: 0.5rem; font: 600 0.9375rem/1.3 var(--narrow); }
.tbl th {
  padding: 0.5rem 0.75rem;
  background: var(--shade);
  border-bottom: 1px solid var(--ink);
  font: 600 0.875rem/1.25 var(--narrow);
  text-align: left;
  vertical-align: bottom;
}
.tbl td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--hair); vertical-align: top; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl td.strong { font-weight: 600; }
.tbl .empty { padding: 1.5rem 0.75rem; color: var(--ink-2); }
.tbl td.param { font-weight: 600; }
.tbl td.cond { color: var(--ink-2); }

/* ---- Code listings ------------------------------------------------------- */

.listing { margin: 0; min-width: 0; }
.listing pre {
  margin: 0;
  padding: 1rem 1.125rem;
  border: 1px solid var(--ink);
  overflow-x: auto;
  font-size: 0.8125rem;
  line-height: 1.6;
  tab-size: 4;
}

/* ---- Controls ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  min-height: 2.75rem;
  padding: 0 1.125rem;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  font: 600 1.0625rem/1 var(--narrow);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.12s, color 0.12s;
}
.btn:hover { background: var(--paper); color: var(--ink); text-decoration: none; }
.btn-q { background: var(--paper); color: var(--ink); }
.btn-q:hover { background: var(--ink); color: var(--paper); }
.btn:disabled { cursor: progress; border-style: dashed; background: var(--paper); color: var(--ink-2); }
.btn svg { width: 1.125rem; height: 1.125rem; flex: none; }
.btn-sm { min-height: 2.25rem; padding: 0 0.75rem; font-size: 0.9375rem; border-width: 1px; }
form.inline { display: inline; margin: 0; }

.field { display: grid; gap: 0.375rem; }
.field > span { font: 600 0.875rem/1.2 var(--narrow); }
input, select, textarea {
  font: inherit;
  color: var(--ink);
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
}
input::placeholder { color: var(--ink-2); opacity: 1; }
input:focus-visible { outline-offset: 0; }

.copy-line {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--ink);
  min-height: 2.75rem;
}
.copy-line code {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0 0.875rem;
  background: none;
  font-size: 0.9375rem;
  white-space: nowrap;
  overflow-x: auto;
}
.copy-line button {
  border: 0;
  border-left: 1px solid var(--ink);
  border-radius: 0;
  padding: 0 0.875rem;
  background: var(--paper);
  color: var(--ink);
  font: 600 0.9375rem/1 var(--narrow);
  cursor: pointer;
}
.copy-line button:hover { background: var(--ink); color: var(--paper); }

/* the live reading marker: a square that inverts each time a fresh reading lands */
.pulse { display: inline-block; width: 0.5rem; height: 0.5rem; background: var(--ink); vertical-align: 0.1em; }
.pulse.beat { animation: beat 0.9s steps(1, end); }
@keyframes beat { 0%, 50% { background: var(--paper); outline: 1px solid var(--ink); } }

/* ---- Datasheet first page (/) --------------------------------------------- */

.title-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(19rem, 25rem);
  gap: 2rem 3rem;
  align-items: end;
  padding: 2.25rem 0 2rem;
}
.title-block h1 { display: grid; gap: 0.625rem; }
.title-block .part { font-size: clamp(3.25rem, 7.2vw, 6rem); line-height: 0.88; letter-spacing: -0.03em; }
.title-block .desc { font-size: clamp(1.375rem, 2.3vw, 2rem); font-weight: 500; line-height: 1.15; }
.title-block .lede { margin-top: 1rem; max-width: 60ch; font-size: 1.0625rem; color: var(--ink-2); }

.eval { display: grid; gap: 0.625rem; padding: 1.125rem; border: 2px solid var(--ink); }
.eval .cap { margin: 0; }
.eval .btn { width: 100%; min-height: 3.25rem; font-size: 1.1875rem; justify-content: space-between; }
.eval form { margin: 0; }
.eval .star-link { display: inline-flex; align-items: center; gap: 0.375rem; font: 500 0.9375rem/1 var(--narrow); }
.eval .star-link svg { width: 1rem; height: 1rem; }
.eval .note { margin: 0; font-size: 0.8125rem; color: var(--ink-2); }

.first {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(17rem, 1.1fr);
  border-top: 2px solid var(--ink);
}
.first > section { padding: 0.875rem 1.5rem 1.5rem 0; }
.first > section + section { padding-left: 1.5rem; border-left: 1px solid var(--ink); }
.first h2 { display: flex; gap: 0.625rem; margin-bottom: 0.75rem; font-size: 1.1875rem; }
.first h2 .n { min-width: 1.25rem; }
.bul { list-style: none; display: grid; gap: 0.5rem; font-size: 0.9375rem; line-height: 1.45; }
.bul li { position: relative; padding-left: 0.875rem; }
.bul li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 0.3125rem; height: 0.3125rem; background: var(--ink); }
.first p { font-size: 0.9375rem; line-height: 1.5; }
.dev-info { margin-top: 1rem; font-size: 0.875rem; }
.dev-info th, .dev-info td { padding: 0.375rem 0.5rem; }

/* Figure 1: the typical application, drawn as the path a request takes */
.fig { margin: 0; }
.fig .cap { margin-bottom: 0.75rem; }
.path { list-style: none; display: grid; position: relative; }
.path li { position: relative; display: grid; grid-template-columns: 5.25rem 1fr; gap: 0.75rem; padding: 0 0 0.875rem; }
.path li::after { content: ""; position: absolute; left: 2.6rem; top: 2.125rem; bottom: 0; width: 1px; background: var(--ink); }
.path li:last-child { padding-bottom: 0; }
.path li:last-child::after { display: none; }
.path b {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 2.125rem;
  border: 1px solid var(--ink);
  font: 600 0.875rem/1 var(--narrow);
  background: var(--paper);
  transition: background-color 0.18s, color 0.18s;
}
.path .end b { border-style: dashed; }
.path span { font-size: 0.8125rem; line-height: 1.35; color: var(--ink-2); padding-top: 0.125rem; }
.path li.on b { background: var(--ink); color: var(--paper); }
.path output { display: block; font: 600 0.9375rem/1.3 var(--narrow); color: var(--ink); font-variant-numeric: tabular-nums; }
.fig-run { display: flex; align-items: center; gap: 0.75rem; margin-top: 1rem; }
.fig-run .btn { flex: none; white-space: nowrap; }
.fig-note { font-size: 0.8125rem; color: var(--ink-2); }

.pair { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 1.5rem 2.5rem; align-items: start; }
.pair + .pair { margin-top: 2.5rem; }
.pair .sub-h { margin-top: 0; }
.pair .prose p { font-size: 1rem; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem; align-items: start; }

.chart-fig { margin: 0; }
.chart-fig img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; } /* the card draws its own frame */

/* the live request log, newest first; live.js prepends rows */
.log { list-style: none; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); font-size: 0.875rem; }
.log li { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr) 3rem 5rem; gap: 0.75rem; padding: 0.375rem 0.75rem; border-bottom: 1px solid var(--hair); }
.log li:last-child { border-bottom: 0; }
.log .m { font-weight: 600; }
.log .r { font-family: var(--mono); font-size: 0.8125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log .s, .log .t { text-align: right; font-variant-numeric: tabular-nums; }
.log .fresh { animation: fresh 1.2s steps(1, end); }
@keyframes fresh { 0%, 40% { background: var(--ink); color: var(--paper); } }
.log .log-empty { display: block; color: var(--ink-2); }
.log-head { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr) 3rem 5rem; gap: 0.75rem; padding: 0.375rem 0.75rem; background: var(--shade); border-top: 2px solid var(--ink); font: 600 0.8125rem/1.2 var(--narrow); }
.log-head + .log { border-top: 1px solid var(--ink); }
.log-head span:nth-child(n+3) { text-align: right; }

/* ---- Evaluation kit (dashboard) ------------------------------------------ */

.kit { display: grid; grid-template-columns: 13.5rem minmax(0, 1fr); flex: 1; width: 100%; max-width: var(--page); margin: 0 auto; padding: 0 var(--gut); }
.kit-index { display: flex; flex-direction: column; gap: 1.5rem; padding: 1.5rem 1.5rem 1.5rem 0; border-right: 1px solid var(--ink); }
.kit-index .cap { margin: 0; }
.kit-nav { display: grid; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
.rail-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.75rem;
  padding: 0 0.75rem;
  border-bottom: 1px solid var(--hair);
  font: 600 1.0625rem/1 var(--narrow);
  text-decoration: none;
}
.rail-link:last-child { border-bottom: 0; }
.rail-link .n { min-width: 1rem; font-variant-numeric: tabular-nums; }
a.rail-link:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.rail-link[aria-current] { background: var(--ink); color: var(--paper); }
.rail-link.is-locked { color: var(--ink-2); font-weight: 500; }
.kit-foot { display: grid; gap: 0.75rem; margin-top: auto; font-size: 0.875rem; }
.kit-foot .who { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.status { margin: 0; color: var(--ink-2); font-size: 0.8125rem; line-height: 1.5; }
.status b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.status .pulse { margin-right: 0.375rem; }
.kit-foot form { margin: 0; }

.kit-main { min-width: 0; padding: 1.5rem 0 2rem 2rem; }
.kit-bar { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 1.25rem; padding-bottom: 0.75rem; border-bottom: 2px solid var(--ink); }
.kit-bar h1 { display: flex; gap: 0.75rem; font-size: 2rem; }
.kit-bar .count { font: 500 1rem/1 var(--narrow); font-variant-numeric: tabular-nums; }
.kit-bar .api { margin-left: auto; font-size: 0.8125rem; color: var(--ink-2); }
.kit-bar .api code { font-size: 0.8125rem; }
.flash:empty { display: none; }
.flash { margin: 1rem 0 0; padding: 0.625rem 0.875rem; background: var(--ink); color: var(--paper); font-weight: 500; }

.composer { display: grid; grid-template-columns: minmax(10rem, 1fr) minmax(12rem, 2fr) auto; gap: 0.75rem; align-items: end; margin: 1.5rem 0; }
.kit-main .tbl-wrap { margin-top: 1.5rem; }
.composer + .tbl-wrap { margin-top: 0; }
.tbl td.act { width: 1%; text-align: right; padding-top: 0.3rem; padding-bottom: 0.3rem; }
.row-btn { min-height: 2rem; padding: 0 0.625rem; border: 1px solid var(--ink); border-radius: 0; background: var(--paper); color: var(--ink); font: 600 0.875rem/1 var(--narrow); cursor: pointer; }
.row-btn:hover { background: var(--ink); color: var(--paper); }
.tbl td.desc { color: var(--ink-2); max-width: 32rem; overflow-wrap: break-word; }
.tbl td.strong { overflow-wrap: break-word; }
.tag { display: inline-block; padding: 0.125rem 0.5rem; border: 1px solid var(--ink); font: 600 0.8125rem/1.3 var(--narrow); }
.tag.is-solid { background: var(--ink); color: var(--paper); }

.signin { display: grid; grid-template-columns: minmax(16rem, 24rem) minmax(0, 1fr); gap: 2.5rem; margin-top: 1.5rem; align-items: start; }
.signin form { display: grid; gap: 1rem; }
.signin .note { margin: 0; font-size: 0.8125rem; color: var(--ink-2); }
.locked .tbl td { color: var(--ink-2); }

.meta { display: grid; grid-template-columns: max-content minmax(0, 1fr); margin: 1.5rem 0 0; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); max-width: 40rem; }
.meta dt, .meta dd { margin: 0; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--hair); }
.meta dt { font: 600 0.875rem/1.5 var(--narrow); background: var(--shade); }
.meta dt:last-of-type, .meta dd:last-of-type { border-bottom: 0; }
.meta dd { overflow-wrap: anywhere; }
.hint { display: grid; gap: 1rem; justify-items: start; margin-top: 1.5rem; max-width: 40rem; font-size: 0.9375rem; }
.hint p { margin: 0; }

/* ---- Performance characteristics (/fast/) -------------------------------- */

.perf-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, 24rem); gap: 2rem 3rem; align-items: end; padding: 2.25rem 0 1.5rem; }
.perf-intro h1 { font-size: clamp(2.5rem, 5vw, 4rem); line-height: 0.95; letter-spacing: -0.025em; }
.perf-intro p { max-width: 60ch; color: var(--ink-2); }
#charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.75rem 2.5rem; margin: 1rem 0 0; }
.perf-intro + .sec-h, .notes-head + .sec-h { margin-top: 1rem; }
.chart { margin: 0; }
.chart figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; margin-bottom: 0.5rem; font-family: var(--narrow); }
.chart figcaption b { font-size: 1rem; }
.chart figcaption .what { font-size: 0.875rem; color: var(--ink-2); }
.chart figcaption .now { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart svg { width: 100%; height: auto; border: 1px solid var(--ink); overflow: visible; }
.chart .line { fill: none; stroke: var(--ink); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.chart .dot { fill: var(--ink); }
.chart .dot.rel { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.chart .grid { stroke: var(--hair); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .scale { display: flex; justify-content: space-between; margin-top: 0.25rem; font-size: 0.75rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.perf .tbl td.hash { font-family: var(--mono); font-size: 0.8125rem; white-space: nowrap; }
.perf .tbl td.date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.perf .tbl td.msg { max-width: 20.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.perf .tbl td.rps { color: var(--ink-2); }
.perf .tbl tr.failed td { color: var(--ink-2); }
.perf .tbl td.status { text-align: left; font-style: italic; }
.badge { display: inline-block; margin-right: 0.5rem; padding: 0 0.375rem; background: var(--ink); color: var(--paper); font: 600 0.75rem/1.5 var(--narrow); }
.d { display: inline-block; margin-left: 0.375rem; padding: 0 0.3rem; font: 600 0.75rem/1.5 var(--narrow); font-variant-numeric: tabular-nums; }
.d.up { background: var(--ink); color: var(--paper); }
.d.dn { border: 1px solid var(--ink); line-height: calc(1.5em - 2px); }
/* drawn triangles: filled up for more instructions, down for fewer */
.d.up::before, .d.dn::before { content: ""; display: inline-block; margin-right: 0.3em; border-left: 0.3em solid transparent; border-right: 0.3em solid transparent; vertical-align: 0.1em; }
.d.up::before { border-bottom: 0.5em solid currentColor; }
.d.dn::before { border-top: 0.5em solid currentColor; }
#err { margin-top: 1rem; padding: 0.625rem 0.875rem; border: 2px solid var(--ink); font-weight: 500; }
.perf .tbl th:first-child, .perf .tbl td:first-child { position: sticky; left: 0; background: var(--paper); }
.perf .tbl th:first-child { background: var(--shade); }

/* ---- Application notes (/blog/) ------------------------------------------ */

.notes-head { padding: 2.25rem 0 1.5rem; }
.notes-head h1 { font-size: clamp(2.5rem, 5vw, 4rem); line-height: 0.95; letter-spacing: -0.025em; }
.notes-head p { margin-top: 0.75rem; max-width: 60ch; color: var(--ink-2); }
.notes .tbl td.an { white-space: nowrap; font-weight: 600; font-family: var(--narrow); }
.notes .tbl td a { font-weight: 600; }
.notes .tbl td .sum { display: block; margin-top: 0.25rem; color: var(--ink-2); font-size: 0.875rem; }
.note-head { padding: 2.25rem 0 1.75rem; border-bottom: 2px solid var(--ink); }
.note-head .an { margin: 0 0 0.75rem; font: 600 1rem/1 var(--narrow); }
.note-head h1 { font-size: clamp(2.25rem, 4.6vw, 3.75rem); line-height: 1; letter-spacing: -0.02em; max-width: 22ch; }
.note-head .sum { margin: 1rem 0 0; max-width: 60ch; font-size: 1.125rem; color: var(--ink-2); }
.note-head .meta-line { margin: 1rem 0 0; font: 500 0.9375rem/1.3 var(--narrow); }
.article { max-width: var(--measure); padding-top: 1.75rem; font-size: 1.0625rem; line-height: 1.65; }
.article h2 { margin: 2.5rem 0 0.75rem; padding-top: 0.5rem; border-top: 2px solid var(--ink); font-size: 1.5rem; }
.article h3 { margin: 2rem 0 0.5rem; font-size: 1.1875rem; }
.article p, .article ul, .article ol, .article blockquote, .article table, .article pre { margin: 0 0 1.125rem; }
.article ul, .article ol { padding-left: 1.25rem; }
.article li + li { margin-top: 0.25rem; }
.article blockquote { margin-left: 0; margin-right: 0; padding: 0.75rem 1rem; border: 1px solid var(--ink); }
.article blockquote p:last-child { margin-bottom: 0; }
.article pre { padding: 1rem 1.125rem; border: 1px solid var(--ink); overflow-x: auto; font-size: 0.8125rem; line-height: 1.6; tab-size: 4; }
.article table { width: 100%; border-collapse: collapse; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); font-size: 0.9375rem; }
.article th { padding: 0.5rem 0.75rem; background: var(--shade); border-bottom: 1px solid var(--ink); font: 600 0.875rem/1.25 var(--narrow); text-align: left; }
.article td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--hair); }
.article img { margin: 1.5rem 0; border: 1px solid var(--ink); }
.article hr { border: 0; border-top: 2px solid var(--ink); margin: 2.5rem 0; }
.empty-state { padding: 2.5rem 0; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
.empty-state p { max-width: 50ch; }

/* ---- Narrow screens ------------------------------------------------------ */

@media (max-width: 1100px) {
  .first { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .first > section:nth-child(3) { padding-left: 0; border-left: 0; }
  .first > section:nth-child(n+3) { border-top: 1px solid var(--ink); }
  .pair { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .doc-head { padding-top: 0.625rem; padding-bottom: 0.5rem; }
  .doc-nav { order: 3; width: calc(100% + 2 * var(--gut)); margin: 0 calc(-1 * var(--gut)); padding: 0 calc(var(--gut) - 0.75rem); overflow-x: auto; scrollbar-width: none; }
  .title-block, .perf-intro { grid-template-columns: minmax(0, 1fr); padding-top: 1.5rem; gap: 1.5rem; }
  .first { grid-template-columns: minmax(0, 1fr); }
  .doc-nav a { padding: 0 0.5rem; }
  .first > section, .first > section + section { padding: 0.875rem 0 1.25rem; border-left: 0; }
  .first > section + section { border-top: 1px solid var(--ink); }
  .two { grid-template-columns: minmax(0, 1fr); }
  #charts { grid-template-columns: minmax(0, 1fr); }
  .sec-h { margin-top: 2.75rem; font-size: 1.3125rem; }
  .log li, .log-head { grid-template-columns: 3rem minmax(0, 1fr) 2.5rem 4.25rem; gap: 0.5rem; }
  .kit { grid-template-columns: minmax(0, 1fr); align-content: start; }
  .kit-index { border-right: 0; border-bottom: 1px solid var(--ink); padding: 1rem 0; gap: 1rem; }
  .kit-main { padding-left: 0; }
  .kit-nav { grid-auto-flow: column; grid-auto-columns: 1fr; }
  .rail-link { justify-content: center; border-bottom: 0; border-right: 1px solid var(--hair); padding: 0 0.5rem; }
  .rail-link:last-child { border-right: 0; }
  .kit-foot { margin-top: 0; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .kit-foot .status { grid-column: 1 / -1; }
  .composer { grid-template-columns: minmax(0, 1fr); }
  .signin { grid-template-columns: minmax(0, 1fr); }
  .tbl .opt { display: none; }
  .kit-bar .api { margin-left: 0; flex-basis: 100%; }
  .doc-foot .license { margin-left: 0; }
}

@media (max-width: 480px) {
  .doc-nav .nav-docs { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
