:root {
  --bg: #faf9f5;
  --surface: #f0eee6;
  --text: #1f1e1d;
  --muted: #6b6a65;
  --line: #e3e0d6;
  --accent: #c96442;
  --accent-soft: #f3e3da;
  --code-bg: #f0eee6;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #262624; --surface: #30302e; --text: #f2f0e8; --muted: #a8a59b;
    --line: #3d3d3a; --accent: #e08a68; --accent-soft: #3d2f28; --code-bg: #1f1e1d;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #262624; --surface: #30302e; --text: #f2f0e8; --muted: #a8a59b;
  --line: #3d3d3a; --accent: #e08a68; --accent-soft: #3d2f28; --code-bg: #1f1e1d;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}
a { color: inherit; }
::selection { background: var(--accent-soft); }

.site-header, main, .site-footer { max-width: 720px; margin: 0 auto; padding: 0 24px; }
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 28px; padding-bottom: 28px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 17px var(--serif); text-decoration: none; letter-spacing: -0.01em;
}
.mark {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff; font: 500 15px var(--serif);
}
nav { display: flex; align-items: center; gap: 22px; font-size: 15px; }
nav a { text-decoration: none; color: var(--muted); transition: color .15s; }
nav a:hover { color: var(--text); }
.theme-toggle {
  display: grid; place-items: center; width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%; background: transparent;
  color: var(--muted); cursor: pointer; transition: color .15s, border-color .15s;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

.hero { padding: 56px 0 40px; }
.eyebrow {
  margin: 0 0 14px; color: var(--accent); font-size: 13px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
}
.hero h1 {
  margin: 0; font: 400 clamp(32px, 5.5vw, 46px)/1.15 var(--serif);
  letter-spacing: -0.02em; text-wrap: balance;
}

.post-list { list-style: none; margin: 0 0 64px; padding: 0; border-top: 1px solid var(--line); }
.post-item a {
  display: block; padding: 30px 0; border-bottom: 1px solid var(--line);
  text-decoration: none; transition: padding-left .2s ease;
}
.post-item a:hover { padding-left: 10px; }
.post-item a:hover h2 { color: var(--accent); }
.post-item h2 { margin: 6px 0 8px; font: 500 25px/1.3 var(--serif); letter-spacing: -0.01em; transition: color .15s; }
.post-item p { margin: 0; color: var(--muted); font-size: 16px; }
.post-meta { display: flex; gap: 8px; color: var(--muted); font-size: 13.5px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tag {
  padding: 2px 10px; border-radius: 999px; background: var(--surface);
  color: var(--muted); font-size: 12.5px;
}
.empty { padding: 40px 0; color: var(--muted); }

.post { padding: 40px 0 64px; }
.post > header { margin-bottom: 40px; }
.post h1 {
  margin: 10px 0 0; font: 500 clamp(32px, 5.5vw, 44px)/1.15 var(--serif);
  letter-spacing: -0.02em; text-wrap: balance;
}
.lede { margin: 18px 0 0; color: var(--muted); font: 400 21px/1.5 var(--serif); }

.prose { font: 400 19px/1.75 var(--serif); }
.prose > * + * { margin-top: 1.2em; }
.prose p { margin-bottom: 0; }
.prose h2, .prose h3 { font-family: var(--serif); font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; margin-top: 2em; }
.prose h2 { font-size: 27px; }
.prose h3 { font-size: 22px; }
.prose a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose blockquote {
  margin-left: 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--accent);
  color: var(--muted); font-style: italic;
}
.prose code { font: 0.84em var(--mono); background: var(--code-bg); padding: 2px 6px; border-radius: 5px; }
.prose pre {
  overflow-x: auto; padding: 20px 22px; border-radius: 12px;
  background: var(--code-bg); border: 1px solid var(--line); line-height: 1.6;
}
.prose pre code { padding: 0; background: none; font-size: 14.5px; }
.prose img { max-width: 100%; border-radius: 12px; }
.prose hr { border: 0; text-align: center; margin: 2.5em 0; }
.prose hr::after { content: "· · ·"; color: var(--muted); letter-spacing: .5em; }
.prose table { width: 100%; border-collapse: collapse; font: 15px var(--sans); }
.prose th, .prose td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .35em; }
.prose li::marker { color: var(--accent); }

.post-footer {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line);
}
.post-footer .tags { margin: 0; }
.back { color: var(--muted); font-size: 15px; text-decoration: none; }
.back:hover { color: var(--accent); }

.site-footer {
  display: flex; justify-content: space-between; padding-top: 28px; padding-bottom: 40px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: 14px;
}
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .site-header, main, .site-footer { padding-left: 16px; padding-right: 16px; }
  nav { gap: 14px; }
  .prose { font-size: 18px; }
  .post-item a:hover { padding-left: 0; }
}
