:root {
  --ink: #111827;
  --muted: #6b7280;
  --bg: #fafafa;
  --card: #ffffff;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.08);
  --gold: #d97706;
  --border: #e5e7eb;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Source Serif 4", Georgia, serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.75;
}

h1, h2, h3 {
  font-family: "IBM Plex Sans", -apple-system, sans-serif;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Nav */
.blog-nav {
  display: flex;
  gap: 2rem;
  padding: 1rem 2rem;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 0.95rem;
}

.nav-home { font-weight: 700; color: var(--ink); }
.nav-blog { color: var(--muted); }
.nav-blog:hover { color: var(--ink); text-decoration: none; }

/* Hero */
.hero {
  padding: 3.5rem 2rem 2.5rem;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.hero-content { max-width: 800px; margin: 0 auto; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); margin: 0 0 0.5rem; }
.subtitle { font-size: 1.15rem; color: var(--muted); margin: 0 0 1.25rem; }

.post-meta {
  display: flex;
  gap: 1.5rem;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.authors {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-family: "IBM Plex Sans", sans-serif;
  margin-bottom: 0.5rem;
}

.author { display: flex; flex-direction: column; gap: 2px; }
.author-name { font-size: 0.9rem; font-weight: 600; color: var(--ink); }
.author-email { font-size: 0.75rem; color: var(--muted); font-family: "IBM Plex Mono", monospace; }
.affiliation { font-family: "IBM Plex Sans", sans-serif; font-size: 0.85rem; color: var(--muted); font-style: italic; }

/* Layout */
.post-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2.5rem;
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
}

@media (max-width: 860px) {
  .post-layout { grid-template-columns: 1fr; }
  .toc { display: none; }
}

/* TOC */
.toc { position: sticky; top: 2rem; align-self: start; }
.toc-title {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.toc nav { display: flex; flex-direction: column; gap: 0.3rem; }
.toc a {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
  padding: 0.35rem 0.6rem;
  border-radius: 4px;
  border-left: 2px solid transparent;
}

.toc a:hover { color: var(--ink); text-decoration: none; }
.toc a.active { color: var(--ink); background: var(--accent-soft); border-left-color: var(--accent); }

/* Content */
.content {
  background: var(--card);
  padding: 2rem 2.5rem;
  border-radius: 10px;
  border: 1px solid var(--border);
}

@media (max-width: 600px) { .content { padding: 1.25rem; } }

.section { scroll-margin-top: 80px; margin-bottom: 2rem; }
.section h2 { font-size: 1.35rem; margin: 0 0 0.75rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--border); }
.section p { margin: 0 0 1rem; }

.highlight {
  background: rgba(217, 119, 6, 0.08);
  border-left: 3px solid var(--gold);
  padding: 0.9rem 1.1rem;
  border-radius: 0 6px 6px 0;
}

/* Figures */
.figure {
  margin: 1.5rem 0;
  padding: 1.25rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.figure-title { font-family: "IBM Plex Sans", sans-serif; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.75rem; }
.figure-caption { font-size: 0.85rem; color: var(--muted); margin-top: 0.6rem; }
.chart { width: 100%; height: 260px; }

/* References */
.references { font-size: 0.85rem; color: var(--muted); padding-left: 1.25rem; }
.references li { margin-bottom: 0.4rem; }

/* Footer */
.post-footer {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1.5rem 2rem 12rem;
  font-family: "IBM Plex Sans", sans-serif;
}

.post-footer a { color: var(--muted); font-size: 0.9rem; }
.post-footer a:hover { color: var(--ink); }

/* Blog List */
.blog-header { padding: 2.5rem 2rem; background: var(--card); border-bottom: 1px solid var(--border); }
.blog-header-content { max-width: 720px; margin: 0 auto; }
.blog-header h1 { font-size: 2rem; margin: 0 0 0.4rem; }
.blog-header p { color: var(--muted); margin: 0; font-size: 1.05rem; }

.blog-list { max-width: 720px; margin: 0 auto; padding: 2rem; }

.post-card {
  display: block;
  background: var(--card);
  padding: 1.5rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
  transition: border-color 0.15s;
}

.post-card:hover { border-color: var(--accent); text-decoration: none; }

.post-card-date { font-family: "IBM Plex Sans", sans-serif; font-size: 0.8rem; color: var(--muted); margin-bottom: 0.3rem; }
.post-card-title { font-family: "IBM Plex Sans", sans-serif; font-size: 1.25rem; font-weight: 700; color: var(--ink); margin: 0 0 0.4rem; }
.post-card-excerpt { color: var(--muted); margin: 0; line-height: 1.5; font-size: 0.95rem; }

.post-card-tags { display: flex; gap: 0.4rem; margin-top: 0.75rem; }
.tag {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 3px;
}
