/* === Blog CSS — Redesigned === */

/* Variables from main site */
:root {
  --bg: #fcfcfd;
  --bg-alt: #f5f5fa;
  --surface: #ffffff;
  --border: #e8e8f0;
  --text: #111118;
  --text-secondary: #4a4a62;
  --text-tertiary: #6b6b80;
  --accent: #6b47f0;
  --accent-soft: rgba(107, 71, 240, 0.06);
  --accent-light: #ede8fe;
  --cyan: #00b4d8;
  --gradient: linear-gradient(135deg, #7c5bf5 0%, #00b4d8 100%);
  --nav-bg: rgba(252, 252, 253, 0.8);
  --glow: 0 0 0 transparent;
  --card-shadow: 0 2px 16px rgba(0,0,0,0.04);
}

[data-theme="dark"] {
  --bg: #0a0a14;
  --bg-alt: #0f0f1e;
  --surface: #14142a;
  --border: #1e1e3a;
  --text: #f0f0f8;
  --text-secondary: #b8b8d0;
  --text-tertiary: #9595b0;
  --accent: #9d7fff;
  --accent-soft: rgba(157, 127, 255, 0.1);
  --accent-light: #1e1540;
  --nav-bg: rgba(10, 10, 20, 0.85);
  --glow: 0 0 30px rgba(124, 91, 245, 0.15);
  --card-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Noto Sans JP', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
  line-height: 1.6;
}

/* Post page: subtle radial gradient in dark mode */
[data-theme="dark"] body.post-page {
  background: var(--bg);
}

::selection { background: var(--accent-light); color: var(--accent); }

/* === Reading Progress Bar === */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--gradient);
  z-index: 200;
  transition: width 0.15s linear;
  will-change: width;
}

/* === Nav === */
.blog-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
}

.blog-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.3rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0;
}
.nav-logo .nav-back {
  margin-right: 6px;
}

.nav-logo .nav-back {
  font-size: 0.9rem;
  opacity: 0.5;
  transition: opacity 0.2s;
  font-weight: 300;
}
.nav-logo:hover .nav-back {
  opacity: 1;
}

.nav-title {
  font-size: 0.7rem;
  font-weight: 300;
  color: var(--text-tertiary);
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-logo .nav-m {
  color: var(--text);
}

.nav-logo .nav-ai {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 400;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--accent); }
.nav-link-blog.active { color: var(--accent); }

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: border-color 0.2s, color 0.2s;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* === Blog Hero (Index) === */
.blog-hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 140px 2rem 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

.blog-hero::before {
  content: '';
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,91,245,0.04) 0%, transparent 70%);
  pointer-events: none;
}

[data-theme="dark"] .blog-hero::before {
  background: radial-gradient(circle, rgba(124,91,245,0.08) 0%, transparent 70%);
}

.blog-hero h1 {
  font-family: 'Noto Serif JP', 'Playfair Display', serif;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 400;
  line-height: 2;
  letter-spacing: 0.08em;
  color: var(--text);
  margin-bottom: 40px;
  position: relative;
  z-index: 2;
  max-width: 600px;
  -webkit-text-fill-color: unset;
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
}

.blog-hero h1 .title-emphasis {
  display: inline;
  background: linear-gradient(180deg, transparent 60%, rgba(124,91,245,0.12) 60%);
}

[data-theme="dark"] .blog-hero h1 .title-emphasis {
  background: linear-gradient(180deg, transparent 60%, rgba(157,127,255,0.15) 60%);
}

.blog-hero .subtitle {
  font-family: 'Noto Serif JP', serif;
  font-size: 0.95rem;
  color: var(--text-tertiary);
  font-weight: 300;
  letter-spacing: 0.12em;
  position: relative;
  z-index: 2;
}

.blog-hero .blog-hero-line,
.blog-hero .blog-hero-by {
  position: relative;
  z-index: 2;
}

.blog-hero .blog-hero-scroll {
  z-index: 2;
}

/* === Filter Buttons === */
.filter-bar {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 0 2rem 2rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 18px;
  font-size: 0.85rem;
  font-family: 'Inter', 'Noto Sans JP', sans-serif;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

[data-theme="dark"] .filter-btn.active {
  background: var(--accent);
  color: #fff;
}

/* === Post Cards Container === */
.blog-posts {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 2rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* === Featured Card === */
.post-card-featured {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1.5px solid transparent;
  border-radius: 16px;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.16,1,0.3,1), box-shadow 0.3s;
  background-clip: padding-box;
  background-origin: border-box;
  border-image: var(--gradient) 1;
  opacity: 0;
  transform: translateY(16px);
  animation: card-in 0.5s ease forwards;
}

/* border-image doesn't support border-radius, so use pseudo element */
.post-card-featured {
  border: none;
}
.post-card-featured::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 1.5px;
  background: var(--gradient);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

/* Featured card with thumbnail layout */
.post-card-featured { display: flex; gap: 0; }
.post-card-thumb {
  flex: 0 0 45%;
  border-radius: 14px 0 0 14px;
  overflow: hidden;
}
.post-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.post-card-body {
  flex: 1;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.post-card-featured:not(:has(.post-card-thumb)) { display: block; }
.post-card-featured:not(:has(.post-card-thumb)) .post-card-body { padding: 0; }

/* Regular card thumbnail */
.post-card-thumb-sm {
  flex: 0 0 120px;
  border-radius: 10px 0 0 10px;
  overflow: hidden;
}
.post-card-thumb-sm img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.post-card:has(.post-card-thumb-sm) { display: flex; gap: 1rem; }

/* Post hero image */
.post-hero-image {
  margin: -0.5rem -0.5rem 1.5rem;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}
.post-hero-image img {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: cover;
  display: block;
}
.post-hero-credit {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.7);
  background: rgba(0,0,0,0.4);
  padding: 2px 8px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}
.post-hero-credit a {
  color: rgba(255,255,255,0.9);
  text-decoration: none;
}
.post-hero-credit a:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .post-card-featured { flex-direction: column; }
  .post-card-thumb { flex: none; height: 200px; border-radius: 14px 14px 0 0; }
  .post-card-thumb-sm { flex: 0 0 80px; }
  .post-hero-image { margin: -0.25rem -0.25rem 1rem; }
  .post-hero-image img { max-height: 240px; }
}

.post-card-featured:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 48px rgba(124,91,245,0.12);
}

[data-theme="dark"] .post-card-featured:hover {
  box-shadow: 0 12px 48px rgba(124,91,245,0.2);
}

/* Thumbnail zoom on card hover */
.post-card-thumb {
  overflow: hidden;
}
.post-card-thumb img {
  transition: transform 0.4s ease;
}
.post-card-featured:hover .post-card-thumb img {
  transform: scale(1.05);
}

.post-card-thumb-sm {
  overflow: hidden;
}
.post-card-thumb-sm img {
  transition: transform 0.4s ease;
}
.post-card:hover .post-card-thumb-sm img {
  transform: scale(1.05);
}

.featured-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.post-card-featured .post-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.post-card-featured .post-card-excerpt {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 0.75rem;
}

.post-card-featured .post-card-bottom {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

/* === Regular Card === */
.post-card {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  transition: transform 0.3s cubic-bezier(0.16,1,0.3,1), box-shadow 0.3s, border-color 0.3s;
  opacity: 0;
  transform: translateY(16px);
  will-change: transform, opacity;
}

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

.post-card-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  flex-shrink: 0;
  min-width: 90px;
}

.post-card-right {
  flex: 1;
  min-width: 0;
}

.post-card-date {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  font-family: 'Inter', monospace;
  white-space: nowrap;
}

.post-card-reading {
  font-size: 0.7rem;
  color: var(--text-tertiary);
}

.category-badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.category-badge.journal {
  background: rgba(124, 91, 245, 0.1);
  color: var(--accent);
}

.category-badge.column {
  background: rgba(0, 180, 216, 0.1);
  color: #007590;
}

.post-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  line-height: 1.4;
}

.post-card-excerpt {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card stagger animation */
@keyframes card-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === Individual Post === */
.post-layout {
  display: flex;
  justify-content: center;
  gap: 3rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 120px 2rem 4rem;
  position: relative;
}

.post-container {
  max-width: 680px;
  width: 100%;
  min-width: 0;
}

/* === TOC Sidebar (Desktop) === */
.toc-sidebar {
  display: none;
  position: sticky;
  top: 100px;
  width: 200px;
  flex-shrink: 0;
  align-self: flex-start;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}

@media (min-width: 1100px) {
  .toc-sidebar {
    display: block;
  }
}

.toc-sidebar-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 0.75rem;
}

.toc-sidebar a {
  display: block;
  font-size: 0.8rem;
  color: var(--text-tertiary);
  text-decoration: none;
  padding: 4px 0 4px 12px;
  border-left: 2px solid var(--border);
  transition: color 0.2s, border-color 0.2s;
  line-height: 1.5;
  margin-bottom: 2px;
}

.toc-sidebar a:hover {
  color: var(--text-secondary);
}

.toc-sidebar a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 500;
}

/* === TOC Mobile (Collapsible) === */
.toc-mobile {
  display: none;
  margin-bottom: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

@media (max-width: 1099px) {
  .toc-mobile { display: block; }
}

.toc-mobile-toggle {
  width: 100%;
  background: none;
  border: none;
  padding: 0.75rem 1rem;
  font-family: 'Inter', 'Noto Sans JP', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: color 0.2s;
}

.toc-mobile-toggle:hover { color: var(--accent); }

.toc-mobile-toggle .toc-arrow {
  transition: transform 0.2s;
  font-size: 0.7rem;
}

.toc-mobile.open .toc-arrow {
  transform: rotate(180deg);
}

.toc-mobile-list {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.toc-mobile.open .toc-mobile-list {
  max-height: 500px;
}

.toc-mobile-list a {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--border);
  transition: color 0.2s, background 0.2s;
}

.toc-mobile-list a:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

/* === Post Header === */
.post-header {
  margin-bottom: 2.5rem;
}

.post-header .category-badge {
  margin-bottom: 1rem;
  display: inline-block;
}

.post-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2.4rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.post-date {
  font-size: 0.9rem;
  color: var(--text-tertiary);
}

.post-reading-time {
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.post-tag {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  background: var(--bg-alt);
  padding: 2px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

/* === Post Content Typography === */
.post-content {
  font-size: 1.05rem;
  line-height: 2.0;
  color: var(--text);
}

.post-content h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 600;
  margin: 2.5rem 0 1rem;
  line-height: 1.4;
}

.post-content h3 {
  font-family: 'Inter', 'Noto Sans JP', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
}

.post-content p {
  margin-bottom: 1.8rem;
}

/* Drop cap */
.post-content .drop-cap::first-letter {
  font-family: 'Playfair Display', serif;
  float: left;
  font-size: 3.4rem;
  line-height: 0.8;
  padding-right: 0.12em;
  padding-top: 0.08em;
  color: var(--accent);
  font-weight: 600;
}

.post-content strong {
  font-weight: 600;
  color: var(--text);
}

.post-content em {
  font-style: italic;
}

.post-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

/* Pull-quote blockquotes */
.post-content blockquote {
  position: relative;
  border: none;
  border-left: 3px solid var(--accent);
  margin: 2.5rem 0;
  padding: 1.5rem 2rem 1.5rem 2rem;
  background: var(--accent-soft);
  border-radius: 0 12px 12px 0;
  text-align: left;
}

[data-theme="dark"] .post-content blockquote {
  border-left-color: var(--accent);
  box-shadow: -4px 0 16px rgba(157,127,255,0.08);
}

.post-content blockquote::before {
  content: '\201C';
  position: absolute;
  top: -8px;
  left: 12px;
  font-family: 'Playfair Display', serif;
  font-size: 3.5rem;
  color: var(--accent);
  opacity: 0.2;
  line-height: 1;
}

.post-content blockquote p {
  font-family: 'Noto Serif JP', 'Playfair Display', serif;
  font-size: 1.1rem;
  line-height: 2;
  color: var(--text-secondary);
  margin-bottom: 0;
  font-style: italic;
}

.post-content code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.9em;
  background: var(--bg-alt);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.post-content pre {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.8rem 0;
}

[data-theme="dark"] .post-content pre {
  border-color: rgba(157,127,255,0.15);
}

.post-content pre code {
  background: none;
  border: none;
  padding: 0;
}

.post-content ul, .post-content ol {
  margin: 1rem 0 1.8rem;
  padding-left: 1.5rem;
}

.post-content li {
  margin-bottom: 0.5rem;
}

.post-content img {
  width: 100%;
  border-radius: 8px;
  margin: 1.8rem 0;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* Paragraph reveal animation */
.post-content > p,
.post-content > h2,
.post-content > h3,
.post-content > blockquote,
.post-content > ul,
.post-content > ol,
.post-content > pre {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  will-change: opacity, transform;
}

.post-content > .revealed {
  opacity: 1;
  transform: translateY(0);
}

/* === Share Buttons === */
.share-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.share-label {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

.share-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-family: 'Inter', sans-serif;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.share-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* === Author Card === */
.author-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 3rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.author-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.author-info {
  min-width: 0;
}

.author-name {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.author-bio {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.author-link {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  margin-top: 0.25rem;
  display: inline-block;
}

.author-link:hover { text-decoration: underline; }

/* === Post Navigation === */
.post-nav {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.post-nav-back {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  transition: opacity 0.2s;
}

.post-nav-back:hover { opacity: 0.7; }

.post-nav-links {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.post-nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.2s, color 0.2s;
  max-width: 48%;
}

.post-nav-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.post-nav-link.next { text-align: right; margin-left: auto; }

.post-nav-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-bottom: 0.25rem;
}

/* === Footer === */
.blog-footer {
  text-align: center;
  padding: 3rem 2rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

.blog-footer a {
  color: var(--text-secondary);
  text-decoration: none;
}

.blog-footer a:hover { color: var(--accent); }

.footer-logo {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.footer-logo .nav-m {
  color: var(--text);
}

.footer-logo .nav-ai {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

/* === Responsive === */
@media (max-width: 640px) {
  .nav-title { display: none; }
  .blog-hero h1 { font-size: 2rem; }
  .blog-hero { padding: 140px 1.25rem 36px; }
  .post-header h1 { font-size: 1.8rem; }
  .post-layout { padding: 100px 1.25rem 3rem; }
  .blog-posts { padding: 0 1.25rem 2rem; }
  .post-nav-links { flex-direction: column; }
  .post-nav-link { max-width: 100%; }
  .post-nav-link.next { text-align: left; }
  .post-card { flex-direction: column; gap: 0.75rem; }
  .post-card-left { flex-direction: row; align-items: center; gap: 0.75rem; }
  .author-card { flex-direction: column; text-align: center; }
  .share-bar { flex-wrap: wrap; }
  .filter-bar { padding: 0 1.25rem 1.5rem; }
}

/* === Dark Mode Fixes === */
[data-theme="dark"] .post-card-featured {
  background: var(--surface);
}

[data-theme="dark"] .post-card {
  background: var(--surface);
}

[data-theme="dark"] .post-card-title {
  color: var(--text);
}

[data-theme="dark"] .post-card-excerpt {
  color: var(--text-secondary);
}

[data-theme="dark"] .post-content {
  color: var(--text);
}

[data-theme="dark"] .post-content p {
  color: var(--text);
}

[data-theme="dark"] .post-header h1 {
  color: var(--text);
}

[data-theme="dark"] .toc-sidebar {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .author-card {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .share-btn {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-secondary);
}

/* === Blog Hero Enhancements === */
.blog-hero-line {
  width: 40px;
  height: 1px;
  background: var(--accent);
  margin: 0 auto 24px;
  opacity: 0.5;
}

.blog-hero-by {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 48px;
}

.blog-hero-scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.blog-hero-scroll span {
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  font-weight: 500;
}

.blog-hero-scroll-line {
  width: 1px;
  height: 32px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: blog-scroll-anim 2s ease-in-out infinite;
}

@keyframes blog-scroll-anim {
  0% { opacity: 0; transform: scaleY(0); transform-origin: top; }
  50% { opacity: 1; transform: scaleY(1); }
  100% { opacity: 0; transform: scaleY(0); transform-origin: bottom; }
}

/* Hero text animation */
.blog-hero h1 {
  opacity: 0;
  transform: translateY(20px);
  animation: hero-text-in 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
}

.blog-hero .blog-hero-line {
  opacity: 0;
  animation: hero-text-in 0.8s ease 1s forwards;
}

.blog-hero .subtitle {
  opacity: 0;
  transform: translateY(12px);
  animation: hero-text-in 1s cubic-bezier(0.16, 1, 0.3, 1) 1.2s forwards;
}

.blog-hero .blog-hero-by {
  opacity: 0;
  animation: hero-text-in 0.8s ease 1.6s forwards;
}

@keyframes hero-text-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Search box */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: auto;
}
.search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-tertiary);
  pointer-events: none;
}
.search-input {
  padding: 6px 12px 6px 32px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  width: 160px;
  transition: width 0.3s ease, border-color 0.2s;
  outline: none;
}
.search-input:focus {
  width: 220px;
  border-color: var(--accent);
}
.search-input::placeholder {
  color: var(--text-tertiary);
}
