:root {
  --paper: #f5f7fa;
  --ink: #1b2430;
  --ink-soft: #55637a;
  --accent: #2e5aac;
  --rule: #d8dfe8;
  --panel: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #12161c;
    --ink: #e4e9f0;
    --ink-soft: #98a5b8;
    --accent: #7fa9f0;
    --rule: #26303c;
    --panel: #171d25;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 5rem;
}

header {
  border-bottom: 2px solid var(--ink);
  padding-bottom: 1.25rem;
  margin-bottom: 2.25rem;
}

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 0.6rem;
}

h1 {
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: clamp(1.9rem, 6vw, 2.6rem);
  line-height: 1.15;
  font-weight: 400;
  margin: 0 0 0.75rem;
  letter-spacing: -0.01em;
}

.meta {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.meta span { white-space: nowrap; }

.lede {
  font-size: 1.05rem;
  color: var(--ink);
  margin: 0 0 2rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: 3px;
  padding: 1rem 1.15rem;
  margin: 0 0 2.25rem;
  font-size: 0.95rem;
}

.card p { margin: 0.35rem 0; }

nav.toc {
  margin: 0 0 2.75rem;
  font-size: 0.95rem;
}

nav.toc p {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 0.6rem;
  font-weight: 600;
}

nav.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
  column-width: 15rem;
  column-gap: 2rem;
}

nav.toc li { counter-increment: toc; margin: 0 0 0.35rem; }

nav.toc li::before {
  content: counter(toc, decimal-leading-zero);
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
  margin-right: 0.55rem;
}

section {
  counter-increment: sec;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
  margin-bottom: 1.75rem;
}

.wrap { counter-reset: sec; }

h2 {
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1.3;
  margin: 0 0 0.9rem;
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
}

h2::before {
  content: counter(sec, decimal-leading-zero);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  flex: none;
  padding-top: 0.25rem;
}

h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
}

p, ul, ol.plain { margin: 0 0 1rem; }

ul, ol.plain { padding-left: 1.3rem; }

li { margin-bottom: 0.45rem; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: 0 0 1.25rem;
}

th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid var(--rule);
}

th {
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
}

footer {
  margin-top: 3.5rem;
  padding-top: 1.25rem;
  border-top: 2px solid var(--ink);
  font-size: 0.88rem;
  color: var(--ink-soft);
}

footer a { color: var(--accent); }

.home {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-size: 0.88rem;
  text-decoration: none;
}

.home:hover { text-decoration: underline; }

.index-list { list-style: none; padding: 0; margin: 2rem 0 0; }

.index-list li { margin-bottom: 1rem; }

.index-list a {
  font-family: Georgia, "Iowan Old Style", serif;
  font-size: 1.25rem;
  text-decoration: none;
}

.index-list a:hover { text-decoration: underline; }

.index-list span { display: block; font-size: 0.9rem; color: var(--ink-soft); }
