/* Minimal Developer Dark Mode */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #0d1117;
  --bg-code: #161b22;
  --text: #c9d1d9;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --border: #30363d;
  --border-hover: #8b949e;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
  margin-bottom: 40px;
}
.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  font-size: 1.1rem;
}
.site-nav { display: flex; gap: 16px; }
.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
}
.site-nav a:hover, .site-nav a.active {
  color: var(--accent);
}

/* Typography */
h1, h2, h3, h4 {
  color: #c9d1d9;
  font-weight: 600;
  margin-bottom: 16px;
  margin-top: 32px;
}
h1 { font-size: 2rem; margin-top: 0; margin-bottom: 8px;}
h2 { font-size: 1.5rem; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
h3 { font-size: 1.25rem; }
p { margin-bottom: 16px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.article-meta { margin-bottom: 40px; }
.part-label { font-family: 'JetBrains Mono', monospace; color: var(--text-muted); font-size: 0.9rem; margin-bottom: 8px; }
.article-subtitle { color: var(--text-muted); font-size: 1.1rem; margin-top: 8px;}

/* Code */
pre, code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
}
code {
  background: var(--bg-code);
  padding: 2px 6px;
  border-radius: 4px;
}
pre {
  background: var(--bg-code);
  padding: 16px;
  border-radius: 6px;
  overflow-x: auto;
  border: 1px solid var(--border);
  margin-bottom: 20px;
}
pre code {
  background: transparent;
  padding: 0;
}
pre.diagram {
  border: 1px dashed var(--border);
  background: transparent;
  font-size: 0.8rem;
  line-height: 1.2;
}

/* Nav */
.article-nav {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-top: 40px;
}
.article-nav a {
  display: flex;
  flex-direction: column;
}
.article-nav .next { text-align: right; }
.article-nav .dir { color: var(--text-muted); font-size: 0.8rem; }
.article-nav .title { font-weight: 600; font-size: 1rem; }

/* Home Table of Contents */
.hero { padding: 40px 0; border-bottom: 1px solid var(--border); margin-bottom: 40px; }
.hero h1 { font-size: 2.5rem; }
.hero .subtitle { color: var(--text-muted); font-size: 1.2rem; }
.hero .kicker { color: var(--accent); font-family: 'JetBrains Mono', monospace; font-size: 0.9rem; margin-bottom: 16px;}
.part-entry {
  display: block;
  padding: 20px 10px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
}
.part-entry:first-of-type { border-top: 1px solid var(--border); }
.part-entry:hover {
  background: var(--bg-code);
}
.part-num { font-family: 'JetBrains Mono', monospace; color: var(--text-muted); font-size: 0.9rem; margin-bottom: 8px; }
.part-title { font-size: 1.4rem; font-weight: 600; margin-bottom: 8px; color: var(--accent); }
.part-desc { color: var(--text-muted); }

/* Table */
table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
th, td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
th { background: var(--bg-code); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 60px;
}

/* Compare */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px;}
.compare > div { border: 1px solid var(--border); padding: 16px; border-radius: 6px; font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; white-space: pre-wrap;}
.compare .heading { font-family: 'Inter', sans-serif; font-weight: 600; margin-bottom: 8px; text-transform: uppercase; font-size: 0.8rem;}
.compare .fail { color: #f85149; }
.compare .ok { color: #3fb950; }

/* Diagram & Image Captions */
.diagram-caption, .img-caption {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: -10px;
  margin-bottom: 20px;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 24px auto 12px auto;
  border: 1px solid var(--border);
  border-radius: 4px;
}
