:root {
  --ink: #141516;
  --ink-2: #2a2d30;
  --muted: #6b6e72;
  --muted-2: #8d9094;
  --rule: #e4e5e7;
  --rule-soft: #f0f1f2;
  --paper: #ffffff;
  --accent: #0f9b8e; /* RelayHub teal, used sparingly */
  --accent-ink: #0a6f66;
  --ok: #2f855a;
  --warn: #b7791f;
  --err: #9b2c2c;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'ss01', 'cv11';
}

a {
  color: var(--accent-ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

a:hover {
  border-bottom-color: var(--accent-ink);
}

.layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 48px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 56px 96px;
}

.toc {
  position: sticky;
  top: 32px;
  align-self: start;
  font-size: 12.5px;
  color: var(--muted);
  border-top: 1px solid var(--rule);
  padding-top: 16px;
}

.toc-label {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 10px;
}

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

.toc li {
  margin: 6px 0;
  counter-increment: toc;
}

.toc li::before {
  content: counter(toc, decimal-leading-zero);
  color: var(--accent);
  font-weight: 500;
  margin-right: 10px;
  font-variant-numeric: tabular-nums;
}

.toc a {
  color: var(--ink-2);
  border: none;
}

.toc a:hover { color: var(--accent-ink); }

.content {
  min-width: 0;
  max-width: 720px;
}

.masthead {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 28px;
  margin-bottom: 48px;
}

.masthead h1 {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.016em;
  line-height: 1.08;
  margin: 0 0 10px;
  color: var(--ink);
}

.masthead .lede {
  font-size: 16px;
  color: var(--ink-2);
  margin: 0 0 18px;
  max-width: 62ch;
  line-height: 1.5;
}

.masthead .meta {
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.masthead .meta span + span::before {
  content: ' · ';
  color: var(--muted-2);
}

section {
  padding-top: 40px;
  margin-top: 40px;
  border-top: 1px solid var(--rule);
}

section:first-of-type {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

h2.section-head {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 0 0 24px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: baseline;
  gap: 12px;
}

h2.section-head .num {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

h3 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin: 28px 0 10px;
  color: var(--ink);
}

p {
  margin: 0 0 14px;
  max-width: 68ch;
}

p.tight { margin-bottom: 4px; }

strong { font-weight: 600; color: var(--ink); }

em { font-style: italic; color: var(--ink-2); }

code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12.5px;
  background: var(--rule-soft);
  border: 1px solid var(--rule);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--ink-2);
}

pre {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  background: var(--rule-soft);
  border: 1px solid var(--rule);
  padding: 14px 16px;
  border-radius: 4px;
  overflow: auto;
  margin: 14px 0 18px;
  color: var(--ink-2);
}

pre code {
  background: none;
  border: none;
  padding: 0;
  border-radius: 0;
  color: inherit;
  font-size: inherit;
}

ul.plain { padding-left: 22px; margin: 10px 0 18px; max-width: 68ch; }
ul.plain li { margin: 4px 0; }

.finding {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--rule-soft);
  align-items: start;
}

.finding:first-of-type { border-top: none; }

.finding .num {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  padding-top: 2px;
}

.finding .body p { margin-bottom: 6px; }
.finding .body p:last-child { margin-bottom: 0; }

figure {
  margin: 22px 0 26px;
  max-width: 720px;
}

figure img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--rule);
  border-radius: 2px;
}

figcaption {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 8px;
  letter-spacing: 0.01em;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 14px 0;
  margin: 16px 0 26px;
}

.stats .stat {
  padding: 0 20px;
  border-left: 1px solid var(--rule-soft);
  min-width: 0;
}

.stats .stat:first-child {
  border-left: none;
  padding-left: 0;
}

.stats .stat .label {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.stats .stat .value {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
}

.stats .stat .sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.rule {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 40px 0;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 14px 0 22px;
}

.table th {
  text-align: left;
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--rule);
}

.table td {
  padding: 10px;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: top;
  color: var(--ink-2);
}

.table tr:last-child td { border-bottom: 1px solid var(--rule); }

.table td:first-child, .table th:first-child { padding-left: 0; }
.table td:last-child, .table th:last-child { padding-right: 0; }

.footer {
  margin-top: 60px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    padding: 28px 24px 60px;
    gap: 24px;
  }
  .toc {
    position: static;
    border-top: none;
    padding-top: 0;
  }
  .masthead h1 { font-size: 30px; }
  .stats { grid-template-columns: 1fr; }
  .stats .stat { border-left: none; padding: 8px 0; border-top: 1px solid var(--rule-soft); }
  .stats .stat:first-child { border-top: none; }
}
