/* ── Anthropic-inspired blog theme ───────────────────────────────── */
:root {
  --coral:       #CC785C;       /* Anthropic primary */
  --coral-dark:  #A85F42;
  --coral-light: #F5DDD5;
  --bg:          #FAF9F6;       /* warm cream */
  --surface:     #F3F0EA;
  --border:      #E8E2D9;
  --text:        #1A1714;       /* near-black warm */
  --muted:       #7A6F66;
  --code-bg:     #1C1C1E;       /* dark charcoal */
  --code-fg:     #E8E6E3;
  --r:           8px;
}

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

body.blog-body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Lato', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.78;
  margin: 0;
  padding: 0;
}

/* ── Reading progress ────────────────────────────────────────────── */
#reading-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2.5px;
  width: 0%;
  background: linear-gradient(90deg, var(--coral), #E8A887, var(--coral-dark));
  z-index: 9999;
  transition: width 80ms linear;
}

/* ── Nav ─────────────────────────────────────────────────────────── */
.blog-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.85rem 2rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(250, 249, 246, 0.94);
  backdrop-filter: blur(10px);
  z-index: 100;
}
.blog-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.02em;
  transition: color 0.15s;
}
.blog-nav .nav-home { color: var(--coral); font-weight: 700; margin-right: auto; }
.blog-nav a:hover   { color: var(--coral); }

/* ── Tags ────────────────────────────────────────────────────────── */
.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 2px 2px;
  text-decoration: none;
  white-space: nowrap;
  border: 1.5px solid transparent;
}

/* Anthropic warm palette for tags */
.tag-autonomous-driving, .tag-autonomousdriving { background: #E8C4B8; color: #7A2E0E; border-color: #D4A090; }
.tag-motion-forecasting, .tag-motionforecasting { background: #C8E0D4; color: #0F4A35; border-color: #A8CEBC; }
.tag-lidar, .tag-3d-detection                   { background: #EDD5B3; color: #6B3A00; border-color: #D9BF9A; }
.tag-generative-ai, .tag-generativeai           { background: #D8C8E8; color: #3E1A6B; border-color: #BFA8D4; }
.tag-robotics                                    { background: #B8D4E4; color: #0A3350; border-color: #98B8CC; }
.tag-deep-learning, .tag-deeplearning           { background: #CCE0E8; color: #0E3648; border-color: #AAC8D4; }
.tag-paper-notes, .tag-papernotes               { background: #F0DFC8; color: #5A3300; border-color: #D8C4A4; }
.tag-transformer                                { background: #D4E8DC; color: #1A4A2E; border-color: #B0CEBC; }
.tag-point-cloud, .tag-pointcloud               { background: #E8D4BC; color: #5A3200; border-color: #CDB898; }
.tag { background: var(--coral-light); color: #7A2E10; border-color: #D4A090; }

/* ═══════════════════════════════════════════════════════════════════
   BLOG INDEX
   ═══════════════════════════════════════════════════════════════════ */
.index-hero {
  max-width: 820px;
  margin: 3rem auto 1.5rem;
  padding: 0 2rem;
}
.index-hero h1 {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--coral);
  margin: 0 0 0.3rem;
}
.index-hero p { color: var(--muted); margin: 0; font-size: 14px; }
.index-divider {
  max-width: 820px;
  margin: 1.5rem auto;
  padding: 0 2rem;
  border: none;
  border-top: 1px solid var(--border);
}

.tag-filter {
  max-width: 820px;
  margin: 0 auto 1.5rem;
  padding: 0 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.tag-filter span { font-size: 11px; color: var(--muted); margin-right: 4px; text-transform: uppercase; letter-spacing: 0.06em; }

.tag-btn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.tag-btn:hover, .tag-btn.active {
  border-color: var(--coral);
  color: var(--coral);
  background: var(--coral-light);
}

.post-list { max-width: 820px; margin: 0 auto; padding: 0 2rem 4rem; }

.year-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  margin: 2rem 0 0.75rem;
}

.post-card {
  display: flex;
  gap: 1.25rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
  align-items: flex-start;
  cursor: pointer;
}
.post-card:hover { border-bottom-color: var(--coral); }
.post-card:hover .card-title { color: var(--coral); }

.card-date {
  flex-shrink: 0;
  width: 4.5rem;
  font-size: 11.5px;
  color: var(--muted);
  padding-top: 3px;
  font-variant-numeric: tabular-nums;
}
.card-body { flex: 1; min-width: 0; }
.card-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.3rem;
  transition: color 0.15s;
  line-height: 1.4;
}
.card-excerpt {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0 0 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}
.card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; }
.card-read-time {
  font-size: 10.5px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
}

/* ═══════════════════════════════════════════════════════════════════
   POST PAGE
   ═══════════════════════════════════════════════════════════════════ */
.post-page {
  display: grid;
  grid-template-columns: 200px 1fr;
  grid-template-areas: "sidebar main";
  max-width: 1020px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  gap: 3rem;
  align-items: start;
}

.post-sidebar {
  grid-area: sidebar;
  position: sticky;
  top: 5rem;
  font-size: 12.5px;
}
.sidebar-meta { margin-bottom: 1.25rem; }
.meta-date, .meta-rt { font-size: 11.5px; color: var(--muted); margin-bottom: 0.2rem; }

.toc-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.5rem;
}
#toc { display: flex; flex-direction: column; gap: 1px; }
#toc a {
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  line-height: 1.5;
  padding: 3px 8px 3px 8px;
  border-left: 2px solid transparent;
  transition: all 0.15s;
  border-radius: 0 4px 4px 0;
}
#toc a.toc-h3  { padding-left: 18px; font-size: 11.5px; }
#toc a:hover   { color: var(--coral); border-left-color: var(--coral); background: var(--coral-light); }
#toc a.active  { color: var(--coral); border-left-color: var(--coral); background: var(--coral-light); font-weight: 600; }

/* ── Main post ───────────────────────────────────────────────────── */
.post-main { grid-area: main; min-width: 0; }

.post-header { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.post-header-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 11.5px;
  color: var(--muted);
}
.post-header-meta .sep { color: var(--border); }

.post-title {
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  margin: 0 0 0.65rem;
}
.post-description {
  font-size: 1rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
  line-height: 1.65;
}
.post-tags-header { margin-top: 0.6rem; }

/* ── Typography ──────────────────────────────────────────────────── */
.post-content { max-width: 68ch; }

.post-content h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin: 2.5rem 0 0.65rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}
.post-content h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--coral-dark);
  margin: 1.75rem 0 0.45rem;
}
.post-content p   { margin: 0 0 1rem; }
.post-content ul,
.post-content ol  { padding-left: 1.5rem; margin: 0 0 1rem; }
.post-content li  { margin-bottom: 0.3rem; }

.post-content a { color: var(--coral); }
.post-content a:hover { color: var(--coral-dark); text-decoration: underline; }

/* Blockquote / pull-quote */
.post-content blockquote {
  border-left: 3px solid var(--coral);
  margin: 1.5rem 0;
  padding: 0.7rem 1.2rem;
  background: var(--coral-light);
  border-radius: 0 var(--r) var(--r) 0;
  color: #5A2A14;
  font-style: italic;
}
.post-content blockquote p { margin: 0; }

/* Callout / insight box */
.insight {
  border: 1.5px solid var(--coral);
  border-radius: var(--r);
  padding: 0.9rem 1.15rem;
  background: var(--coral-light);
  margin: 1.5rem 0;
}
.insight strong { color: var(--coral-dark); display: block; margin-bottom: 0.35rem; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* ── Code ────────────────────────────────────────────────────────── */
.post-content code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.81em;
  background: var(--surface);
  padding: 2px 5px;
  border-radius: 4px;
  color: var(--coral-dark);
  border: 1px solid var(--border);
}
.post-content pre {
  background: var(--code-bg);
  color: var(--code-fg);
  border-radius: var(--r);
  padding: 1.2rem 1.4rem;
  overflow-x: auto;
  margin: 1.25rem 0;
  font-size: 0.8rem;
  line-height: 1.7;
  border: 1px solid #3A3A3C;
}
.post-content pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
  border-radius: 0;
  border: none;
}

/* Syntax highlight — warm dark palette to complement Anthropic coral */
.highlight .c, .highlight .cd { color: #8E8E93; font-style: italic; }
.highlight .k, .highlight .kd { color: #E88B6E; }   /* keyword — coral family */
.highlight .s, .highlight .s1, .highlight .s2 { color: #A8D8A8; }   /* string — sage green */
.highlight .mi,.highlight .mf { color: #C8B4E8; }   /* number — soft purple */
.highlight .nf { color: #F0C88C; }                    /* function — warm amber */
.highlight .nb { color: #90C8D8; }                    /* builtin — cool blue */
.highlight .nc { color: #F0C88C; }                    /* class */
.highlight .o  { color: #E88B6E; }                    /* operator */
.highlight .na { color: #A0D4C0; }                    /* attribute */
.highlight .lineno { color: #4A4A4E; user-select: none; margin-right: 1rem; }

/* ── KaTeX ───────────────────────────────────────────────────────── */
.post-content .katex-display { overflow-x: auto; padding: 0.5rem 0; }

/* ── Images ──────────────────────────────────────────────────────── */
.post-content img { max-width: 100%; border-radius: var(--r); margin: 0.75rem 0; }
.post-content figure { margin: 1.5rem 0; text-align: center; }
.post-content figcaption { font-size: 11.5px; color: var(--muted); margin-top: 0.35rem; }

/* ── Post footer ─────────────────────────────────────────────────── */
.post-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.author-card {
  display: flex;
  gap: 1rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1rem 1.25rem;
}
.author-card img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.author-name { font-weight: 700; margin: 0 0 1px; font-size: 14px; }
.author-bio  { font-size: 12px; color: var(--muted); margin: 0; }
.author-links { margin-top: 4px; font-size: 12px; }
.author-links a { color: var(--coral); margin-right: 0.75rem; text-decoration: none; }
.author-links a:hover { color: var(--coral-dark); text-decoration: underline; }

/* ── Back link ───────────────────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 12.5px;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 1.5rem;
  transition: color 0.15s;
}
.back-link:hover { color: var(--coral); }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 820px) {
  .post-page {
    grid-template-columns: 1fr;
    grid-template-areas: "main";
    padding: 1.25rem 1rem;
  }
  .post-sidebar { display: none; }
  .post-title   { font-size: 1.45rem; }
}

@media (max-width: 560px) {
  .blog-nav          { padding: 0.7rem 1rem; gap: 1rem; }
  .index-hero,
  .tag-filter,
  .post-list         { padding-left: 1rem; padding-right: 1rem; }
  .post-card         { flex-direction: column; gap: 0.35rem; }
  .card-date         { width: auto; }
}
