:root {
  color-scheme: light dark;
  --bg: #f5f0e7;
  --surface: #ede6db;
  --text: #25221f;
  --muted: #665f57;
  --accent: #934c32;
  --accent-strong: #74351f;
  --border: #cfc6b9;
  --code: #e9e1d5;
  --mark: #ded1bc;
  --focus: #1f5f8b;
  --measure: 45rem;
  --wide: 72rem;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 100%;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 1.0625rem;
  line-height: 1.72;
}

a { color: var(--accent-strong); text-decoration-thickness: .08em; text-underline-offset: .16em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; border-radius: 2px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: .75rem;
  left: .75rem;
  padding: .65rem 1rem;
  background: var(--text);
  color: var(--bg);
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.site-header { border-bottom: 1px solid var(--border); }
.header-inner, .footer-inner, .wide-wrap, .article-shell, .page-shell {
  width: min(100% - 2rem, var(--wide));
  margin-inline: auto;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 5.25rem;
}
.wordmark {
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: .78rem;
  font-weight: 750;
  letter-spacing: .18em;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
}
.site-nav ul { display: flex; flex-wrap: wrap; gap: .3rem 1.25rem; margin: 0; padding: 0; list-style: none; }
.site-nav a {
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: .84rem;
  text-decoration: none;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); text-decoration: underline; text-underline-offset: .35rem; }

main { min-height: 68vh; }
.page-shell { padding-block: clamp(3rem, 7vw, 6.5rem); }
.article-shell { padding-block: 2.25rem 6rem; }
.measure { max-width: var(--measure); }
.eyebrow, .meta, .kicker, .breadcrumbs, .article-card__meta, .subject-list, .archive-date, .section-label {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.eyebrow, .section-label {
  margin: 0 0 .9rem;
  color: var(--accent-strong);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}
h1, h2, h3 { line-height: 1.12; text-wrap: balance; }
h1 { margin: 0; font-size: clamp(2.75rem, 8vw, 6.5rem); font-weight: 500; letter-spacing: -.045em; }
.page-title { font-size: clamp(2.4rem, 5vw, 4.2rem); }
.article-title { max-width: 13ch; font-size: clamp(2.5rem, 7vw, 5.4rem); }
h2 { margin: 3.25rem 0 1.15rem; font-size: clamp(1.75rem, 3.5vw, 2.5rem); font-weight: 500; letter-spacing: -.025em; }
h3 { margin: 2.25rem 0 .75rem; font-size: 1.32rem; }
p { margin: 0 0 1.15rem; }
.subtitle { margin: .4rem 0 1.5rem; font-size: clamp(1.35rem, 3vw, 2.05rem); line-height: 1.3; color: var(--muted); }
.lede, .standfirst { max-width: 41rem; font-size: clamp(1.2rem, 2.2vw, 1.45rem); line-height: 1.55; color: var(--muted); }
.home-sections { display: grid; gap: 3.5rem; padding-block: clamp(3rem, 6vw, 5rem); }
.home-heading h1 { margin: 0; }

.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.section-heading h2 { margin: 0; }
.text-link { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: .87rem; }
.article-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--border); }
.article-card { padding: 1.5rem 2rem 1.65rem 0; border-bottom: 1px solid var(--border); }
.article-card:nth-child(odd) { border-right: 1px solid var(--border); }
.article-card:nth-child(even) { padding-left: 2rem; }
.article-card h3 { margin: 0 0 .65rem; font-size: 1.35rem; font-weight: 600; }
.article-card h3 a { color: var(--text); text-decoration: none; }
.article-card h3 a:hover { color: var(--accent-strong); text-decoration: underline; }
.article-card p { margin: 0 0 1rem; color: var(--muted); font-size: .98rem; line-height: 1.55; }
.article-card__meta { display: flex; flex-wrap: wrap; gap: .35rem .8rem; color: var(--muted); font-size: .74rem; letter-spacing: .025em; text-transform: uppercase; }
.article-card__meta span + span::before { content: "·"; margin-right: .8rem; }

.subject-list { display: grid; grid-template-columns: repeat(5, 1fr); margin: 0; padding: 0; border: 1px solid var(--border); list-style: none; }
.subject-list li + li { border-left: 1px solid var(--border); }
.subject-list a { display: block; min-height: 100%; padding: 1.4rem 1rem; color: var(--text); font-size: .86rem; text-align: center; text-decoration: none; }
.subject-list a:hover { background: var(--surface); }
.breadcrumbs { margin-bottom: 2.6rem; color: var(--muted); font-size: .77rem; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0; padding: 0; list-style: none; }
.breadcrumbs li + li::before { content: "/"; margin-right: .45rem; color: var(--border); }
.breadcrumbs a { color: inherit; }
.article-header { max-width: var(--measure); padding-block: 2rem 3.25rem; }
.meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; margin: 2.1rem 0 0; padding: 1.2rem 0; border-block: 1px solid var(--border); font-size: .78rem; line-height: 1.45; }
.meta div { display: grid; gap: .1rem; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; }
.article-layout { display: grid; grid-template-columns: minmax(12rem, 15rem) minmax(0, var(--measure)); gap: clamp(2.5rem, 6vw, 6rem); align-items: start; }
.toc { position: sticky; top: 1.5rem; padding-top: .5rem; }
.toc h2 { margin: 0 0 .8rem; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: .76rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.toc ol { margin: 0; padding: 0; list-style: none; }
.toc li { margin-bottom: .55rem; }
.toc a { color: var(--muted); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: .78rem; line-height: 1.35; text-decoration: none; }
.toc a:hover { color: var(--text); text-decoration: underline; }
.article-body { min-width: 0; }
.article-body > :first-child { margin-top: 0; }
.article-body li { margin-bottom: .45rem; }
.article-body strong { font-weight: 700; }
.article-body table { width: 100%; border-collapse: collapse; margin: 1.6rem 0 2rem; font-variant-numeric: tabular-nums; }
caption { padding-bottom: .65rem; color: var(--muted); font-style: italic; text-align: left; }
th, td { padding: .7rem .75rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: .75rem; letter-spacing: .03em; }
tbody tr:hover { background: color-mix(in srgb, var(--surface) 65%, transparent); }
.table-wrap { max-width: 100%; overflow-x: auto; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
code { padding: .08em .3em; background: var(--code); border-radius: 3px; font-size: .88em; }
pre { max-width: 100%; margin: 1.25rem 0 2rem; padding: 1.15rem 1.25rem; overflow-x: auto; background: var(--code); border: 1px solid var(--border); border-radius: 3px; font-size: .84rem; line-height: 1.55; tab-size: 2; white-space: pre; }
pre code { padding: 0; background: transparent; font-size: inherit; }
blockquote { margin: 1.7rem 0; padding-left: 1.3rem; border-left: 3px solid var(--accent); color: var(--muted); }
.callout { margin: 1.8rem 0; padding: 1.1rem 1.25rem; background: var(--surface); border-left: 3px solid var(--accent); }
.callout p:last-child { margin-bottom: 0; }
.example { margin: 1.5rem 0; padding: 1.2rem 1.3rem; border: 1px solid var(--border); }
.example__label { display: block; margin-bottom: .6rem; color: var(--muted); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.rendered-heading { margin: 0; }
.copy-mark { display: inline-block; min-width: 2.1em; padding: .15em .35em; background: var(--code); border: 1px solid var(--border); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.15em; text-align: center; user-select: all; }
.swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; margin: 1.5rem 0 2rem; }
.swatch { min-height: 8rem; display: flex; align-items: end; padding: .75rem; border: 1px solid var(--border); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: .76rem; font-weight: 650; }
.swatch--hue { background: #2d6aa3; color: #fff; }
.swatch--tint { background: #b9d3ec; color: #17212a; }
.swatch--shade { background: #173650; color: #fff; }
.swatch--tone { background: #65798c; color: #fff; }
.swatch--warm { background: #b5532f; color: #fff; }
.swatch--cool { background: #356e7d; color: #fff; }

.sources { margin-top: 4rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.sources h2 { margin-top: 0; font-size: 1.5rem; }
.sources li { margin-bottom: .55rem; }
.related { margin-top: 4rem; }
.related h2 { margin-top: 0; font-size: 1.5rem; }
.related-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 0; padding: 0; list-style: none; }
.related-list a { display: block; padding: 1rem; border: 1px solid var(--border); color: var(--text); text-decoration: none; }
.related-list a:hover { background: var(--surface); }
.article-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; max-width: var(--measure); margin-top: 4rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.article-nav a { display: grid; color: var(--text); text-decoration: none; }
.article-nav a:last-child { text-align: right; }
.article-nav small { color: var(--muted); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }

.page-header { max-width: var(--measure); margin-bottom: 3.5rem; }
.page-header h1 { margin-bottom: 1rem; }
.page-header--compact { margin-bottom: 2.5rem; }
.page-header--compact h1 { margin-bottom: 0; }
.category-links { display: flex; flex-wrap: wrap; gap: .55rem; margin: 1.5rem 0 3rem; padding: 0; list-style: none; }
.category-links a { display: block; padding: .35rem .75rem; border: 1px solid var(--border); border-radius: 999px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: .78rem; text-decoration: none; }
.category-links a:hover { background: var(--surface); }
.index-list { border-top: 1px solid var(--border); }
.index-list .article-card { display: grid; grid-template-columns: minmax(13rem, 1.2fr) 2fr; gap: 2rem; padding: 1.5rem 0; border-right: 0; }
.index-list .article-card h2 { margin: 0; font-size: 1.45rem; }
.index-list .article-card:nth-child(even) { padding-left: 0; }
.index-list .article-card p { margin-bottom: .7rem; }
.reference-group { display: grid; grid-template-columns: minmax(9rem, 14rem) 1fr; gap: 2.5rem; padding-block: 2.5rem; border-top: 1px solid var(--border); }
.reference-group h2 { margin-top: 0; }
.reference-group .article-card { padding: 0 0 1.4rem; border-right: 0; }
.reference-group .article-card + .article-card { padding-top: 1.4rem; }
.archive-year { display: grid; grid-template-columns: 10rem 1fr; gap: 2rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.archive-year h2 { margin: 0; font-size: 2.2rem; }
.archive-month h3 { margin-top: 0; color: var(--muted); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; }
.archive-list { margin: 0; padding: 0; list-style: none; }
.archive-list li { display: grid; grid-template-columns: 4rem 1fr auto; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--border); }
.archive-list a { color: var(--text); text-decoration: none; }
.archive-list a:hover { text-decoration: underline; }
.archive-date { color: var(--muted); font-size: .78rem; }
.about-banner { height: clamp(15rem, 32vw, 25rem); margin: 0 0 clamp(2.5rem, 6vw, 4.5rem); overflow: hidden; border: 1px solid var(--border); }
.about-banner img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center 56%; }
.about-profile { display: grid; grid-template-columns: minmax(13rem, 18rem) minmax(0, 38rem); gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.about-portrait { margin: 0; }
.about-portrait img { width: 100%; height: auto; display: block; border: 1px solid var(--border); }
.about-copy h1 { margin-bottom: 1.25rem; }
.about-copy > :last-child { margin-bottom: 0; }

.image-page-body { min-height: 100vh; }
.image-page {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(.75rem, 2vw, 1.5rem);
  width: min(100% - 2rem, 72rem);
  margin-inline: auto;
  padding-block: clamp(1rem, 3vw, 2rem);
}
.image-page img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
}

.site-footer { border-top: 1px solid var(--border); }
.footer-inner { display: flex; padding-block: 2.25rem 3rem; color: var(--muted); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: .74rem; }

@media (max-width: 800px) {
  .header-inner { align-items: flex-start; flex-direction: column; gap: .85rem; padding-block: 1.1rem; }
  .site-nav { width: 100%; overflow-x: auto; }
  .site-nav ul { min-width: max-content; }
  .article-grid { grid-template-columns: 1fr; }
  .article-card, .article-card:nth-child(even) { padding-inline: 0; border-right: 0; }
  .subject-list { grid-template-columns: 1fr 1fr; }
  .subject-list li + li { border-left: 0; }
  .subject-list li { border-bottom: 1px solid var(--border); }
  .subject-list li:nth-child(even) { border-left: 1px solid var(--border); }
  .subject-list li:last-child { grid-column: 1 / -1; border-bottom: 0; }
  .article-layout { display: block; }
  .toc { position: static; margin-bottom: 2.75rem; padding: 1rem; background: var(--surface); }
  .toc ol { columns: 2; column-gap: 1.5rem; }
  .meta { grid-template-columns: 1fr 1fr; }
  .reference-group, .archive-year { grid-template-columns: 1fr; gap: 1.5rem; }
  .about-profile { grid-template-columns: minmax(11rem, 15rem) minmax(0, 1fr); gap: 2rem; align-items: start; }
}

@media (max-width: 560px) {
  body { font-size: 1rem; }
  .header-inner, .footer-inner, .wide-wrap, .article-shell, .page-shell { width: min(100% - 1.35rem, var(--wide)); }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .subject-list { grid-template-columns: 1fr; }
  .subject-list li:nth-child(even) { border-left: 0; }
  .subject-list li:last-child { grid-column: auto; }
  .index-list .article-card { grid-template-columns: 1fr; gap: .65rem; }
  .toc ol { columns: 1; }
  .meta { grid-template-columns: 1fr; gap: .65rem; }
  .swatches, .related-list, .article-nav { grid-template-columns: 1fr; }
  .article-nav a:last-child { text-align: left; }
  .archive-list li { grid-template-columns: 3.25rem 1fr; }
  .archive-list .article-card__meta { grid-column: 2; }
  .footer-inner { flex-direction: column; gap: .5rem; }
  .about-banner { height: auto; aspect-ratio: 16 / 9; margin-bottom: 2rem; }
  .about-profile { grid-template-columns: 1fr; }
  .about-portrait { max-width: 14rem; }
  .image-page { grid-template-columns: 1fr; width: min(100% - 1.35rem, 36rem); }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #191816;
    --surface: #24211d;
    --text: #eee8dd;
    --muted: #b9b0a5;
    --accent: #d98a68;
    --accent-strong: #e49a79;
    --border: #484139;
    --code: #2b2823;
    --mark: #4c4135;
    --focus: #78bce8;
  }
  .swatch--tint { color: #17212a; }
}

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

@media print {
  :root { --bg: #fff; --text: #000; --muted: #333; --border: #aaa; }
  .site-header, .site-footer, .toc, .breadcrumbs, .article-nav, .related { display: none; }
  .article-shell { width: 100%; padding: 0; }
  .article-layout { display: block; }
  a { color: inherit; }
  a[href^="https://"]::after { content: " (" attr(href) ")"; font-size: .75em; }
}
