/* ==========================================================================
   The Field Guide
   Warm workshop-manual feel. One signature element: the oversized plate
   numerals in the left margin. Everything else stays quiet on purpose.
   ========================================================================== */

:root {
  --paper:        #f6f3ec;
  --paper-raised: #fbf9f4;
  --paper-sunk:   #efeae0;
  --ink:          #221f1b;
  --ink-soft:     #4a453e;
  --ink-mute:     #7a736a;
  --rule:         #e2dbcf;
  --rule-strong:  #cfc5b5;
  --accent:       #1f5b4e;
  --accent-deep:  #164036;
  --accent-soft:  #e6efea;
  --amber:        #8d6210;
  --amber-soft:   #f5ecda;

  /* The text column. Everything readable is capped at this so line length stays
     comfortable, and the page is sized so the column fills it rather than leaving a
     ragged gutter down the right. */
  --measure: 34rem;
  --sidebar-w: 18rem;
  --plate-col: 5.5rem;
  --plate-gap: 1.75rem;
  --rail-w: 19rem;
  --rail-gap: 2.5rem;

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:        #171614;
    --paper-raised: #1e1c19;
    --paper-sunk:   #131211;
    --ink:          #ece7df;
    --ink-soft:     #c1bab0;
    --ink-mute:     #8d867c;
    --rule:         #322e29;
    --rule-strong:  #443f38;
    --accent:       #74c2ab;
    --accent-deep:  #9ad6c3;
    --accent-soft:  #1b2a26;
    --amber:        #d7a851;
    --amber-soft:   #2a2318;
  }
}

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

html {
  scroll-behavior: smooth;
  /* Sticky sidebar means anchored headings need clearance. */
  scroll-padding-top: 2rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-deep); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 60;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
  transition: top 160ms var(--ease);
}
.skip-link:focus { top: 0.75rem; }

/* ---------------------------------------------------------------- shell -- */

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: 0;
  /* sidebar + plate gutter + prose + rail. Wide enough that a laptop runs close to
     edge to edge instead of stranding the text in a narrow strip. */
  max-width: 88rem;
  margin: 0 auto;
}

/* -------------------------------------------------------------- sidebar -- */

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  height: 100dvh;
  padding: 2.75rem 1.5rem 2rem 2rem;
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 2rem;
  overflow-y: auto;
}

.brand__mark {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 0.6rem;
}

.brand__title {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 12, "WONK" 1, "opsz" 40;
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.4rem;
}

.brand__subtitle {
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--ink-mute);
  margin: 0;
}

.toc { margin: 0; padding: 0; list-style: none; }

.toc__item + .toc__item { margin-top: 0.125rem; }

.toc__link {
  display: grid;
  grid-template-columns: 1.9rem 1fr;
  align-items: baseline;
  gap: 0.25rem;
  padding: 0.5rem 0.5rem 0.5rem 0.75rem;
  margin-left: -0.75rem;
  border-left: 2px solid transparent;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.9375rem;
  line-height: 1.35;
  border-radius: 0 3px 3px 0;
  transition: color 140ms var(--ease), border-color 140ms var(--ease), background 140ms var(--ease);
}

.toc__num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-mute);
  transition: color 140ms var(--ease);
}

.toc__link:hover { color: var(--ink); background: var(--paper-sunk); }

.toc__link[aria-current="true"] {
  color: var(--ink);
  border-left-color: var(--accent);
  font-weight: 500;
}
.toc__link[aria-current="true"] .toc__num { color: var(--accent); }

.toc__link--draft .toc__title::after {
  content: "draft";
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  padding: 0.05em 0.3em;
  margin-left: 0.45em;
  vertical-align: 0.15em;
  white-space: nowrap;
}

.sidebar__foot {
  margin-top: auto;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--ink-mute);
}

/* ----------------------------------------------------------- mobile nav -- */

.navbar { display: none; }

/* ----------------------------------------------------------------- main -- */

.main { padding: 0 2.5rem 8rem; min-width: 0; }

/* ----------------------------------------------------------------- hero -- */

.hero {
  padding: 6rem 0 3.5rem;
  margin-left: calc(var(--plate-col) + var(--plate-gap));
  max-width: var(--measure);
}

.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.5rem;
}

.hero__title {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 20, "WONK" 1, "opsz" 144;
  font-weight: 600;
  font-size: clamp(2.75rem, 6.5vw, 4.25rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0 0 1.25rem;
}

.hero__promise {
  font-size: clamp(1.1875rem, 2.2vw, 1.4375rem);
  line-height: 1.45;
  color: var(--ink-soft);
  margin: 0 0 2rem;
  max-width: 30rem;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.8125rem;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  max-width: 30rem;
}

/* ----------------------------------------------------------- short path -- */

.shortpath {
  margin: 0 0 2rem;
  padding: 1.125rem 1.25rem 1.25rem;
  border: 1px solid var(--rule);
  border-left: 2px solid var(--accent);
  border-radius: 0 6px 6px 0;
  background: var(--paper-raised);
  max-width: var(--measure);
}

.shortpath__label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

.shortpath__list {
  list-style: none;
  margin: 0 0 0.875rem;
  padding: 0;
  counter-reset: sp;
}

.shortpath__list li {
  counter-increment: sp;
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.45rem;
  font-size: 0.9375rem;
  line-height: 1.45;
}

.shortpath__list li::before {
  content: counter(sp);
  position: absolute;
  left: 0;
  top: 0.05em;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--ink-mute);
}

.shortpath__list a { font-weight: 500; text-decoration-color: var(--rule-strong); }
.shortpath__list span { color: var(--ink-mute); }

.shortpath__body {
  margin: 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--rule);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink-mute);
}

/* --------------------------------------------------------------- module -- */

/* The signature element: the plate numeral hangs in the left gutter, and the module
   body occupies a single column so the title, the prose and the cards all share one
   left edge. */
.module {
  display: grid;
  grid-template-columns: var(--plate-col) minmax(0, 1fr);
  gap: 0 var(--plate-gap);
  align-items: start;
  padding: 4.5rem 0 1rem;
  border-top: 1px solid var(--rule);
}

.module__body { min-width: 0; }

.module__head { margin-bottom: 3rem; }

.module__plate {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 0, "WONK" 0, "opsz" 144;
  font-weight: 600;
  font-size: 4.5rem;
  line-height: 0.82;
  letter-spacing: -0.04em;
  color: var(--accent);
  opacity: 0.9;
  margin: 0;
  position: relative;
}

.module__plate::after {
  content: "";
  display: block;
  width: 2rem;
  height: 1px;
  background: var(--rule-strong);
  margin-top: 1rem;
}

.module__title {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 16, "WONK" 1, "opsz" 96;
  font-weight: 600;
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0.35rem 0 0.9rem;
}

.module__kicker {
  font-size: 1.125rem;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0;
  max-width: var(--measure);
}

.module__intro { max-width: var(--measure); }
.module__intro p { margin: 0 0 1.25rem; }

/* ------------------------------------------------------------ try this -- */

/* The doing beat. Visually the loudest thing in a part after the plate numeral,
   because it is the only element that asks the reader to stop and act. */
.try {
  max-width: var(--measure);
  margin-top: 2rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent-soft);
  padding: 1.25rem 1.375rem 1.375rem;
}

.try__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.try__done {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  user-select: none;
}
.try__done:hover { color: var(--accent); }

.try__check {
  appearance: none;
  width: 0.95rem;
  height: 0.95rem;
  margin: 0;
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  background: var(--paper);
  cursor: pointer;
  position: relative;
}

.try__check:checked { background: var(--accent); border-color: var(--accent); }

.try__check:checked::after {
  content: "";
  position: absolute;
  left: 0.28rem;
  top: 0.1rem;
  width: 0.25rem;
  height: 0.5rem;
  border-right: 1.5px solid var(--paper);
  border-bottom: 1.5px solid var(--paper);
  transform: rotate(42deg);
}

.try--done { opacity: 0.62; }
.try--done:hover { opacity: 1; }
.try--done .try__done { color: var(--accent); }

.try__label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.5rem;
}

.try__title {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 12, "WONK" 1, "opsz" 32;
  font-weight: 600;
  font-size: 1.1875rem;
  line-height: 1.25;
  margin: 0 0 0.6rem;
}

.try__body { margin: 0; font-size: 1rem; line-height: 1.6; }

.try__steps {
  margin: 0.875rem 0 0;
  padding-left: 1.15rem;
  font-size: 0.96875rem;
  line-height: 1.55;
}
.try__steps li { margin-bottom: 0.4rem; }
.try__steps li::marker { color: var(--accent); font-family: var(--font-mono); font-size: 0.85em; }

.try__example {
  margin: 1rem 0 0;
  padding: 0.875rem 1rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow-x: auto;
}

.try__example code {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--ink-soft);
  white-space: pre;
}

.try__output {
  margin: 1rem 0 0;
  padding-top: 0.875rem;
  border-top: 1px solid var(--rule-strong);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.try__output span {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-right: 0.5em;
}

/* ---------------------------------------------------------------- terms -- */

.terms {
  max-width: var(--measure);
  margin-top: 2.5rem;
  padding: 1.375rem 1.5rem 0.75rem;
  background: var(--paper-sunk);
  border-radius: 6px;
}

.terms__label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 1rem;
}

.terms__list { margin: 0; }

.terms__row {
  padding-bottom: 0.875rem;
  margin-bottom: 0.875rem;
  border-bottom: 1px solid var(--rule);
}
.terms__row:last-child { border-bottom: 0; }

.terms__term {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 12, "WONK" 1, "opsz" 24;
  font-weight: 600;
  font-size: 1.0625rem;
  line-height: 1.3;
  margin: 0 0 0.2rem;
}

.terms__def {
  margin: 0;
  font-size: 0.96875rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

/* ---------------------------------------------------------------- steps -- */

/* On a route the page is a numbered sequence rather than the guide's module
   structure, so a route reads as its own thing rather than as the guide with gaps. */
.module--step { padding: 3rem 0 1rem; }

.step__from {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0.5rem 0 0.75rem;
}
.step__from--own { color: var(--accent); }

.step__note {
  max-width: var(--measure);
  margin: 0 0 1.75rem;
  padding-left: 1.125rem;
  border-left: 2px solid var(--accent);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
}

.part--step { margin-top: 0; padding-top: 0; border-top: 0; }

.route__assumes {
  max-width: var(--measure);
  margin: 0 0 1rem;
  padding: 0.875rem 1.125rem;
  border: 1px dashed var(--rule-strong);
  border-radius: 6px;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.toc__link--own .toc__num { color: var(--accent); }

/* ----------------------------------------------------------------- part -- */

.part {
  margin-top: 3.5rem;
  padding-top: 2.25rem;
  border-top: 1px solid var(--rule);
}

.part__title {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 16, "WONK" 1, "opsz" 48;
  font-weight: 600;
  font-size: 1.625rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 1.75rem;
}

.beat { margin-bottom: 1.75rem; max-width: var(--measure); }

.beat__label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 0.5rem;
}

.beat__body { margin: 0; }
.beat__body em { font-style: italic; }

/* When it's the right call, the trade-off block. */
.tradeoff {
  max-width: var(--measure);
  margin-bottom: 1.75rem;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1.25rem 1.375rem 0.5rem;
}

.tradeoff__row { margin-bottom: 0.875rem; }

.tradeoff__key {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 0.25rem;
}

.tradeoff__row--cost .tradeoff__key { color: var(--amber); }
.tradeoff__val { margin: 0; font-size: 1rem; line-height: 1.55; }

/* So what, the payoff beat. */
.sowhat {
  max-width: var(--measure);
  border-left: 2px solid var(--accent);
  padding: 0.125rem 0 0.125rem 1.25rem;
  margin: 2rem 0 0;
}

.sowhat__label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.4rem;
}

.sowhat__body {
  margin: 0;
  font-size: 1.09375rem;
  line-height: 1.55;
}

/* Under the bonnet, subordinate detail, skippable. */
.aside {
  max-width: var(--measure);
  margin-top: 1.75rem;
  border: 1px dashed var(--rule-strong);
  border-radius: 6px;
  background: transparent;
}

.aside > summary {
  cursor: pointer;
  padding: 0.75rem 1.125rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  list-style: none;
  border-radius: 6px;
}
.aside > summary::-webkit-details-marker { display: none; }
.aside > summary::before { content: "+ "; color: var(--accent); }
.aside[open] > summary::before { content: "− "; }
.aside > summary:hover { color: var(--ink); }

.aside__body {
  margin: 0;
  padding: 0 1.125rem 1.125rem;
  font-size: 0.96875rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* ----------------------------------------------------------------- rail -- */

/* Prose left, rail right. The rail is where the diagrams live, which is what turns
   the empty right-hand space into something structural. */
@media (min-width: 78rem) {
  .part--railed {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--rail-w);
    gap: 0 var(--rail-gap);
    align-items: start;
  }
  .part--railed .part__title { grid-column: 1 / -1; }
  .part--railed .part__rail { position: sticky; top: 2.5rem; }
}

.part__prose { max-width: var(--measure); min-width: 0; }
.part__rail { min-width: 0; }
.part__rail > * + * { margin-top: 1.5rem; }

/* -------------------------------------------------------------- figures -- */

.figure {
  margin: 2rem 0 0;
  max-width: var(--measure);
}

@media (min-width: 78rem) {
  .figure { margin-top: 0.5rem; max-width: none; }
}

.figure__art {
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper-sunk);
  padding: 1rem 0.875rem;
}

.figure__art svg { display: block; width: 100%; height: auto; overflow: visible; }
.figure__art svg text { fill: currentColor; }

.figure__caption {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink-mute);
}

/* ------------------------------------------------------------ next card -- */

.nextcard {
  margin-top: 3.5rem;
  border-top: 1px solid var(--rule);
  padding-top: 1.5rem;
  max-width: var(--measure);
}

.nextcard__link {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  background: var(--paper-raised);
  transition: border-color 140ms var(--ease);
}
.nextcard__link:hover { border-color: var(--accent); }

.nextcard__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.nextcard__title {
  display: block;
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 12, "WONK" 1, "opsz" 32;
  font-weight: 600;
  font-size: 1.1875rem;
  line-height: 1.25;
  margin-bottom: 0.2rem;
}

.nextcard__kicker {
  display: block;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--ink-mute);
}

.nextcard--end .nextcard__label { color: var(--ink-mute); }
.nextcard--end .nextcard__title {
  font-size: 1.0625rem;
  margin-bottom: 0.5rem;
}
.nextcard--end .nextcard__link {
  display: inline-block;
  border: 0;
  background: none;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

/* --------------------------------------------------------------- ending -- */

.ending {
  margin-top: 3.5rem;
  border-top: 1px solid var(--rule);
  padding-top: 2.5rem;
  max-width: var(--measure);
}

.ending__label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

.ending__title {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 16, "WONK" 1, "opsz" 48;
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 1.5rem;
}

.ending__list { list-style: none; margin: 0 0 1.5rem; padding: 0; }

.ending__list li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.7rem;
  line-height: 1.55;
}

.ending__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.42em;
  width: 0.7rem;
  height: 0.38rem;
  border-left: 1.5px solid var(--accent);
  border-bottom: 1.5px solid var(--accent);
  transform: rotate(-45deg);
}

.ending__close {
  margin: 0 0 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 1.09375rem;
  line-height: 1.55;
  color: var(--ink);
}

.ending__link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ------------------------------------------------------------- progress -- */

.progress { margin-bottom: 1rem; }

.progress__meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
  margin-bottom: 0.5rem;
}
.progress__meta b { color: var(--ink-soft); font-weight: 500; }

.progress__track {
  height: 2px;
  background: var(--rule);
  border-radius: 2px;
  overflow: hidden;
}

.progress__fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 120ms linear;
}

.progress__exercises {
  margin: 0.6rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
}

.sidebar__note { margin: 0; }

/* -------------------------------------------------------------- glossary -- */

.glossary { margin-top: 3rem; }
.glossary .terms__list { max-width: var(--measure); }

.glossary__from {
  float: right;
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  text-decoration: none;
  padding-top: 0.35em;
}
.glossary__from:hover { color: var(--accent); }

/* ------------------------------------------------------- onward from end -- */

.ending__next {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.ending__nextlist { list-style: none; margin: 0 0 1.5rem; padding: 0; }

.ending__nextlist li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.7rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.ending__nextlist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.6rem;
  height: 1px;
  background: var(--accent);
}

/* ----------------------------------------------------------- learn more -- */

.learnmore {
  margin-top: 3.5rem;
  padding-top: 2.25rem;
  border-top: 1px solid var(--rule);
}

.learnmore--group + .learnmore--group { margin-top: 2.5rem; padding-top: 2rem; }

.learnmore__note {
  margin: -0.75rem 0 1.5rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--ink-mute);
  max-width: var(--measure);
}

.learnmore__title {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 1.5rem;
}

.links { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }

.link {
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper-raised);
  padding: 1.125rem 1.25rem;
  transition: border-color 140ms var(--ease), transform 140ms var(--ease);
  max-width: var(--measure);
}

.link:hover { border-color: var(--rule-strong); }

.link__title { margin: 0 0 0.35rem; font-size: 1.0625rem; line-height: 1.35; font-weight: 500; }
.link__title a { text-decoration-color: var(--rule-strong); }

.link__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  font-size: 0.8125rem;
  color: var(--ink-mute);
}

.link__source { font-family: var(--font-mono); font-size: 0.75rem; }
.link__sep { color: var(--rule-strong); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  padding: 0.15em 0.55em 0.2em;
  border-radius: 999px;
  border: 1px solid var(--rule-strong);
  color: var(--ink-soft);
  white-space: nowrap;
}

.tag__dot { width: 0.4em; height: 0.4em; border-radius: 50%; background: var(--accent); }
.tag--freemium { border-color: var(--amber); color: var(--amber); background: var(--amber-soft); }
.tag--freemium .tag__dot { background: var(--amber); }
.tag--flagged { border-color: var(--amber); color: var(--amber); background: var(--amber-soft); }
.tag--flagged .tag__dot { background: transparent; box-shadow: inset 0 0 0 1px var(--amber); }

.link__why { margin: 0; font-size: 0.9375rem; line-height: 1.55; color: var(--ink-soft); }

/* ---------------------------------------------------------------- draft -- */

.draft {
  max-width: var(--measure);
  border: 1px dashed var(--rule-strong);
  border-radius: 6px;
  padding: 1.5rem 1.5rem 1.25rem;
  background: var(--paper-sunk);
}

.draft__label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 0.9rem;
}

.draft__lead { margin: 0 0 1rem; color: var(--ink-soft); font-size: 0.96875rem; }

.draft__list { margin: 0; padding: 0; list-style: none; }

.draft__list li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.5rem;
  font-size: 0.96875rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.draft__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 0.5rem;
  height: 1px;
  background: var(--rule-strong);
}

/* --------------------------------------------------------------- footer -- */

.colophon {
  margin-top: 5rem;
  margin-left: calc(var(--plate-col) + var(--plate-gap));
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--ink-mute);
  max-width: var(--measure);
}

/* ------------------------------------------------------------ responsive -- */

@media (max-width: 70rem) {
  :root { --plate-col: 5rem; --plate-gap: 1.5rem; }
  .module__plate { font-size: 3.5rem; }
  .main { padding: 0 2rem 6rem; }
}

@media (max-width: 54rem) {
  .shell { display: block; }

  .sidebar { display: none; }

  .navbar {
    display: block;
    position: sticky;
    top: 0;
    z-index: 40;
    background: color-mix(in srgb, var(--paper) 92%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--rule);
  }

  .navbar__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
  }

  .navbar__title {
    font-family: var(--font-display);
    font-variation-settings: "SOFT" 12, "WONK" 1;
    font-weight: 600;
    font-size: 1.0625rem;
    margin: 0;
  }

  .navbar__toggle {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-soft);
    background: transparent;
    border: 1px solid var(--rule-strong);
    border-radius: 4px;
    padding: 0.45rem 0.7rem;
    cursor: pointer;
  }

  .navbar__panel {
    display: none;
    padding: 0.25rem 1.25rem 1rem;
    border-top: 1px solid var(--rule);
    max-height: 60vh;
    overflow-y: auto;
  }
  .navbar__panel[data-open="true"] { display: block; }

  html { scroll-padding-top: 4.25rem; }

  .main { padding: 0 1.25rem 5rem; }
  .hero { padding: 3.5rem 0 2.5rem; }

  .module { display: block; padding-top: 3rem; }
  .module__head { margin-bottom: 2rem; }
  .module__plate { font-size: 3rem; margin-bottom: 0.5rem; }
  .module__plate::after { margin-top: 0.75rem; }
  .module__title { margin-top: 0.75rem; }
  .hero, .colophon { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media print {
  .sidebar, .navbar { display: none; }
  .shell { display: block; }
  body { background: #fff; color: #000; }
}
