:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #18181b;
  --muted: #52525b;
  --border: #e4e4e7;
  --accent: #1d4ed8;
  --code-bg: #f4f4f5;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #161922;
    --text: #e4e4e7;
    --muted: #a1a1aa;
    --border: #27272a;
    --accent: #60a5fa;
    --code-bg: #1f2330;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 740px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

nav a {
  margin-left: 20px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.94rem;
}

nav a:hover, nav a.active {
  color: var(--text);
}

main {
  padding: 40px 0 64px;
}

.intro {
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.intro h1 {
  margin: 0 0 12px;
  font-size: 1.75rem;
  line-height: 1.3;
  letter-spacing: -0.025em;
}

.intro p {
  margin: 0;
  color: var(--muted);
}

.post-card {
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
}

.post-card:last-child {
  border-bottom: none;
}

.post-card time, .article-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.post-card h2 {
  margin: 6px 0 8px;
  font-size: 1.25rem;
  line-height: 1.35;
}

.post-card h2 a {
  color: var(--text);
  text-decoration: none;
}

.post-card h2 a:hover {
  color: var(--accent);
}

.post-card p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.96rem;
}

.tags span {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 8px;
  margin-right: 6px;
}

article.prose h1 {
  font-size: 1.75rem;
  line-height: 1.3;
  margin: 8px 0 18px;
}

article.prose h2 {
  font-size: 1.2rem;
  margin: 28px 0 10px;
}

article.prose pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.5;
}

article.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: var(--code-bg);
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 0.88em;
}

article.prose pre code {
  background: none;
  padding: 0;
}

.back-link {
  display: inline-block;
  margin-top: 28px;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.94rem;
}

.back-link:hover {
  text-decoration: underline;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  color: var(--muted);
  font-size: 0.86rem;
}
