:root {
  --bg: #fbf8f3;
  --paper: #ffffff;
  --tint: #f4eee5;
  --ink: #2b2622;
  --muted: #6f655c;
  --line: #e8e0d5;
  --accent: #b23a48;
  --leaf: #4f6b3a;
  --radius: 14px;
  --measure: 46rem;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1b1917; --paper: #24211e; --tint: #2a2622; --ink: #ece6dd; --muted: #a99f94; --line: #3a3530; --accent: #e07a86; --leaf: #9cbf7f; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.7 var(--sans); }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }
h2 { font-size: clamp(26px, 3.4vw, 34px); margin: 0 0 16px; }
h3 { font-size: 22px; margin: 28px 0 8px; }
h2 em, h3 em { font-weight: 400; color: var(--muted); font-size: 0.72em; margin-left: 0.3em; }
p, ul, ol, dl { margin: 0 0 16px; }
li { margin: 5px 0; }
.small { font-size: 14px; color: var(--muted); }

/* header */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px 24px;
  padding: 12px max(16px, calc((100% - 1160px) / 2)); background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font: 600 21px/1 var(--serif); color: var(--ink); text-decoration: none; white-space: nowrap; }
.main-nav { display: flex; align-items: center; gap: 2px 6px; font-size: 15px; }
.main-nav > a, .dd > button { color: var(--muted); text-decoration: none; padding: 8px 10px; border-radius: 8px; background: none; border: 0; font: inherit; cursor: pointer; }
.main-nav > a:hover, .dd:hover > button, .dd:focus-within > button { color: var(--ink); background: var(--tint); }
.main-nav > a[aria-current="page"], .dd.active > button { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.dd { position: relative; }
.dd > button::after { content: ""; display: inline-block; margin-left: 6px; border: 4px solid transparent; border-top-color: currentColor; transform: translateY(2px); }
.dd-menu { position: absolute; left: 0; top: 100%; min-width: 220px; padding: 8px; background: var(--paper); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.12); display: none; }
.dd:hover .dd-menu, .dd:focus-within .dd-menu { display: block; }
.dd-menu a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.dd-menu a:hover, .dd-menu a[aria-current="page"] { background: var(--tint); }
.menu-toggle, .menu-btn { display: none; }

/* layout */
main.page { max-width: 1160px; margin: 0 auto; padding: 0 16px 40px; overflow-x: clip; }
.subnav { margin: 20px 0 0; font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.subnav span { font-weight: 600; }
.subnav a { color: var(--muted); text-decoration: none; }
.subnav a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.page-title { font-size: clamp(36px, 6vw, 60px); margin: 36px 0 12px; max-width: 18em; }
.lead { font-size: 1.2em; line-height: 1.6; color: var(--muted); max-width: var(--measure); margin: 0 0 32px; }
main.page > section, main.page > article { max-width: var(--measure); margin: 0 auto 0 0; padding: 44px 0 8px; border-top: 1px solid var(--line); }
main.page > section > h2:first-child { margin-top: 0; }

/* table of contents */
.toc { background: var(--tint); border-radius: var(--radius); padding: 20px 26px; margin: 0 0 40px; max-width: var(--measure); }
.toc h2 { font-size: 15px; font-family: var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px; }
.toc ol { columns: 2 220px; column-gap: 32px; margin: 0; padding-left: 1.3em; }
.toc li { break-inside: avoid; margin: 3px 0; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }

/* images */
figure { margin: 0 0 24px; }
figure img { border-radius: var(--radius); width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: var(--tint); }
figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }
figure.wide { margin: 28px 0; width: min(1128px, calc(100vw - 32px)); max-width: none; }
figure.wide img { aspect-ratio: 21 / 9; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; margin: 28px 0; width: min(1128px, calc(100vw - 32px)); }
.split > figure { margin: 0; }
.split img { aspect-ratio: 4 / 3; }
.split.reverse > figure { order: 2; }
.split > div > :last-child { margin-bottom: 0; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 28px 0; width: min(1128px, calc(100vw - 32px)); }
.gallery figure { margin: 0; }
.gallery img { aspect-ratio: 1 / 1; }

/* boxes */
.note { background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--leaf); border-radius: 10px; padding: 18px 22px; margin: 24px 0; }
.note h3 { margin: 0 0 6px; font-size: 19px; }
.note p:last-child { margin: 0; }
blockquote { margin: 28px 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--accent); font: italic 20px/1.55 var(--serif); color: var(--ink); }
blockquote p:last-child { margin: 0; }
.profiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 24px 0; width: min(1128px, calc(100vw - 32px)); }
.profile { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.profile h3 { margin: 0 0 4px; font-size: 20px; }
.when, .profile .when { color: var(--leaf); font-size: 14px; font-weight: 600; margin: 0 0 8px; }
.profile p:last-child { margin: 0; }
.entry { margin: 0 0 24px; }
.entry h3 { margin: 18px 0 6px; font-size: 19px; color: var(--leaf); font-family: var(--sans); font-weight: 600; letter-spacing: 0; }
dl { display: grid; grid-template-columns: minmax(120px, 200px) 1fr; gap: 8px 20px; }
dt { font-weight: 600; }
dd { margin: 0; color: var(--ink); }

/* tables */
.table-wrap { overflow-x: auto; margin: 24px 0; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
table.data th { text-align: left; font-weight: 600; background: var(--tint); }
table.data th, table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.credits td:first-child { width: 76px; }
table.credits img { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; aspect-ratio: auto; }

/* prev / next and footer */
.prevnext { display: flex; justify-content: space-between; gap: 16px; margin: 56px 0 0; padding-top: 24px; border-top: 1px solid var(--line); max-width: var(--measure); }
.prevnext a { text-decoration: none; color: var(--ink); font: 600 20px/1.3 var(--serif); }
.prevnext small { display: block; font: 13px var(--sans); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.prevnext .next { text-align: right; }
.bottom { border-top: 1px solid var(--line); background: var(--tint); padding: 36px max(16px, calc((100% - 1160px) / 2)) 28px; color: var(--muted); font-size: 14px; }
.sitemap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-bottom: 24px; }
.sitemap h4 { font-size: 16px; color: var(--ink); margin: 0 0 8px; }
.sitemap a { display: block; color: var(--muted); text-decoration: none; padding: 3px 0; }
.sitemap a:hover { color: var(--accent); }

/* home */
.page-index .page-title { margin-top: 44px; }

@media (max-width: 900px) {
  .menu-btn { display: flex; flex-direction: column; justify-content: center; gap: 5px; width: 40px; height: 40px; cursor: pointer; padding: 8px; }
  .menu-btn span { display: block; height: 2px; background: var(--ink); border-radius: 2px; }
  .main-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; max-height: calc(100vh - 64px); overflow-y: auto; }
  .menu-toggle:checked ~ .main-nav { display: flex; }
  .main-nav > a, .dd > button { padding: 10px 4px; text-align: left; width: 100%; }
  .dd > button::after { display: none; }
  .dd > button { font-weight: 600; color: var(--ink); cursor: default; }
  .dd-menu { display: block; position: static; box-shadow: none; border: 0; padding: 0 0 6px 12px; min-width: 0; background: none; }
  .main-nav > a[aria-current="page"], .dd.active > button { box-shadow: none; color: var(--accent); }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .split { grid-template-columns: 1fr; gap: 16px; }
  .split.reverse > figure { order: 0; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .gallery figure:nth-child(3) { display: none; }
  figure.wide img { aspect-ratio: 3 / 2; }
  .sitemap { grid-template-columns: 1fr 1fr; }
  dl { grid-template-columns: 1fr; gap: 2px; }
  dd { margin-bottom: 10px; }
}
