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

:root {
  --bg: #ffffff;
  --text: #111111;
  --muted: #666666;
  --border: #e5e5e5;
  --tag-bg: #f0f0f0;
  --accent: #0066cc;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

html { font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 64px 24px 96px;
}

/* ── Homepage header ── */
.site-header {
  margin-bottom: 60px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.site-title {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.site-description {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.social-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.15s;
}
.social-links a:hover { color: var(--text); }

/* ── Section title ── */
.section-title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}

/* ── Filters ── */
.filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.filter-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s;
}
.filter-btn:hover {
  border-color: var(--text);
  color: var(--text);
}
.filter-btn.active {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

/* ── Search ── */
.search-wrap {
  margin-bottom: 16px;
}

.search-input {
  width: 100%;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font);
  font-size: 0.88rem;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color 0.15s;
}
.search-input::placeholder { color: var(--muted); }
.search-input:focus { border-color: #aaa; }

/* ── Post list ── */
.posts-list {
  display: flex;
  flex-direction: column;
}

.post-item {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 11px 0;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--border);
  transition: opacity 0.15s;
}
.post-item:first-child { border-top: 1px solid var(--border); }
.post-item:hover { opacity: 0.7; }

.post-date {
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 88px;
}

.post-title {
  flex: 1;
  font-size: 0.92rem;
}

.post-tag {
  font-size: 0.68rem;
  background: var(--tag-bg);
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

/* ── Post page ── */
.back-link {
  display: inline-block;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  margin-bottom: 36px;
  transition: color 0.15s;
}
.back-link:hover { color: var(--text); }

.post-header {
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.post-header .post-title {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 14px;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

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

.tag {
  font-size: 0.68rem;
  background: var(--tag-bg);
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 20px;
}

/* ── Post content ── */
.post-content {
  font-size: 0.93rem;
  line-height: 1.85;
}

.post-content h1,
.post-content h2,
.post-content h3 {
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 2.2em 0 0.6em;
}
.post-content h1 { font-size: 1.35rem; }
.post-content h2 { font-size: 1.15rem; }
.post-content h3 { font-size: 1rem; }

.post-content p { margin-bottom: 1.2em; }

.post-content ul,
.post-content ol {
  margin: 0 0 1.2em 1.4em;
}
.post-content li { margin-bottom: 0.3em; }

.post-content code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--tag-bg);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

.post-content pre {
  background: #f8f8f8;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 18px;
  overflow-x: auto;
  margin-bottom: 1.4em;
}
.post-content pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
}

.post-content blockquote {
  border-left: 3px solid var(--border);
  padding-left: 16px;
  color: var(--muted);
  margin: 0 0 1.2em;
}

.post-content a {
  color: var(--accent);
  text-decoration: none;
}
.post-content a:hover { text-decoration: underline; }

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 8px 0;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.2em;
  font-size: 0.9em;
}
.post-content th,
.post-content td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
}
.post-content th { background: var(--tag-bg); font-weight: 600; }

/* ── Misc ── */
.empty-state {
  color: var(--muted);
  font-size: 0.88rem;
  padding: 16px 0;
}

@media (max-width: 600px) {
  .container { padding: 40px 18px 60px; }
  .post-item { flex-wrap: wrap; gap: 6px; }
  .post-date { min-width: auto; }
}
