:root {
  --bg: #080d17;
  --bg-elevated: #0f172a;
  --bg-card: #111c33;
  --border: #1e293b;
  --border-accent: #10b98155;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --accent: #10b981;
  --accent-2: #38bdf8;
  --code-bg: #060a12;
  --max-width: 860px;
  --radius: 10px;
}

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

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

body {
  margin: 0;
  background: radial-gradient(circle at top right, #0f2438 0%, var(--bg) 45%);
  background-color: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent-2);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(8, 13, 23, 0.88);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
  flex-wrap: wrap;
  padding: 0.5rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

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

.brand-badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.14);
  color: var(--accent);
  border: 1px solid var(--border-accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.95rem;
}

.nav-links a {
  color: var(--text-muted);
  font-weight: 500;
}

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

/* Main */
main {
  flex: 1;
  padding: 2.5rem 0 4rem;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(56, 189, 248, 0.06));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 2.25rem;
}

.hero-kicker {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 0.5rem;
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 3.2vw, 2.35rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.hero p {
  margin: 0;
  color: var(--text-muted);
  max-width: 65ch;
}

.topic-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.pill {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

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

/* Section Heading */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.6rem;
}

.section-head h2 {
  margin: 0;
  font-size: 1.25rem;
}

/* Post Cards */
.post-list {
  display: grid;
  gap: 1.15rem;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.post-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-1px);
}

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

.post-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  line-height: 1.35;
}

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

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

.post-summary {
  margin: 0 0 0.9rem;
  color: var(--text-muted);
  font-size: 0.96rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.74rem;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent-2);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.tag:hover {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent);
  border-color: var(--border-accent);
  text-decoration: none;
}

/* Single Article */
.article-header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.article-header h1 {
  margin: 0.4rem 0 0.85rem;
  font-size: clamp(1.75rem, 3.5vw, 2.4rem);
  line-height: 1.22;
  letter-spacing: -0.02em;
}

.toc-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  font-size: 0.92rem;
}

.toc-title {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin: 0 0 0.5rem;
}

.toc-box ul {
  margin: 0;
  padding-left: 1.15rem;
}

.article-content h2 {
  margin-top: 2.1rem;
  margin-bottom: 0.75rem;
  font-size: 1.45rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.35rem;
}

.article-content h3 {
  margin-top: 1.6rem;
  margin-bottom: 0.5rem;
  font-size: 1.15rem;
}

.article-content p,
.article-content ul,
.article-content ol {
  margin-bottom: 1.1rem;
}

.article-content blockquote {
  margin: 1.25rem 0;
  padding: 0.8rem 1.1rem;
  border-left: 3px solid var(--accent);
  background: rgba(16, 185, 129, 0.06);
  border-radius: 0 8px 8px 0;
  color: var(--text);
}

.article-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  border: 1px solid var(--border);
  padding: 0.12rem 0.35rem;
  border-radius: 5px;
  color: #a7f3d0;
}

.article-content pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  overflow-x: auto;
  line-height: 1.55;
  margin: 1.25rem 0;
}

.article-content pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: #e2e8f0;
  font-size: 0.86rem;
}

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

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

.article-content th {
  background: var(--bg-elevated);
}

/* Chroma Syntax Highlighting (CSP-safe class-based theme) */
.chroma .c, .chroma .c1, .chroma .cm { color: #64748b; font-style: italic; }
.chroma .k, .chroma .kd, .chroma .kn, .chroma .kp, .chroma .kr, .chroma .kt { color: #38bdf8; }
.chroma .s, .chroma .s1, .chroma .s2, .chroma .sb, .chroma .sc, .chroma .sd { color: #34d399; }
.chroma .na, .chroma .nb, .chroma .nc, .chroma .nf { color: #fbbf24; }
.chroma .nt { color: #7dd3fc; }
.chroma .nv, .chroma .vi { color: #f472b6; }
.chroma .m, .chroma .mi, .chroma .mf { color: #c084fc; }
.chroma .o, .chroma .p { color: #cbd5e1; }

/* Post Navigation */
.post-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.post-nav-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
}

.post-nav-label {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
