:root {
  --bg: #faf8f3;
  --fg: #1a1a1a;
  --muted: #6b6b6b;
  --rule: #e5e0d4;
  --accent: #b85c38;
  --accent-hover: #8f4528;
  --max: 36rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14130f;
    --fg: #ebe7dc;
    --muted: #8a877e;
    --rule: #2a2823;
    --accent: #e8825b;
    --accent-hover: #f3a17e;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: ui-serif, Georgia, "Iowan Old Style", "Apple Garamond", "Times New Roman", serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main, header, footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

header {
  padding-top: 4rem;
  padding-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

header .brand {
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--fg);
  text-decoration: none;
}

header nav {
  display: flex;
  gap: 1.5rem;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 0.95rem;
}

header nav a {
  color: var(--muted);
  text-decoration: none;
}

header nav a:hover,
header nav a[aria-current="page"] {
  color: var(--fg);
}

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

h1 {
  font-size: 2.2rem;
  line-height: 1.15;
  margin: 1rem 0 1.5rem;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.35rem;
  line-height: 1.25;
  margin: 2.5rem 0 0.75rem;
  letter-spacing: -0.005em;
}

h3 {
  font-size: 1.1rem;
  margin: 2rem 0 0.5rem;
}

p { margin: 0 0 1.1rem; }

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

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

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

.lede {
  font-size: 1.15rem;
  color: var(--fg);
}

.muted {
  color: var(--muted);
}

ul.posts {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
}

ul.posts li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: baseline;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--rule);
}

ul.posts li time {
  flex: 0 0 6rem;
  color: var(--muted);
  font-family: ui-sans-serif, -apple-system, system-ui, sans-serif;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

ul.posts li a {
  text-decoration: none;
  color: var(--fg);
  font-weight: 500;
}

ul.posts li a:hover { color: var(--accent); }

article header {
  display: block;
  padding: 0;
  margin-bottom: 2rem;
}

article time {
  font-family: ui-sans-serif, -apple-system, system-ui, sans-serif;
  font-size: 0.9rem;
  color: var(--muted);
}

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

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

pre {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 0.9rem;
  line-height: 1.55;
  background: var(--rule);
  padding: 1rem 1.25rem;
  border-radius: 6px;
  overflow-x: auto;
}

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

footer {
  padding-bottom: 3rem;
  font-family: ui-sans-serif, -apple-system, system-ui, sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
  border-top: 1px solid var(--rule);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

footer a { color: var(--muted); }
footer a:hover { color: var(--fg); }
