*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #111111;
  --text: #f0f0f0;
  --muted: #888888;
  --link: #f0f0f0;
  --link-hover: #ffffff;
  --accent: #7c3aed;
  --border: #222222;
  --max-width: 680px;
}

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--link-hover); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Header ── */
header {
  padding: 40px 0 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}

.site-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.site-desc {
  margin-top: 4px;
  font-size: 0.88rem;
  color: var(--muted);
}

/* ── Post list (index page) ── */
.post-list { list-style: none; }

.post-list li {
  display: flex;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}

.post-list li:last-child { border-bottom: none; }

.post-date {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
  min-width: 80px;
  flex-shrink: 0;
  padding-top: 2px;
}

.post-title {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.45;
  transition: color 0.15s;
}

.post-list li a:hover .post-title { color: var(--link-hover); }

/* ── Article page ── */
.article-header {
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.article-date {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.article-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
  color: var(--text);
}

.article-excerpt {
  margin-top: 12px;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.55;
}

.article-content {
  font-size: 0.95rem;
  line-height: 1.75;
  color: #d4d4d4;
}

.article-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 32px 0 12px;
  letter-spacing: -0.02em;
}

.article-content h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin: 24px 0 8px;
}

.article-content p { margin-bottom: 18px; }

.article-content ul, .article-content ol {
  margin: 0 0 18px 20px;
}

.article-content li { margin-bottom: 6px; }

.article-content strong { color: var(--text); }

.article-content code {
  background: #1a1a1a;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.87em;
  color: #a78bfa;
}

.article-content pre {
  background: #1a1a1a;
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 18px;
  border: 1px solid var(--border);
}

.article-content pre code {
  background: none;
  padding: 0;
  font-size: 0.87rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 40px;
  transition: color 0.15s;
}

.back-link:hover { color: var(--text); }

/* ── Footer ── */
footer {
  margin-top: 64px;
  padding: 32px 0;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--muted);
}

/* ── Tags ── */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tag {
  font-size: 0.75rem;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 4px;
}

/* ── Read time ── */
.read-meta {
  display: flex;
  gap: 16px;
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 8px;
}

@media (max-width: 640px) {
  .article-title { font-size: 1.4rem; }
  .post-list li { flex-direction: column; gap: 2px; }
  .post-date { min-width: unset; }
}