:root {
  --bg: #fbfaf7;
  --fg: #1d1d1b;
  --muted: #6b6a65;
  --rule: #e4e1d8;
  --accent: #2f5d8a;
  --code-bg: #f1eee6;
  --max: 42rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413;
    --fg: #e8e6df;
    --muted: #9b998f;
    --rule: #2c2b28;
    --accent: #8fb6dc;
    --code-bg: #1f1e1c;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.65 ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem 1rem 4rem;
}

header.site {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 3rem;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.95rem;
}

header.site a { color: var(--fg); text-decoration: none; font-weight: 600; }
header.site nav a { color: var(--muted); font-weight: 400; margin-left: 1rem; }
header.site nav a:hover { color: var(--accent); }

h1, h2, h3 {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

h1 { font-size: 2rem; margin: 0 0 0.5rem; }
h2 { font-size: 1.3rem; margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1.05rem; margin: 1.75rem 0 0.5rem; }

.meta {
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

a { color: var(--accent); text-underline-offset: 2px; }

p, ul, ol { margin: 0 0 1.1rem; }
li { margin-bottom: 0.35rem; }

code {
  font: 0.88em/1.4 ui-monospace, "SFMono-Regular", Consolas, monospace;
  background: var(--code-bg);
  padding: 0.1em 0.3em;
  border-radius: 4px;
}

pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
}

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

.table-scroll { overflow-x: auto; margin: 0 0 1.25rem; }

table {
  border-collapse: collapse;
  width: 100%;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.9rem;
}

th, td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--rule); }
th { font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

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

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

.posts { list-style: none; padding: 0; }
.posts li { margin-bottom: 1.25rem; }
.posts .date {
  display: block;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.85rem;
}

footer.site {
  margin-top: 4rem;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.85rem;
}
