/* homedistiller.net: one small stylesheet, no web fonts.
   Look: a printed reference book / almanac. Ink on parchment (light), brass on near-black (dark). */
:root {
  --bg: #f4eee1;
  --surface: #faf6ec;
  --text: #2a2119;
  --muted: #6d5f4c;
  --line: #d6c9ae;
  --accent: #8a3a1c;        /* oxblood ink */
  --accent-soft: #ecdfc6;
  --status-bg: #f9f1dd;
  --status-line: #b38e52;
  --code-bg: #ece3cf;
  --max: 42rem;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --text-serif: Charter, "Bitstream Charter", "Iowan Old Style", Georgia, Cambria, serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12100d;
    --surface: #1a1713;
    --text: #e7ddc9;
    --muted: #a99d87;
    --line: #3b342a;
    --accent: #d4a557;      /* brass */
    --accent-soft: #2a2218;
    --status-bg: #1b1813;
    --status-line: #8b6c37;
    --code-bg: #241f19;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1.0625rem/1.7 var(--text-serif);
}
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: var(--surface); padding: 6px 10px; z-index: 9; }

/* masthead */
.masthead { text-align: center; }
.masthead .wrap { padding-top: 14px; padding-bottom: 6px; }
.dateline {
  display: flex; justify-content: space-between; gap: 12px;
  font: 0.72rem/1.4 var(--serif); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-bottom: 14px;
}
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  color: var(--text); text-decoration: none;
  font: 600 2.3rem/1.1 var(--serif); letter-spacing: 0.01em;
}
.brand:hover { color: var(--text); }
.brand svg { width: 58px; height: 44px; color: var(--accent); flex: none; }
.brand .tld { color: var(--muted); font-weight: 400; }
.tagline { margin: 6px 0 12px; font: italic 1rem/1.4 var(--serif); color: var(--muted); }
.site-nav { border-top: 3px double var(--line); border-bottom: 1px solid var(--line); }
.site-nav .wrap {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 22px;
  padding-top: 6px; padding-bottom: 6px;
}
.site-nav a {
  font: 0.86rem/1.5 var(--serif); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text); text-decoration: none; padding: 2px 0;
}
.site-nav a:hover { color: var(--accent); }
.site-nav a[aria-current="page"] { color: var(--accent); }

/* typography */
main { padding-top: 10px; padding-bottom: 48px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; }
h1 { font-size: 2.1rem; margin: 30px 0 6px; text-align: center; }
h2 {
  font-size: 1.12rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  margin: 44px 0 12px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--text);
}
h3 { font-size: 1.12rem; margin: 26px 0 4px; font-style: italic; font-weight: 600; }
h3 a { text-decoration: none; }
h3 a:hover { text-decoration: underline; }
p { margin: 0 0 1em; hyphens: auto; }
.lede {
  font: italic 1.18rem/1.6 var(--serif); color: var(--muted);
  text-align: center; max-width: 36rem; margin: 6px auto 22px;
}
/* a large initial on the first paragraph of the first section */
main > h2:first-of-type + p::first-letter {
  float: left; font: 600 3.3em/0.85 var(--serif); color: var(--accent); padding: 0.06em 0.08em 0 0;
}
blockquote {
  margin: 18px 0; padding: 2px 0 2px 18px; border-left: 3px double var(--accent);
  font-style: italic;
}
blockquote p { margin: 6px 0; }
small, .small { font-size: 0.9rem; color: var(--muted); }
sup.cite { font: 0.68rem/1 var(--serif); margin-left: 1px; white-space: nowrap; }
sup.cite a { text-decoration: none; }
code { background: var(--code-bg); padding: 1px 5px; font-size: 0.9em; }
ul, ol { padding-left: 1.3em; }
li { margin: 0.25em 0; }

/* notices: like a printed notice in a ledger, not an app card */
.status {
  margin: 24px 0; padding: 12px 18px 10px;
  background: var(--status-bg);
  border-top: 3px double var(--status-line); border-bottom: 1px solid var(--status-line);
}
.status h2, .status h3 {
  margin: 0 0 6px; padding: 0; border: 0;
  font-size: 0.82rem; letter-spacing: 0.16em; color: var(--accent);
}
.status ul { margin: 6px 0 4px; padding-left: 18px; }
.status li { margin: 5px 0; }
.answer {
  margin: 20px 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--accent);
  font-size: 1.05rem;
}
.answer p { margin: 4px 0; }
.read-more {
  font-size: 0.95rem; font-style: italic; color: var(--muted);
  padding-left: 18px; border-left: 1px solid var(--line);
}
.read-more strong { font-style: normal; font-variant: small-caps; letter-spacing: 0.05em; color: var(--text); }
.disclosure { font-size: 0.82rem; color: var(--muted); font-style: italic; text-align: center; }

/* plates: historical pictures with captions */
figure.plate { margin: 28px 0; }
figure.plate img {
  display: block; margin: 0 auto; max-width: 100%; height: auto;
  border: 1px solid var(--line); padding: 5px; background: var(--surface);
}
figure.plate figcaption { font: italic 0.88rem/1.5 var(--serif); color: var(--muted); margin: 8px 4px 0; }
figure.plate .credit { font-style: normal; font-size: 0.78rem; letter-spacing: 0.02em; }
figure.plate.right { float: right; width: 40%; margin: 6px 0 16px 24px; }
h2 { clear: both; }
@media (prefers-color-scheme: dark) { figure.plate img { filter: brightness(0.9); } }

/* home page contents, like a book's table of contents */
.toc { list-style: upper-roman; padding-left: 2.4em; margin: 18px 0 8px; }
.toc li { margin: 0 0 14px; padding-left: 6px; }
.toc li::marker { font-family: var(--serif); color: var(--accent); }
.toc a { font: 600 1.15rem/1.3 var(--serif); text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.toc span { display: block; color: var(--muted); font-size: 0.97rem; }

/* old card grid (kept for any page that still uses it) */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 18px 0; }
.card { border-top: 1px solid var(--line); padding: 10px 0; text-decoration: none; color: var(--text); display: block; }
.card h3 { margin: 0 0 4px; color: var(--accent); }
.card p { margin: 0; font-size: 0.97rem; color: var(--muted); }

/* timeline */
.timeline { list-style: none; padding: 0; margin: 16px 0; }
.timeline li { position: relative; padding: 0 0 16px 5.2rem; }
.timeline li::before { content: ""; position: absolute; left: 4.55rem; top: 0.4em; bottom: 0.6em; border-left: 1px solid var(--line); }
.timeline .when {
  position: absolute; left: 0; top: 0; width: 4rem; text-align: right;
  font: 600 1rem/1.7 var(--serif); color: var(--accent);
}

/* tables */
.table-wrap { overflow-x: auto; margin: 14px 0; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
thead th { border-top: 2px solid var(--text); border-bottom: 1px solid var(--text); }
tbody tr:last-child td { border-bottom: 2px solid var(--text); }
th, td { text-align: left; vertical-align: top; padding: 7px 10px 7px 0; border-bottom: 1px solid var(--line); }
th { font: 600 0.78rem/1.4 var(--serif); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.dates td:first-child { white-space: nowrap; font-family: var(--serif); }

/* myths and facts */
.myths { margin: 16px 0; }
.myth { padding: 10px 0; border-bottom: 1px solid var(--line); }
.myth p { margin: 3px 0; }
.myth .m { font-style: italic; }
.myth .m::before { content: "Myth. "; font-style: normal; font-variant: small-caps; letter-spacing: 0.06em; color: var(--muted); }
.myth .f::before { content: "Fact. "; font-variant: small-caps; letter-spacing: 0.06em; font-weight: 600; color: var(--accent); }

/* sources, set like endnotes */
.sources { margin-top: 52px; font-size: 0.88rem; line-height: 1.55; }
.sources h2 { font-size: 0.9rem; }
.sources ol { padding-left: 2em; }
.sources li { margin: 5px 0; overflow-wrap: anywhere; }
.sources li::marker { color: var(--muted); }
.sources li:target { background: var(--accent-soft); }
.src-who, .src-note { color: var(--muted); font-style: italic; }

/* placeholders (only in --drafts builds) */
.placeholder { border: 1px dashed var(--status-line); padding: 10px 16px; margin: 18px 0; }
.placeholder-label { font: 0.82rem/1.3 var(--serif); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin: 4px 0 8px; }

/* footer */
.site-footer {
  border-top: 3px double var(--line); text-align: center;
  font-size: 0.88rem; color: var(--muted);
}
.site-footer .wrap { padding-top: 18px; padding-bottom: 30px; }
.site-footer p { margin: 8px 0; }
.site-footer .fleuron { font-size: 1.1rem; color: var(--accent); margin: 0 0 6px; }

@media (max-width: 560px) {
  body { font-size: 1rem; }
  figure.plate.right { float: none; width: auto; margin: 22px 0; }
  figure.plate.right img { max-width: 70%; }
  .brand { font-size: 1.75rem; gap: 9px; }
  .brand svg { width: 44px; height: 33px; }
  .dateline { font-size: 0.66rem; letter-spacing: 0.1em; }
  h1 { font-size: 1.7rem; }
  .lede { font-size: 1.06rem; }
  .site-nav .wrap { gap: 2px 16px; }
  .site-nav a { font-size: 0.8rem; }
  .timeline li { padding-left: 4.3rem; }
  .timeline li::before { left: 3.75rem; }
  .timeline .when { width: 3.3rem; }
}
@media print {
  .site-nav, .skip { display: none; }
  a { color: inherit; }
}
