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

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

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

:root {
  --pad: clamp(16px, 3.4vw, 56px);
  --max: 1280px;
  /* The measuring scale on the right edge is the page's scrollbar, so the sheet
     keeps that much room clear rather than drawing over its own text. */
  --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: developed film, a little blue in the base. */
  --field: #0a0c0e;
  --field-soft: #101315;
  --ink: #edeae3;
  --ink-dim: #9aa0a1;
  --ink-faint: #5b6265;
  --rule: rgba(237, 234, 227, 0.12);
  --rule-strong: rgba(237, 234, 227, 0.26);
  --grid: rgba(237, 234, 227, 0.05);
  --accent: #7fe7d6;
  --accent-dim: rgba(127, 231, 214, 0.38);
  --accent-raise: rgba(127, 231, 214, 0.58);
  --accent-faint: rgba(127, 231, 214, 0.16);
  --accent-ink: #06201c;
}

:root[data-theme="light"] {
  /* The paper plate: uncoated stock, warm, printed in a colder ink than it looks. */
  --field: #f3f0e8;
  --field-soft: #eae6dc;
  --ink: #14161a;
  --ink-dim: #5e6467;
  --ink-faint: #8b9092;
  --rule: rgba(20, 22, 26, 0.14);
  --rule-strong: rgba(20, 22, 26, 0.3);
  --grid: rgba(20, 22, 26, 0.07);
  --accent: #0f7d6e;
  --accent-dim: rgba(15, 125, 110, 0.3);
  --accent-raise: rgba(15, 125, 110, 0.5);
  --accent-faint: rgba(15, 125, 110, 0.16);
  --accent-ink: #f3f0e8;
}

*,
*::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 drawn as the ruler on the right edge: a fixed element,
     so hiding the native one costs no layout. Chrome reads the webkit rules
     below; the standard properties are behind the feature query so they cannot
     win in Chrome and turn the check in `docs.md` into a false pass. */
}

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

@supports not selector(::-webkit-scrollbar) {
  html {
    scrollbar-width: none;
  }
  pre {
    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 waterfall or a strip of marks is noise, and it steals the
   gesture the plate is built around. Prose, code and signatures stay selectable. */
.ruler,
.ruler-readout,
.topline,
.nav,
.doc-toc,
.api-toc,
.masthead-index,
.foot,
.hero-line,
.hero-legend,
.trace,
.strip,
.strip-readout,
.formula,
.segments,
.controls,
.annotations,
.plate-no,
.copy,
.marginalia,
.page-kicker,
.facts,
.counter,
.presets,
.lab-hint,
.lab-control label,
.lab-send,
.api-filter-wrap label,
.api-count,
.api-hint {
  -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;
  border-bottom: 0;
  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(54px, 10.4vw, 146px);
  line-height: 0.86;
  letter-spacing: -0.035em;
}

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

p {
  margin: 0;
}

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

.mono,
.marginalia,
.plate-no,
.stop,
.readout,
.index-row,
pre,
code {
  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 ruler: the page's own scrollbar, drawn as a measuring scale */
.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);
  /* Two graduations on the same nine-pixel beat: a faint one across the whole band
     so the mark reads as a scale, and a brighter one in the minor-tick column so a
     glance can find the exact position. */
  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);
}

.ruler:hover {
  cursor: grab;
}

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

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

.ruler-readout {
  position: fixed;
  right: calc(var(--rail) + 10px);
  bottom: 18px;
  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.9;
  pointer-events: none;
}

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

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

.masthead {
  min-height: 100svh;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: auto 1fr auto;
  gap: 0 var(--pad);
  /* The top margin lives on `.topline` itself, so the front plate and every
     inner plate put the header at the same height. */
  padding: 0 0 var(--pad);
  position: relative;
}

.narrow-only {
  display: none;
}

.topline {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 18px clamp(16px, 3vw, 40px);
  flex-wrap: wrap;
  /* Inner plates keep a compact head; only the front plate is tall. The 0.35em
     is a deliberate small lift off the top edge, not a full drop. */
  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
     plates instead of jumping. */
  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);
}

.masthead-body {
  grid-column: 1 / -1;
  align-self: end;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0 var(--pad);
  padding: clamp(24px, 5vw, 56px) 0 clamp(8px, 1.2vw, 18px);
}

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

.masthead-body .lede {
  grid-column: 9 / span 4;
  align-self: end;
  padding-bottom: 6px;
}

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

/* The plates, set as a table of contents rather than a menu: five lines, a number
   in the margin and a rule that lights up under the pointer. */
.masthead-index {
  display: grid;
  gap: 2px;
  min-width: 190px;
}

.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);
}

.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;
}

/* the hairline under the type, with the marks where the request forks */
.hero-line {
  grid-column: 1 / -1;
  width: 100%;
  height: 96px;
  display: block;
  overflow: visible;
  margin-top: clamp(20px, 4vw, 44px);
}

.hero-line line {
  stroke: var(--ink);
  stroke-width: 1;
  fill: none;
}

.hero-line .done {
  stroke: var(--accent);
}

.trace .event-stem {
  stroke: var(--ink-faint);
  stroke-width: 1;
}

/* ---------------------------------------------------------------- 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;
}

/* ---------------------------------------------------------------- trace plate */

.trace {
  position: relative;
}

.trace svg {
  display: block;
  width: 100%;
  overflow: visible;
}

.trace text {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  fill: var(--ink-faint);
  text-transform: uppercase;
}

.trace .row-name {
  font-size: 11px;
  letter-spacing: 0.02em;
  fill: var(--ink);
  text-transform: none;
}

.trace .row-kind {
  font-size: 8.5px;
  letter-spacing: 0.14em;
  fill: var(--ink-faint);
  opacity: 0.9;
}

.trace .row-time {
  font-size: 10px;
  fill: var(--ink-dim);
}

.trace .grid-line {
  stroke: var(--grid);
  stroke-width: 1;
}

.trace .axis {
  stroke: var(--rule-strong);
  stroke-width: 1;
}

.trace .bar {
  stroke: var(--ink);
  stroke-width: 1;
  fill: none;
  transition: stroke 180ms ease, stroke-width 180ms ease;
}

.trace .bar-body {
  stroke: var(--ink);
  stroke-width: 2;
}

.trace .event {
  fill: var(--ink-dim);
}

.trace .row {
  transition: opacity 200ms ease;
}

.trace.has-active .row {
  opacity: 0.22;
}

.trace.has-active .row.is-active {
  opacity: 1;
}

.trace.has-active .row.is-active .bar,
.trace.has-active .row.is-active .bar-body {
  stroke: var(--accent);
}

.trace.has-active .row.is-active .event {
  fill: var(--accent);
}

.trace.has-active .row.is-active .row-name {
  fill: var(--accent);
}

.trace-readout {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  display: flex;
  gap: clamp(12px, 2.4vw, 30px);
  flex-wrap: wrap;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  min-height: 40px;
}

.trace-readout b {
  color: var(--ink);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.trace-readout .attrs {
  color: var(--ink-faint);
}

/* ---------------------------------------------------------------- header plate */

.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: 24px;
}

.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);
}

.specimen {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--mono);
  font-size: clamp(15px, 2.15vw, 29px);
  letter-spacing: -0.005em;
  word-break: break-all;
  line-height: 1;
  color: var(--ink);
}

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

.specimen-head .copy {
  flex: 0 0 auto;
  margin-top: 6px;
}

.specimen .dash {
  color: var(--ink-faint);
  padding: 0 0.12em;
}

.specimen .flags {
  color: var(--accent);
  border-bottom-color: var(--accent-dim);
}

.annotations {
  position: relative;
  height: 90px;
  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;
}

/* Two levels, because "version" is two characters wide and its note runs into the
   note under the trace id. Lifting the second note one full note-height clears it. */
.annotation.is-lifted {
  top: 44px;
}

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

.annotations .tick:first-of-type {
  height: 8px;
}

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

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

.header-note p {
  grid-column: 2 / span 6;
  color: var(--ink-dim);
  font-size: 14px;
  line-height: 1.7;
}

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

/* ---------------------------------------------------------------- decision plate */

.strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  align-items: flex-end;
  height: 128px;
  padding-bottom: 1px;
  border-bottom: 1px solid var(--rule-strong);
}

/* A dropped request is a speck on the rule; a kept one is a mark standing on it. The
   proportion is then read by eye, which is the whole point of the plate. */
.strip i {
  flex: 1 1 0;
  min-width: 1px;
  height: 7px;
  background: var(--ink-faint);
  opacity: 0.45;
  transition: height 460ms cubic-bezier(0.2, 0.7, 0.2, 1),
    background-color 460ms ease, opacity 460ms ease;
}

.strip i.kept {
  height: 104px;
  background: var(--accent);
  opacity: 1;
}

.strip:hover i.kept {
  opacity: 0.82;
}

.strip i.is-pointed {
  background: var(--ink);
  height: 128px;
  opacity: 1;
}

.strip i.kept.is-pointed {
  background: var(--accent);
}

.controls {
  margin-top: 20px;
  display: flex;
  align-items: baseline;
  gap: clamp(14px, 2.6vw, 36px);
  flex-wrap: wrap;
  justify-content: space-between;
}

.stops {
  display: flex;
  align-items: baseline;
  gap: 0;
}

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

.stop + .stop {
  padding-left: 14px;
  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);
}

.counter {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
}

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

.strip-readout {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  min-height: 18px;
}

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

.formula {
  margin-top: 6px;
  text-align: right;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

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

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

.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 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;
}

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

.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;
}

.index-row .sig em {
  color: var(--ink-faint);
  font-style: normal;
}

/* ---------------------------------------------------------------- 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);
}

/* the end of the line: one tick, where the trace stopped */
.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);
}

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

.toplink {
  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 switch, in the topline, as a printed caption */
.theme {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom: 1px solid transparent;
  transition: color 160ms ease, border-color 160ms ease;
}

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

/* ---------------------------------------------------------------- print marks */

/* A registration mark, as a press would put one at the edge of a sheet: a cross
   inside a circle, there to check that the plates line up rather than to decorate.
   Two of them, at opposite corners, at the weight of a rule. */
.colophon::after {
  content: "";
  position: absolute;
  width: 13px;
  height: 13px;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  background:
    linear-gradient(var(--rule-strong), var(--rule-strong)) center / 17px 1px no-repeat,
    linear-gradient(var(--rule-strong), var(--rule-strong)) center / 1px 17px no-repeat;
  opacity: 0.7;
  pointer-events: none;
}

.colophon::after {
  right: 0;
  bottom: 14px;
}

/* ---------------------------------------------------------------- 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(64px, 10vw, 132px) 0 clamp(44px, 6vw, 76px);
}

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

.page-title {
  grid-column: 3 / span 7;
  font-size: clamp(44px, 7.2vw, 104px);
  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(28px, 4vw, 44px) 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 */

/* A printed table of contents: three columns of numbered lines, one rule above the
   whole thing and none under it, so the first section can start on its own rule. */
.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(44px, 6vw, 84px) 0 clamp(52px, 7vw, 96px);
  scroll-margin-top: 20px;
}

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

.doc-tag {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-faint);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  display: none;
}

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

.doc-body h2 {
  font-size: clamp(28px, 3.6vw, 46px);
  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: 34px 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: linear-gradient(180deg, var(--field-soft), transparent);
  font-size: 12px;
  line-height: 1.8;
  max-width: 100%;
}

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

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

.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;
}

/* the limits table: a printed table, rules only */
.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);
}

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

.example {
  border-top: 1px solid var(--rule);
  padding: clamp(44px, 6vw, 84px) 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(22px, 3vw, 36px);
}

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

.example-head h2 {
  grid-column: 2 / span 4;
  font-size: clamp(30px, 4vw, 52px);
  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 {
  max-height: none;
  padding: 18px;
  background: linear-gradient(180deg, var(--field-soft), transparent 60%);
  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: an id broken across two lines is not the id that was
   printed. The block scrolls instead, which is what a terminal does too. */
.output {
  margin: 0 0 18px;
  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;
}

/* ---------------------------------------------------------------- notes */

.note-status {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  padding: 2px 6px;
  white-space: nowrap;
}

.note-status.is-open {
  color: var(--ink-dim);
  border-color: var(--rule-strong);
}

.doc-body .verdict {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0 0 18px;
  padding: 10px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.doc-body .verdict b {
  color: var(--ink);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0.02em;
}

/* ---------------------------------------------------------------- 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-filter-wrap .api-count {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.api-filter-wrap .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-toc a[aria-current] {
  color: var(--ink);
}

.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(36px, 5vw, 64px) 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(32px, 4.2vw, 54px);
  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-call {
  display: inline;
  min-width: 0;
}

.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-sig .arrow {
  color: var(--ink-faint);
  padding: 0 2px;
}

.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-doc a {
  color: var(--ink);
}

.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-fields .api-field-doc p {
  margin: 0;
}

.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);
}

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

.foot {
  border-top: 1px solid var(--rule-strong);
  padding: 28px 0 clamp(44px, 6vw, 64px);
  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;
}

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

.lab {
  padding-top: clamp(36px, 5vw, 64px);
  padding-bottom: clamp(40px, 6vw, 72px);
}

.hop {
  padding-top: clamp(40px, 6vw, 72px);
}

.lab-specimen {
  grid-column: 1 / -1;
  border-top: 1px solid var(--rule-strong);
  padding-top: 12px;
  margin-bottom: clamp(28px, 4vw, 52px);
}

.lab-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(32px, 5vw, 72px) var(--pad);
}

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

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

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

.lab-control label span {
  color: var(--ink-faint);
  opacity: 0.7;
}

#tp-input,
#ts-input {
  appearance: none;
  display: block;
  width: 100%;
  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: clamp(10.5px, 1.1vw, 15px);
  letter-spacing: 0;
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease;
}

#ts-input {
  font-size: 13px;
  color: var(--ink-dim);
}

#tp-input:focus,
#ts-input:focus {
  border-bottom-color: var(--accent);
}

.lab-hint {
  margin: 12px 0 6px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-bottom: 26px;
}

.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);
}

.ts-label {
  margin-top: 2px;
}

/* 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: 26px;
  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;
}

/* the four fields, as a specimen: value above, name and width below */
.segments {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px 0.14em;
  margin: 14px 0 6px;
}

.seg {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.seg-value {
  font-family: var(--mono);
  font-size: clamp(9px, 2.1vw, 30px);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1;
  color: var(--ink);
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 6px;
  overflow-wrap: anywhere;
}

.seg[data-field="trace-id"] .seg-value {
  color: var(--accent);
  border-bottom-color: var(--accent-dim);
}

.seg[data-field="span-id"] .seg-value {
  color: var(--ink);
}

.seg-legend {
  margin: 0;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.seg-dash {
  align-self: flex-start;
  padding-top: 1px;
  /* The header uses a hyphen, but at this size its glyph sits on the baseline next to
     an underlined field and reads as an underscore. Lift it to the middle, where a
     separator belongs, without changing the character. */
  transform: translateY(-0.18em);
  font-family: var(--mono);
  font-size: clamp(9px, 2.1vw, 30px);
  color: var(--ink-faint);
}

.segments[data-mode="raw"] {
  align-items: flex-start;
  margin: 16px 0 14px;
}

.raw {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.9;
  letter-spacing: 0.04em;
  color: var(--ink-dim);
  overflow-wrap: anywhere;
}

.raw-char {
  display: inline-block;
  min-width: 0.62ch;
}

.raw-char.is-bad {
  color: var(--ink);
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}

.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 {
  color: var(--ink);
}

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

.lab-fields {
  margin: 12px 0 0;
  display: grid;
  gap: 4px;
}

.lab-field {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 4px 12px;
  align-items: baseline;
}

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

.lab-field dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-dim);
  overflow-wrap: anywhere;
}

/* the hop */
.hop-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(24px, 4vw, 44px);
}

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

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

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

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

.hop-header {
  font-family: var(--mono);
  font-size: clamp(14px, 1.9vw, 25px);
  line-height: 1.5;
  color: var(--ink);
  overflow-wrap: anywhere;
  padding: 14px 0 16px;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule);
  min-height: 60px;
}

.compare {
  margin: 16px 0 0;
  display: grid;
  gap: 0;
  max-width: 760px;
}

.compare-row {
  display: grid;
  grid-template-columns: 130px 150px minmax(0, 1fr);
  gap: 8px 18px;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px solid var(--rule);
}

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

.compare-row dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-dim);
  overflow-wrap: anywhere;
}

.compare-verdict {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 9px !important;
  color: var(--ink-faint) !important;
}

.compare-row.is-accent .compare-verdict,
.compare-row.is-accent .compare-value {
  color: var(--accent) !important;
}

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

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

.step-no {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  margin-bottom: 10px;
}

.step h3 {
  font-size: clamp(24px, 2.6vw, 34px);
  line-height: 1.05;
  margin-bottom: 10px;
}

.step p {
  color: var(--ink-dim);
  font-size: 13.5px;
  line-height: 1.7;
  margin-bottom: 18px;
}

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

.step pre {
  margin-top: auto;
  font-size: 10.5px;
}

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





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

@media (width <= 980px) {
  .masthead-body h1 {
    grid-column: 1 / -1;
  }
  .masthead-body .lede {
    grid-column: 1 / span 7;
    margin-top: 24px;
  }
  .plate-head h2,
  .plate-head .note {
    grid-column: 1 / -1;
  }
  .plate-no {
    grid-column: 1 / -1;
    padding-bottom: 10px;
  }
  .plate-head h2 {
    margin-bottom: 14px;
  }
  .header-note p {
    grid-column: 1 / -1;
  }
  .colophon .end,
  .colophon .meta {
    grid-column: 1 / -1;
  }
  .colophon .meta {
    margin-top: 24px;
  }
  .seams {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .masthead-index {
    display: none;
  }
  .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;
  }
  /* A package heading is a stack on a narrow sheet: number, name, path, intro. */
  .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;
  }
  .page-title,
  .page-lede,
  .page-facts {
    grid-column: 1 / -1;
  }
  .page-kicker {
    grid-column: 1 / -1;
    padding-bottom: 14px;
  }
  .page-lede {
    margin-top: 18px;
  }
  .doc-toc {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 24px;
  }
  .lab-control,
  .lab-read {
    grid-column: 1 / -1;
  }
  .hop-head h2,
  .hop-head .note {
    grid-column: 1 / -1;
  }
  .hop-head h2 {
    margin-bottom: 12px;
  }
  .steps-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .doc-mark {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: baseline;
    gap: 12px;
    padding-bottom: 10px;
  }
  .doc-body {
    grid-column: 1 / -1;
  }
  .doc-aside {
    grid-column: 2 / span 7;
    margin-top: 26px;
  }
  .example-head h2 {
    grid-column: 2 / span 6;
  }
  .example-head .path {
    grid-column: 2 / span 6;
  }
  .example-head .run {
    grid-column: 8 / span 5;
    text-align: left;
  }
  .example-body .listing,
  .example-side {
    grid-column: 1 / -1;
  }
  .example-body .listing pre {
    font-size: 10.5px;
  }
}

@media (width <= 760px) {
  /* The path and the command need a line each at this width: broken in the middle of
     a file name, they are worse than a taller header. */
  .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;
  }
  .segments {
    min-height: 0;
  }
  .seg-value,
  .seg-dash {
    font-size: 9px;
    letter-spacing: -0.02em;
  }
  #tp-input {
    font-size: 10px;
    letter-spacing: -0.01em;
  }
  .segments {
    gap: 10px 0.12em;
  }
  .seam pre {
    font-size: 10px;
  }
  .compare-row {
    grid-template-columns: 100px minmax(0, 1fr);
  }
  .compare-value {
    grid-column: 2;
  }
  .compare-verdict {
    grid-column: 2;
  }
}

@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;
  }
  /* The wordmark and the two controls are one row; the kicker and the registration
     mark are the first things to go when the row is too narrow for them. */
  .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);
  }
  /* A specimen that wraps cannot carry notes hung under it: they become a list, and
     the fields wrap as whole fields with the dashes dropped. */
  .specimen-head {
    flex-direction: column;
    gap: 12px;
  }
  .specimen-head .copy {
    margin-top: 0;
  }
  .specimen {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 12px;
    font-size: 13px;
    line-height: 1.9;
    word-break: normal;
  }
  .specimen .dash {
    display: none;
  }
  .specimen .field {
    padding-bottom: 4px;
  }
  .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::before {
    display: none;
  }
  .annotation b {
    display: inline;
    min-width: 74px;
  }
  .specimen-note {
    text-align: left;
    padding-bottom: 8px;
  }
}

/* The index rows need two lines before the phone breakpoint as well: at 700px a
   long name plus a long signature overflows the sheet. */
@media (width <= 760px) {
  .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);
  }
}

@media (width <= 640px) {
  .masthead {
    min-height: auto;
  }
  .masthead-body .lede {
    grid-column: 1 / -1;
  }
  .display {
    font-size: clamp(44px, 15vw, 74px);
  }
  .hero-line {
    height: 64px;
  }
  .strip {
    height: 96px;
  }
  .strip i.kept {
    height: 72px;
  }
  .strip i {
    height: 28px;
  }
  .strip i.is-pointed {
    height: 96px;
  }
  .plate {
    padding: 56px 0;
  }
  .wide-only {
    display: none;
  }
  .narrow-only {
    display: inline;
  }
  .facts {
    gap: 6px 16px;
  }
  .fact {
    font-size: 9.5px;
    letter-spacing: 0.08em;
  }
  .trace-readout {
    font-size: 9px;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .hero-line .draw {
    stroke-dashoffset: 0 !important;
  }
}

/* The one entrance: the line is drawn, once, when it comes into view. */
.hero-line .draw {
  stroke-dasharray: var(--len, 1200);
  stroke-dashoffset: var(--len, 1200);
}

.hero-line.is-drawn .draw {
  animation: draw 1400ms cubic-bezier(0.16, 0.8, 0.2, 1) forwards;
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

.hero-legend {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.hero-legend span:last-child {
  color: var(--ink-dim);
}

.hero-line .tick {
  opacity: 0;
}

.hero-line.is-drawn .tick {
  animation: appear 400ms ease forwards;
  animation-delay: calc(var(--i, 0) * 170ms + 220ms);
}

@keyframes appear {
  to {
    opacity: 1;
  }
}

/* ---------------------------------------------------------------- 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;
  }
}
