:root {
  --bg: #fdfcfa;
  --fg: #1c1b1a;
  --muted: #6b6862;
  --accent: #2a5db0;
  --rule: #e4e1db;
  --banner-bg: #fff5d6;
  --banner-fg: #6b5300;
  --code-bg: #f2f0ec;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181c;
    --fg: #d8d5cf;
    --muted: #8f8c85;
    --accent: #7aa5e8;
    --rule: #2c2f35;
    --banner-bg: #2e2812;
    --banner-fg: #d8bc5e;
    --code-bg: #20232a;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.075rem;
  line-height: 1.65;
}

header, main, footer {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

header { padding-top: 1.5rem; }

nav {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.75rem;
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 0.9rem;
}

.site-name {
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 1.25rem;
}

.nav-links a:hover { color: var(--accent); }

main { padding-top: 1.5rem; padding-bottom: 3rem; }

h1, h2, h3 {
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.25;
}

h1 { font-size: 1.7rem; margin-top: 0.5rem; }
h2 { font-size: 1.25rem; margin-top: 2.2rem; }

a { color: var(--accent); }

.draft-banner {
  background: var(--banner-bg);
  color: var(--banner-fg);
  border-radius: 4px;
  padding: 0.5rem 0.9rem;
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 0.85rem;
}

.dateline {
  color: var(--muted);
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 0.85rem;
  margin-bottom: 0;
}

blockquote {
  margin: 1.5rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--rule);
  color: var(--muted);
}

code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
}

pre code { background: none; padding: 0; }

table {
  border-collapse: collapse;
  font-size: 0.92rem;
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

th, td {
  border: 1px solid var(--rule);
  padding: 0.4rem 0.7rem;
  text-align: left;
}

hr { border: none; border-top: 1px solid var(--rule); margin: 2.5rem 0; }

footer {
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
  padding-bottom: 2.5rem;
  color: var(--muted);
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 0.8rem;
}

.site-name { display: inline-flex; align-items: center; gap: 0.5rem; }
.site-name .mark { width: 1.15rem; height: 1.15rem; flex: none; }

figure.fig {
  margin: 2rem 0;
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}
figure.fig svg { display: block; width: 100%; height: auto; }
figure.fig figcaption {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 0.5rem;
}

/* Auto-generated Essays index (/essays/) and receipt dataset lists */
.index-count { color: var(--muted); font-size: 0.95rem; margin-top: -0.25rem; }
ul.essay-index { list-style: none; padding-left: 0; }
ul.essay-index li {
  padding: 0.7rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--muted) 25%, transparent);
}
ul.essay-index li a { font-weight: 600; text-decoration: none; }
ul.essay-index li a:hover { text-decoration: underline; }
ul.essay-index time {
  display: inline-block;
  margin-left: 0.6rem;
  color: var(--muted);
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 0.8rem;
}
.essay-index-summary {
  display: block;
  color: var(--muted);
  font-size: 0.96rem;
  margin-top: 0.2rem;
}
