:root {
  --bg: #0d0f14;
  --surface: #151820;
  --border: #252a36;
  --text: #e8eaef;
  --muted: #8b93a7;
  --accent: #6c8cff;
  --accent-hover: #8aa4ff;
  --radius: 10px;
  --max: 720px;
  --wide: 960px;
}

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

html { font-size: 17px; scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
}

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

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.logo:hover { color: var(--accent); text-decoration: none; }

.nav { display: flex; gap: 1.25rem; font-size: 0.9rem; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--text); }

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

main.wide { max-width: var(--wide); }

h1 {
  font-size: 2rem;
  line-height: 1.25;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}

h2 {
  font-size: 1.35rem;
  margin: 2rem 0 0.75rem;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.5rem;
}

.meta {
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 2rem;
}

.meta .category {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  margin-right: 0.5rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

article p { margin-bottom: 1.1rem; }

article ul, article ol {
  margin: 0 0 1.1rem 1.5rem;
}

article li { margin-bottom: 0.35rem; }

article code {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  font-size: 0.85em;
  font-family: "SF Mono", Menlo, Monaco, Consolas, monospace;
}

article pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 1.25rem 0;
  font-size: 0.85rem;
  line-height: 1.5;
}

article pre code {
  background: none;
  border: none;
  padding: 0;
}

article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.9rem;
}

article th, article td {
  border: 1px solid var(--border);
  padding: 0.6rem 0.75rem;
  text-align: left;
}

article th { background: var(--surface); font-weight: 600; }

article blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.5rem 0 0.5rem 1rem;
  margin: 1.25rem 0;
  color: var(--muted);
}

.cta-block {
  margin-top: 2.5rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.cta-block h3 { margin-top: 0; font-size: 1.05rem; }
.cta-block p { color: var(--muted); font-size: 0.95rem; margin-bottom: 1rem; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1.25rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}
.btn:hover { background: var(--accent-hover); color: #fff; text-decoration: none; }

.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
}
.post-list li:last-child { border-bottom: none; }

.post-list a.title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  display: block;
  margin-bottom: 0.35rem;
}
.post-list a.title:hover { color: var(--accent); }

.post-list .excerpt { color: var(--muted); font-size: 0.9rem; }

.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.category-pills a {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
}
.category-pills a:hover, .category-pills a.active {
  border-color: var(--accent);
  color: var(--accent);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
  align-items: center;
}

.pagination a {
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination a.current { border-color: var(--accent); color: var(--accent); font-weight: 600; }

.related {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.related h3 { margin: 0 0 0.75rem; font-size: 1rem; color: var(--muted); }
.related ul { list-style: none; margin: 0; padding: 0; }
.related li { margin-bottom: 0.5rem; }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

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