:root {
  --bg: #faf8f4;
  --surface: #f1ede5;
  --text: #22201c;
  --muted: #6b665d;
  --rule: #e2ddd2;
  --accent: #b4532a;
  --accent-ink: #ffffff;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --measure: 40rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171614;
    --surface: #211f1c;
    --text: #ebe7df;
    --muted: #a39d92;
    --rule: #33302b;
    --accent: #e08a5e;
    --accent-ink: #171614;
  }
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

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

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Header & footer */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem;
  align-items: center; justify-content: space-between;
  padding-top: 1.25rem; padding-bottom: 1.25rem;
  font-family: var(--sans); font-size: 0.95rem;
}
.brand { display: flex; align-items: center; gap: 0.5rem; color: var(--text); text-decoration: none; font-weight: 600; }
.brand-mark { color: var(--accent); font-size: 1.25rem; line-height: 1; }
.site-header nav { display: flex; gap: 1.25rem; }
.site-header nav a { color: var(--muted); text-decoration: none; }
.site-header nav a:hover { color: var(--text); }

.site-footer { border-top: 1px solid var(--rule); margin-top: 4rem; }
.site-footer p { font-family: var(--sans); font-size: 0.85rem; color: var(--muted); margin: 1.5rem 0 2.5rem; }
.site-footer a { color: inherit; }

main { padding-top: 3rem; }

/* Home */
.hero { margin-bottom: 3.5rem; }
.hero h1 { font-size: clamp(2rem, 6vw, 2.75rem); line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 1rem; font-weight: 600; }
.lede { color: var(--muted); font-size: 1.2rem; margin: 0; }
.lede p { margin: 0; }

.section-label, .comments h2 {
  font-family: var(--sans); font-size: 0.8rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
  margin: 0 0 1rem;
}
.page-title { font-size: 2rem; margin: 0 0 2rem; }

/* Post list */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-item { border-top: 1px solid var(--rule); }
.post-item:last-child { border-bottom: 1px solid var(--rule); }
.post-item a { display: block; padding: 1.25rem 0; color: inherit; text-decoration: none; }
.post-item h3 { margin: 0 0 0.25rem; font-size: 1.3rem; line-height: 1.3; }
.post-item a:hover h3 { color: var(--accent); }
.post-item p { margin: 0 0 0.4rem; color: var(--muted); }
.post-item time, .post-meta { font-family: var(--sans); font-size: 0.85rem; color: var(--muted); }
.more { font-family: var(--sans); font-size: 0.95rem; }
.empty { color: var(--muted); font-style: italic; }
.pagination { display: flex; justify-content: space-between; margin-top: 2rem; font-family: var(--sans); font-size: 0.95rem; }

/* Article */
.post header { margin-bottom: 2rem; }
.post h1 { font-size: clamp(1.9rem, 5.5vw, 2.5rem); line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 0.5rem; }
.post-meta { margin: 0; }
.prose h2 { font-size: 1.5rem; margin: 2.5rem 0 0.75rem; line-height: 1.25; }
.prose h3 { font-size: 1.25rem; margin: 2rem 0 0.5rem; }
.prose img { max-width: 100%; height: auto; border-radius: 4px; }
.prose blockquote { margin: 1.5rem 0; padding: 0 0 0 1.25rem; border-left: 3px solid var(--accent); color: var(--muted); font-style: italic; }
.prose hr { border: 0; text-align: center; margin: 2.5rem 0; }
.prose hr::after { content: "◐  ◐  ◐"; color: var(--muted); letter-spacing: 0.5em; }
.prose code { font-size: 0.9em; background: var(--surface); padding: 0.1em 0.3em; border-radius: 3px; }
.prose pre { background: var(--surface); padding: 1rem; overflow-x: auto; border-radius: 4px; font-size: 0.85rem; }
.prose pre code { background: none; padding: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 0.75rem; font-family: var(--sans); font-size: 0.9rem; margin-top: 2.5rem; }

.comments { margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid var(--rule); }

/* Subscribe */
.subscribe { background: var(--surface); margin-top: 4rem; padding: 2.5rem 0; }
.subscribe h2 { margin: 0 0 0.25rem; font-size: 1.4rem; }
.subscribe p { margin: 0 0 1.25rem; color: var(--muted); }
.subscribe-form { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.subscribe-form input[type="email"] {
  flex: 1 1 14rem; min-width: 0; padding: 0.7rem 0.9rem;
  font: inherit; font-family: var(--sans); font-size: 1rem;
  color: var(--text); background: var(--bg);
  border: 1px solid var(--rule); border-radius: 4px;
}
.subscribe-form input[type="email"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.subscribe-form button {
  padding: 0.7rem 1.25rem; font-family: var(--sans); font-size: 1rem; font-weight: 600;
  color: var(--accent-ink); background: var(--accent);
  border: 0; border-radius: 4px; cursor: pointer;
}
.subscribe-form button:hover { filter: brightness(1.08); }
.subscribe + .site-footer { margin-top: 0; }
