:root {
  color-scheme: light dark;
  --paper: #fbfaf6;
  --ink: #1d1b18;
  --muted: #66615a;
  --rule: #d4d2ca;
  --link: #0b6470;
  --quote: #eef4f1;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
}
* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); }
body { margin: 0; }
a { color: var(--link); text-underline-offset: 0.16em; }
.site-header, .site-footer { border-color: var(--rule); }
.site-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid var(--rule);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.brand { font-weight: 750; text-decoration: none; color: inherit; }
.header-links { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.95rem; }
main { width: min(760px, calc(100% - 36px)); margin: 0 auto; padding: 44px 0 58px; }
.home { width: min(920px, calc(100% - 36px)); }
h1 { margin: 0 0 18px; font-size: clamp(2.55rem, 8vw, 5.3rem); line-height: 0.95; letter-spacing: 0; }
.chapter h1 { font-size: clamp(2.25rem, 7vw, 4.2rem); }
p { font-size: 1.13rem; line-height: 1.68; margin: 0 0 1.05em; }
.meta, .kicker, .chapter-nav, .toc-label { font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.meta, .kicker { color: var(--muted); }
.kicker { text-transform: uppercase; letter-spacing: 0; font-size: 0.78rem; font-weight: 700; margin-bottom: 12px; }
.hero { padding-bottom: 28px; border-bottom: 1px solid var(--rule); margin-bottom: 26px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.button { display: inline-block; border: 1px solid currentColor; border-radius: 6px; padding: 11px 15px; color: inherit; text-decoration: none; font-weight: 700; font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.button:hover { background: rgba(11, 100, 112, 0.08); }
.toc { list-style: none; padding: 0; margin: 24px 0 0; border-top: 1px solid var(--rule); }
.toc li { border-bottom: 1px solid var(--rule); }
.toc a { display: grid; grid-template-columns: 4.5ch 1fr auto; gap: 12px; align-items: baseline; padding: 12px 0; text-decoration: none; color: inherit; }
.toc a:hover .toc-title { text-decoration: underline; text-underline-offset: 0.16em; }
.toc-number, .toc-label { color: var(--muted); font-size: 0.92rem; }
.toc-title { font-size: 1.08rem; }
.chapter-nav { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 12px 0; margin: 0 0 34px; }
.chapter-nav.bottom { margin: 42px 0 0; }
.chapter-nav a { text-decoration: none; }
.chapter-nav a:hover { text-decoration: underline; text-underline-offset: 0.16em; }
.chapter-nav .disabled { color: var(--muted); }
.prose { margin-top: 28px; }
blockquote { margin: 26px 0; padding: 18px 20px; background: var(--quote); border-left: 4px solid #2b7a78; }
blockquote p { margin-bottom: 0.7em; }
blockquote p:last-child { margin-bottom: 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; font-size: 0.92em; }
.site-footer { border-top: 1px solid var(--rule); padding: 20px clamp(18px, 4vw, 48px); color: var(--muted); font-size: 0.92rem; font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
@media (max-width: 620px) {
  .site-header { align-items: flex-start; flex-direction: column; }
  .toc a { grid-template-columns: 4ch 1fr; }
  .toc-label { grid-column: 2; }
  .chapter-nav { font-size: 0.94rem; }
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #171713; --ink: #f3f0e8; --muted: #b9b3a8; --rule: #48483f; --link: #8bd7d2; --quote: #1d2825; }
  .button:hover { background: rgba(139, 215, 210, 0.12); }
}
