:root {
  --bg: #0d0e10;
  --bg-elev: #161719;
  --bg-card: #1c1d20;
  --border: #2a2b30;
  --text: #e8e8e8;
  --text-dim: #9a9a9f;
  --text-muted: #6b6c72;
  --accent: #56b6c2;
  --accent-hover: #7ac8d2;
  --mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Source Serif 4', 'Georgia', serif;
  --max-width: 720px;
}

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

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

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

/* ─── Header ─── */
header.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 2rem;
  position: sticky;
  top: 0;
  background: rgba(13, 14, 16, 0.95);
  backdrop-filter: blur(8px);
  z-index: 100;
}
.header-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--text);
}
.logo span { color: var(--accent); }
.header-nav { display: flex; gap: 1.5rem; }
.header-nav a { color: var(--text-dim); font-size: 0.9rem; font-weight: 500; }
.header-nav a:hover { color: var(--text); }

/* ─── Index Page ─── */
.index-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 3rem 2rem;
}
.index-hero {
  text-align: center;
  margin-bottom: 4rem;
}
.index-hero h1 {
  font-family: var(--sans);
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}
.index-hero p {
  color: var(--text-dim);
  font-size: 1.1rem;
  max-width: 480px;
  margin: 0 auto;
}
.post-list { display: flex; flex-direction: column; gap: 2rem; }
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  transition: border-color 0.15s, transform 0.15s;
}
.post-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.post-card a { color: inherit; }
.post-card a:hover { text-decoration: none; }
.post-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-family: var(--mono);
}
.post-tag {
  background: rgba(86, 182, 194, 0.12);
  color: var(--accent);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
}
.post-card h2 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}
.post-card p.excerpt {
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ─── Article Page ─── */
article.post {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
}
.post-header { margin-bottom: 2.5rem; }
.post-header h1 {
  font-family: var(--sans);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 1rem 0;
}
.post-header .post-meta { margin-bottom: 0; }

/* ─── Hero Image ─── */
.post-hero {
  width: 100%;
  max-width: 100%;
  border-radius: 8px;
  overflow: hidden;
  margin: 0 0 2.5rem;
  border: 1px solid var(--border);
}
.post-hero img {
  display: block;
  width: 100%;
  height: auto;
}

/* ─── Inline Image ─── */
.post-body img.inline {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin: 1.5rem 0;
}

/* ─── Article Body ─── */
.post-body { font-family: var(--serif); font-size: 1.125rem; line-height: 1.8; }
.post-body p { margin-bottom: 1.5rem; }
.post-body h2 {
  font-family: var(--sans);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  letter-spacing: -0.02em;
}
.post-body h3 {
  font-family: var(--sans);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
}
.post-body code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--bg-elev);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  color: var(--accent);
}
.post-body pre {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}
.post-body pre code {
  background: none;
  color: var(--text);
  padding: 0;
}
.post-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  color: var(--text-dim);
  font-style: italic;
}
.post-body ul, .post-body ol { margin: 1rem 0 1.5rem 1.5rem; }
.post-body li { margin-bottom: 0.5rem; }
.post-body strong { font-weight: 700; }
.post-body em { font-style: italic; }

/* ─── CTA at end of posts ─── */
.post-cta {
  margin-top: 3rem;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
}
.post-cta p { margin-bottom: 1rem; color: var(--text-dim); }
.post-cta a {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  background: var(--accent);
  color: var(--bg);
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.95rem;
}
.post-cta a:hover {
  background: var(--accent-hover);
  text-decoration: none;
}

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

/* ─── Responsive ─── */
@media (max-width: 640px) {
  .index-hero h1 { font-size: 1.8rem; }
  .post-header h1 { font-size: 1.6rem; }
  .post-body { font-size: 1rem; }
  article.post { padding: 2rem 1.25rem 4rem; }
  .index-container { padding: 2rem 1.25rem; }
  header.site-header { padding: 1rem 1.25rem; }
}
