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

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

:root {
  color-scheme: light;
  --bg: #fbfaf7;
  --paper: #ffffff;
  --text: #1d1d1b;
  --muted: #66645e;
  --line: #ded8cc;
  --accent: #004f5f;
  --accent-soft: #e3f2f3;
  --max: 74ch;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-size: 19px;
  line-height: 1.72;
}

a {
  color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.site-header,
.page,
.site-footer {
  width: min(var(--max), calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  padding: 22px 0 16px;
}

.top-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--accent);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.2;
  text-decoration: none;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.page {
  padding: 16px 0 48px;
}

.hero {
  padding: 26px 0 18px;
  border-bottom: 1px solid var(--line);
}

.eyebrow,
.post-card__kicker,
.meta,
.toc-title,
.article-source {
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.35;
}

h1,
h2,
h3 {
  line-height: 1.16;
  letter-spacing: 0;
}

h1 {
  margin: 12px 0 18px;
  font-size: clamp(34px, 10vw, 58px);
}

h2 {
  margin: 48px 0 14px;
  font-size: clamp(26px, 7vw, 36px);
}

h3 {
  margin: 34px 0 10px;
  font-size: clamp(22px, 5.8vw, 28px);
}

p {
  margin: 0 0 1.15em;
}

ul {
  margin: 0 0 1.2em;
  padding-left: 1.3em;
}

li + li {
  margin-top: 0.3em;
}

code {
  padding: 0.08em 0.28em;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.lead {
  color: #35332e;
  font-size: clamp(21px, 5.8vw, 26px);
  line-height: 1.55;
}

.post-list {
  display: grid;
  gap: 12px;
  margin: 28px 0 0;
}

.post-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: inherit;
  text-decoration: none;
}

.post-card strong {
  color: var(--text);
  font-size: 22px;
  line-height: 1.25;
}

.post-card > span:not(.post-card__kicker) {
  color: #3b3934;
  font-size: 16px;
  line-height: 1.5;
}

.post-card small {
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

.post-card__meta,
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  align-items: baseline;
}

.article-meta__author {
  flex-basis: 100%;
  color: var(--text);
}

.article-header {
  padding: 18px 0 22px;
  border-bottom: 1px solid var(--line);
}

.article-header h1 {
  max-width: 11em;
}

.article-body {
  padding-top: 24px;
}

.table-scroll {
  overflow-x: auto;
  margin: 24px 0 30px;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  background: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

th,
td {
  padding: 12px 14px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--accent-soft);
  color: var(--text);
}

.toc {
  margin: 24px 0 10px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.toc-title {
  margin-bottom: 8px;
  font-weight: 700;
}

.toc ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
}

.toc a {
  display: inline-block;
  padding: 4px 0;
}

.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 42px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.35;
}

.article-nav a {
  min-height: 48px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  text-decoration: none;
}

.article-nav a:last-child {
  text-align: right;
}

.site-footer {
  display: grid;
  gap: 6px;
  padding: 26px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

.site-footer__contact {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

.section-method {
  margin: 28px 0 34px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.section-method h2 {
  margin: 0 0 14px;
  font-size: 25px;
}

.section-method ol {
  margin: 0;
  padding-left: 1.4em;
}

.related-sections {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 30px;
}

.related-sections a {
  display: inline-block;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  text-decoration: none;
}

.article-group {
  margin: 42px 0;
}

.article-group > h2 {
  margin-bottom: 8px;
}

.article-group > p {
  margin-top: 0;
  color: var(--muted);
}

.evidence-figure {
  margin: 30px 0;
}

.evidence-figure img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 78vh;
  object-fit: contain;
  border: 1px solid var(--line);
  background: #111;
}

.evidence-figure figcaption {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-top: 0;
  background: var(--paper);
  color: #3b3934;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 30px 0;
}

.evidence-grid--3,
.evidence-grid--6 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.evidence-grid .evidence-figure {
  min-width: 0;
  margin: 0;
}

@media (max-width: 640px) {
  body {
    font-size: 17px;
    line-height: 1.68;
  }

  .site-header,
  .page,
  .site-footer {
    width: min(100% - 24px, var(--max));
  }

  .hero {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .site-header {
    padding: 12px 0 8px;
  }

  h1 {
    margin: 8px 0 12px;
    font-size: 34px;
  }

  h2 {
    margin: 34px 0 12px;
    font-size: 25px;
  }

  h3 {
    margin: 28px 0 8px;
    font-size: 21px;
  }

  .lead {
    font-size: 19px;
    line-height: 1.5;
  }

  .post-card {
    gap: 6px;
    padding: 14px;
  }

  .post-card strong {
    font-size: 20px;
  }

  .post-card > span:not(.post-card__kicker) {
    font-size: 15px;
  }

  .section-method {
    margin: 20px 0 26px;
    padding: 16px;
  }

  .section-method h2 {
    font-size: 22px;
  }

  .evidence-grid,
  .evidence-grid--3,
  .evidence-grid--6 {
    grid-template-columns: 1fr;
  }

  .evidence-figure img {
    max-height: none;
  }

  .article-nav {
    grid-template-columns: 1fr;
  }

  .article-nav a:last-child {
    text-align: left;
  }
}
