/* ============================================================
   dbcrate — site stylesheet
   Marketing + docs + blog + changelog. Reads from tokens.
============================================================ */

:root {
  --serif: ui-serif, Georgia, "Times New Roman", Times, serif;
  --sans:  system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono:  ui-monospace, "SF Mono", Menlo, Monaco, "Cascadia Mono", Consolas, monospace;

  --ink:      #111;
  --paper:    #ffffff;
  --rule:     #111;
  --soft:     #6a6a6a;
  --mute:     #222;
  --hairline: #ddd;
  --tint:     #f5f5f5;

  --ok:   #1f6f3f;
  --warn: #a06a00;
  --err:  #a51d2d;

  --fs-h1: 28px;
  --fs-h2: 19px;
  --fs-h3: 19px;
  --fs-body: 17px;
  --fs-data: 15px;
  --fs-meta: 13px;
  --fs-eyebrow: 11px;
  --fs-label: 10.5px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 22px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  --content-max: 1100px;
  --prose-max: 720px;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --ink:      #ededea;
    --paper:    #111111;
    --rule:     #ededea;
    --soft:     #9a9a9a;
    --mute:     #d8d8d4;
    --hairline: #333333;
    --tint:     #1a1a1a;
    --ok:       #6db391;
    --warn:     #d6a64c;
    --err:      #e07a86;
  }
}
html[data-theme="dark"] {
  --ink:      #ededea;
  --paper:    #111111;
  --rule:     #ededea;
  --soft:     #9a9a9a;
  --mute:     #d8d8d4;
  --hairline: #333333;
  --tint:     #1a1a1a;
  --ok:       #6db391;
  --warn:     #d6a64c;
  --err:      #e07a86;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--fs-body);
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "liga", "onum";
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
::selection { background: var(--ink); color: var(--paper); }

p { margin: 0 0 1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

code { font-family: var(--mono); font-size: 0.9em; }

/* ---------- Topbar ---------- */

.topbar {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  position: sticky; top: 0; z-index: 5;
}
.topbar-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 32px;
  display: flex; align-items: center; gap: 28px;
  height: 72px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
}
.wordmark .mark {
  display: block;
  width: 52px;
  height: 34px;
  flex-shrink: 0;
  color: var(--ink);
}
.colophon .wordmark .mark { width: 36px; height: 24px; }
.wordmark::after {
  content: "";
  display: inline-block;
  width: 1px;
  height: 18px;
  background: var(--hairline);
  margin-left: 18px;
}
.primary-nav {
  display: flex; align-items: center; gap: 22px;
  list-style: none; margin: 0; padding: 0;
}
.primary-nav a {
  font-family: var(--sans);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--soft);
  text-decoration: none;
}
.primary-nav a:hover { color: var(--ink); }
.primary-nav a.active { color: var(--ink); }
.account { margin-left: auto; display: flex; gap: 16px; align-items: center; }
.account a {
  font-family: var(--sans);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--soft);
  text-decoration: none;
}
.account a.cta {
  color: var(--ink);
  border: 1px solid var(--rule);
  padding: 8px 14px;
}
.account a.cta:hover { background: var(--ink); color: var(--paper); }
.account a:hover { color: var(--ink); }
.account .disabled {
  font-family: var(--sans);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
  opacity: 0.5;
  cursor: not-allowed;
  user-select: none;
}

/* ---------- Folio (top meta strip on marketing pages) ---------- */

.folio {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 12px 32px 0;
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--soft);
}
.folio span { white-space: nowrap; }
.folio a { color: var(--soft); text-decoration: none; }
.folio a:hover { color: var(--ink); }

/* ---------- Page container ---------- */

.page {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 36px 32px 80px;
}
.page.narrow { max-width: 820px; }

/* ---------- Page header (marketing) ---------- */

.masthead {
  text-align: center;
  border-bottom: 1px solid var(--rule);
  padding: 28px 0 28px;
  margin-bottom: 36px;
}
.nameplate {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(48px, 11vw, 112px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin: 4px 0 10px;
}
.motto {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--mute);
}
.motto::before, .motto::after {
  content: "—";
  margin: 0 0.6em;
  color: var(--soft);
  font-style: normal;
}

/* ---------- Page header (interior) ---------- */

.page-header {
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 22px;
  margin-bottom: 36px;
}
.eyebrow {
  font-family: var(--sans);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--soft);
  margin: 0 0 10px;
}
.eyebrow.err { color: var(--err); }
.page-header h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: var(--fs-h1);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  text-wrap: balance;
}
.page-header .subtitle {
  font-family: var(--serif);
  font-style: italic;
  font-size: var(--fs-body);
  color: var(--mute);
  margin: 0;
  max-width: 38em;
}

/* ---------- Lede (homepage hero) ---------- */

.lede {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
  padding: 8px 0 14px;
}
.lede h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 18px;
  text-wrap: balance;
}
.lede .deck {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(18px, 2vw, 21px);
  line-height: 1.45;
  color: var(--mute);
  margin: 0 0 28px;
  max-width: 36em;
  margin-left: auto; margin-right: auto;
  text-wrap: pretty;
}
.lede .actions {
  display: flex; justify-content: center; gap: 14px; flex-wrap: wrap;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 12px 18px;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  cursor: pointer;
}
.btn:hover { text-decoration: none; }
.btn-quiet {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--ink);
}
.btn-quiet:hover { background: var(--ink); color: var(--paper); }
.btn-sm { padding: 7px 12px; font-size: 11px; }

/* ---------- Section head (plain hairline) ---------- */

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 10px;
  margin: 56px 0 22px;
}
.section-head h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: var(--fs-h2);
  margin: 0;
}
.section-head .more {
  font-family: var(--sans);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--soft);
  text-decoration: none;
}
.section-head .more:hover { color: var(--ink); }

/* ---------- Stub head (printer's ornament, italic, fleurons) ---------- */
/* The newspaper-style section break, used on marketing pages.            */

.stub {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(24px, 3.4vw, 32px);
  letter-spacing: 0.005em;
  text-align: center;
  margin: 64px 0 28px;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.stub::before, .stub::after {
  content: "";
  flex: 0 1 110px;
  height: 1px;
  background: var(--rule);
}
.stub .ornament-glyph {
  font-style: normal;
  font-size: 0.78em;
  color: var(--soft);
  line-height: 1;
  transform: translateY(-1px);
}
.stub .ornament-left  { margin-right: -6px; }
.stub .ornament-right { margin-left:  -6px; }

/* ---------- Kicker + dateline ---------- */

.kicker {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--soft);
  text-align: left;
  margin: 0 0 12px;
}
.kicker::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--rule);
  vertical-align: middle;
  margin: 0 10px 3px 0;
}
.dateline {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-right: 0.5em;
}

/* ---------- Endmark ---------- */

.endmark {
  text-align: center;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.5em;
  color: var(--soft);
  margin: 28px 0 0;
  text-indent: 0 !important;
}

/* ---------- At a Glance (double-rule sidebar) ---------- */

.atglance {
  max-width: 460px;
  margin: 36px auto 0;
  padding: 18px 22px 20px;
  border-top: 3px double var(--rule);
  border-bottom: 3px double var(--rule);
}
.atglance h3 {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-align: center;
  margin: 0 0 14px;
  color: var(--ink);
}
.atglance dl {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 18px;
  row-gap: 6px;
  font-size: 14px;
}
.atglance dt {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--soft);
  align-self: baseline;
  padding-top: 2px;
}
.atglance dd {
  margin: 0;
  font-family: var(--serif);
  color: var(--ink);
}

/* ---------- Status note (boxed CTA on marketing pages) ---------- */

.status-note {
  border: 1px solid var(--rule);
  padding: 22px 24px;
  margin: 8px 0 0;
}
.status-note h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 22px;
  margin: 0 0 8px;
}
.status-note p { text-align: left; }
.status-note .cta {
  display: inline-block;
  margin-top: 6px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  border: 1px solid var(--rule);
  padding: 10px 16px;
  text-decoration: none;
}
.status-note .cta:hover { background: var(--ink); color: var(--paper); }

/* ---------- Masthead refinements ---------- */

.masthead.with-folio { border-top: 1px solid var(--rule); }
.masthead .motto { font-size: 16px; }

/* ---------- Ornament (used rarely) ---------- */

.ornament {
  text-align: center;
  margin: 56px 0 28px;
}
.ornament .head {
  font-family: var(--serif);
  font-style: italic;
  font-size: 28px;
  margin: 0;
  display: flex; align-items: center; justify-content: center; gap: 18px;
}
.ornament .head::before, .ornament .head::after {
  content: "";
  flex: 0 1 110px;
  height: 1px;
  background: var(--rule);
}
.ornament .fleur { color: var(--soft); font-size: 16px; font-style: normal; }
.ornament .sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: var(--fs-meta);
  color: var(--soft);
  margin: 8px 0 0;
}

/* ---------- Stat strip ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin: 28px 0;
}
.stat {
  padding: 18px 22px;
  border-right: 1px solid var(--hairline);
}
.stat:last-child { border-right: 0; }
.stat .label {
  font-family: var(--sans);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--soft);
  margin: 0 0 6px;
}
.stat .value {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 32px;
  font-variant-numeric: tabular-nums;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.stat .meta {
  font-family: var(--serif);
  font-style: italic;
  font-size: var(--fs-meta);
  color: var(--soft);
  margin: 0;
}

/* ---------- Feature list (two-column hairlined) ---------- */

.features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 44px;
}
.features li {
  padding: 18px 0;
  border-top: 1px solid var(--hairline);
}
.features li:nth-child(-n+2) { border-top: 0; }
.features h3 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 19px;
  margin: 0 0 6px;
  letter-spacing: -0.005em;
}
.features p {
  margin: 0;
  font-size: var(--fs-data);
  color: var(--mute);
}

/* ---------- Two-col body ---------- */

.two-col {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 48px;
}
.two-col aside h3 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: var(--fs-h3);
  margin: 0 0 10px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
}
.two-col aside p {
  font-size: var(--fs-data);
  color: var(--mute);
  margin: 0 0 14px;
}

/* ---------- Pull quote ---------- */

.pullquote {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 28px 0;
  margin: 48px 0;
  text-align: center;
}
.pullquote q {
  quotes: none;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(22px, 3vw, 28px);
  line-height: 1.25;
  letter-spacing: -0.005em;
  display: block;
  max-width: 22em;
  margin: 0 auto;
  text-wrap: balance;
}
.pullquote q::before { content: "“"; }
.pullquote q::after  { content: "”"; }
.pullquote .attrib {
  font-family: var(--sans);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--soft);
  margin-top: 16px;
}

/* ---------- Code block / figure ---------- */

.figure {
  margin: 28px 0;
}
.figure pre {
  display: block;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.5;
  margin: 0;
  padding: 20px 24px;
  border: 1px solid var(--hairline);
  background: var(--tint);
  overflow-x: auto;
}
.figcaption {
  font-family: var(--sans);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--soft);
  margin-top: 10px;
}
.figure.center { text-align: center; }
.figure.center pre { display: inline-block; text-align: left; }

/* ---------- ASCII plate (illustration block) ---------- */
/* Black-and-white ASCII illustration, sits in the page like a plate.
   The plate has 1px hairline, mono interior, optional small-caps title. */

.plate {
  margin: 28px 0;
  border: 1px solid var(--hairline);
  background: var(--paper);
}
.plate .plate-title {
  font-family: var(--sans);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--soft);
  padding: 10px 18px 8px;
  border-bottom: 1px solid var(--hairline);
  display: flex; justify-content: space-between;
}
.plate .plate-title .num { color: var(--mute); }
.plate-body {
  background: var(--tint);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.plate pre {
  display: block;
  width: -moz-max-content;
  width: max-content;
  max-width: none;
  margin: 0 auto;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.35;
  padding: 22px 24px;
  background: transparent;
  color: var(--ink);
  white-space: pre;
}
.plate.dark .plate-body { background: var(--ink); }
.plate.dark pre { color: var(--paper); }
.plate.dark .plate-title { background: var(--ink); color: var(--paper); border-bottom-color: var(--ink); }
.plate.dark .plate-title .num { color: var(--paper); opacity: 0.7; }
.plate-caption {
  font-family: var(--serif);
  font-style: italic;
  font-size: var(--fs-meta);
  color: var(--soft);
  text-align: center;
  margin: 10px 0 0;
}

/* Two plates side by side */
.plate-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 28px 0;
}
.plate-pair .plate { margin: 0; }

/* ---------- Video frame (black-and-white treatment) ---------- */

.vidframe {
  margin: 28px 0;
  border: 1px solid var(--rule);
  background: var(--paper);
}
.vidframe .vid-title {
  font-family: var(--sans);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 10px 18px 9px;
  border-bottom: 1px solid var(--rule);
  display: flex; justify-content: space-between; align-items: baseline;
}
.vidframe .vid-title .runtime { color: var(--soft); font-family: var(--mono); letter-spacing: 0.04em; text-transform: none; font-size: 12px; }
.vidframe .player {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}
.vidframe .player iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
  /* Black-and-white treatment, calmly desaturated to match the page. */
  filter: grayscale(1) contrast(1.05);
}
.vidframe .vid-caption {
  font-family: var(--serif);
  font-style: italic;
  font-size: var(--fs-meta);
  color: var(--mute);
  padding: 12px 18px;
  border-top: 1px solid var(--hairline);
}

/* Pair of video frames */
.vid-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 28px 0;
}
.vid-pair .vidframe { margin: 0; }

@media (max-width: 820px) {
  .plate-pair, .vid-pair { grid-template-columns: 1fr; }
}

/* ---------- Tables (engines table, blog index, changelog) ---------- */

.ledger {
  width: 100%;
  border-collapse: collapse;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-variant-numeric: tabular-nums;
}
.ledger th {
  font-family: var(--sans);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--soft);
  text-align: left;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--hairline);
}
.ledger td {
  font-family: var(--serif);
  font-size: var(--fs-data);
  padding: 14px 16px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
}
.ledger tr:last-child td { border-bottom: 0; }
.ledger th.num, .ledger td.num { text-align: right; font-variant-numeric: tabular-nums; }
.ledger td.mono { font-family: var(--mono); font-size: 13.5px; }

/* ---------- Status chip ---------- */

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--serif);
  font-size: var(--fs-meta);
}
.status::before {
  content: "";
  width: 6px; height: 6px;
  background: currentColor;
  display: inline-block;
}
.status.ok    { color: var(--ok); }
.status.warn  { color: var(--warn); }
.status.err   { color: var(--err); }
.status.muted { color: var(--soft); }

/* ---------- Blog index entries ---------- */

.entries { list-style: none; margin: 0; padding: 0; }
.entries li {
  padding: 22px 0;
  border-top: 1px solid var(--hairline);
  display: grid;
  grid-template-columns: 130px 1fr 140px;
  gap: 28px;
  align-items: baseline;
}
.entries li:first-child { border-top: 0; padding-top: 0; }
.entries .date {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--soft);
}
.entries h3 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 21px;
  margin: 0 0 6px;
  letter-spacing: -0.005em;
}
.entries h3 a { text-decoration: none; }
.entries h3 a:hover { text-decoration: underline; }
.entries p {
  font-size: var(--fs-data);
  color: var(--mute);
  margin: 0;
  text-wrap: pretty;
}
.entries .author {
  font-family: var(--sans);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--soft);
  text-align: right;
}

/* ---------- Article (blog post) ---------- */

.article {
  max-width: var(--prose-max);
  margin: 0 auto;
}
.article header {
  text-align: center;
  margin-bottom: 44px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--hairline);
}
.article h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 14px;
  text-wrap: balance;
}
.article .deck {
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  color: var(--mute);
  margin: 0 0 18px;
  max-width: 32em;
  margin-left: auto; margin-right: auto;
}
.article .byline {
  font-family: var(--sans);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--soft);
}
.article .byline .sep { margin: 0 0.6em; }
.article p { font-size: var(--fs-body); line-height: 1.65; }
.article h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 22px;
  margin: 38px 0 12px;
  letter-spacing: -0.005em;
}
.article h3 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 17px;
  margin: 28px 0 8px;
}
.article blockquote {
  margin: 24px 0;
  padding: 0 0 0 18px;
  border-left: 1px solid var(--rule);
  font-style: italic;
  color: var(--mute);
}
.article ul, .article ol { padding-left: 22px; margin: 0 0 1em; }
.article li { margin: 0 0 6px; }
.article hr {
  border: 0;
  border-top: 1px solid var(--hairline);
  margin: 36px 0;
}
.article .endmark {
  text-align: center;
  font-family: var(--serif);
  font-size: var(--fs-meta);
  letter-spacing: 0.5em;
  color: var(--soft);
  margin: 36px 0 0;
}

/* ---------- Changelog ---------- */

.release {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 36px;
  padding: 28px 0;
  border-top: 1px solid var(--hairline);
}
.release:first-of-type { border-top: 1px solid var(--rule); }
.release:last-of-type { border-bottom: 1px solid var(--rule); }
.release .meta .ver {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 22px;
  margin: 0 0 4px;
  font-variant-numeric: tabular-nums;
}
.release .meta .date {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--soft);
  margin: 0 0 8px;
}
.release .meta .tag {
  font-family: var(--sans);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--soft);
}
.release .meta .tag.beta { color: var(--warn); }
.release .meta .tag.stable { color: var(--ok); }
.release h3 {
  font-family: var(--sans);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--soft);
  margin: 0 0 10px;
}
.release h3:not(:first-child) { margin-top: 22px; }
.release ul {
  list-style: none;
  margin: 0 0 4px;
  padding: 0;
}
.release li {
  padding: 6px 0 6px 0;
  font-size: var(--fs-data);
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 16px;
}
.release li .kind {
  font-family: var(--sans);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--soft);
  padding-top: 3px;
}
.release li .kind.added { color: var(--ok); }
.release li .kind.fixed { color: var(--ink); }
.release li .kind.changed { color: var(--warn); }
.release li .kind.removed { color: var(--err); }

.release .headline {
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  line-height: 1.45;
  color: var(--ink);
  margin: 0 0 26px;
  max-width: 44em;
}

.release .components {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px;
  column-rule: 1px solid var(--hairline);
}
.release .components.single { grid-template-columns: 1fr; max-width: 38em; }

.release .component .component-label {
  font-family: var(--sans);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.release .component .component-label::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--soft);
  flex: 0 0 8px;
}
.release .component-agent .component-label::before { background: var(--warn); }
.release .component-server .component-label::before { background: var(--ok); }

.release .component h3 {
  font-size: var(--fs-label);
  letter-spacing: 0.2em;
  margin: 18px 0 6px;
}
.release .component h3:first-child { margin-top: 0; }
.release .component li {
  grid-template-columns: 60px 1fr;
  gap: 10px;
  padding: 4px 0;
  font-size: 14.5px;
  line-height: 1.55;
}
.release .component li .kind { font-size: 9.5px; letter-spacing: 0.16em; padding-top: 4px; }

/* ---------- Docs ---------- */

.docs-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 56px;
}
.docs-nav {
  position: sticky;
  top: 96px;
  align-self: start;
}
.docs-nav h4 {
  font-family: var(--sans);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--soft);
  margin: 22px 0 6px;
}
.docs-nav h4:first-child { margin-top: 0; }
.docs-nav ul {
  list-style: none; margin: 0; padding: 0;
}
.docs-nav li { margin: 0; }
.docs-nav a {
  display: block;
  padding: 4px 0;
  font-size: var(--fs-data);
  text-decoration: none;
  color: var(--mute);
}
.docs-nav a:hover { color: var(--ink); }
.docs-nav a.active { color: var(--ink); border-left: 2px solid var(--ink); padding-left: 10px; margin-left: -12px; }

/* ---------- Engines grid (databases page) ---------- */

.engines {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.engine {
  padding: 24px 22px;
  border-top: 1px solid var(--hairline);
  border-right: 1px solid var(--hairline);
}
.engine:nth-child(-n+2) { border-top: 0; }
.engine:nth-child(2n) { border-right: 0; }
.engine .head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 6px;
}
.engine h3 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 22px;
  margin: 0;
  letter-spacing: -0.005em;
}
.engine .versions {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--soft);
}
.engine p {
  font-size: var(--fs-data);
  color: var(--mute);
  margin: 8px 0 14px;
}
.engine .row {
  font-family: var(--sans);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--soft);
}
.engine .row .sep { margin: 0 0.6em; color: var(--hairline); }

/* ---------- Footer ---------- */

.colophon {
  margin-top: 80px;
  border-top: 1px solid var(--rule);
  padding: 28px 0;
}
.colophon-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
}
.colophon h5 {
  font-family: var(--sans);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--soft);
  margin: 0 0 10px;
}
.colophon ul { list-style: none; margin: 0; padding: 0; }
.colophon li { margin: 0 0 6px; font-size: var(--fs-data); }
.colophon a { color: var(--mute); text-decoration: none; }
.colophon a:hover { color: var(--ink); text-decoration: underline; }
.colophon .disabled { color: var(--mute); opacity: 0.5; cursor: not-allowed; user-select: none; }
.colophon .about p {
  font-size: var(--fs-meta);
  color: var(--soft);
  margin: 8px 0 0;
  font-style: italic;
  max-width: 26em;
}
.colophon .about .wordmark { font-size: 18px; }
.colophon-end {
  max-width: var(--content-max);
  margin: 22px auto 0;
  padding: 14px 32px 0;
  border-top: 1px solid var(--hairline);
  display: flex; justify-content: space-between;
  font-family: var(--sans);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--soft);
}

/* ---------- Mobile ---------- */

@media (max-width: 820px) {
  .topbar-inner { gap: 12px; padding: 0 14px; height: 60px; }
  .wordmark { font-size: 18px; flex-shrink: 0; gap: 8px; }
  .wordmark .mark { width: 40px; height: 27px; }
  .wordmark::after { display: none; }
  .topbar nav { min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .topbar nav::-webkit-scrollbar { display: none; }
  .primary-nav { gap: 14px; flex-wrap: nowrap; }
  .primary-nav a { font-size: 10px; letter-spacing: 0.14em; white-space: nowrap; }
  .account { flex-shrink: 0; }
  .account a { font-size: 10px; letter-spacing: 0.14em; }
  .account a.cta { padding: 6px 10px; }
  .folio { display: none; }
  .page { padding: 24px 18px 60px; }
  .features, .engines { grid-template-columns: 1fr; }
  .features li { border-top: 1px solid var(--hairline); }
  .features li:nth-child(2) { border-top: 1px solid var(--hairline); }
  .features li:first-child { border-top: 0; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--hairline); }
  .stat .value { font-size: 26px; }
  .two-col { grid-template-columns: 1fr; gap: 24px; }
  .entries li { grid-template-columns: 1fr; gap: 6px; }
  .entries .author { text-align: left; }
  .release { grid-template-columns: 1fr; gap: 12px; }
  .release .components { grid-template-columns: 1fr; gap: 32px; }
  .release .headline { font-size: 17px; margin-bottom: 18px; }
  .docs-layout { grid-template-columns: 1fr; gap: 24px; }
  .docs-nav { position: static; }
  .colophon-inner { grid-template-columns: 1fr 1fr; }
  .colophon-end { flex-direction: column; gap: 6px; align-items: flex-start; padding-right: 18px; padding-left: 18px; }
  .engine:nth-child(odd) { border-right: 0; }
  .engine:nth-child(2) { border-top: 1px solid var(--hairline); }

  /* Ledger tables scroll horizontally on phones rather than overflowing the page */
  .ledger { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  .ledger th, .ledger td { padding: 12px 12px; }

  /* Plates: shrink the ASCII font and tighten padding so the box itself fits without scroll on most phones */
  .plate pre { font-size: 10.5px; padding: 16px 14px; line-height: 1.3; }
  .plate .plate-title { padding: 9px 14px 7px; }

  /* Code figure tweaks for phone widths */
  .figure pre { padding: 16px 14px; font-size: 11.5px; }

  /* Stub side rules can squeeze the title on narrow screens */
  .stub { gap: 12px; margin: 44px 0 22px; }
  .stub::before, .stub::after { flex: 0 1 40px; }

  /* Lede h1 line-length on mobile */
  .lede { padding: 4px 0 10px; }
  .lede h1 { font-size: clamp(28px, 7vw, 38px); margin-bottom: 14px; }
  .lede .deck { font-size: clamp(16px, 4vw, 18px); margin-bottom: 22px; }

  /* Pull quotes */
  .pullquote { padding: 22px 0; margin: 32px 0; }
  .pullquote q { font-size: clamp(19px, 5vw, 24px); }

  /* Feature cards spacing */
  .features { gap: 0; }

  /* Status note CTA spacing */
  .status-note { padding: 18px 18px; }
  .status-note h2 { font-size: 18px; }
}

@media (max-width: 480px) {
  .nameplate { font-size: clamp(40px, 14vw, 80px); }
  .colophon-inner { grid-template-columns: 1fr; gap: 24px; }
  .release li { grid-template-columns: 1fr; gap: 2px; }
  .release li .kind { padding-top: 0; }
  .primary-nav { gap: 10px; }
  .primary-nav a, .account a { font-size: 9.5px; letter-spacing: 0.12em; }
  .topbar-inner { gap: 10px; padding: 0 14px; }
  .page { padding: 20px 14px 48px; }
  .atglance { padding: 16px 14px 18px; }
  .atglance dl { grid-template-columns: 1fr; row-gap: 10px; }
  .atglance dt { padding-top: 0; }
}
