/* The Founder's Almanack: warm paper, system serif, one quiet column. No external fonts, no tracking. */
:root {
  --bg: #f6f1e7;
  --paper: #fbf8f2;
  --text: #1f1a16;
  --soft: #3d352e;
  --muted: #7d7166;
  --accent: #6b2d1a;
  --accent-2: #8e3f23;
  --gold: #b0893f;
  --rule: #e4dccd;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--serif); font-size: 1.125rem; line-height: 1.7; }
.wrap { max-width: 660px; margin: 0 auto; padding: 3rem 1.5rem 4rem; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .15em; }
a:hover { color: var(--accent-2); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--paper); padding: .4rem .7rem; }

/* Header: name left, three words right */
.site-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .4rem 1.5rem; margin-bottom: 3.5rem; }
.site-title { color: var(--text); text-decoration: none; font-size: 1.15rem; letter-spacing: .01em; }
.site-header nav { display: flex; align-items: baseline; gap: .55rem; font-size: 1rem; }
.site-header nav a { color: var(--muted); text-decoration: none; }
.site-header nav a:hover, .site-header nav a[aria-current] { color: var(--text); }
.site-header .dot { color: var(--rule); }
.site-header nav a.nav-book { color: var(--accent); margin-left: .6rem; }

/* Type */
h1 { font-size: 2rem; font-weight: normal; line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; line-height: 1.35; margin: 2.4em 0 .7em; }
.intro { margin: 0 0 2.5rem; color: var(--soft); }
.label { margin: 0 0 .75rem; font-size: .75rem; font-weight: normal; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }

/* Essays list (home) */
.essays { list-style: none; margin: 0; padding: 0; }
.essays li { display: flex; justify-content: space-between; align-items: baseline; gap: 1.5rem; padding: .42rem 0; }
.essays a { color: var(--text); text-decoration: none; }
.essays a:hover { color: var(--accent); text-decoration: underline; }
.essays time { flex: 0 0 auto; color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Quotes page */
.qotd { margin: 0 0 2.75rem; }
.qotd figure { margin: 0; padding: 1.1rem 1.3rem; background: var(--paper); border: 1px solid var(--rule); border-radius: 3px; }
.qotd blockquote { margin: 0; }
.qotd blockquote p { margin: 0; font-size: 1.15rem; line-height: 1.5; }
.qotd figcaption { margin-top: .6rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .2rem 1rem; font-size: .92rem; }
.qotd .who { color: var(--soft); }
.qotd .from { color: var(--muted); text-decoration: none; font-size: .88rem; }
.qotd .from:hover { color: var(--text); }
.toc ol { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem 1.4rem; font-size: 1rem; }
.toc a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--rule); }
.toc a:hover { color: var(--accent); border-color: currentColor; }
.chapter { scroll-margin-top: 1.5rem; padding-top: 1rem; }
.chapter h2 { font-size: 1.45rem; font-weight: normal; margin: 2.5rem 0 .15rem; }
.chapter h2 .num { color: var(--gold); }
.chapter .tagline { margin: 0 0 2rem; color: var(--muted); font-style: italic; font-size: 1rem; }
.q { margin: 0 0 1.9rem; }
.q blockquote { margin: 0; padding-left: 1.1rem; border-left: 2px solid var(--gold); }
.q blockquote p { margin: 0; font-size: 1.12rem; line-height: 1.6; }
.q figcaption { margin-top: .5rem; padding-left: 1.1rem; font-size: .93rem; line-height: 1.5; }
.q figcaption > span { display: block; }
.q .who { color: var(--soft); }
.q .src { color: var(--muted); }
.q .note { color: var(--muted); font-style: italic; font-size: .86rem; margin-top: .15rem; }
.q .rel { margin-top: .3rem; font-size: .86rem; color: var(--muted); }
.top { margin: 0; font-size: .85rem; }
.top a { color: var(--muted); text-decoration: none; }

/* Prose (About) */
.prose p, .essay p { margin: 0 0 1.15em; }
.prose h2 { font-weight: normal; font-size: 1.3rem; margin-top: 2.2em; }

.photo { margin: 2rem 0 0; }
.photo img { display: block; width: 100%; height: auto; border-radius: 4px; }

/* Essay pages */
.essay h1 { margin-bottom: .3em; }
.essay .byline { color: var(--muted); font-size: .95rem; margin: 0 0 2.25rem; }
.essay .subtitle { margin: 0 0 .35em; font-size: 1.15rem; font-style: italic; line-height: 1.45; color: var(--muted); }
.essay .date { display: block; margin: 0 0 2.25rem; color: var(--muted); font-size: .95rem; }
.essay h2 { scroll-margin-top: 1rem; }
.essay blockquote { margin: 1.5em 0; padding: 0 0 0 1.2em; border-left: 2px solid var(--gold); color: var(--soft); }
.essay blockquote p { margin: 0; font-style: italic; }
.essay blockquote ul { font-style: italic; }
.essay p.signature { margin-top: 2.25em; font-style: italic; }
.essay ol, .essay ul { padding-left: 1.4em; margin: 0 0 1.15em; }
.essay li { margin: 0 0 .55em; }
.essay li strong { font-weight: bold; }
.essay figure { margin: 2rem 0; }
.essay figure img { display: block; max-width: 100%; height: auto; border: 1px solid rgba(0,0,0,.08); border-radius: 3px; background: #fff; }
.essay figcaption { color: var(--muted); font-size: .88rem; font-style: italic; margin-top: .5rem; line-height: 1.45; }
.back { margin: 3rem 0 0; font-size: 1rem; }
.back a { text-decoration: none; }

/* Footer */
footer { margin-top: 4rem; color: var(--muted); font-size: .85rem; }
footer p { margin: 0 0 .3rem; }
footer .tiny { font-size: .78rem; font-style: italic; }

/* Book CTA (only rendered when SHOW_BOOK = True in build.py) */
.book { margin-top: 3.5rem; display: grid; grid-template-columns: 8.5rem 1fr; gap: 1.75rem; align-items: center; background: var(--paper); border: 1px solid var(--rule); border-radius: 4px; padding: 1.6rem; }
.book h2 { margin: 0 0 .4rem; }
.book p { margin: 0 0 .8rem; font-size: 1rem; line-height: 1.6; color: var(--soft); }
.book-cover { aspect-ratio: 2 / 3; background: var(--accent); color: #f3e9d6; border-radius: 2px 5px 5px 2px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: .6rem; }
.bc-top { font-size: .62rem; letter-spacing: .25em; text-transform: uppercase; color: #e0c48a; }
.bc-title { font-size: 1.02rem; line-height: 1.15; margin-top: .2rem; }
.bc-rule { width: 2rem; height: 1px; background: #e0c48a; margin: .55rem 0; }
.bc-author { font-size: .55rem; letter-spacing: .14em; text-transform: uppercase; }
.button { display: inline-block; background: var(--accent); color: #fbf6ec; text-decoration: none; padding: .5rem 1.1rem; border-radius: 3px; }
.book .isbn { font-size: .82rem; color: var(--muted); margin: 0; }

@media (max-width: 640px) {
  body { font-size: 1.0625rem; }
  .wrap { padding: 1.75rem 1.2rem 3rem; }
  .site-header { margin-bottom: 2.25rem; }
  h1 { font-size: 1.75rem; }
  .essays li { flex-direction: column; gap: 0; padding: .5rem 0; }
  .essays time { font-size: .82rem; }
  .q blockquote p { font-size: 1.06rem; }
  .book { grid-template-columns: 5.5rem 1fr; gap: 1.1rem; padding: 1.2rem; }
}
@media print { .site-header nav, .book, .skip, .toc, .qotd, .top { display: none; } }
