/* =============================================================
   Egghead — Utopian Scholastic
   ============================================================= */

:root {
  --paper:       #F4F1EA;
  --paper-deep:  #ECE6D8;
  --ink:         #111111;
  --ink-soft:    #2B2B2B;
  --ink-muted:   #5A5651;
  --rule:        #C9C3B6;
  --rule-strong: #8F8778;
  --stamp:       #8A1E1E;

  --serif-display: "Bodoni Moda", "Didot", serif;
  --serif:         "Source Serif 4", "Cambria", Georgia, serif;
  --sans-label:    "Archivo Narrow", "Trade Gothic", sans-serif;
  --mono:          "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;

  --measure:        64ch;
  --measure-narrow: 42ch;
  --page-max:       76rem;
  --gutter:         clamp(1rem, 3vw, 2.75rem);
}

/* =============================================================
   RESET & BASELINE
   ============================================================= */

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

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-feature-settings: "onum" 1, "liga" 1, "dlig" 1, "kern" 1;
  font-variation-settings: "opsz" 14;
  font-size: clamp(15px, 0.9vw + 12px, 19px);
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.07  0 0 0 0 0.06  0 0 0 0 0.05  0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 220px 220px;
}

a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 0.5px; }
a:hover { color: var(--stamp); }

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

img { max-width: 100%; display: block; }

code, pre {
  font-family: var(--mono);
  font-feature-settings: "zero" 1, "ss01" 1;
  font-size: 0.92em;
}
p code, dd code, dt code, li code, figcaption code {
  padding: 0 0.25em;
  background: var(--paper-deep);
  border: 0.5px solid var(--rule);
  overflow-wrap: anywhere;
}
abbr { text-decoration: none; border-bottom: 0.5px dotted var(--rule-strong); cursor: help; }

/* =============================================================
   LAYOUT SHELL
   ============================================================= */

main { display: block; }

.landing {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 5rem) var(--gutter) clamp(2.5rem, 6vw, 6rem);
  display: grid;
  gap: clamp(2.75rem, 6vw, 6.5rem);
}

/* Every section in the landing hosts zero or more floating decorations;
   establish a stacking context so decorations at z-index: -1 sit behind
   their section's text without escaping into the page-root context. */
.landing > * { position: relative; z-index: 0; }

/* =============================================================
   DECORATIONS — museum-specimen clip-art floated inline with the
   prose so text wraps around them (shape-outside traces the image
   alpha). A few stay absolute (Voltaire bust in its own masthead
   column; Great Sphinx as a wide horizon above the colophon).
   Parallax drift via translate keyframes still applies — it moves
   the image visually without disturbing the wrap.
   ============================================================= */

.decoration {
  pointer-events: none;
  user-select: none;
  height: auto;
  max-width: 100%;
  /* Tight specimen contact shadow — sits on the paper, not levitating.
     Low offset, small blur, punchy opacity. */
  filter: drop-shadow(0 5px 6px rgba(17, 17, 17, 0.24))
          drop-shadow(0 1px 1px rgba(17, 17, 17, 0.18));
}

/* ── Shared inline-float base ─────────────────────────────── */

.decoration--float-right {
  float: right;
  margin: 0.2em 0 0.8em 1.2em;
}
.decoration--float-left {
  float: left;
  margin: 0.2em 1.2em 0.8em 0;
}

/* ── Individual decorations (inline floats inside prose) ──── */

.decoration--astrolabe {
  float: right;
  width: clamp(9rem, 17vw, 14rem);
  shape-outside: url("../img/astrolabe.png");
  shape-margin: 1.25rem;
  shape-image-threshold: 0.5;
  margin: -1.5em 0 1em 1.25em;
}

/* Chronometer lives in the install grid; rules in the install block. */

.decoration--greek-sphinx {
  float: right;
  width: clamp(12rem, 15vw, 13rem);
  shape-outside: url("../img/greek-sphinx.png");
  shape-margin: 1.25rem;
  shape-image-threshold: 0.5;
  margin: 0 0 1em 1.25em;
  opacity: 0.96;
}

.decoration--next {
  float: left;
  width: clamp(10rem, 18vw, 15rem);
  shape-outside: url("../img/next-computer.png");
  shape-margin: 1.25rem;
  shape-image-threshold: 0.5;
  margin: 0.1em 1.25em 1em -6em;
}

.decoration--artemis {
  float: right;
  width: clamp(10rem, 11vw, 13rem);
  shape-outside: url("../img/artemis-ii.png");
  shape-margin: 1.25rem;
  shape-image-threshold: 0.5;
  margin: 0 0 1em 1.25em;
  position: relative;
  z-index: 10;
}

.decoration--david {
  float: right;
  width: clamp(9rem, 13vw, 11rem);
  shape-outside: url("../img/david.png");
  shape-margin: 1.25rem;
  shape-image-threshold: 0.5;
  margin: 0 0 1em 1.25em;
  -webkit-mask-image: linear-gradient(to bottom, #000 85%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 85%, transparent 100%);
}

.decoration--lamassu {
  float: right;
  width: clamp(11rem, 18vw, 15rem);
  shape-outside: url("../img/lammasu-2.png");
  shape-margin: 1.25rem;
  shape-image-threshold: 0.5;
  margin: 0 -5em 1em 1.25em;
  filter: drop-shadow(0 5px 6px rgba(17, 17, 17, 0.24))
          drop-shadow(0 1px 1px rgba(17, 17, 17, 0.18))
          sepia(0.1);
}

@media (max-width: 860px) {
    .decoration--next { margin-left: 0; }
    .decoration--lamassu { margin-right: 0; }
}

.decoration--kabuto {
  float: left;
  width: clamp(7rem, 10vw, 9rem);
  shape-outside: url("../img/kabuto.png");
  shape-margin: 1.25rem;
  shape-image-threshold: 0.5;
  margin: 0.1em 1.25em 1em 0;
}

.decoration--socrates {
  float: left;
  width: clamp(11.5rem, 15vw, 15rem);
  shape-outside: url("../img/socrates.png");
  shape-margin: 0.75rem;
  shape-image-threshold: 0.5;
  margin: 0 1em 0.25em 0;
  transform: scaleX(-1) rotate(12deg);
}

.decoration--davinci {
  float: left;
  width: clamp(10rem, 22vw, 17rem);
  shape-outside: url("../img/davinci-flying-machine.png");
  shape-margin: 1.25rem;
  shape-image-threshold: 0.5;
  margin: 0.1em 1.25em 1em 0;
}

.decoration--tengu {
  float: left;
  width: clamp(9rem, 14vw, 12rem);
  shape-outside: url("../img/tengu-mask.png");
  shape-margin: 1.25rem;
  shape-image-threshold: 0.5;
  margin: 0 1.25em 1em 0;
}

.decoration--mercator {
  float: right;
  width: clamp(8rem, 13vw, 11rem);
  shape-outside: url("../img/mercator-celestial-globe.png");
  shape-margin: 1.25rem;
  shape-image-threshold: 0.5;
  margin: 0 0 1em 1.25em;
}

.decoration--great-sphinx {
  float: right;
  width: clamp(11rem, 16vw, 14rem);
  shape-outside: url("../img/great-sphinx.png");
  shape-margin: 1.25rem;
  shape-image-threshold: 0.5;
  margin: 0 0 1em 1.25em;
  opacity: 0.96;
}

/* ── Responsive: on narrow viewports (no shape-outside room),
   unfloat and centre-block the decorations so they become
   punctuation between paragraphs instead of crowded in-flow
   thumbnails. ─────────────────────────────────────────────── */

/* Floats and shape-outside work at every width — keep the ragged
   text wrap on phones instead of unfloating to centred blocks. The
   individual decorations use smaller clamp minimums so they scale
   down and text still has a readable column beside them. */

/* Decorations inside guide prose. The docs column is narrower
   than the landing's body text (max-width: 42rem), so cap the
   floats tighter; the float side and shape rules above still
   apply. */
.docs-prose .decoration {
  margin-bottom: 0.85em;
}
.docs-prose .decoration--davinci {
  width: clamp(8rem, 32%, 12rem);
  margin: 0.1em 1.25em 0.85em 0;
}
.docs-prose .decoration--mercator {
  width: clamp(6.5rem, 22%, 9.5rem);
  margin: 0 0 0.85em 1.25em;
}
.docs-prose .decoration--great-sphinx {
  width: clamp(8rem, 28%, 11rem);
  margin: 0 0 0.85em 1.25em;
}



/* =============================================================
   MASTHEAD — title only, NO rule under it.
   ============================================================= */

.masthead {
  display: grid;
  grid-template-columns: minmax(0, 62fr) minmax(0, 38fr);
  align-items: stretch;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding-bottom: 0.25rem;
}

.masthead__figure {
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-width: 0;
}
.masthead__bust {
  width: 100%;
  max-width: 22rem;
  height: auto;
  display: block;
  filter: drop-shadow(0 14px 22px rgba(17, 17, 17, 0.16))
          drop-shadow(0 3px 4px rgba(17, 17, 17, 0.10));
  /* Soften the hard bottom edge of the cutout so it sits on the paper
     rather than ending in a guillotine line. */
  -webkit-mask-image: linear-gradient(to bottom, #000 88%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 88%, transparent 100%);
}

.masthead__text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.masthead__title {
  margin: 0;
  font-family: var(--serif-display);
  font-weight: 500;
  font-variation-settings: "opsz" 96, "wght" 500;
  font-size: clamp(3rem, 13vw, 11rem);
  line-height: 1;
  letter-spacing: -0.02em;
  text-align: left;
  color: var(--ink);
  padding: 0;
  white-space: nowrap;
}

.masthead__dek {
  margin: clamp(1.25rem, 2vw, 2.25rem) 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-variation-settings: "opsz" 48, "wght" 400;
  font-size: clamp(1.25rem, 2vw + 0.4rem, 2rem);
  line-height: 1.25;
  text-align: left;
  color: var(--ink-soft);
  max-width: 44ch;
}

@media (max-width: 760px) {
  .masthead {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    justify-items: center;
    text-align: center;
  }
  .masthead__figure { order: -1; width: min(55%, 18rem); }
  .masthead__title {
    text-align: center;
    font-size: clamp(3.25rem, 22vw, 8rem);
  }
  .masthead__dek {
    text-align: center;
    margin-inline: auto;
    max-width: 42ch;
  }
}

/* =============================================================
   INSTALL CARD  (the page's call to action)
   ============================================================= */

.install {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.5rem clamp(1rem, 3vw, 2rem);
  border-top: 0.5px solid var(--rule);
  border-bottom: 0.5px solid var(--rule);
  text-align: center;
}
/* Chronometer hangs in the left margin of the install card —
   anchored to the card but living outside its left edge. */
.install .decoration--chronometer {
  position: absolute;
  float: none;
  shape-outside: none;
  right: calc(100% + 1.25rem);   /* right edge sits left of card */
  top: 50%;
  translate: 0 -50%;
  width: clamp(5rem, 9vw, 8rem);
  margin: 0;
}
@media (max-width: 760px) {
  /* No margin to hang in — slide it above the card as a flourish. */
  .install .decoration--chronometer {
    position: static;
    translate: 0;
    width: clamp(4rem, 22vw, 6rem);
    margin: 0 auto 1rem;
    display: block;
  }
}
.install__label {
  font-family: var(--sans-label);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--stamp);
  margin: 0 0 0.85rem;
  font-weight: 600;
}
.install__cmd {
  margin: 0;
  padding: 0.95rem 1.15rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: clamp(0.78rem, 1.3vw, 1rem);
  line-height: 1.4;
  text-align: left;
  border: 0.5px solid var(--ink);
  font-weight: 500;
  max-width: 100%;
  /* Allow the command to wrap rather than require horizontal scroll
     on narrow viewports — mobile browsers handle overflow-x scroll
     inconsistently and users can still copy the line. */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.install__cmd code {
  font-family: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  white-space: inherit;
  overflow-wrap: inherit;
}
.install__note {
  margin: 0.9rem 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-variation-settings: "opsz" 14;
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.install__note code {
  font-style: normal;
}

/* =============================================================
   SECTION HEADS
   ============================================================= */

.section-head {
  font-family: var(--serif-display);
  font-variation-settings: "opsz" 14, "wght" 600;
  font-size: clamp(1.5rem, 2.4vw + 0.4rem, 2.5rem);
  line-height: 1.1;
  margin: 0 0 1.25rem;
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  flex-wrap: wrap;
  border-bottom: 0.5px solid var(--rule);
  padding-bottom: 0.55rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.section-head__num {
  font-family: var(--sans-label);
  font-size: 0.64rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--stamp);
  white-space: nowrap;
  transform: translateY(-0.35em);
  font-weight: 600;
}
.section-head__text { font-style: normal; }

/* =============================================================
   ESSAY (opening)
   ============================================================= */

.essay__body {
  max-width: var(--measure);
  margin-inline: auto;
}

.prose p {
  margin: 0 0 1em;
  font-size: 1.05rem;
  line-height: 1.6;
  hyphens: auto;
  text-align: justify;
  font-variation-settings: "opsz" 14;
}
.prose p + p { text-indent: 1.6em; }
.prose__lede { text-indent: 0 !important; }

/* Drop cap + first-word sans treatment (DK Eyewitness opener) */
.dropcap {
  float: left;
  font-family: var(--serif-display);
  font-variation-settings: "opsz" 28, "wght" 600;
  font-size: clamp(3em, 8.5vw, 4.75em);
  line-height: 0.82;
  margin: 0.08em 0.15em 0 -0.03em;
  color: var(--ink);
}
.dropcap__follow {
  font-family: var(--sans-label);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  font-size: 0.88em;
}

/* =============================================================
   FEATURES (architecture / interfaces / record)
   ============================================================= */

.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 3.5vw, 3.5rem);
  align-items: start;
}
.feature--inverted .feature__figure { order: 2; }
.feature--inverted .feature__body   { order: 1; }

@media (max-width: 860px) {
  .feature { grid-template-columns: 1fr; }
  .feature--inverted .feature__figure { order: 1; }
  .feature--inverted .feature__body   { order: 2; }
}

.landing { counter-reset: figure; }

.feature__figure {
  margin: 0;
  min-width: 0;
  counter-increment: figure;
  padding: 6px;
  border: 0.5px solid var(--rule);
}
.feature__body { min-width: 0; }

.feature__image {
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 72vh;
  background: var(--paper-deep);
  display: block;
}
.feature__image--placeholder {
  border: 0.5px solid var(--rule-strong);
  background-image:
    repeating-linear-gradient(-45deg, transparent 0 12px, rgba(0,0,0,0.04) 12px 13px);
  position: relative;
}
.feature__image--placeholder::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 0.5px dashed var(--rule-strong);
}

.feature__caption {
  margin-top: 0.5rem;
  padding: 0 0.25rem;
  font-family: var(--serif);
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--ink-soft);
  font-style: italic;
  font-variation-settings: "opsz" 10;
}
.feature__caption::before {
  content: "Fig. " counter(figure) ". ";
  font-family: var(--sans-label);
  font-style: normal;
  font-variant: small-caps;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--ink);
  margin-right: 0.25em;
}

.feature__body p {
  font-size: 1rem;
  line-height: 1.6;
  margin: 0 0 1em;
  max-width: 54ch;
}

/* Supervision-tree mono specimen */
.specimen {
  background: var(--paper-deep);
  border: 0.5px solid var(--rule-strong);
  padding: 1.15rem 1.35rem;
  font-family: var(--mono);
  font-size: clamp(0.72rem, 0.5vw + 0.62rem, 0.84rem);
  line-height: 1.5;
  overflow-x: auto;
  margin: 1.25rem 0 0;
}

/* Commands list */
.commands {
  margin: 1.5rem 0 0;
  display: grid;
  gap: 0;
  border-top: 0.5px solid var(--rule);
}
.command {
  display: grid;
  grid-template-columns: minmax(7rem, 10rem) 1fr;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 0.5px solid var(--rule);
  align-items: baseline;
}
.command dt { font-family: var(--mono); font-size: 0.88rem; color: var(--ink); }
.command dt code { background: transparent; border: none; padding: 0; }
.command dd {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ink-soft);
  font-variation-settings: "opsz" 12;
}
@media (max-width: 560px) {
  .command { grid-template-columns: 1fr; gap: 0.2rem; }
}

/* Data card (record substrate card — no decorative label) */
.card {
  margin: 1.4rem 0 0;
  padding: 1.25rem 1.5rem 1.4rem;
  background: var(--paper);
  border: 0.5px solid var(--ink);
  box-shadow: 3px 3px 0 var(--paper-deep);
}
.card__dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem 1.25rem;
  font-size: 0.92rem;
  line-height: 1.45;
}
.card__dl dt {
  font-family: var(--sans-label);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--ink-muted);
  font-weight: 600;
  padding-top: 0.2em;
}
.card__dl dd {
  margin: 0;
  color: var(--ink-soft);
  font-variation-settings: "opsz" 12;
  overflow-wrap: anywhere;
}
.card__dl dd code { font-style: normal; font-size: 0.85em; }
.card__dl .small {
  font-family: var(--serif-display);
  color: var(--rule-strong);
  margin: 0 0.15em;
}
@media (max-width: 480px) {
  .card { padding: 1rem 1.1rem; }
  .card__dl { grid-template-columns: 1fr; gap: 0.15rem 0; }
  .card__dl dt { margin-top: 0.6rem; }
}

/* =============================================================
   BIBLIOGRAPHY
   ============================================================= */

.bibliography {
  max-width: 56rem;
  margin-inline: auto;
  width: 100%;
}
.biblio-list {
  list-style: none;
  counter-reset: bib;
  margin: 0;
  padding: 0;
}
.biblio-list li {
  counter-increment: bib;
  padding: 1rem 0 1rem 3rem;
  border-bottom: 0.5px solid var(--rule);
  position: relative;
  z-index: 5;
}
.biblio-list li::before {
  content: counter(bib, upper-roman) ".";
  position: absolute;
  left: 0.5rem;
  top: 1rem;
  font-family: var(--serif-display);
  font-variation-settings: "opsz" 18, "wght" 700;
  font-size: 1.1rem;
  color: var(--stamp);
  letter-spacing: 0.04em;
}
.biblio-list a {
  text-decoration: none;
  display: grid;
  gap: 0.25rem;
}
.biblio-list a:hover .biblio__title { text-decoration: underline; }
.biblio__title {
  font-family: var(--serif-display);
  font-variation-settings: "opsz" 24, "wght" 700;
  font-size: 1.2rem;
  color: var(--ink);
}
.biblio__desc {
  font-size: 0.95rem;
  color: var(--ink-soft);
  font-variation-settings: "opsz" 12;
  line-height: 1.5;
}

/* =============================================================
   MOTTO — engraved ribbon above the colophon.
   The source has a dark vignette; mix-blend-mode: multiply lets
   the cream paper show through the lighter areas, so the ink
   sits on the page like an engraving rather than pasting a
   dark rectangle onto it.
   ============================================================= */

.motto {
  margin: 0 auto;
  max-width: 28rem;
  width: 100%;
  text-align: center;
  padding: 0 1rem;
}
.motto__image {
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  mix-blend-mode: multiply;
}

/* =============================================================
   PULL-QUOTE  (intermezzo between § 3 and § 4)
   ============================================================= */

.pull-quote {
  margin: 0 auto;
  max-width: 44rem;
  text-align: center;
  padding: 1rem 0.5rem;
}
.pull-quote p {
  margin: 0;
  padding-top: 2.5rem;
  font-family: var(--serif-display);
  font-style: italic;
  font-variation-settings: "opsz" 14, "wght" 500;
  font-size: clamp(1.5rem, 2.8vw + 0.4rem, 2.6rem);
  line-height: 1.3;
  color: var(--ink-soft);
}

/* =============================================================
   COLOPHON
   ============================================================= */

.colophon { padding-top: 1.5rem; margin-top: 1rem; }
.colophon__rule { display: block; margin-bottom: 1.25rem; }
.rule { display: block; background: var(--ink); }
.rule--thin { height: 0.5px; }
.colophon p { margin: 0 0 0.35rem; }
.colophon__meta {
  font-family: var(--sans-label);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-muted);
  font-weight: 600;
}
.colophon__meta a {
  color: inherit;
  text-decoration: none;
  border-bottom: 0.5px solid var(--rule);
}
.colophon__meta a:hover { color: var(--stamp); border-bottom-color: var(--stamp); }
.colophon__license {
  font-family: var(--serif);
  font-variation-settings: "opsz" 12, "wght" 400;
  font-style: italic;
  font-size: 0.88rem;
  color: var(--ink-muted);
}

/* =============================================================
   INTERIOR PAGES
   ============================================================= */

body.interior main {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 2rem var(--gutter);
}
body.interior > nav {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 1.25rem var(--gutter);
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  border-bottom: 0.5px solid var(--rule);
  font-family: var(--sans-label);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 500;
}
body.interior > nav a { text-decoration: none; }
body.interior > nav a:hover { color: var(--stamp); }
body.interior > nav a:first-child {
  font-family: var(--serif-display);
  font-variation-settings: "opsz" 48, "wght" 600;
  text-transform: none;
  letter-spacing: 0;
  font-size: 1.15rem;
  margin-right: auto;
}
body.interior footer {
  max-width: var(--page-max);
  margin: 2rem auto 2.5rem;
  padding: 1.25rem var(--gutter) 0;
  border-top: 0.5px solid var(--rule);
  font-family: var(--sans-label);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-muted);
  font-weight: 500;
}
body.interior footer p { margin: 0; }

body.home > footer { display: none; }

/* =============================================================
   DOCS — Guides section. Restrained Utopian Scholastic.
   One serif family (Source Serif 4), one sans label (Archivo
   Narrow), one mono (IBM Plex Mono). No Bodoni, no opsz tuning,
   no decorative flourishes. Three-column shell: left nav, content,
   right in-page TOC.
   ============================================================= */

body.interior.docs main {
  max-width: none;
  margin: 0;
  padding: 0;
}

.docs-shell {
  max-width: 84rem;
  margin: 0 auto;
  padding: 1.25rem var(--gutter) 3rem;
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr) 12rem;
  gap: 2.5rem;
  align-items: start;
}

@media (max-width: 1100px) {
  .docs-shell { grid-template-columns: 14rem minmax(0, 1fr); }
  .docs-disclosure--toc { display: none; }
}

@media (max-width: 760px) {
  .docs-shell { grid-template-columns: 1fr; gap: 1rem; }
  /* Re-enable the right rail at the mobile breakpoint so it's accessible
     as a collapsible disclosure above the content. */
  .docs-disclosure--toc { display: block; }
  .docs-disclosure--rail { order: 0; }
  .docs-disclosure--toc  { order: 1; }
  .docs-content          { order: 2; }
  /* Empty TOC placeholder (pages without a generated TOC) — collapse it
     so it doesn't introduce a phantom gap between rail and content. */
  .docs-shell > aside:empty { display: none; }
}

/* ── Disclosure wrapper (mobile-collapsible rails) ────────── */

/* The <details> element is the grid item. On desktop it's `[open]` and
   the summary is hidden — content renders identically to before. On
   mobile (≤760px) a small inline script removes the `[open]` attribute,
   the summary becomes a touchable toggle, and the rail collapses. If
   JS is disabled, the rails simply stay expanded — still accessible. */
.docs-disclosure__toggle {
  display: none;
  list-style: none;
  cursor: pointer;
}
.docs-disclosure__toggle::-webkit-details-marker { display: none; }

@media (max-width: 760px) {
  .docs-disclosure {
    border: 0.5px solid var(--rule);
    background: var(--paper);
  }
  .docs-disclosure__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
    background: var(--paper-deep);
    user-select: none;
  }
  .docs-disclosure[open] > .docs-disclosure__toggle {
    border-bottom: 0.5px solid var(--rule);
  }
  .docs-disclosure__label {
    font-family: var(--sans-label);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-weight: 700;
    color: var(--ink);
  }
  .docs-disclosure__caret::before {
    content: "▾";
    display: inline-block;
    color: var(--ink-muted);
    transition: transform 0.15s ease;
  }
  .docs-disclosure[open] > .docs-disclosure__toggle .docs-disclosure__caret::before {
    transform: rotate(180deg);
  }
}

/* ── Left rail ────────────────────────────────────────────── */

.docs-disclosure--rail {
  position: sticky;
  top: 1.25rem;
  align-self: start;
  max-height: calc(100vh - 2.5rem);
  overflow-y: auto;
  padding: 0 0.5rem 1rem 0;
}

.docs-rail {
  font-family: var(--sans-label);
  font-size: 0.82rem;
  line-height: 1.45;
}

@media (max-width: 760px) {
  .docs-disclosure--rail {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 0;
  }
  .docs-rail {
    padding: 0.65rem 0.85rem 0.85rem;
    max-height: 60vh;
    overflow-y: auto;
  }
}

.docs-rail__home {
  display: block;
  padding: 0 0 0.5rem;
  margin: 0 0 0.85rem;
  font-family: var(--sans-label);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 0.5px solid var(--rule);
}
.docs-rail__home:hover { color: var(--stamp); }

.docs-section { margin: 0 0 0.95rem; }
.docs-section__label {
  margin: 0 0 0.25rem;
  padding: 0;
  font-family: var(--sans-label);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-muted);
  font-weight: 600;
}
.docs-section__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.docs-section__list li { margin: 0; }

.docs-link {
  display: block;
  padding: 0.12rem 0;
  color: var(--ink-soft);
  text-decoration: none;
}
.docs-link:hover { color: var(--stamp); }
.docs-link--active {
  color: var(--ink);
  font-weight: 600;
}

/* ── Content ──────────────────────────────────────────────── */

.docs-content {
  min-width: 0;
  max-width: 42rem;
}

.docs-header {
  margin: 0 0 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 0.5px solid var(--rule);
}
.docs-eyebrow {
  margin: 0 0 0.4rem;
  font-family: var(--sans-label);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-muted);
  font-weight: 600;
}
.docs-eyebrow a { color: inherit; text-decoration: none; }
.docs-eyebrow a:hover { color: var(--stamp); }

.docs-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.95rem;
  line-height: 1.15;
  letter-spacing: -0.005em;
}
.docs-lede {
  margin: 0.5rem 0 0;
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 56ch;
}

/* ── Prose body ───────────────────────────────────────────── */

.docs-prose {
  font-size: 0.98rem;
  line-height: 1.6;
}

.docs-prose p {
  margin: 0 0 0.95em;
}

.docs-prose h2 {
  margin: 2rem 0 0.5rem;
  padding-top: 1.2rem;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1.25;
  border-top: 0.5px solid var(--rule);
}
.docs-prose > h2:first-child {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.docs-prose h3 {
  margin: 1.5rem 0 0.35rem;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.08rem;
  line-height: 1.3;
}

.docs-prose h4 {
  margin: 1.2rem 0 0.3rem;
  font-family: var(--sans-label);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.docs-prose ul, .docs-prose ol {
  margin: 0 0 0.95em;
  padding-left: 1.4rem;
}
.docs-prose li { margin: 0.15em 0; }
.docs-prose li > p { margin: 0.15em 0; }

.docs-prose a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 0.5px;
  text-decoration-color: var(--rule-strong);
}
.docs-prose a:hover {
  color: var(--stamp);
  text-decoration-color: var(--stamp);
}

.docs-prose blockquote {
  margin: 1rem 0;
  padding: 0.5rem 0.95rem;
  border-left: 2px solid var(--rule-strong);
  color: var(--ink-soft);
  background: var(--paper-deep);
}

.docs-prose pre {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  background: #1a1a1c;
  color: #e8e3d8;
  border: 0.5px solid var(--rule-strong);
  overflow-x: auto;
  font-size: 0.84rem;
  line-height: 1.55;
  max-width: 100%;
}
.docs-prose pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.docs-prose table {
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.92rem;
  width: 100%;
}
.docs-prose th, .docs-prose td {
  text-align: left;
  padding: 0.45rem 0.75rem 0.45rem 0;
  border-bottom: 0.5px solid var(--rule);
  vertical-align: top;
}
.docs-prose th {
  font-family: var(--sans-label);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  color: var(--ink-muted);
  font-weight: 600;
  border-bottom: 0.5px solid var(--rule-strong);
}

.docs-prose hr {
  border: none;
  border-top: 0.5px solid var(--rule);
  margin: 2rem 0;
}

/* ── Right rail (in-page TOC) ─────────────────────────────── */

.docs-disclosure--toc {
  position: sticky;
  top: 1.25rem;
  align-self: start;
  max-height: calc(100vh - 2.5rem);
  overflow-y: auto;
  padding: 0;
}

.docs-toc-rail {
  font-family: var(--sans-label);
  font-size: 0.78rem;
  line-height: 1.4;
}

@media (max-width: 760px) {
  .docs-disclosure--toc {
    position: static;
    max-height: none;
    overflow: visible;
  }
  .docs-toc-rail {
    padding: 0.65rem 0.85rem 0.85rem;
    max-height: 50vh;
    overflow-y: auto;
  }
  /* The summary already says "On this page" — drop the duplicate label */
  .docs-disclosure--toc .docs-toc-rail__label { display: none; }
}
.docs-toc-rail__label {
  margin: 0 0 0.3rem;
  font-family: var(--sans-label);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-muted);
  font-weight: 600;
}
.docs-toc-rail nav#TableOfContents > ul,
.docs-toc-rail #TableOfContents > ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.docs-toc-rail ul ul {
  list-style: none;
  padding-left: 0.7rem;
  margin: 0;
}
.docs-toc-rail li { margin: 0; }
.docs-toc-rail a {
  display: block;
  padding: 0.1rem 0;
  color: var(--ink-muted);
  text-decoration: none;
}
.docs-toc-rail a:hover { color: var(--stamp); }

/* ── Pager (prev / next) ──────────────────────────────────── */

.docs-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 0.5px solid var(--rule);
}
.docs-pager > a {
  display: block;
  padding: 0.65rem 0.85rem;
  border: 0.5px solid var(--rule);
  text-decoration: none;
  color: inherit;
}
.docs-pager > a:hover {
  border-color: var(--ink);
  background: var(--paper-deep);
}
.docs-pager__prev { text-align: left; }
.docs-pager__next { text-align: right; grid-column: 2; }
.docs-pager__label {
  display: block;
  font-family: var(--sans-label);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-muted);
  font-weight: 600;
}
.docs-pager__title {
  display: block;
  margin-top: 0.15rem;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
}
@media (max-width: 560px) {
  .docs-pager { grid-template-columns: 1fr; }
  .docs-pager__next { grid-column: 1; text-align: left; }
}
