/* ============================================================================
   Drawbridge docs theme (2026-11-05).

   The docs pages wear the front page (site/assets/drawbridge.css): an
   architect's sheet set for one gatehouse. Cream board with the drafting
   grid, green ink linework, gold only where the chain and the signed things
   are, slate for construction lines. Each docs page is one more sheet laid on
   the board: ruled ink border, the margin line inset, a boxed sheet tag over
   a Big Shoulders Stencil title. Commands sit on the page's one dark surface,
   the terminal, with the gold Copy button in its bar. Every value below comes
   from the front page's tokens; nothing was invented for the docs.

   How it gets onto the pages: docs/docs.json "theme" names this file and
   docs/_header.html. The docs builder copies this file to
   site/docs/theme/drawbridge.css and links it after the kit's docs.css, so the
   --dk-* tokens and the rules below win without !important. The kit's
   docs.css stays byte for byte Squire's.

   The front page has no dark mode, so the dark set is derived: a night
   shift at the drafting office. The board goes graphite (a warm near-black,
   the cream turned down, never a green wallpaper), the chalk grid stays,
   linework is a light tint of the brand green, filled tags and header rows
   keep the true brand green, and the terminal stays the deep green surface
   it is on the front page. Same drawings, lights down, moat still sold
   separately.

   The magic carried over from the front page, and no more: the enlarged
   detail bubble with the app icon stamped in on the sheet's corner, the
   stenciled title lettered in, the sheet tag's construction line drawn
   across, and section rules inked as they scroll in. All of it only under
   prefers-reduced-motion: no-preference; at rest every page is complete.

   File map: 1. fonts and tokens  2. board  3. masthead  4. sidebar and menu
             5. the sheet  6. terminals  7. tables, notes, callouts
             8. toc, pager, title block  9. dark  10. responsive
             11. motion (no-preference only)  12. print
   ========================================================================== */

/* ---------------------------------------------------- 1. fonts and tokens */

@font-face {
  font-family: "Big Shoulders Stencil Display";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../../assets/fonts/big-shoulders-stencil-display-latin-600-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Big Shoulders Stencil Display";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../../assets/fonts/big-shoulders-stencil-display-latin-800-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Architects Daughter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../../assets/fonts/architects-daughter-latin-400-normal.woff2") format("woff2");
}

:root {
  /* The front page's palette, under the same names. */
  --db-paper: #f4f1ea;          /* the board's cream */
  --db-sheet: #fbfaf6;          /* a fresh sheet laid on the board */
  --db-ink: #0c5449;            /* green ink: linework, headings */
  --db-ink-deep: #073a32;
  --db-text: #22302c;
  --db-text-2: #4a5d57;
  --db-slate: #728780;          /* construction lines only, never small text */
  --db-grid: rgba(114, 135, 128, 0.13);
  --db-grid-major: rgba(114, 135, 128, 0.24);
  --db-gold: #ffcc33;
  --db-gold-hi: #ffd65c;
  --db-gold-soft: #fff1c2;
  --db-gold-ink: #7a5c00;
  --db-red: #a8362a;            /* the revision pen */
  --db-water: #cfe0dc;
  --db-term: #0f2420;
  --db-term-text: #dbe8e4;
  --db-term-dim: #8fa8a1;
  --db-term-ok: #9fe0b4;
  --db-display: "Big Shoulders Stencil Display", "Arial Narrow", Impact, sans-serif;
  --db-hand: "Architects Daughter", "Segoe Print", "Bradley Hand", cursive;
  --db-mono: var(--wsu-font-family-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
  --db-body: var(--wsu-font-family-body, Lato, Calibri, "Helvetica Neue", Arial, sans-serif);
  --db-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --db-ease-swing: cubic-bezier(0.55, 0, 0.25, 1.25);

  /* Roles, so dark mode only has to swap these. */
  --db-line: var(--db-ink);                    /* sheet borders and rules */
  --db-fill: var(--db-ink);                    /* filled tags and header rows */
  --db-ring: var(--db-ink);                    /* the detail bubble's dashed ring */
  --db-hairline: rgba(12, 84, 73, 0.2);
  --db-hairline-2: rgba(12, 84, 73, 0.32);
  --db-wash: rgba(12, 84, 73, 0.07);           /* inline code, hovers */
  --db-masthead-bg: rgba(244, 241, 234, 0.92);
  --db-tag-ink: var(--db-sheet);               /* text in a boxed ink tag */
  --db-btn-shadow: rgba(12, 84, 73, 0.22);
  --db-shade: rgba(7, 58, 50, 0.22);         /* a table's scroll edge */
  --db-term-edge: var(--db-term);
  --db-masthead-h: 60px;

  /* The kit's tokens, set from the palette above. */
  --dk-bg: var(--db-paper);
  --dk-ink: var(--db-text);
  --dk-muted: var(--db-text-2);
  --dk-rule: var(--db-water);
  --dk-accent: var(--db-ink);
  --dk-on-accent: #ffffff;
  --dk-code-bg: var(--db-paper);
  --dk-display: var(--db-display);
  --dk-mono: var(--db-mono);
  --dk-radius: 2px;
  --dk-focus: var(--db-ink);
  --dk-focus-w: 3px;
  --dk-focus-o: 2px;
  --dk-sidebar: 15rem;
  --dk-prose-max: 48rem;
  --dk-gap: 1.75rem;
  --dk-note: var(--db-ink);
  --dk-tip: var(--db-ink);
  --dk-warning: var(--db-gold-ink);
  --dk-danger: var(--db-red);

  color-scheme: light;
}

/* ------------------------------------------------------------- 2. board */

html {
  background: var(--dk-bg);
  scroll-padding-top: calc(var(--db-masthead-h) + 1rem);
}

/* The drafting board: 8 px minor grid, 40 px major, as on the front page. */
body {
  margin: 0;
  color: var(--dk-ink);
  background-color: var(--dk-bg);
  background-image:
    linear-gradient(var(--db-grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--db-grid-major) 1px, transparent 1px),
    linear-gradient(var(--db-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--db-grid) 1px, transparent 1px);
  background-size: 40px 40px, 40px 40px, 8px 8px, 8px 8px;
  font-family: var(--db-body);
  overflow-x: clip;
}

/* The front page's focus: an ink ring with a gold halo. */
:where(a, button, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--dk-focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px var(--db-gold);
}

/* ---------------------------------------------------------- 3. masthead */

.site-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 20;
  background: var(--db-masthead-bg);
  backdrop-filter: blur(6px);
  border-block-end: 1px solid var(--db-hairline);
}

.site-header__row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  box-sizing: border-box;
  max-inline-size: 100rem;
  min-block-size: var(--db-masthead-h);
  margin-inline: auto;
  padding-inline: var(--dk-gap);
}

.brand {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.6rem;
  color: var(--db-ink);
  text-decoration: none;
}

.brand img {
  display: block;
  border-radius: 8px;
}

.brand__name {
  font-family: var(--db-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.sheet-index {
  display: flex;
  gap: 1.25rem;
  margin-inline-start: auto;
}

.sheet-index a {
  padding-block: 0.25rem;
  font-size: 0.9375rem;
  color: var(--dk-ink);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1.5px solid transparent;
}

.sheet-index a:hover {
  color: var(--db-ink);
  border-color: var(--db-line);
}

/* You are here: the gold rule the front page puts under a chosen tab. */
.sheet-index a[aria-current="page"] {
  font-weight: 700;
  color: var(--db-ink);
  border-color: transparent;
  box-shadow: inset 0 -4px 0 var(--db-gold);
}

.sheet-index__no {
  margin-inline-end: 0.2rem;
  font-family: var(--db-mono);
  font-size: 0.75rem;
  color: var(--dk-muted);
}

.brand__rev {
  flex-shrink: 0;
  padding: 0.15rem 0.5rem;
  font-family: var(--db-mono);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  color: var(--db-ink);
  border: 1.5px solid var(--db-line);
  border-radius: 2px;
}

/* --------------------------------------------------- 4. sidebar and menu */

.docs-layout {
  gap: 1.5rem clamp(1.5rem, 0.75rem + 2vw, 3rem);
  padding-block: 2.25rem 3.5rem;
  padding-inline: var(--dk-gap);
}

/* Group labels are sheet tags: mono caps with a construction line running on. */
.docs-nav__label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1.5rem 0 0.4rem;
  font-family: var(--db-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dk-muted);
}

.docs-nav__label::after {
  content: "";
  flex: 1;
  block-size: 1px;
  background: var(--db-slate);
  opacity: 0.6;
}

/* Group lists are plain <ul> inside the kit's list: no bullets, no indent. */
.docs-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* A group's pages hang off a dashed leader, so the top-level pages after it read as their own. */
.docs-nav__group > ul {
  margin-inline-start: 0.35rem;
  padding-inline-start: 0.5rem;
  border-inline-start: 1px dashed var(--db-hairline-2);
}

.docs-nav__group + li {
  margin-top: 1rem;
}

.docs-nav a {
  padding: 0.38rem 0.7rem;
  font-size: 0.97rem;
  line-height: 1.35;
  color: var(--dk-ink);
  border-radius: 2px;
}

.docs-nav a:hover {
  color: var(--db-ink);
  background: var(--db-wash);
}

/* The current sheet: laid on top, its edge inked in gold. */
.docs-nav a[aria-current="page"] {
  font-weight: 700;
  color: var(--db-ink);
  background: var(--db-sheet);
  box-shadow: inset 4px 0 0 var(--db-gold), inset 0 0 0 1px var(--db-hairline-2);
}

.docs-menu summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  min-block-size: 44px;
  padding: 0.4rem 1rem;
  font-family: var(--db-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--db-ink);
  background: var(--db-sheet);
  border: 1.5px solid var(--db-line);
  border-radius: 2px;
  box-shadow: 3px 3px 0 var(--db-btn-shadow);
  list-style: none;
}

.docs-menu summary::-webkit-details-marker {
  display: none;
}

.docs-menu summary::after {
  content: "";
  inline-size: 0.5rem;
  block-size: 0.5rem;
  border-inline-end: 2px solid currentColor;
  border-block-end: 2px solid currentColor;
  rotate: 45deg;
  translate: 0 -2px;
}

.docs-menu[open] summary::after {
  rotate: 225deg;
  translate: 0 2px;
}

.docs-menu[open] > .docs-nav {
  margin-top: 0.75rem;
  padding: 0.25rem 1rem 1rem;
  background: var(--db-sheet);
  border: 1.5px solid var(--db-line);
}

/* --------------------------------------------------------- 5. the sheet */

/* Each page is a sheet on the board: ink border, margin line inset. */
.docs-content > main {
  position: relative;
  box-sizing: border-box;
  max-inline-size: calc(var(--dk-prose-max) + 2 * clamp(1.25rem, 3vw, 2.5rem));
  padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1.25rem, 3vw, 2.5rem) clamp(1.75rem, 3vw, 2.75rem);
  background: var(--db-sheet);
  border: 1.5px solid var(--db-line);
  outline: 1px solid var(--db-hairline-2);
  outline-offset: -7px;
  box-shadow: 0 30px 50px -34px rgba(7, 58, 50, 0.45);
}

.docs-article {
  max-width: none;
  font-family: var(--db-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--dk-ink);
}

/* The sheet tag over every title: a boxed DOCS with a construction line
   running on, as each front page sheet carries its number. */
.docs-article::before {
  content: "Docs" / "";
  display: block;
  margin: 0 0 1rem;
  padding: 0.2rem 0.55rem;
  font-family: var(--db-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--db-tag-ink);
  background:
    linear-gradient(var(--db-fill), var(--db-fill)) 0 0 / calc(4ch + 0.32em + 1.1rem) 100% no-repeat,
    linear-gradient(var(--db-slate), var(--db-slate)) 0 50% / var(--db-tag-run, 100%) 1px no-repeat;
}

/* The enlarged detail from the front page's drawing: a dashed bubble on the
   sheet's top line with the app icon in it. The ring is ::before, the icon
   ::after, so the icon can be stamped in after the ring swings round.
   Decoration only (no text), and only where there is room for it. */
@media (min-width: 760px) {
  .docs-content > main {
    --db-tag-run: calc(100% - 7rem);
  }

  .docs-content > main::before,
  .docs-content > main::after {
    content: "";
    position: absolute;
    inset-block-start: -30px;
    inset-inline-end: 1.5rem;
    inline-size: 84px;
    block-size: 84px;
    pointer-events: none;
  }

  .docs-content > main::before {
    box-sizing: border-box;
    background: var(--db-sheet);
    border: 1.5px dashed var(--db-ring);
    border-radius: 50%;
  }

  .docs-content > main::after {
    background: url("../../brand/drawbridge-avatar-256.png") center / 56px 56px no-repeat;
  }
}

.docs-article h1,
.docs-article h2,
.docs-article h3 {
  font-family: var(--db-display);
  color: var(--dk-accent);
  scroll-margin-top: calc(var(--db-masthead-h) + 1rem);
  text-wrap: balance;
}

.docs-article h1 {
  margin: 0 0 1.25rem;
  font-size: clamp(2.6rem, 1.8rem + 3vw, 4.25rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.docs-article h2 {
  margin: 2.75rem 0 0.85rem;
  padding-bottom: 0.4rem;
  font-size: clamp(1.75rem, 1.4rem + 1.1vw, 2.35rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  /* The rule is a background, not a border, so it can be inked in (11). */
  background: linear-gradient(var(--db-line), var(--db-line)) 0 100% / 100% 1.5px no-repeat;
}

.docs-article h3 {
  margin: 2rem 0 0.5rem;
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Commands are case sensitive: code in a caps heading keeps its case. */
.docs-article :is(h1, h2, h3) code {
  font-size: 0.62em;
  text-transform: none;
  vertical-align: 0.12em;
}

.docs-heading-link {
  color: var(--dk-muted);
  font-family: var(--db-mono);
  font-size: 0.5em;
  font-weight: 400;
  vertical-align: 0.4em;
}

.docs-article a {
  color: var(--dk-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.docs-article a:hover {
  text-decoration-thickness: 3px;
}

.docs-article strong {
  color: var(--dk-accent);
}

.docs-article :is(ul, ol) {
  padding-inline-start: 1.4rem;
}

.docs-article li {
  margin-block: 0.3rem;
}

.docs-article li::marker {
  font-weight: 700;
  color: var(--dk-accent);
}

.docs-article img {
  max-inline-size: 100%;
  block-size: auto;
}

.docs-article hr {
  margin-block: 2.5rem;
  border: 0;
  border-block-start: 3px double var(--db-line);
}

/* ----------------------------------------------------------- 6. terminals */

.docs-article code {
  padding: 0.05em 0.3em;
  font-family: var(--db-mono);
  font-size: 0.9em;
  color: inherit;
  background: var(--db-wash);
  border-radius: 3px;
  overflow-wrap: anywhere;
}

/* What you type, and the files you write: the front page's terminal, the
   only dark surface on the sheet. The top band is the terminal's bar; the
   Copy button sits in it, so it never covers a line. Lines keep their shape
   and scroll on a wide sheet, and wrap on a phone, as on the front page. */
.docs-article pre {
  position: relative;
  margin: 1.1rem 0 1.5rem;
  padding: 2.4rem 1.1rem 1.05rem;
  font: 0.84375rem/1.65 var(--db-mono);
  color: var(--db-term-text);
  background-color: var(--db-term);
  border: 1px solid var(--db-term-edge);
  border-radius: 6px;
  box-shadow: 0 18px 30px -22px rgba(7, 58, 50, 0.7);
  tab-size: 4;
  scrollbar-color: #2e4a44 transparent;
}

/* The bar's three lamps, on shells only. */
.docs-article pre:has(> code:is(.language-sh, .language-bash, .language-powershell, .language-shell, .language-console)) {
  background-image:
    radial-gradient(circle, rgba(219, 232, 228, 0.25) 4.5px, transparent 5px),
    radial-gradient(circle, rgba(219, 232, 228, 0.25) 4.5px, transparent 5px),
    radial-gradient(circle, rgba(219, 232, 228, 0.25) 4.5px, transparent 5px);
  background-position: 0.8rem 0.6rem, calc(0.8rem + 15px) 0.6rem, calc(0.8rem + 30px) 0.6rem;
  background-size: 10px 10px;
  background-repeat: no-repeat;
}

/* A file, not a shell: the front page's assertion detail, slate across the top. */
.docs-article pre:has(> code:is(.language-yaml, .language-json, .language-dotenv, .language-apache, .language-lua, .language-php, .language-ini)) {
  border-top: 4px solid var(--db-slate);
}

.docs-article pre code {
  padding: 0;
  font-size: inherit;
  color: inherit;
  background: none;
  border-radius: 0;
  overflow-wrap: normal;
}

/* With docs.js the block sits in .docs-copy (position: relative in the kit). */
.docs-copy {
  margin: 1.1rem 0 1.5rem;
}

.docs-copy > pre {
  margin: 0;
}

/* What kind of block it is, set in the bar like a window title. */
.docs-copy::after {
  position: absolute;
  z-index: 1;
  inset-block-start: 0.55rem;
  inset-inline-start: calc(0.8rem + 52px);
  font: 0.75rem/1.4 var(--db-mono);
  color: var(--db-term-dim);
  pointer-events: none;
}

.docs-copy:has(code:is(.language-sh, .language-bash, .language-shell))::after { content: "sh" / ""; }
.docs-copy:has(code.language-powershell)::after { content: "PowerShell" / ""; }
.docs-copy:has(code.language-yaml)::after { content: "yaml" / ""; inset-inline-start: 1.1rem; }
.docs-copy:has(code.language-dotenv)::after { content: ".env" / ""; inset-inline-start: 1.1rem; }
.docs-copy:has(code.language-apache)::after { content: "apache" / ""; inset-inline-start: 1.1rem; }
.docs-copy:has(code.language-json)::after { content: "json" / ""; inset-inline-start: 1.1rem; }
.docs-copy:has(code:is(.language-yaml, .language-dotenv, .language-apache, .language-json))::after { inset-block-start: calc(0.55rem + 3px); }

/* The front page's Copy button: gold, square shouldered, in the bar. */
.docs-copy__button {
  inset-block-start: 0.4rem;
  inset-inline-end: 0.5rem;
  z-index: 2;
  min-block-size: 28px;
  padding: 0.35rem 0.75rem;
  font: 700 0.8125rem/1 var(--db-body);
  color: var(--db-ink-deep);
  background: var(--db-gold);
  border: 0;
  border-radius: 2px;
}

.docs-copy:has(code:is(.language-yaml, .language-dotenv, .language-apache, .language-json)) .docs-copy__button {
  inset-block-start: calc(0.4rem + 3px);
}

.docs-copy__button:hover {
  color: var(--db-ink-deep);
  background: var(--db-gold-hi);
}

/* On the dark terminal an ink ring would vanish: a pale one, as the screen's text. */
.docs-copy__button:focus-visible {
  outline-color: var(--db-term-text);
  box-shadow: none;
}

/* A block that scrolls sideways takes focus (docs.js): gold ring inside the terminal. */
.docs-article pre:focus-visible {
  outline: 3px solid var(--db-gold);
  outline-offset: -4px;
  box-shadow: 0 18px 30px -22px rgba(7, 58, 50, 0.7);
}

/* Synced OS tabs (when the builder has them): the front page's build tabs,
   an ink rule under the row and the gold bar under the chosen one. */
.docs-tabs {
  margin: 1.1rem 0 1.5rem;
}

.docs-tabs__tablist {
  gap: 0;
  margin-bottom: 0;
  border-bottom: 1.5px solid var(--db-line);
}

.docs-tabs__tab {
  padding: 0.4rem 1rem;
  font-family: var(--db-body);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--dk-ink);
  background: transparent;
  border: 0;
  border-radius: 0;
  cursor: pointer;
}

.docs-tabs__tab:hover {
  color: var(--db-ink);
  background: var(--db-wash);
}

.docs-tabs__tab[aria-selected="true"] {
  color: var(--db-ink);
  background: transparent;
  box-shadow: inset 0 -4px 0 var(--db-gold);
}

.docs-tabs__label {
  margin: 0.75rem 0 0.4rem;
  font-family: var(--db-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--dk-muted);
}

.docs-tabs__panel .docs-copy,
.docs-tabs__panel > pre {
  margin-top: 0.75rem;
}

/* ---------------------------------------------- 7. tables, notes, callouts */

/* The door schedule: a ruled table, ink header row. */
/* A wide schedule scrolls inside its frame; a soft shade at the cut edge
   says there is more, and lifts once the reader reaches that end. */
.docs-table {
  margin: 1.25rem 0 1.6rem;
  background:
    linear-gradient(to right, var(--db-sheet) 40%, transparent) 0 0 / 2.5rem 100% no-repeat local,
    linear-gradient(to left, var(--db-sheet) 40%, transparent) 100% 0 / 2.5rem 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, var(--db-shade), transparent) 0 0 / 0.9rem 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, var(--db-shade), transparent) 100% 0 / 0.9rem 100% no-repeat scroll,
    var(--db-sheet);
  border: 1.5px solid var(--db-line);
  border-radius: 0;
}

.docs-article table {
  font-size: 0.95rem;
  line-height: 1.5;
}

.docs-article th {
  padding: 0.6rem 0.8rem;
  font-family: var(--db-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--db-tag-ink);
  background: var(--db-fill);
  border-bottom: 0;
}

.docs-article td {
  padding: 0.65rem 0.8rem;
  vertical-align: top;
  border-bottom: 0;
  border-top: 1px solid var(--db-hairline);
}

.docs-article tbody tr:first-child td {
  border-top: 0;
}

/* A path or variable keeps its shape in a cell: the column sizes to it, and
   it only breaks if it would spill out of the table. */
.docs-article td code {
  overflow-wrap: break-word;
}

/* A quotation is a legend entry: gold rule, a lighter wash of paper. */
.docs-article blockquote {
  margin: 1.5rem 0;
  padding: 0.9rem 1.1rem;
  color: var(--dk-ink);
  background: var(--db-paper);
  border-inline-start: 3px solid var(--db-gold);
}

.docs-article blockquote > :last-child {
  margin-bottom: 0;
}

/* Callouts are drawing notes: a ruled box with its kind in a boxed tag
   sitting on the top line, the way a sheet labels a detail. Note is ink,
   tip is the gold the page keeps for good news, warning is gold ink, and
   danger is the revision pen. */
.docs-callout {
  --db-callout: var(--dk-note);
  --db-callout-ink: var(--db-tag-ink);
  position: relative;
  margin: 2rem 0 1.5rem;
  padding: 1.35rem 1.15rem 0.95rem;
  background: var(--db-sheet);
  border: 1.5px solid var(--db-callout-line, var(--db-callout));
  border-inline-start-width: 5px;
  border-radius: 0;
}

.docs-callout__label {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0.85rem;
  translate: 0 -50%;
  margin: 0;
  padding: 0.2rem 0.55rem;
  font-family: var(--db-mono);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--db-callout-ink);
  background: var(--db-callout);
}

.docs-callout > :last-child {
  margin-bottom: 0;
}

.docs-callout--note {
  --db-callout: var(--db-fill);
  --db-callout-line: var(--dk-note);
}

.docs-callout--tip {
  --db-callout: var(--db-gold);
  --db-callout-ink: var(--db-ink-deep);
}

.docs-callout--warning {
  --db-callout: var(--dk-warning);
  --db-callout-ink: #ffffff;
}

.docs-callout--danger {
  --db-callout: var(--dk-danger);
  --db-callout-ink: #ffffff;
}

/* The kit colors the label text; here it is the tag ink on the kind's box. */
.docs-callout .docs-callout__label {
  color: var(--db-callout-ink);
}

/* ------------------------------------------- 8. toc, pager, title block */

.docs-toc__title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--db-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--dk-muted);
}

.docs-toc__title::after {
  content: "";
  flex: 1;
  block-size: 1px;
  background: var(--db-slate);
  opacity: 0.6;
}

.docs-toc__list {
  border-left: 1.5px solid var(--db-hairline-2);
}

/* Sub items carry only the --sub class, so the kit gives them no block
   padding: named here too, so every entry is a 24 px target. */
.docs-toc__item a,
.docs-toc__item--sub a {
  display: block;
  padding-block: 0.25rem;
  margin-inline-start: -1.5px;
  font-size: 0.93rem;
  line-height: 1.4;
  color: var(--dk-muted);
  border-inline-start: 1.5px solid transparent;
}

.docs-toc__item--sub a {
  padding-inline: 1.5rem 0.75rem;
  text-decoration: none;
}

.docs-toc__item a:hover,
.docs-toc__item--sub a:hover {
  color: var(--db-ink);
  border-inline-start-color: var(--db-line);
}

/* Previous and next are the front page's drawing buttons: square shouldered, a hard shadow. */
.docs-pager {
  max-inline-size: calc(var(--dk-prose-max) + 2 * clamp(1.25rem, 3vw, 2.5rem));
  margin-top: 2rem;
  padding-top: 0;
  border-top: 0;
}

.docs-pager__link {
  box-sizing: border-box;
  flex: 1 1 0;
  max-width: 22rem;
  padding: 0.75rem 1.1rem 0.9rem;
  background: var(--db-sheet);
  border: 1.5px solid var(--db-line);
  border-radius: 2px;
  box-shadow: 3px 3px 0 var(--db-btn-shadow);
}

.docs-pager__link--next {
  margin-inline-start: auto;
  box-shadow: 3px 3px 0 var(--db-gold);
}

.docs-pager__dir {
  font-family: var(--db-hand);
  font-size: 1rem;
  color: var(--dk-muted);
}

.docs-pager__title {
  display: block;
  margin-top: 0.1rem;
  font-family: var(--db-display);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--dk-accent);
  text-decoration: none;
}

/* The footer is the title block: full-bleed sheet under a double rule, the
   cells ruled in ink. The bleed is a border-image outset, which paints past
   the box without making the page scroll sideways (a positioned bar or a
   spread shadow would). */
.docs-footer {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
  gap: 0;
  margin-top: 1rem;
  padding: 2.25rem var(--dk-gap) 2.75rem;
  color: var(--dk-ink);
  font-size: 0.95rem;
  background: var(--db-sheet);
  border-top: 0;
  border-image: linear-gradient(
      var(--db-line) 0 1px,
      var(--db-sheet) 1px 2px,
      var(--db-line) 2px 3px,
      var(--db-sheet) 3px
    ) fill 0 / 0 / 0 100vmax;
}

.docs-footer > span {
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--db-line);
  overflow-wrap: anywhere;
}

.docs-footer > span + span {
  border-inline-start-width: 0;
}

/* The front page's title block carries the same joke. */
.docs-footer::after {
  content: "Moat sold separately." / "";
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  font-family: var(--db-hand);
  font-size: 1.1rem;
  color: var(--db-ink);
  border: 1.5px solid var(--db-line);
  border-inline-start-width: 0;
}

.docs-footer a {
  color: var(--dk-accent);
  text-underline-offset: 3px;
}

/* ---------------------------------------------------------------- 9. dark */

/* The same night shift as the front page (site/assets/drawbridge.css,
   section 11): keep the two palettes in step. The drafting office with the
   lights down: a graphite board (warm, like the cream turned down) under a
   faint chalk grid, sheets a shade lighter, linework and headings in a light
   tint of the brand green, filled tags and header rows in the brand green
   itself, gold still gold. The terminal keeps the front page's deep green,
   so it is the one green surface here as it is there. The palette names are
   swapped so every rule above follows; one set, used twice below (the
   system preference, and an explicit data-theme="dark"). The kit's --dk-*
   colors are restated here too: the kit's own dark blocks are more specific
   than :root and would otherwise hand the page WayneUI's dark green
   surface, the green wallpaper this theme is meant to avoid. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --db-paper: #191a17;
    --db-sheet: #20221e;
    --db-ink: #93cfc0;
    --db-ink-deep: #191a17;
    --db-text: #e7e3d9;
    --db-text-2: #b0ab9f;
    --db-slate: #6a7570;
    --db-grid: rgba(231, 227, 217, 0.035);
    --db-grid-major: rgba(231, 227, 217, 0.07);
    --db-gold-ink: #ffcc33;
    --db-red: #ff9a8d;
    --db-water: #34372f;
    --db-term: #0f2420;
    --db-line: #5c8a7f;
    --db-fill: #0c5449;
    --db-ring: #5c8a7f;
    --db-hairline: rgba(231, 227, 217, 0.13);
    --db-hairline-2: rgba(231, 227, 217, 0.22);
    --db-wash: rgba(147, 207, 192, 0.1);
    --db-masthead-bg: rgba(25, 26, 23, 0.92);
    --db-tag-ink: #f4f1ea;
    --db-btn-shadow: rgba(0, 0, 0, 0.5);
    --db-shade: rgba(0, 0, 0, 0.6);
    --db-term-edge: #2d4a43;

    --dk-bg: var(--db-paper);

    --dk-ink: var(--db-text);

    --dk-muted: var(--db-text-2);

    --dk-rule: var(--db-water);

    --dk-accent: var(--db-ink);

    --dk-code-bg: var(--db-paper);

    --dk-focus: var(--db-ink);

    --dk-tip: var(--db-ink);

    --dk-on-accent: #191a17;
    --dk-note: var(--db-line);
    --dk-warning: var(--db-gold);
    --dk-danger: var(--db-red);

    color-scheme: dark;
  }

  :root:not([data-theme="light"]) .docs-callout--tip {
    --db-callout: var(--db-gold-soft);
    --db-callout-ink: #191a17;
  }

  :root:not([data-theme="light"]) .docs-callout:is(.docs-callout--warning, .docs-callout--danger) {
    --db-callout-ink: #191a17;
  }

  :root:not([data-theme="light"]) .docs-content > main {
    box-shadow: 0 30px 50px -34px rgba(0, 0, 0, 0.8);
  }
}

:root[data-theme="dark"] {
  --db-paper: #191a17;
  --db-sheet: #20221e;
  --db-ink: #93cfc0;
  --db-ink-deep: #191a17;
  --db-text: #e7e3d9;
  --db-text-2: #b0ab9f;
  --db-slate: #6a7570;
  --db-grid: rgba(231, 227, 217, 0.035);
  --db-grid-major: rgba(231, 227, 217, 0.07);
  --db-gold-ink: #ffcc33;
  --db-red: #ff9a8d;
  --db-water: #34372f;
  --db-term: #0f2420;
  --db-line: #5c8a7f;
  --db-fill: #0c5449;
  --db-ring: #5c8a7f;
  --db-hairline: rgba(231, 227, 217, 0.13);
  --db-hairline-2: rgba(231, 227, 217, 0.22);
  --db-wash: rgba(147, 207, 192, 0.1);
  --db-masthead-bg: rgba(25, 26, 23, 0.92);
  --db-tag-ink: #f4f1ea;
  --db-btn-shadow: rgba(0, 0, 0, 0.5);
  --db-shade: rgba(0, 0, 0, 0.6);
  --db-term-edge: #2d4a43;

  --dk-bg: var(--db-paper);

  --dk-ink: var(--db-text);

  --dk-muted: var(--db-text-2);

  --dk-rule: var(--db-water);

  --dk-accent: var(--db-ink);

  --dk-code-bg: var(--db-paper);

  --dk-focus: var(--db-ink);

  --dk-tip: var(--db-ink);

  --dk-on-accent: #191a17;
  --dk-note: var(--db-line);
  --dk-warning: var(--db-gold);
  --dk-danger: var(--db-red);

  color-scheme: dark;
}

:root[data-theme="dark"] .docs-callout--tip {
  --db-callout: var(--db-gold-soft);
  --db-callout-ink: #191a17;
}

:root[data-theme="dark"] .docs-callout:is(.docs-callout--warning, .docs-callout--danger) {
  --db-callout-ink: #191a17;
}

:root[data-theme="dark"] .docs-content > main {
  box-shadow: 0 30px 50px -34px rgba(0, 0, 0, 0.8);
}

/* --------------------------------------------------------- 10. responsive */

@media (min-width: 760px) {
  /* The sidebar rides under the masthead while the page scrolls. */
  .docs-nav--sidebar {
    position: sticky;
    top: calc(var(--db-masthead-h) + 1.25rem);
    max-block-size: calc(100vh - var(--db-masthead-h) - 2.5rem);
    overflow-y: auto;
    padding-inline-end: 0.25rem;
  }

  .docs-nav--sidebar > .docs-nav__list > li:first-child > .docs-nav__label {
    margin-top: 0;
  }
}

@media (min-width: 1200px) {
  .docs-layout--toc .docs-toc {
    top: calc(var(--db-masthead-h) + 1.25rem);
  }
}

/* Tablet: as on the front page, the sheet index folds away and the revision
   chip moves to the right; the docs menu below carries the pages. */
@media (max-width: 1023px) {
  .sheet-index {
    display: none;
  }

  .brand__rev {
    margin-inline-start: auto;
  }

  .docs-footer {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .docs-footer::after {
    grid-column: 1 / -1;
    border-inline-start-width: 1.5px;
    border-top-width: 0;
  }
}

/* Phone: commands wrap rather than hide their tails off the edge, as on the
   front page, and the title block stacks. */
@media (max-width: 760px) {
  :root {
    --dk-gap: 1rem;
  }

  .docs-layout {
    padding-block-start: 1rem;
  }

  .docs-content > main {
    outline-offset: -5px;
  }

  .docs-article pre {
    font-size: 0.8125rem;
  }

  /* Shell lines wrap; files keep their indentation and scroll. */
  .docs-article pre:has(> code:is(.language-sh, .language-bash, .language-powershell, .language-shell, .language-console)) {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }

  .docs-article pre > code:is(.language-sh, .language-bash, .language-powershell, .language-shell, .language-console) {
    overflow-wrap: anywhere;
  }

  .docs-pager {
    flex-direction: column;
    gap: 0.9rem;
  }

  .docs-pager__link,
  .docs-pager__link--next {
    max-width: none;
    margin-inline-start: 0;
  }

  .docs-footer {
    grid-template-columns: minmax(0, 1fr);
  }

  .docs-footer > span + span,
  .docs-footer::after {
    border-inline-start-width: 1.5px;
    border-top-width: 0;
  }
}

@media (max-width: 400px) {
  .brand__name {
    font-size: 1.3rem;
  }
}

/* ------------------------------------------- 11. motion (no-preference) */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  /* The title is lettered in, the way the front page stencils its name. */
  .docs-article h1 {
    animation: db-letter 0.6s var(--db-ease) 0.1s both;
  }

  /* The sheet tag's construction line draws across, then the box is inked. */
  .docs-article::before {
    animation: db-tag 0.9s var(--db-ease) both;
  }

  .sheet-index a,
  .docs-nav a,
  .docs-toc__item a,
  .docs-toc__item--sub a {
    transition: border-color 0.2s, color 0.2s, background-color 0.2s;
  }

  .docs-pager__link,
  .docs-menu summary {
    transition: transform 0.15s var(--db-ease), box-shadow 0.15s var(--db-ease);
  }

  .docs-pager__link:hover {
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 var(--db-btn-shadow);
  }

  .docs-pager__link--next:hover {
    box-shadow: 5px 5px 0 var(--db-gold);
  }

  .docs-pager__link:active,
  .docs-menu summary:active {
    transform: translate(2px, 2px);
    box-shadow: 0 0 0 transparent;
  }

  .brand img {
    transition: transform 0.3s var(--db-ease-swing);
  }

  .brand:hover img {
    transform: rotate(-6deg) scale(1.05);
  }

  .docs-copy__button {
    transition: background-color 0.15s;
  }

  /* The detail bubble swings round onto the sheet, then the icon is
     stamped into it: the front page's opening move, once per page. */
  .docs-content > main::before {
    animation: db-bubble 0.9s var(--db-ease-swing) 0.15s both;
  }

  .docs-content > main::after {
    animation: db-stamp 0.6s var(--db-ease-swing) 0.55s both;
  }

  /* Section rules are inked left to right as they scroll into view, the
     way the front page draws a sheet's rule as it arrives. Browsers without
     scroll-driven animations show the finished rule. */
  @supports (animation-timeline: view()) {
    .docs-article h2 {
      animation: db-rule linear both;
      animation-timeline: view();
      animation-range: entry 10% cover 30%;
    }
  }
}

@keyframes db-bubble {
  from { transform: scale(0.4) rotate(-90deg); opacity: 0; }
}

@keyframes db-stamp {
  from { transform: scale(1.5) rotate(8deg); opacity: 0; }
}

@keyframes db-rule {
  from { background-size: 0 1.5px; }
}

@keyframes db-letter {
  from { opacity: 0; transform: translateY(0.25em); clip-path: inset(0 0 100% 0); }
  to { opacity: 1; transform: none; clip-path: inset(0 0 0 0); }
}

@keyframes db-tag {
  from {
    background-size: calc(4ch + 0.32em + 1.1rem) 100%, 0 1px;
  }
}

/* -------------------------------------------------------------- 12. print */

@media print {
  body {
    background: #ffffff;
  }

  .site-header {
    position: static;
    backdrop-filter: none;
  }

  .sheet-index {
    display: none;
  }

  .docs-content > main {
    box-shadow: none;
  }

  .docs-article pre {
    color: #22302c;
    background: #ffffff;
    border-color: #0c5449;
    white-space: pre-wrap;
  }

  .docs-copy__button,
  .docs-copy::after {
    display: none;
  }

  .docs-content > main::before,
  .docs-content > main::after {
    display: none;
  }

  .docs-footer {
    border-image: none;
    border-top: 3px double #0c5449;
  }
}
