/* Copyright 2026 Leo Cheng
   SPDX-License-Identifier: Apache-2.0

   One sheet: a warm dark field and a warm paper field, three faces, one accent,
   rules only. Nothing here is a card, a shadow or a gradient mesh.

   The instrument is a field of samples, not a line: the right edge is the page's
   scrollbar drawn as a measuring scale, and the front plate counts a window into
   it. */

/* ---------------------------------------------------------------- tokens */

:root {
  --pad: clamp(16px, 3.4vw, 56px);
  --max: 1280px;
  /* The scale on the right edge is the scrollbar, so the sheet keeps that much
     room clear rather than drawing under its own hand. */
  --rail: 34px;
  --serif: "Instrument Serif", "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;
  --sans: "Inter Tight", -apple-system, "Segoe UI", system-ui, sans-serif;

  /* The dark plate: charcoal with a little red in it, the way a darkroom is warm. */
  --field: #0c0a08;
  --field-soft: #14100b;
  --ink: #f2ebe0;
  --ink-dim: #a79b8c;
  --ink-faint: #6e6358;
  --rule: rgba(242, 235, 224, 0.12);
  --rule-strong: rgba(242, 235, 224, 0.26);
  --grid: rgba(242, 235, 224, 0.055);
  --grid-cell: rgba(242, 235, 224, 0.09);
  --accent: #e9a05c;
  --accent-dim: rgba(233, 160, 92, 0.38);
  --accent-raise: rgba(233, 160, 92, 0.58);
  --accent-faint: rgba(233, 160, 92, 0.16);
  --accent-ink: #191006;
}

:root[data-theme="light"] {
  /* The paper plate: uncoated stock, printed in a brown-black ink. */
  --field: #f5efe3;
  --field-soft: #ece4d4;
  --ink: #191410;
  --ink-dim: #6a5b4c;
  --ink-faint: #94867a;
  --rule: rgba(25, 20, 16, 0.14);
  --rule-strong: rgba(25, 20, 16, 0.3);
  --grid: rgba(25, 20, 16, 0.07);
  --grid-cell: rgba(25, 20, 16, 0.11);
  --accent: #a85b22;
  --accent-dim: rgba(168, 91, 34, 0.3);
  --accent-raise: rgba(168, 91, 34, 0.5);
  --accent-faint: rgba(168, 91, 34, 0.16);
  --accent-ink: #f5efe3;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* What the reader sees is what they would type: no `->` drawn as an arrow. Form
   controls do not inherit this, so they are named here as well. */
html,
button,
input,
textarea,
select,
code,
pre {
  font-variant-ligatures: no-contextual;
}

html {
  background: var(--field);
  /* The page scrollbar is the scale on the right edge: a fixed element, so hiding
     the native one costs no layout. Chrome reads the webkit rules; the standard
     properties sit behind the feature query so they cannot win there and turn the
     overflow check into a false pass. */
}

@supports selector(::-webkit-scrollbar) {
  html::-webkit-scrollbar {
    width: 0;
    height: 0;
  }
  pre::-webkit-scrollbar,
  #expo-input::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }
  pre::-webkit-scrollbar-track,
  #expo-input::-webkit-scrollbar-track {
    background: transparent;
  }
  pre::-webkit-scrollbar-thumb,
  #expo-input::-webkit-scrollbar-thumb {
    background: var(--rule-strong);
    border-radius: 99px;
  }
  pre::-webkit-scrollbar-corner,
  #expo-input::-webkit-scrollbar-corner {
    background: transparent;
  }
  pre:hover::-webkit-scrollbar-thumb,
  #expo-input:hover::-webkit-scrollbar-thumb,
  #expo-input:focus::-webkit-scrollbar-thumb {
    background: var(--ink-faint);
  }
}

@supports not selector(::-webkit-scrollbar) {
  html {
    scrollbar-width: none;
  }
  pre,
  #expo-input {
    scrollbar-width: thin;
    scrollbar-color: var(--rule-strong) transparent;
  }
}

body {
  margin: 0;
  padding-right: var(--rail);
  background: var(--field);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.62;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
  transition: background-color 240ms ease, color 240ms ease;
}

/* Interaction surfaces are read with the pointer, not copied: a selection box
   dragged across a field of marks is noise, and it steals the gesture the plate is
   built around. Prose, code, signatures, results and copyable strings stay
   selectable. */
.ruler,
.ruler-readout,
.topline,
.nav,
.masthead-index,
.field,
.field-axis,
.field-readout,
.annotations,
.colophon,
.specimen-head .stops,
.foot,
.colophon .meta a,
.page-kicker,
.plate-no,
.copy,
.marginalia,
.facts,
.lab-hint,
.lab-send,
.doc-toc,
.api-toc,
.api-count,
.api-hint,
.api-filter-wrap label,
.presets,
.stops {
  -webkit-user-select: none;
  user-select: none;
}

body.is-dragging {
  -webkit-user-select: none;
  user-select: none;
}

.skip {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 9;
  padding: 8px 12px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  transition: top 160ms ease;
}

.skip:focus {
  top: 12px;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

/* ---------------------------------------------------------------- type */

.display,
h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

.display {
  font-size: clamp(48px, 8.6vw, 120px);
  line-height: 0.86;
  letter-spacing: -0.035em;
}

.display em {
  font-style: italic;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
}

.lede {
  font-size: clamp(16px, 1.45vw, 19px);
  line-height: 1.55;
  max-width: 34ch;
  color: var(--ink-dim);
}

.mono,
.marginalia,
.plate-no,
pre,
code,
.index-row {
  font-family: var(--mono);
  font-variant-ligatures: no-contextual;
}

.marginalia {
  font-size: 10px;
  line-height: 1.5;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 1px;
  transition: border-color 160ms ease, color 160ms ease;
}

a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

a:focus-visible,
button:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

/* ---------------------------------------------------------------- frame */

.sheet {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* the scale: the page's own scrollbar */
.ruler {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 4;
  width: var(--rail);
  height: 100vh;
  cursor: grab;
  touch-action: none;
  border-left: 1px solid var(--rule);
  background:
    repeating-linear-gradient(
        to bottom,
        var(--rule) 0 1px,
        transparent 1px 9px
      )
      no-repeat right 9px top 0 / 6px 100%,
    repeating-linear-gradient(
        to bottom,
        var(--rule-strong) 0 1px,
        transparent 1px 45px
      )
      no-repeat right 0 top 0 / 12px 100%;
}

/* The thumb is the moving band: the full width of the rail, a wash of accent
   carrying its own graduations, and a solid accent edge on the right. It is the
   only part that moves, and it moves with the pointer, so the transform has no
   transition — a drag must not lag behind the hand. Only the tone eases. */
.ruler-thumb {
  position: absolute;
  right: 0;
  top: 0;
  width: 100%;
  height: 68px;
  border-right: 1px solid var(--accent);
  background-color: var(--accent-dim);
  background-image:
    repeating-linear-gradient(
      to bottom,
      var(--accent-faint) 0 1px,
      transparent 1px 9px
    ),
    repeating-linear-gradient(to bottom, var(--accent) 0 1px, transparent 1px 9px);
  background-repeat: no-repeat, no-repeat;
  background-position: 0 0, right 9px top 0;
  background-size: 100% 100%, 6px 100%;
  opacity: 0.92;
  transition: opacity 200ms ease, background-color 200ms ease;
}

/* Coming up the sheet, the mark is dimmed but never gone: a scrollbar that hides
   itself at the top reads as a scrollbar that is not there. */
.ruler.is-top .ruler-thumb {
  opacity: 0.5;
}

.ruler:hover .ruler-thumb,
.ruler:focus-visible .ruler-thumb,
body.is-dragging .ruler-thumb {
  opacity: 1;
  background-color: var(--accent-raise);
}

body.is-dragging .ruler {
  cursor: grabbing;
}

.ruler:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}

/* The readout: window, scrape, second. Three facts about where in the sheet the
   reader is, set as the caption to a scale. */
.ruler-readout {
  position: fixed;
  right: calc(var(--rail) + 10px);
  bottom: 16px;
  z-index: 4;
  text-align: right;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  line-height: 1.85;
  pointer-events: none;
}

.ruler-readout b {
  display: block;
  color: var(--ink);
  font-weight: 500;
  font-size: 10px;
}

/* ---------------------------------------------------------------- masthead */

.masthead {
  height: 100svh;
  min-height: 736px;
  display: grid;
  grid-template-rows: auto auto minmax(180px, 1fr) auto;
  gap: 0;
  padding: 0 0 var(--pad);
  position: relative;
}

.narrow-only {
  display: none;
}

.topline {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 18px clamp(16px, 3vw, 40px);
  flex-wrap: wrap;
  padding: 0.35em 0 12px;
  border-bottom: 1px solid var(--rule);
  /* The one element that survives a navigation, so a cross-page view transition
     can carry it between the tall front plate and the compact inner plates. */
  view-transition-name: site-header;
}

/* The front plate is allowed the extra drop: the same header, set lower. */
.masthead .topline {
  padding-top: calc(var(--pad) + 8px);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 18px;
  min-width: 0;
}

.wordmark {
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--ink);
  border-bottom: 0;
  padding: 0;
}

.wordmark:hover {
  color: var(--accent);
  border-bottom: 0;
}

.nav {
  display: flex;
  align-items: baseline;
  gap: clamp(12px, 1.8vw, 26px);
  margin-left: auto;
}

.nav a {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom: 0;
  padding: 0;
  white-space: nowrap;
}

.nav a:hover {
  color: var(--ink);
  border-bottom: 0;
}

.nav a[aria-current="page"] {
  color: var(--ink);
}

.nav a[aria-current="page"]::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 1px;
  margin-right: 7px;
  background: var(--accent);
  vertical-align: middle;
  transform: translateY(-1px);
}

.toplinks {
  display: flex;
  align-items: baseline;
  gap: 18px;
}

.toplink,
.theme {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom: 0;
}

.toplink:hover {
  color: var(--ink);
  border-bottom: 0;
}

.theme {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: color 160ms ease, border-color 160ms ease;
}

.theme:hover {
  color: var(--ink);
  border-bottom-color: var(--rule-strong);
}

.masthead-head {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0 var(--pad);
  align-items: end;
  padding: clamp(22px, 3.8vw, 44px) 0 clamp(8px, 1.2vw, 16px);
}

.masthead-head h1 {
  grid-column: 1 / span 8;
}

.masthead-head .lede {
  grid-column: 9 / span 4;
  padding-bottom: 6px;
}

/* ---------------------------------------------------------------- the field */

/* One scrape, drawn: fifteen columns of seconds across, one row per bucket, every
   sample a hairline where it landed. The column of bars at the right edge is the
   same counters read the other way — each row of the field, summed. */
.field-wrap {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  min-height: 0;
}

.field {
  position: relative;
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) clamp(104px, 13%, 176px);
  grid-template-rows: minmax(0, 1fr);
  gap: 0 clamp(12px, 1.8vw, 26px);
  min-height: 0;
}

.row-labels {
  display: grid;
  grid-template-rows: repeat(15, minmax(0, 1fr));
  height: 100%;
  min-height: 0;
}

.row-labels span {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.02em;
  color: var(--ink-dim);
  white-space: nowrap;
}

.row-labels span.is-edge {
  color: var(--ink-faint);
}

.row-labels span.is-budget {
  color: var(--accent);
}

.cells {
  display: grid;
  grid-template-columns: repeat(15, minmax(0, 1fr));
  grid-template-rows: repeat(15, minmax(0, 1fr));
  height: 100%;
  min-height: 0;
  border-left: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule-strong);
}

.cell {
  border-right: 1px solid var(--grid-cell);
  border-top: 1px solid var(--grid-cell);
  display: flex;
  flex-wrap: wrap;
  align-content: flex-end;
  gap: 1px;
  padding: 2px 2px 2px 1px;
  overflow: hidden;
  position: relative;
}

.cell i {
  width: 1px;
  height: 6px;
  background: var(--ink-faint);
  opacity: 0.6;
}

.cell i.is-over {
  background: var(--accent);
  opacity: 1;
}

.cell:hover {
  outline: 1px solid var(--accent-dim);
  outline-offset: -1px;
}

.cell.is-row {
  outline: 1px solid var(--accent-faint);
  outline-offset: -1px;
}

/* The budget: one hairline across the field, on the boundary between the last
   bucket inside the threshold and the first one outside it. */
.budget-rule {
  position: absolute;
  left: 60px;
  right: calc(clamp(104px, 13%, 176px) + clamp(12px, 1.8vw, 26px));
  border-top: 1px solid var(--accent-dim);
  pointer-events: none;
  z-index: 2;
}

/* The scan: one pass, when the plate first comes into view. The only motion the
   field gets, and it says what the plate is about — a window being read. */
.scan {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--accent);
  opacity: 0;
  pointer-events: none;
  z-index: 3;
}

.field.is-drawn .scan {
  animation: sweep 1500ms cubic-bezier(0.16, 0.8, 0.2, 1) 1;
}

@keyframes sweep {
  0% {
    opacity: 0;
    transform: translateX(0);
  }
  8% {
    opacity: 0.85;
  }
  92% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
    transform: translateX(var(--sweep, 800px));
  }
}

/* the fold: one bar per row, drawn as the row's own sum */
.fold {
  position: relative;
  display: grid;
  grid-template-rows: repeat(15, minmax(0, 1fr));
  height: 100%;
  min-height: 0;
  border-left: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
}

.fold-row {
  position: relative;
  display: flex;
  align-items: center;
  border-top: 1px solid var(--grid);
}

.fold-row i {
  display: block;
  height: 7px;
  width: var(--w, 0%);
  background: var(--ink-faint);
  opacity: 0.75;
  transform-origin: left center;
}

.fold-row i.is-over {
  background: var(--accent);
  opacity: 1;
}

.field.is-drawn .fold-row i {
  animation: grow 720ms cubic-bezier(0.16, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 34ms + 180ms);
}

@keyframes grow {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

.fold-row span {
  position: absolute;
  left: calc(var(--w, 0%) + 6px);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
  white-space: nowrap;
  opacity: 0.9;
}

.fold-row.is-row {
  background: var(--accent-faint);
}

.field-axis {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) clamp(104px, 13%, 176px);
  gap: 0 clamp(12px, 1.8vw, 26px);
  margin-top: 6px;
}

.field-axis .ticks {
  display: grid;
  grid-template-columns: repeat(15, minmax(0, 1fr));
}

.field-axis .ticks span {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}

.field-axis .legend {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: right;
  white-space: nowrap;
}

.field-readout {
  display: flex;
  justify-content: space-between;
  gap: 10px 32px;
  margin-top: 8px;
  padding-top: 8px;
  padding-right: 96px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  min-height: 26px;
  flex-wrap: wrap;
}

.field-readout b {
  color: var(--ink);
  font-weight: 500;
}

.field-readout .hint {
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 8.5px;
}

/* ---------------------------------------------------------------- masthead foot */

.masthead-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px 40px;
  flex-wrap: wrap;
  padding-top: 12px;
  padding-right: 96px;
  border-top: 1px solid var(--rule);
}

.facts {
  display: flex;
  gap: clamp(14px, 2.4vw, 34px);
  flex-wrap: wrap;
}

.fact {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.fact b {
  color: var(--ink);
  font-weight: 500;
}

.fact.is-over b {
  color: var(--accent);
}

.masthead-index {
  display: grid;
  gap: 2px;
  min-width: 196px;
}

.masthead-index a {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom: 0;
  padding: 1px 0;
}

.masthead-index a span {
  width: 18px;
  color: var(--ink-faint);
}

.masthead-index a:hover {
  color: var(--ink);
  border-bottom: 0;
}

.masthead-index a:hover span {
  color: var(--accent);
}

/* ---------------------------------------------------------------- plates */

.plate {
  position: relative;
  border-top: 1px solid var(--rule);
  padding: clamp(72px, 12vw, 168px) 0;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0 var(--pad);
}

.plate-head {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0 var(--pad);
  align-items: end;
  margin-bottom: clamp(28px, 4vw, 56px);
}

.plate-no {
  grid-column: 1 / span 1;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  padding-top: 6px;
}

.plate-head h2 {
  grid-column: 2 / span 6;
  font-size: clamp(30px, 4.4vw, 62px);
  line-height: 0.98;
}

.plate-head .note {
  grid-column: 9 / span 4;
  color: var(--ink-dim);
  font-size: 14px;
  line-height: 1.65;
  padding-bottom: 6px;
}

.plate-body {
  grid-column: 1 / -1;
}

/* ---------------------------------------------------------------- specimen */

.specimen-wrap {
  position: relative;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule);
  padding: clamp(14px, 2vw, 26px) 0 0;
}

.specimen-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px 24px;
}

.specimen {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--mono);
  font-size: clamp(12px, 1.62vw, 21px);
  letter-spacing: -0.005em;
  line-height: 1.5;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.specimen .field {
  position: relative;
  display: inline;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--rule-strong);
}

.specimen .field.is-label {
  color: var(--accent);
  border-bottom-color: var(--accent-dim);
}

.specimen .field.is-value {
  color: var(--ink);
}

.specimen .field.is-time {
  color: var(--ink-dim);
}

.specimen .call {
  color: var(--ink);
}

.specimen-note {
  padding: 9px 0 0;
  text-align: right;
}

.copy {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--rule-strong);
  border-radius: 0;
  padding: 0 0 2px;
  margin: 0;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
  transition: color 160ms ease, border-color 160ms ease;
}

.copy:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.copy.is-copied {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.stops {
  display: flex;
  align-items: baseline;
  gap: 0;
  margin-top: 6px;
}

.stop {
  appearance: none;
  background: none;
  border: 0;
  border-top: 1px solid var(--rule-strong);
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 6px 12px 5px 0;
  margin: 0;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease;
  border-radius: 0;
}

.stop + .stop {
  padding-left: 12px;
  border-left: 1px solid var(--rule);
}

.stop:hover {
  color: var(--ink);
}

.stop[aria-pressed="true"] {
  color: var(--accent);
  border-top-color: var(--accent);
  box-shadow: inset 0 1px 0 var(--accent);
}

.annotations {
  position: relative;
  height: 92px;
  margin-top: 2px;
}

.annotation {
  position: absolute;
  top: 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  line-height: 1.55;
  white-space: nowrap;
  padding-top: 10px;
}

.annotations .tick {
  position: absolute;
  top: 0;
  width: 1px;
  height: 8px;
  background: var(--rule-strong);
}

.annotation b {
  display: block;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: 0.12em;
}

.specimen-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px 24px;
  flex-wrap: wrap;
  padding: 10px 0 0;
  border-top: 1px solid var(--rule);
}

.specimen-foot .marginalia {
  text-align: right;
}

.header-note {
  margin-top: clamp(28px, 4vw, 44px);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0 var(--pad);
}

.header-note .prose {
  grid-column: 2 / span 6;
}

.header-note p {
  color: var(--ink-dim);
  font-size: 14px;
  line-height: 1.7;
}

.header-note p + p {
  margin-top: 12px;
}

.header-note p b {
  color: var(--ink);
  font-weight: 500;
}

.header-note .side {
  grid-column: 9 / span 4;
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.8;
  letter-spacing: 0.03em;
  color: var(--ink-faint);
  border-top: 1px solid var(--rule-strong);
  padding-top: 10px;
  align-self: start;
}

.header-note .side b {
  display: block;
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 6px;
}

.header-note .side code {
  color: var(--ink-dim);
}

/* ---------------------------------------------------------------- seams */

.seams {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 44px);
}

.seam {
  border-top: 1px solid var(--rule-strong);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
}

.seam h3 {
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.1;
  margin-bottom: 10px;
}

.seam p {
  color: var(--ink-dim);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 18px;
  max-width: 42ch;
}

.seam p code {
  color: var(--ink);
  font-size: 0.92em;
  border-bottom: 1px solid var(--rule);
}

.seam pre {
  margin-top: auto;
}

pre {
  margin: 0;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  overflow-x: auto;
  font-size: 11.5px;
  line-height: 1.75;
  color: var(--ink);
  tab-size: 2;
}

pre .k {
  color: var(--ink-faint);
}

pre .a {
  color: var(--accent);
}

pre .s {
  color: var(--ink-dim);
}

pre .c {
  color: var(--ink-faint);
}

code {
  font-size: 0.92em;
  color: var(--ink);
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- aggregation */

.aggregate {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 26px var(--pad);
  align-items: start;
}

.agg-plot {
  grid-column: 1 / span 8;
  min-width: 0;
}

.agg-plot svg {
  display: block;
  width: 100%;
  height: clamp(240px, 26vw, 340px);
  overflow: visible;
}

.agg-axis {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  margin-top: 6px;
  border-top: 1px solid var(--rule);
  padding-top: 5px;
}

.agg-axis span {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
  white-space: nowrap;
}

.agg-axis span.is-budget {
  color: var(--accent);
}

.agg-side {
  grid-column: 9 / span 4;
  min-width: 0;
  border-top: 1px solid var(--rule-strong);
  padding-top: 10px;
}

.agg-read {
  margin: 18px 0 0;
  display: grid;
  gap: 0;
}

.agg-read > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  border-top: 1px solid var(--rule);
  padding: 7px 0 8px;
}

.agg-read dt {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.agg-read dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 15px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.agg-read dd.is-moved {
  color: var(--accent);
}

.agg-hint {
  margin-top: 12px;
}

/* ---------------------------------------------------------------- index */

.index-group {
  border-top: 1px solid var(--rule-strong);
  padding: 12px 0 4px;
}

.index-group + .index-group {
  margin-top: 40px;
}

.index-group h3 {
  font-size: 13px;
  font-family: var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 14px;
}

.index-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 12px;
  line-height: 2.35;
  letter-spacing: 0.01em;
}

.index-row .name {
  color: var(--ink);
  white-space: nowrap;
}

/* A rule, not a dot leader: a dotted leader has to be coaxed onto the baseline and
   sits a pixel wrong at some size or another, and this sheet is nothing but rules. */
.index-row .leader {
  flex: 1 1 auto;
  min-width: 12px;
  border-bottom: 1px solid var(--rule);
  transform: translateY(-4px);
}

.index-row .sig {
  color: var(--ink-dim);
  text-align: right;
  white-space: nowrap;
}

/* ---------------------------------------------------------------- inner pages */

.page-head {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0 var(--pad);
  align-items: end;
  padding: clamp(56px, 9vw, 120px) 0 clamp(40px, 5.5vw, 72px);
}

.page-kicker {
  grid-column: 1 / span 2;
  padding-bottom: 10px;
}

.page-title {
  grid-column: 3 / span 7;
  font-size: clamp(42px, 6.8vw, 96px);
  line-height: 0.92;
  letter-spacing: -0.035em;
}

.page-title em {
  font-style: italic;
  letter-spacing: -0.02em;
}

.page-lede {
  grid-column: 9 / span 4;
  align-self: end;
  color: var(--ink-dim);
  font-size: clamp(15px, 1.3vw, 18px);
  line-height: 1.6;
  padding-bottom: 4px;
}

.page-facts {
  grid-column: 3 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px clamp(24px, 5vw, 64px);
  margin: clamp(26px, 3.6vw, 42px) 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
}

.page-facts div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.page-facts dt {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.page-facts dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink);
}

/* ---------------------------------------------------------------- guide */

.doc-toc {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 var(--pad);
  border-top: 1px solid var(--rule-strong);
  padding: 10px 0 12px;
}

.doc-toc a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
  border-bottom: 0;
  padding: 4px 0;
}

.doc-toc a span {
  color: var(--ink-faint);
  width: 20px;
  flex: 0 0 auto;
}

.doc-toc a:hover {
  color: var(--ink);
  border-bottom: 0;
}

.doc-toc a:hover span {
  color: var(--accent);
}

.doc-toc + .doc-section {
  border-top: 0;
}

.doc-section {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0 var(--pad);
  border-top: 1px solid var(--rule);
  padding: clamp(40px, 5.5vw, 76px) 0 clamp(46px, 6vw, 88px);
  scroll-margin-top: 20px;
}

.doc-mark {
  grid-column: 1 / span 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 6px;
}

.doc-body {
  grid-column: 2 / span 7;
  min-width: 0;
}

.doc-body h2 {
  font-size: clamp(26px, 3.4vw, 44px);
  line-height: 1.02;
  margin-bottom: 18px;
}

.doc-body h3 {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 400;
  margin: 32px 0 10px;
}

.doc-body p {
  color: var(--ink-dim);
  font-size: 15.5px;
  line-height: 1.72;
  max-width: 64ch;
  margin: 0 0 14px;
}

.doc-body p b,
.doc-body p strong {
  color: var(--ink);
  font-weight: 500;
}

.doc-body a {
  color: var(--ink);
}

.doc-body p code,
.doc-body li code,
.doc-body dd code,
.doc-body td code {
  color: var(--ink);
  font-size: 0.9em;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
}

.doc-body ul,
.doc-body ol {
  margin: 0 0 18px;
  padding-left: 18px;
  color: var(--ink-dim);
  font-size: 15px;
  line-height: 1.7;
  max-width: 62ch;
}

.doc-body li {
  margin-bottom: 7px;
  padding-left: 4px;
}

.doc-body li::marker {
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 0.85em;
}

.doc-body pre {
  margin: 22px 0 18px;
  padding: 16px 18px;
  border: 0;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule);
  background: none;
  font-size: 12px;
  line-height: 1.8;
  max-width: 100%;
}

.doc-body pre code {
  font-size: inherit;
}

.doc-aside {
  grid-column: 10 / span 3;
  border-top: 1px solid var(--rule-strong);
  padding-top: 10px;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.7;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
}

.doc-aside b {
  display: block;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 6px;
}

.doc-aside p {
  color: var(--ink-faint);
  font-size: 10.5px;
  line-height: 1.65;
  margin-bottom: 8px;
  max-width: none;
}

.doc-aside code {
  color: var(--ink-dim);
  font-size: 10px;
}

.doc-aside a {
  color: var(--ink-dim);
  border-bottom-color: var(--rule);
}

.output-label {
  margin: 0 0 6px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* A result is quoted, not boxed: one rule in the margin, the terminal's own
   spelling kept, and a horizontal scroll if a line is longer than the column. */
.doc-body .output {
  margin: 0 0 20px;
  padding: 8px 0 8px 14px;
  border-left: 1px solid var(--rule-strong);
  font-size: 11.5px;
  line-height: 1.75;
  color: var(--ink-dim);
  white-space: pre;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0 22px;
  font-family: var(--mono);
  font-size: 11px;
}

.table th {
  text-align: left;
  font-weight: 500;
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--rule-strong);
  padding: 0 14px 7px 0;
}

.table td {
  color: var(--ink-dim);
  border-bottom: 1px solid var(--rule);
  padding: 8px 14px 8px 0;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.table tr td:first-child {
  color: var(--ink);
  white-space: nowrap;
}

kbd {
  font-family: var(--mono);
  font-size: 0.85em;
  border: 1px solid var(--rule-strong);
  border-bottom-width: 2px;
  border-radius: 2px;
  padding: 0 4px;
  color: var(--ink-dim);
}

/* ---------------------------------------------------------------- reference */

.api-head .page-title {
  grid-column: 3 / span 8;
}

.api-layout {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0 var(--pad);
  border-top: 1px solid var(--rule-strong);
}

.api-contents {
  grid-column: 1 / span 3;
  align-self: start;
  position: sticky;
  top: 24px;
  padding: 22px 0 40px;
}

.api-filter-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 8px;
  margin-bottom: 16px;
}

.api-filter-wrap label {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

#api-filter {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--rule-strong);
  border-radius: 0;
  padding: 4px 0 6px;
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease;
}

#api-filter::placeholder {
  color: var(--ink-faint);
}

#api-filter:focus {
  border-bottom-color: var(--accent);
}

.api-count {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.api-count b {
  color: var(--ink-dim);
  font-weight: 400;
}

.api-toc {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.api-toc a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  border-bottom: 0;
  padding: 4px 0;
}

.api-toc a:hover {
  color: var(--ink);
  border-bottom: 0;
}

.api-hint {
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.8;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}

.api-packages {
  grid-column: 4 / -1;
  min-width: 0;
}

.api-package {
  padding: clamp(32px, 4.5vw, 58px) 0 40px;
  scroll-margin-top: 16px;
}

.api-package + .api-package {
  border-top: 1px solid var(--rule);
}

.api-package-head {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 4px 16px;
  align-items: baseline;
  margin-bottom: 26px;
}

.api-package-head .plate-no {
  grid-column: 1 / span 1;
}

.api-package-head h2 {
  grid-column: 2 / span 4;
  font-size: clamp(30px, 4vw, 50px);
  line-height: 1;
}

.api-package-head code {
  grid-column: 6 / span 3;
  text-align: right;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-faint);
  overflow-wrap: anywhere;
}

.api-package-head p {
  grid-column: 2 / -1;
  color: var(--ink-dim);
  font-size: 13.5px;
  line-height: 1.7;
  max-width: 68ch;
  margin-top: 12px;
}

.api-group {
  margin-top: 26px;
}

.api-group-title {
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 7px;
  margin-bottom: 0;
}

.api-entry {
  border-bottom: 1px solid var(--rule);
  padding: 12px 0 14px;
  scroll-margin-top: 16px;
}

.api-entry:target {
  background: linear-gradient(90deg, var(--accent-dim), transparent 46%);
  box-shadow: inset 2px 0 0 var(--accent);
  padding-left: 12px;
  margin-left: -12px;
}

.api-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}

.api-kind {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border: 1px solid var(--rule);
  padding: 1px 4px;
  line-height: 1.5;
  white-space: nowrap;
}

.api-name {
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.api-sig {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.01em;
  color: var(--ink-dim);
  overflow-wrap: anywhere;
}

.api-meta {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-left: auto;
}

.api-doc {
  margin-top: 6px;
}

.api-doc p {
  color: var(--ink-dim);
  font-size: 12.5px;
  line-height: 1.72;
  max-width: 74ch;
  margin-bottom: 6px;
}

.api-doc p code {
  color: var(--ink);
  font-size: 0.92em;
  border-bottom: 1px solid var(--rule);
}

.api-fields {
  margin: 10px 0 2px;
  display: grid;
  gap: 4px;
}

.api-fields > div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 8px 14px;
  align-items: baseline;
}

.api-fields dt {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink);
}

.api-fields dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-faint);
  overflow-wrap: anywhere;
}

.api-fields .api-field-doc {
  grid-column: 2;
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--ink-faint);
}

.api-variants {
  margin: 10px 0 2px;
  display: grid;
  gap: 6px;
}

.api-variant {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) minmax(0, 2fr);
  gap: 6px 18px;
  align-items: baseline;
}

.api-variant code {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.api-variant p {
  color: var(--ink-faint);
  font-size: 11.5px;
  line-height: 1.6;
}

.api-methods {
  margin-top: 8px;
  border-left: 1px solid var(--rule);
  padding-left: clamp(10px, 1.6vw, 20px);
}

.api-methods > .api-group-title {
  border-bottom: 0;
  padding-bottom: 0;
  margin: 6px 0 2px;
}

.api-method {
  border-bottom: 1px solid var(--rule);
  padding: 9px 0 10px;
}

.api-method:last-child {
  border-bottom: 0;
}

.api-method .api-name {
  font-size: 12px;
  font-weight: 400;
}

.api-method .api-sig {
  font-size: 10.5px;
}

.api-method .api-doc p {
  font-size: 12px;
}

.api-derived {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.api-derived code {
  font-size: 9.5px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-faint);
}

.api-empty {
  padding: 24px 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-faint);
}

/* ---------------------------------------------------------------- examples */

.example {
  border-top: 1px solid var(--rule);
  padding: clamp(40px, 5.5vw, 80px) 0;
  scroll-margin-top: 20px;
}

.example-head {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px var(--pad);
  align-items: baseline;
  margin-bottom: clamp(20px, 3vw, 34px);
}

.example-head .plate-no {
  grid-column: 1 / span 1;
}

.example-head h2 {
  grid-column: 2 / span 4;
  font-size: clamp(28px, 3.8vw, 48px);
  line-height: 1;
}

.example-head .path {
  grid-column: 6 / span 4;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  overflow-wrap: anywhere;
}

.example-head .run {
  grid-column: 10 / span 3;
  text-align: right;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  overflow-wrap: anywhere;
}

.example-body {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px var(--pad);
  align-items: start;
}

.example-body .listing {
  grid-column: 1 / span 7;
  min-width: 0;
}

.example-body .listing pre {
  padding: 18px 0 18px 18px;
  background: none;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule);
  font-size: 11.5px;
  line-height: 1.85;
}

.example-side {
  grid-column: 8 / span 5;
  min-width: 0;
}

.example-side h3 {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 400;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule-strong);
}

/* A terminal wraps nothing: a number broken across two lines is not the number that
   was printed. The block scrolls instead, which is what a terminal does too. */
.example-side .output {
  margin: 0 0 14px;
  padding: 0 0 6px;
  border: 0;
  font-size: 10px;
  line-height: 1.8;
  color: var(--ink-dim);
  white-space: pre;
  overflow-x: auto;
}

.example-side p {
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 1.7;
}

/* ---------------------------------------------------------------- showcase */

.lab {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 28px var(--pad);
  border-top: 1px solid var(--rule-strong);
  padding: clamp(26px, 3.5vw, 44px) 0 clamp(44px, 6vw, 80px);
}

.lab-input {
  grid-column: 1 / span 6;
  min-width: 0;
}

.lab-read {
  grid-column: 8 / span 5;
  min-width: 0;
  border-top: 1px solid var(--rule-strong);
  padding-top: 10px;
}

.lab-label {
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 4px;
}

.lab-label span {
  opacity: 0.7;
}

#expo-input {
  appearance: none;
  display: block;
  width: 100%;
  min-height: 246px;
  margin: 4px 0 0;
  padding: 8px 0 10px;
  border: 0;
  border-bottom: 1px solid var(--rule-strong);
  border-radius: 0;
  background: none;
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.75;
  color: var(--ink);
  outline: none;
  resize: none;
  transition: border-color 160ms ease;
}

#expo-input:focus {
  border-bottom-color: var(--accent);
}

.lab-note {
  margin: 6px 0 14px;
  color: var(--ink-dim);
  font-size: 14px;
  line-height: 1.7;
  max-width: 48ch;
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 12px 0 4px;
}

.preset {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  padding: 2px 0;
  margin: 0;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease;
}

.preset:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

/* the one go button: a rule above and below, not a filled rectangle */
.lab-send {
  appearance: none;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  width: 100%;
  margin-top: 18px;
  padding: 12px 0 10px;
  border: 0;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
  border-radius: 0;
  background: none;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: color 160ms ease, border-color 160ms ease;
}

.lab-send:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
}

.lab-send span {
  color: var(--accent);
  font-size: 14px;
  letter-spacing: 0;
}

.lab-status {
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.8;
  letter-spacing: 0.03em;
  color: var(--ink-dim);
  min-height: 36px;
  padding-top: 8px;
  border-top: 1px solid var(--rule);
}

.lab-status b {
  font-weight: 500;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.lab-status.is-refused b::before {
  content: "×";
  color: var(--accent);
  margin-right: 6px;
}

.family {
  margin-top: 14px;
  border-top: 1px solid var(--rule);
  padding-top: 7px;
}

.family-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.family-name {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.family-kind {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border: 1px solid var(--rule);
  padding: 1px 4px;
  white-space: nowrap;
}

.sample-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
  border-top: 1px solid var(--rule);
  margin-top: 4px;
  padding-top: 4px;
  font-family: var(--mono);
  font-size: 10px;
}

.sample-row .labels {
  color: var(--ink-dim);
  overflow-wrap: anywhere;
}

.sample-row .value {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sample-more {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-faint);
}

/* ---------------------------------------------------------------- foot */

.foot {
  border-top: 1px solid var(--rule-strong);
  padding: 28px 96px clamp(44px, 6vw, 64px) 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px 32px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.foot nav {
  display: flex;
  gap: 18px;
}

.foot a {
  color: var(--ink-faint);
  border-bottom: 0;
}

.foot a:hover {
  color: var(--ink);
  border-bottom: 0;
}

/* ---------------------------------------------------------------- colophon */

.colophon {
  border-top: 1px solid var(--rule-strong);
  padding: clamp(36px, 6vw, 72px) 0 clamp(56px, 8vw, 96px);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0 var(--pad);
  align-items: start;
}

.colophon .end {
  grid-column: 2 / span 4;
  font-family: var(--serif);
  font-size: clamp(24px, 3vw, 40px);
  line-height: 1.05;
}

.colophon .end em {
  font-style: italic;
  color: var(--ink-dim);
}

.colophon .meta {
  grid-column: 9 / span 4;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.colophon .meta a {
  border-bottom: 0;
  color: var(--ink-dim);
}

.colophon .meta a:hover {
  color: var(--accent);
}

.end-tick {
  grid-column: 1 / -1;
  height: 1px;
  margin-top: clamp(36px, 6vw, 64px);
  background: linear-gradient(90deg, var(--rule-strong), var(--rule) 60%, transparent);
  position: relative;
}

.end-tick::before {
  content: "";
  position: absolute;
  left: 0;
  top: -3px;
  width: 1px;
  height: 7px;
  background: var(--accent);
}

/* ---------------------------------------------------------------- narrow */

@media (width <= 1100px) {
  .brand .wide-only {
    display: none;
  }
  .fold-row span {
    display: none;
  }
}

@media (width <= 980px) {
  /* An inner plate folds to one column: the number, the prose, the aside. */
  .page-kicker,
  .page-title,
  .page-lede,
  .page-facts {
    grid-column: 1 / -1;
  }
  .page-kicker {
    padding-bottom: 14px;
  }
  .page-lede {
    margin-top: 18px;
    padding-bottom: 0;
  }
  .page-facts {
    margin-top: 24px;
  }
  .doc-mark {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: baseline;
    gap: 12px;
    padding-bottom: 10px;
    padding-top: 0;
  }
  .doc-body,
  .doc-aside {
    grid-column: 1 / -1;
  }
  .doc-aside {
    margin-top: 26px;
  }
  .doc-toc {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 24px;
  }
  .api-contents {
    grid-column: 1 / -1;
    position: static;
    display: block;
    padding-bottom: 18px;
  }
  .api-toc {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 2px 22px;
  }
  .api-toc a {
    gap: 6px;
  }
  .api-hint {
    display: none;
  }
  .api-packages {
    grid-column: 1 / -1;
  }
  .api-package-head {
    grid-template-columns: minmax(0, 1fr);
  }
  .api-package-head .plate-no,
  .api-package-head h2,
  .api-package-head code,
  .api-package-head p {
    grid-column: 1 / -1;
  }
  .api-package-head code {
    text-align: left;
  }
  .seams {
    grid-template-columns: minmax(0, 1fr);
  }
  .agg-plot,
  .agg-side {
    grid-column: 1 / -1;
  }
  .masthead {
    height: auto;
    min-height: 0;
    padding-bottom: calc(var(--pad) * 0.6);
  }
  .masthead-head h1,
  .masthead-head .lede {
    grid-column: 1 / -1;
  }
  .masthead-head .lede {
    margin-top: 20px;
    max-width: 46ch;
  }
  .field-wrap {
    min-height: 380px;
  }
  .masthead-foot {
    padding-right: 0;
  }
  .masthead-index {
    display: none;
  }
  .plate-head h2,
  .plate-head .note,
  .plate-no {
    grid-column: 1 / -1;
  }
  .plate-no {
    padding-bottom: 10px;
  }
  .plate-head h2 {
    margin-bottom: 14px;
  }
  .header-note p {
    grid-column: 1 / -1;
  }
  .header-note .side {
    grid-column: 1 / -1;
    margin-top: 20px;
  }
  .colophon .end,
  .colophon .meta {
    grid-column: 1 / -1;
  }
  .colophon .meta {
    margin-top: 24px;
  }
}

@media (width <= 760px) {
  :root {
    /* A scrollbar still has to be draggable on a phone, but it can be a sliver. */
    --rail: 18px;
  }
  .ruler-readout {
    display: none;
  }
  .brand .marginalia {
    display: none;
  }
  .topline {
    gap: 12px 16px;
  }
  .nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
    gap: 10px;
    padding-top: 9px;
    border-top: 1px solid var(--rule);
  }
  .nav {
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .doc-toc {
    grid-template-columns: minmax(0, 1fr);
  }
  .foot {
    padding-right: 0;
  }
  .field {
    grid-template-columns: 44px minmax(0, 1fr) 70px;
    gap: 0 8px;
  }
  .field-axis {
    grid-template-columns: 44px minmax(0, 1fr) 70px;
    gap: 0 8px;
  }
  .row-labels span {
    font-size: 7.5px;
    padding-right: 6px;
  }
  .cell i {
    height: 5px;
  }
  .budget-rule {
    left: 44px;
    right: calc(70px + 8px);
  }
  .field-axis .ticks span:nth-child(even) {
    visibility: hidden;
  }
  .field-axis .legend {
    font-size: 7px;
  }
  .field-readout {
    padding-right: 0;
    font-size: 9px;
  }
  .field-readout .hint {
    display: none;
  }
  .specimen-head {
    flex-direction: column;
    gap: 12px;
  }
  .specimen-head .copy {
    margin-top: 0;
  }
  .specimen {
    font-size: 11px;
  }
  .annotations {
    position: static;
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 0 14px;
  }
  .annotation {
    position: static;
    white-space: normal;
    padding-top: 0;
    display: flex;
    gap: 8px;
    align-items: baseline;
  }
  .annotation b {
    display: inline;
    min-width: 84px;
  }
  .specimen-foot .marginalia {
    text-align: left;
  }
  .plate {
    padding: 56px 0;
  }
  .example-head {
    grid-template-columns: minmax(0, 1fr);
  }
  .example-head .plate-no,
  .example-head h2,
  .example-head .path,
  .example-head .run {
    grid-column: 1 / -1;
  }
  .example-head h2 {
    margin: 2px 0 6px;
  }
  .example-head .run {
    text-align: left;
  }
  .example-body .listing,
  .example-side {
    grid-column: 1 / -1;
  }
  .lab-input,
  .lab-read {
    grid-column: 1 / -1;
  }
  .index-row {
    flex-wrap: wrap;
    line-height: 1.6;
    padding-bottom: 8px;
  }
  .index-row .leader {
    display: none;
  }
  .index-row .name {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .index-row .sig {
    text-align: left;
    white-space: normal;
    width: 100%;
    color: var(--ink-faint);
  }
  .seam pre {
    font-size: 10px;
  }
}

@media (width <= 640px) {
  /* Fifteen labels have to stay readable in a field that still holds fifteen rows:
     the sizes come down, but not to a hairline. */
  .row-labels span {
    font-size: 9px;
    letter-spacing: -0.02em;
    padding-right: 5px;
  }
  .field {
    grid-template-columns: 52px minmax(0, 1fr) 64px;
  }
  .field-axis {
    grid-template-columns: 52px minmax(0, 1fr) 64px;
  }
  .budget-rule {
    left: 52px;
    right: calc(64px + 8px);
  }
  .display {
    font-size: clamp(42px, 14vw, 72px);
  }
  .field-wrap {
    min-height: 320px;
  }
  .facts {
    gap: 6px 16px;
  }
  .fact {
    font-size: 9.5px;
    letter-spacing: 0.08em;
  }
  .wide-only {
    display: none;
  }
  .narrow-only {
    display: inline;
  }
}

/* ---------------------------------------------------------------- motion */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .field.is-drawn .fold-row i {
    animation: none;
  }
}

/* ---------------------------------------------------------------- crossing */

/* The header is the one named element, so moving between the tall front plate and
   a compact inner plate morphs its box rather than swapping it. Same-origin
   navigations only; a browser without view transitions just lands on the page. */
@view-transition {
  navigation: auto;
}

::view-transition-group(site-header) {
  animation-duration: 340ms;
  animation-timing-function: cubic-bezier(0.16, 0.8, 0.2, 1);
}

/* The sheet as a whole only cross-fades briefly: the header carries the motion,
   and a long page fade would compete with it. */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 180ms;
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}
