:root {
  --bg: #ffffff;
  --bg-soft: #f6f8fa;
  --text: #111827;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --code-bg: #f3f4f6;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d10;
    --bg-soft: #13171d;
    --text: #e5e7eb;
    --text-muted: #9ca3af;
    --border: #1f242d;
    --accent: #60a5fa;
    --accent-soft: rgba(96, 165, 250, 0.12);
    --code-bg: #161b22;
  }
}

:root[data-theme="dark"] {
  --bg: #0b0d10;
  --bg-soft: #13171d;
  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --border: #1f242d;
  --accent: #60a5fa;
  --accent-soft: rgba(96, 165, 250, 0.12);
  --code-bg: #161b22;
}

* {
  box-sizing: border-box;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

header.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
  margin-bottom: 2.5rem;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.brand:hover {
  text-decoration: none;
  color: var(--accent);
}

nav.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.92rem;
}

nav.site-nav a {
  color: var(--text-muted);
}

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

.theme-btn {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 0.25rem 0.55rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.theme-btn:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.intro {
  margin-bottom: 2.25rem;
}

.intro h1 {
  font-size: 1.6rem;
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.02em;
}

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

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}

.filter-pill {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.filter-pill:hover {
  text-decoration: none;
  color: var(--text);
}

.filter-pill.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 500;
}

.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.post-item {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

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

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.83rem;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  margin-bottom: 0.35rem;
}

.badge {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.45rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.post-title {
  margin: 0 0 0.35rem 0;
  font-size: 1.2rem;
  line-height: 1.35;
}

.post-title a {
  color: var(--text);
}

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

.post-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

article.post-full header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

article.post-full h1 {
  font-size: 1.9rem;
  line-height: 1.25;
  letter-spacing: -0.025em;
  margin: 0.5rem 0 0.75rem 0;
}

.github-box {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  padding: 0.35rem 0.75rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.86rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.post-content h2,
.post-content h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  letter-spacing: -0.015em;
}

.post-content p {
  margin: 1rem 0;
}

.post-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
}

.post-content pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  line-height: 1.5;
}

.post-content pre code {
  background: none;
  padding: 0;
  font-size: 0.87rem;
}

.post-content blockquote {
  margin: 1.25rem 0;
  padding: 0.5rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--bg-soft);
  color: var(--text-muted);
}

.post-content img {
  max-width: 100%;
  border-radius: 8px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 2rem;
}

footer.site-footer {
  margin-top: 4rem;
  padding: 1.75rem 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.empty-state {
  padding: 2rem;
  text-align: center;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
}
