/* ═══════════════════════════════════════════════════
   TESTNEXUS BLOG — Design System v3
   Dark editorial + developer edge
   Fonts: Outfit + Instrument Serif (matching prototype)
   ═══════════════════════════════════════════════════ */

/* ─── Accessibility ─── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sr-only:focus {
  position: fixed;
  top: 0;
  left: 0;
  width: auto;
  height: auto;
  padding: 0.75rem 1.5rem;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  background: var(--nexus-teal);
  color: #000;
  font-weight: 600;
  z-index: 9999;
  border-radius: 0 0 0.5rem 0;
}

/* ─── Design Tokens ─── */
:root {
  /* Brand */
  --nexus-teal: #00E0CC;
  --nexus-cyan: #4E8EF7;
  --nexus-purple: #A855F7;

  /* Teal scale */
  --teal-50: #f0fdfa;
  --teal-100: #ccfbf1;
  --teal-200: #99f6e4;
  --teal-300: #5eead4;
  --teal-400: #2dd4bf;
  --teal-500: #14b8a6;
  --teal-600: #0d9488;
  --teal-700: #0f766e;
  --teal-800: #115e59;
  --teal-900: #134e4a;

  /* Typography — matching prototype */
  --font-display: 'Outfit', system-ui, sans-serif;
  --font-body: 'Outfit', system-ui, sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Layout */
  --nav-height: 60px;
  --sidebar-width: 260px;
  --content-max: 740px;
  --page-max: 1140px;
  --toc-width: 220px;

  /* Module accent colors */
  --mod-all: #0d9488;
  --mod-datahub: #6366f1;
  --mod-mocklocation: #f59e0b;
  --mod-deepinspector: #f43f5e;
  --mod-customforms: #22c55e;
  --mod-terminal: #3b82f6;
  --mod-aiagent: #ec4899;
  --mod-tokensystem: #eab308;

  /* Radii — match website */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  /* Motion */
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 500ms;
}

/* ─── Dark Theme (default — matching prototype) ─── */
[data-theme="dark"] {
  --bg: #08090C;
  --bg-raised: #0D0F14;
  --bg-subtle: #141720;
  --bg-glass: #141720;
  --bg-glass-hover: #1A1E28;

  --text: #F0F2F5;
  --text-secondary: #9BA4B5;
  --text-muted: #5C6478;
  --text-faint: #3A4050;

  --accent: var(--nexus-teal);
  --accent-dim: rgba(0, 224, 204, 0.12);
  --accent-glow: rgba(0, 224, 204, 0.15);

  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.1);
  --border-accent: rgba(0, 224, 204, 0.3);

  --code-bg: #0D0F14;
  --code-border: rgba(255, 255, 255, 0.06);

  --nav-bg: rgba(8, 9, 12, 0.7);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.2);
  --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.3);
  --glow: 0 0 30px rgba(0, 224, 204, 0.15);
}

/* ─── Light Theme ─── */
[data-theme="light"] {
  --bg: #fafbfc;
  --bg-raised: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.7);
  --bg-glass-hover: rgba(255, 255, 255, 0.9);

  --text: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-faint: #cbd5e1;

  --accent: #0d9488;
  --accent-dim: rgba(13, 148, 136, 0.08);
  --accent-glow: rgba(13, 148, 136, 0.06);

  --border: rgba(0, 0, 0, 0.06);
  --border-hover: rgba(0, 0, 0, 0.1);
  --border-accent: rgba(13, 148, 136, 0.3);

  --code-bg: #f1f5f9;
  --code-border: #e2e8f0;

  --nav-bg: rgba(250, 251, 252, 0.85);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.08);
  --glow: 0 0 30px rgba(13, 148, 136, 0.1);
}

/* ─── Reset ─── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 24px);
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: opacity 250ms ease;
}
body.page-exit { opacity: 0; }

/* Noise texture — subtle film grain for depth */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

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

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-faint); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ─── Links ─── */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}
a:hover { color: var(--nexus-cyan); }

img { max-width: 100%; height: auto; display: block; }

/* ═══════════════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════════════ */

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--nexus-teal), var(--nexus-cyan));
  z-index: 1100;
  width: 0;
  transition: width 0.1s linear;
  box-shadow: 0 0 10px var(--accent-glow);
}

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--nav-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: box-shadow var(--duration-base) var(--ease-out);
}

.nav-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.nav-logo:hover { color: var(--text); }

.nav-logo svg { width: 32px; height: 32px; flex-shrink: 0; }

.nav-logo .logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.nav-logo .blog-badge {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  background: var(--accent);
  color: #0a0a0f;
  padding: 2px 7px;
  border-radius: 4px;
}

/* Nav Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast) var(--ease-out);
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--accent-glow);
}

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

.nav-cta {
  background: var(--nexus-teal) !important;
  color: #0a0a0f !important;
  font-weight: 600 !important;
  border-radius: var(--radius-sm) !important;
}
.nav-cta:hover {
  box-shadow: 0 0 20px rgba(0, 199, 175, 0.3);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 8px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  transition: all var(--duration-fast) var(--ease-out);
  line-height: 1;
}
.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--border-accent);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 8px;
}

/* ═══════════════════════════════════════════════════
   HERO — Homepage only
   ═══════════════════════════════════════════════════ */

.hero {
  padding: calc(var(--nav-height) + 80px) 2rem 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Pulsing gradient orb — matching prototype */
.hero::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  animation: pulse 8s ease-in-out infinite;
}

.hero::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(78, 142, 247, 0.08) 0%, transparent 70%);
  top: -100px;
  right: -100px;
  pointer-events: none;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.1); }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
}

/* Hero badge */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(0, 224, 204, 0.06);
  border: 1px solid var(--border-accent);
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  margin-bottom: 2rem;
  animation: fadeIn 0.6s var(--ease-out) both;
}

.hero-badge .badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 5.5vw, 4rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero-sub {
  font-size: 1.15rem;
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 2.5rem;
  font-weight: 300;
}

/* Hero stats bar */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  animation: fadeUp 0.6s var(--ease-out) 0.35s both;
}

.hero-stat { text-align: center; }

.hero-stat-num {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
}

.hero-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  background: var(--nexus-teal);
  color: var(--bg);
  text-decoration: none;
  transition: all 0.2s;
}
.hero-cta:hover {
  color: var(--bg);
  background: #00f5df;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.hero-cta svg { width: 18px; height: 18px; }

/* ═══════════════════════════════════════════════════
   SERIES GRID — Homepage post cards
   ═══════════════════════════════════════════════════ */

.series-section {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 2rem 6rem;
}

/* Filter chips */
.filter-chips {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 3rem;
  animation: fadeUp 0.6s var(--ease-out) 0.4s both;
}

.filter-chip {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.filter-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 224, 204, 0.06);
}

.filter-chip.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 224, 204, 0.06);
}

.series-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
}

.series-card {
  display: flex;
  flex-direction: column;
  padding: 1.75rem;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

/* Module gradient overlay — appears on hover */
.series-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--duration-base) var(--ease-out);
  pointer-events: none;
  border-radius: inherit;
}

.series-card:hover::before { opacity: 1; }

.series-card:hover {
  color: var(--text);
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

/* Module-specific hover glows */
.series-card[data-module="All"]::before { background: radial-gradient(ellipse at top left, rgba(13,148,136,0.08), transparent 70%); }
.series-card[data-module="DataHub"]::before { background: radial-gradient(ellipse at top left, rgba(99,102,241,0.08), transparent 70%); }
.series-card[data-module="DataHub"]:hover { border-color: rgba(99,102,241,0.3); box-shadow: 0 16px 40px rgba(99,102,241,0.08); }
.series-card[data-module="Mock Location"]::before { background: radial-gradient(ellipse at top left, rgba(245,158,11,0.08), transparent 70%); }
.series-card[data-module="Mock Location"]:hover { border-color: rgba(245,158,11,0.3); box-shadow: 0 16px 40px rgba(245,158,11,0.08); }
.series-card[data-module="Deep Inspector"]::before { background: radial-gradient(ellipse at top left, rgba(244,63,94,0.08), transparent 70%); }
.series-card[data-module="Deep Inspector"]:hover { border-color: rgba(244,63,94,0.3); box-shadow: 0 16px 40px rgba(244,63,94,0.08); }
.series-card[data-module="Custom Forms"]::before { background: radial-gradient(ellipse at top left, rgba(34,197,94,0.08), transparent 70%); }
.series-card[data-module="Custom Forms"]:hover { border-color: rgba(34,197,94,0.3); box-shadow: 0 16px 40px rgba(34,197,94,0.08); }
.series-card[data-module="Terminal"]::before { background: radial-gradient(ellipse at top left, rgba(59,130,246,0.08), transparent 70%); }
.series-card[data-module="Terminal"]:hover { border-color: rgba(59,130,246,0.3); box-shadow: 0 16px 40px rgba(59,130,246,0.08); }
.series-card[data-module="AI Agent"]::before { background: radial-gradient(ellipse at top left, rgba(236,72,153,0.08), transparent 70%); }
.series-card[data-module="AI Agent"]:hover { border-color: rgba(236,72,153,0.3); box-shadow: 0 16px 40px rgba(236,72,153,0.08); }
.series-card[data-module="Token System"]::before { background: radial-gradient(ellipse at top left, rgba(234,179,8,0.08), transparent 70%); }
.series-card[data-module="Token System"]:hover { border-color: rgba(234,179,8,0.3); box-shadow: 0 16px 40px rgba(234,179,8,0.08); }

/* Module-colored badges */
.series-card[data-module="DataHub"] .card-module { color: var(--mod-datahub); background: rgba(99,102,241,0.12); }
.series-card[data-module="Mock Location"] .card-module { color: var(--mod-mocklocation); background: rgba(245,158,11,0.12); }
.series-card[data-module="Deep Inspector"] .card-module { color: var(--mod-deepinspector); background: rgba(244,63,94,0.12); }
.series-card[data-module="Custom Forms"] .card-module { color: var(--mod-customforms); background: rgba(34,197,94,0.12); }
.series-card[data-module="Terminal"] .card-module { color: var(--mod-terminal); background: rgba(59,130,246,0.12); }
.series-card[data-module="AI Agent"] .card-module { color: var(--mod-aiagent); background: rgba(236,72,153,0.12); }
.series-card[data-module="Token System"] .card-module { color: var(--mod-tokensystem); background: rgba(234,179,8,0.12); }

/* Card hidden by filter */
.series-card.hidden {
  display: none;
}

/* Card top row — number + module side by side */
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 1;
}

.card-number {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-faint);
}

.card-module {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(0, 224, 204, 0.06);
}

.card-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1.25;
  margin-bottom: 0.75rem;
  position: relative;
  z-index: 1;
}

.card-desc {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-secondary);
  flex: 1;
  position: relative;
  z-index: 1;
  font-weight: 300;
}

/* Card footer — read time + arrow */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.card-time {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.card-arrow {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: all 0.2s;
}

.series-card:hover .card-arrow {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 224, 204, 0.06);
}

/* ═══════════════════════════════════════════════════
   BLOG LIST — /posts/ with sidebar
   ═══════════════════════════════════════════════════ */

.blog-layout {
  display: flex;
  max-width: var(--page-max);
  margin: 0 auto;
  padding-top: var(--nav-height);
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  position: sticky;
  top: var(--nav-height);
  height: calc(100vh - var(--nav-height));
  overflow-y: auto;
  padding: 28px 20px;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-section { margin-bottom: 28px; }

.sidebar-title {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding-left: 12px;
}

.sidebar-links { list-style: none; }

.sidebar-links li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--duration-fast) var(--ease-out);
  text-decoration: none;
}

.sidebar-links li a:hover {
  color: var(--text);
  background: var(--accent-glow);
}

.sidebar-links li a.active {
  color: var(--accent);
  background: var(--accent-dim);
}

.sidebar-links .cat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sidebar-search {
  position: relative;
  margin-bottom: 24px;
}

.sidebar-search input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.85rem;
  font-family: var(--font-body);
  outline: none;
  transition: border-color var(--duration-fast) var(--ease-out);
  backdrop-filter: blur(8px);
}

.sidebar-search input::placeholder { color: var(--text-muted); }
.sidebar-search input:focus { border-color: var(--accent); }

.sidebar-search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 16px;
  height: 16px;
}

/* Blog Content */
.blog-content {
  flex: 1;
  padding: 32px 40px;
  min-width: 0;
}

.blog-list-header {
  margin-bottom: 32px;
}

.blog-list-header h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.blog-list-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.blog-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.blog-list-item {
  padding: 20px 24px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  display: block;
  color: var(--text);
  transition: all var(--duration-base) var(--ease-out);
  backdrop-filter: blur(8px);
}

.blog-list-item:hover {
  color: var(--text);
  background: var(--bg-glass-hover);
  border-color: var(--border-accent);
  transform: translateX(4px);
  box-shadow: var(--shadow-card);
}

.blog-list-item .post-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
}

.blog-list-item h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 400;
  margin: 3px 0 6px;
}

.blog-list-item > p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.blog-list-item .tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.blog-list-item .tag {
  font-size: 0.68rem;
  padding: 2px 8px;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: var(--radius-pill);
  font-weight: 500;
  font-family: var(--font-mono);
}

/* ═══════════════════════════════════════════════════
   ARTICLE — Single post reading experience
   ═══════════════════════════════════════════════════ */

.article-layout {
  display: flex;
  max-width: var(--page-max);
  margin: 0 auto;
  padding-top: var(--nav-height);
}

.article-main {
  flex: 1;
  padding: 48px 48px 80px;
  max-width: calc(var(--content-max) + 96px);
  min-width: 0;
}

/* TOC Sidebar */
.article-toc {
  width: var(--toc-width);
  position: sticky;
  top: calc(var(--nav-height) + 32px);
  height: fit-content;
  padding: 0 24px 24px 0;
  flex-shrink: 0;
}

.toc-title {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.article-toc #TableOfContents ul {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 1px solid var(--border);
}

.article-toc #TableOfContents li { margin: 0; }

.article-toc #TableOfContents a {
  display: block;
  padding: 5px 16px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--text-muted);
  transition: all var(--duration-fast) var(--ease-out);
  text-decoration: none;
  border-left: 2px solid transparent;
  margin-left: -1px;
  line-height: 1.4;
}

.article-toc #TableOfContents a:hover {
  color: var(--text-secondary);
}

.article-toc #TableOfContents a.active {
  color: var(--accent);
  border-left-color: var(--accent);
}

.article-toc #TableOfContents ul ul {
  border-left: none;
}

.article-toc #TableOfContents ul ul a {
  padding-left: 28px;
  font-size: 0.74rem;
}

/* Article Header */
.article-header {
  margin-bottom: 48px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.breadcrumb a {
  color: var(--text-muted);
  transition: color var(--duration-fast);
}
.breadcrumb a:hover { color: var(--accent); }

.breadcrumb .sep { opacity: 0.4; }

.article-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 1.25rem;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.article-meta .module-badge {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.72rem;
  background: var(--accent-dim);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.02em;
}

.article-meta .sep { opacity: 0.3; }

.article-desc {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--text-secondary);
  margin-top: 20px;
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════
   ARTICLE BODY — Typography for reading
   ═══════════════════════════════════════════════════ */

.article-body {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-secondary);
  font-weight: 300;
}

.article-body > *:first-child { margin-top: 0; }

.article-body h2 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--text);
  margin: 3.5rem 0 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.article-body h3 {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 2.5rem 0 0.75rem;
}

.article-body h4 {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
  margin: 1.75rem 0 0.5rem;
}

.article-body p {
  margin-bottom: 1.5rem;
}

.article-body strong {
  color: var(--text);
  font-weight: 500;
}

.article-body ul, .article-body ol {
  margin: 16px 0;
  padding-left: 24px;
}

.article-body li {
  margin-bottom: 8px;
  line-height: 1.7;
}

.article-body li > p { margin-bottom: 6px; }

/* Inline code */
.article-body code {
  font-family: var(--font-mono);
  font-size: 0.84em;
  background: var(--accent-dim);
  color: var(--accent);
  padding: 2px 7px;
  border-radius: 5px;
}

/* Code blocks */
.article-body pre {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  overflow-x: auto;
  margin: 28px 0;
  position: relative;
}

.article-body pre code {
  background: none;
  padding: 0;
  color: #e2e8f0;
  font-size: 0.82rem;
  line-height: 1.7;
}

[data-theme="light"] .article-body pre {
  background: #1e293b;
}

[data-theme="light"] .article-body pre code {
  color: #e2e8f0;
}

/* Blockquote */
.article-body blockquote {
  padding: 20px 24px;
  margin: 28px 0;
  border-left: 3px solid var(--accent);
  background: var(--accent-glow);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.article-body blockquote p {
  font-size: 0.95rem;
  margin-bottom: 8px;
}
.article-body blockquote p:last-child { margin-bottom: 0; }

/* Tables */
.article-body table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 28px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  font-size: 0.88rem;
  line-height: 1.5;
}

.article-body th {
  font-family: var(--font-display);
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--teal-700), var(--teal-800));
  color: white;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

[data-theme="light"] .article-body th {
  background: linear-gradient(135deg, var(--teal-600), var(--teal-700));
}

.article-body td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.article-body tr:last-child td { border-bottom: none; }

.article-body tr:hover td {
  background: var(--bg-glass);
}

/* Horizontal rule */
.article-body hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-hover), transparent);
  margin: 56px 0;
}

/* ═══════════════════════════════════════════════════
   ARTICLE FOOTER — CTA + Navigation
   ═══════════════════════════════════════════════════ */

.article-cta {
  margin: 56px 0;
  padding: 40px 32px;
  background: linear-gradient(135deg, var(--bg-raised), var(--bg-subtle));
  border: 1px solid var(--border-hover);
  border-radius: 12px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Glow orb — top-right accent */
.article-cta::before {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  top: -150px;
  right: -100px;
  pointer-events: none;
}

.article-cta h3 {
  font-family: var(--font-serif);
  font-size: 1.65rem;
  font-weight: 400;
  margin-bottom: 0.75rem;
  position: relative;
}

.article-cta > p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  position: relative;
  font-weight: 300;
}

.article-cta .btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.article-cta .btn:hover {
  background: #00f5df;
  transform: translateY(-2px);
  box-shadow: 0 6px 30px var(--accent-glow);
  color: var(--bg);
}

.article-cta .btn-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 10px;
  position: relative;
}

/* Post navigation */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 48px;
}

.post-nav-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 1.25rem 1.5rem;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
}

.post-nav-link:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  color: var(--text);
}

.post-nav-next { text-align: right; }
.post-nav-next:only-child { grid-column: 2; }

.post-nav-dir {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
}

.post-nav-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

.back-to-all {
  display: block;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 20px;
}
.back-to-all:hover { color: var(--accent); }

/* ═══════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════ */

.site-footer {
  padding: 48px 24px 28px;
  border-top: 1px solid var(--border);
  margin-top: 60px;
}

.footer-grid {
  max-width: var(--page-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}

.footer-brand .footer-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
  margin-bottom: 10px;
}
.footer-brand .footer-logo:hover { color: var(--text); }
.footer-brand .footer-logo svg { width: 28px; height: 28px; }

.footer-brand > p {
  color: var(--text-muted);
  font-size: 0.85rem;
  max-width: 280px;
  line-height: 1.55;
}

.footer-col h4 {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 14px;
  color: var(--text-secondary);
}

.footer-links { list-style: none; }
.footer-links li { margin-bottom: 6px; }
.footer-links a {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-decoration: none;
  transition: color var(--duration-fast);
}
.footer-links a:hover { color: var(--accent); }

.footer-bottom {
  max-width: var(--page-max);
  margin: 32px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer-bottom a { color: var(--text-muted); }
.footer-bottom a:hover { color: var(--accent); }

/* ═══════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════ */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); filter: blur(6px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Scroll-triggered reveals */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Hero staggered entrance */
.hero-badge { animation: fadeIn 0.6s var(--ease-out) 0.05s both; }
.hero h1 { animation: fadeUp 0.8s var(--ease-out) 0.1s both; }
.hero-sub { animation: fadeUp 0.8s var(--ease-out) 0.2s both; }
.hero-cta { animation: fadeUp 0.8s var(--ease-out) 0.3s both; }

/* Staggered card reveals */
.series-card.reveal:nth-child(1) { transition-delay: 0ms; }
.series-card.reveal:nth-child(2) { transition-delay: 60ms; }
.series-card.reveal:nth-child(3) { transition-delay: 120ms; }
.series-card.reveal:nth-child(4) { transition-delay: 180ms; }
.series-card.reveal:nth-child(5) { transition-delay: 240ms; }
.series-card.reveal:nth-child(6) { transition-delay: 300ms; }
.series-card.reveal:nth-child(7) { transition-delay: 360ms; }
.series-card.reveal:nth-child(8) { transition-delay: 420ms; }
.series-card.reveal:nth-child(9) { transition-delay: 480ms; }
.series-card.reveal:nth-child(10) { transition-delay: 540ms; }

/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  .article-toc { display: none; }
  .article-main { padding: 36px 32px 60px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  body { font-size: 15px; }

  .sidebar { display: none; }
  .blog-content { padding: 24px 16px; }
  .article-main { padding: 24px 16px 48px; }

  .nav-links { display: none; }
  .mobile-menu-btn { display: block; }

  .nav-links.open {
    display: flex !important;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(24px);
  }

  .hero { padding: calc(var(--nav-height) + 48px) 1.25rem 3rem; }
  .hero h1 { font-size: 2.25rem; }
  .hero-sub { font-size: 1rem; }
  .hero-stats { gap: 2rem; }

  .filter-chips { padding: 0 1.25rem; margin-bottom: 2rem; }

  .series-section { padding: 0 1.25rem 4rem; }
  .series-grid { grid-template-columns: 1fr; }

  .article-header h1 { font-size: 1.6rem; }
  .article-body { font-size: 1rem; }

  .post-nav { grid-template-columns: 1fr; }
  .post-nav-next { text-align: left; }
  .post-nav-next:only-child { grid-column: 1; }

  .footer-grid { grid-template-columns: 1fr; gap: 28px; }

  .article-body pre {
    border-radius: var(--radius-sm);
    padding: 16px;
  }

  .article-body table {
    display: block;
    overflow-x: auto;
  }
}

@media (max-width: 480px) {
  .breadcrumb { font-size: 0.75rem; }
  .article-meta { font-size: 0.75rem; }
}
