:root, .theme-light {
  --bg: #e8f0f7;
  --panel: rgba(255, 255, 255, 0.78);
  --text: #16202c;
  --muted: #546575;
  --line: rgba(46, 80, 144, 0.16);
  --accent: #2e5090;
  --accent-2: #3b6fb6;
  --accent-3: #5b8def;
  --shadow: 0 18px 48px rgba(22, 48, 85, 0.14);
  --radius: 28px;
  --max: 1280px;
  --text-secondary: #2a3a4a;
  --btn-text: #fff7ed;
  --code-bg: rgba(46, 80, 144, 0.09);
  --code-text: var(--accent);
  --code-border: transparent;
  --pre-bg: #eef3f8;
  --details-bg: rgba(255, 255, 255, 0.62);
  --details-open-bg: rgba(255, 255, 255, 0.58);
  --details-summary: #1e2c3a;
  --quote-text: #f0f7ff;
  --quote-muted: rgba(240, 247, 255, 0.72);
  --mermaid-fill: #16202c;
  --mermaid-node-fill: #e8f0f7;
  --mermaid-node-stroke: #546575;
  --mermaid-label-bg: #e8f0f7;
  --overlay-bg: rgba(12, 20, 30, 0.88);
  --overlay-inner-bg: rgba(244, 249, 255, 0.88);
  --close-hint: rgba(244, 237, 227, 0.6);
  --close-hint-hover: rgba(244, 237, 227, 0.85);
  --body-bg:
    radial-gradient(circle at 12% 8%, rgba(91, 141, 239, 0.18), transparent 34%),
    radial-gradient(circle at 88% 16%, rgba(46, 80, 144, 0.14), transparent 30%),
    radial-gradient(circle at 50% 100%, rgba(91, 141, 239, 0.10), transparent 48%),
    linear-gradient(180deg, #f4f9ff 0%, #eaf1f8 52%, #e2ebf4 100%);
}

.theme-dark {
  --bg: #1c1814;
  --panel: rgba(55, 48, 42, 0.80);
  --text: #f2e8d8;
  --muted: #b09f8a;
  --line: rgba(176, 159, 138, 0.16);
  --accent: #d97a48;
  --accent-2: #6ec4b2;
  --accent-3: #ebbf60;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
  --radius: 28px;
  --max: 1280px;
  --text-secondary: #d3c7b6;
  --btn-text: #1c1814;
  --code-bg: rgba(110, 196, 178, 0.12);
  --code-text: var(--accent-2);
  --code-border: rgba(110, 196, 178, 0.18);
  --pre-bg: #0f0d0b;
  --details-bg: rgba(55, 48, 42, 0.66);
  --details-open-bg: rgba(55, 48, 42, 0.82);
  --details-summary: #d3c7b6;
  --quote-text: #f0e8dc;
  --quote-muted: rgba(240, 232, 220, 0.72);
  --mermaid-fill: #f0e8dc;
  --mermaid-node-fill: #2d2824;
  --mermaid-node-stroke: #9a8876;
  --mermaid-label-bg: #2d2824;
  --overlay-bg: rgba(31, 26, 23, 0.88);
  --overlay-inner-bg: #211c18;
  --close-hint: rgba(244, 237, 227, 0.6);
  --close-hint-hover: rgba(244, 237, 227, 0.85);
  --body-bg:
    radial-gradient(circle at top left, rgba(215, 155, 53, 0.08), transparent 32%),
    radial-gradient(circle at top right, rgba(31, 75, 71, 0.08), transparent 28%),
    linear-gradient(180deg, #211c18 0%, #1c1814 58%, #181512 100%);
}

.theme-catppuccin {
  --bg: #1e1e2e;
  --panel: rgba(30, 30, 46, 0.88);
  --text: #cdd6f4;
  --muted: #a6adc8;
  --line: rgba(69, 71, 90, 0.3);
  --accent: #cba6f7;
  --accent-2: #89b4fa;
  --accent-3: #f5c2e7;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
  --radius: 28px;
  --max: 1280px;
  --text-secondary: #bac2de;
  --btn-text: #1e1e2e;
  --code-bg: rgba(137, 180, 250, 0.12);
  --code-text: var(--accent-2);
  --code-border: rgba(137, 180, 250, 0.18);
  --pre-bg: #181825;
  --details-bg: rgba(30, 30, 46, 0.7);
  --details-open-bg: rgba(30, 30, 46, 0.85);
  --details-summary: #bac2de;
  --quote-text: #cdd6f4;
  --quote-muted: rgba(205, 214, 244, 0.6);
  --mermaid-fill: #cdd6f4;
  --mermaid-node-fill: #181825;
  --mermaid-node-stroke: #6c7086;
  --mermaid-label-bg: #181825;
  --overlay-bg: rgba(24, 24, 37, 0.9);
  --overlay-inner-bg: #11111b;
  --close-hint: rgba(205, 214, 244, 0.45);
  --close-hint-hover: rgba(205, 214, 244, 0.7);
  --body-bg:
    radial-gradient(circle at 20% 10%, rgba(203, 166, 247, 0.06), transparent 30%),
    radial-gradient(circle at 90% 20%, rgba(137, 180, 250, 0.06), transparent 28%),
    linear-gradient(180deg, #1e1e2e 0%, #181825 60%, #11111b 100%);
}

.theme-tokyo-night {
  --bg: #1a1b26;
  --panel: rgba(26, 27, 38, 0.88);
  --text: #a9b1d6;
  --muted: #565f89;
  --line: rgba(86, 95, 137, 0.25);
  --accent: #7aa2f7;
  --accent-2: #bb9af7;
  --accent-3: #f7768e;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
  --radius: 28px;
  --max: 1280px;
  --text-secondary: #9aa5ce;
  --btn-text: #1a1b26;
  --code-bg: rgba(187, 154, 247, 0.12);
  --code-text: var(--accent-2);
  --code-border: rgba(187, 154, 247, 0.18);
  --pre-bg: #16161e;
  --details-bg: rgba(26, 27, 38, 0.7);
  --details-open-bg: rgba(26, 27, 38, 0.85);
  --details-summary: #9aa5ce;
  --quote-text: #a9b1d6;
  --quote-muted: rgba(169, 177, 214, 0.6);
  --mermaid-fill: #a9b1d6;
  --mermaid-node-fill: #16161e;
  --mermaid-node-stroke: #565f89;
  --mermaid-label-bg: #16161e;
  --overlay-bg: rgba(22, 22, 30, 0.9);
  --overlay-inner-bg: #13141d;
  --close-hint: rgba(169, 177, 214, 0.45);
  --close-hint-hover: rgba(169, 177, 214, 0.7);
  --body-bg:
    radial-gradient(circle at 15% 8%, rgba(122, 162, 247, 0.06), transparent 30%),
    radial-gradient(circle at 85% 15%, rgba(247, 118, 142, 0.05), transparent 28%),
    linear-gradient(180deg, #1a1b26 0%, #16161e 60%, #13141d 100%);
}

.theme-dracula {
  --bg: #282a36;
  --panel: rgba(40, 42, 54, 0.88);
  --text: #f8f8f2;
  --muted: #6272a4;
  --line: rgba(98, 114, 164, 0.25);
  --accent: #bd93f9;
  --accent-2: #50fa7b;
  --accent-3: #ffb86c;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
  --radius: 28px;
  --max: 1280px;
  --text-secondary: #e6e6d4;
  --btn-text: #282a36;
  --code-bg: rgba(80, 250, 123, 0.12);
  --code-text: var(--accent-2);
  --code-border: rgba(80, 250, 123, 0.2);
  --pre-bg: #21222c;
  --details-bg: rgba(40, 42, 54, 0.7);
  --details-open-bg: rgba(40, 42, 54, 0.85);
  --details-summary: #e6e6d4;
  --quote-text: #f8f8f2;
  --quote-muted: rgba(248, 248, 242, 0.6);
  --mermaid-fill: #f8f8f2;
  --mermaid-node-fill: #21222c;
  --mermaid-node-stroke: #6272a4;
  --mermaid-label-bg: #21222c;
  --overlay-bg: rgba(33, 34, 44, 0.9);
  --overlay-inner-bg: #191a21;
  --close-hint: rgba(248, 248, 242, 0.45);
  --close-hint-hover: rgba(248, 248, 242, 0.7);
  --body-bg:
    radial-gradient(circle at 10% 12%, rgba(189, 147, 249, 0.06), transparent 30%),
    radial-gradient(circle at 90% 18%, rgba(255, 184, 108, 0.05), transparent 28%),
    linear-gradient(180deg, #282a36 0%, #21222c 60%, #191a21 100%);
}

.theme-nord {
  --bg: #2e3440;
  --panel: rgba(46, 52, 64, 0.88);
  --text: #eceff4;
  --muted: #81a1c1;
  --line: rgba(129, 161, 193, 0.2);
  --accent: #88c0d0;
  --accent-2: #b48ead;
  --accent-3: #a3be8c;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
  --radius: 28px;
  --max: 1280px;
  --text-secondary: #d8dee9;
  --btn-text: #2e3440;
  --code-bg: rgba(180, 142, 173, 0.12);
  --code-text: var(--accent-2);
  --code-border: rgba(180, 142, 173, 0.2);
  --pre-bg: #242933;
  --details-bg: rgba(46, 52, 64, 0.7);
  --details-open-bg: rgba(46, 52, 64, 0.85);
  --details-summary: #d8dee9;
  --quote-text: #eceff4;
  --quote-muted: rgba(236, 239, 244, 0.6);
  --mermaid-fill: #eceff4;
  --mermaid-node-fill: #242933;
  --mermaid-node-stroke: #81a1c1;
  --mermaid-label-bg: #242933;
  --overlay-bg: rgba(36, 41, 51, 0.9);
  --overlay-inner-bg: #1e232b;
  --close-hint: rgba(236, 239, 244, 0.45);
  --close-hint-hover: rgba(236, 239, 244, 0.7);
  --body-bg:
    radial-gradient(circle at 18% 10%, rgba(136, 192, 208, 0.06), transparent 30%),
    radial-gradient(circle at 82% 16%, rgba(163, 190, 140, 0.05), transparent 28%),
    linear-gradient(180deg, #2e3440 0%, #242933 60%, #1e232b 100%);
}

.theme-gruvbox {
  --bg: #282828;
  --panel: rgba(40, 40, 40, 0.88);
  --text: #ebdbb2;
  --muted: #a89984;
  --line: rgba(168, 152, 132, 0.2);
  --accent: #fe8019;
  --accent-2: #8ec07c;
  --accent-3: #fabd2f;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
  --radius: 28px;
  --max: 1280px;
  --text-secondary: #d5c4a1;
  --btn-text: #282828;
  --code-bg: rgba(142, 192, 124, 0.12);
  --code-text: var(--accent-2);
  --code-border: rgba(142, 192, 124, 0.2);
  --pre-bg: #1d2021;
  --details-bg: rgba(40, 40, 40, 0.7);
  --details-open-bg: rgba(40, 40, 40, 0.85);
  --details-summary: #d5c4a1;
  --quote-text: #ebdbb2;
  --quote-muted: rgba(235, 219, 178, 0.6);
  --mermaid-fill: #ebdbb2;
  --mermaid-node-fill: #1d2021;
  --mermaid-node-stroke: #a89984;
  --mermaid-label-bg: #1d2021;
  --overlay-bg: rgba(29, 32, 33, 0.9);
  --overlay-inner-bg: #181818;
  --close-hint: rgba(235, 219, 178, 0.45);
  --close-hint-hover: rgba(235, 219, 178, 0.7);
  --body-bg:
    radial-gradient(circle at 14% 8%, rgba(254, 128, 25, 0.06), transparent 30%),
    radial-gradient(circle at 86% 14%, rgba(142, 192, 124, 0.05), transparent 28%),
    linear-gradient(180deg, #282828 0%, #1d2021 60%, #181818 100%);
}

.theme-rose-pine {
  --bg: #191724;
  --panel: rgba(25, 23, 36, 0.88);
  --text: #e0def4;
  --muted: #908caa;
  --line: rgba(81, 78, 105, 0.25);
  --accent: #c4a7e7;
  --accent-2: #9ccfd8;
  --accent-3: #ebbcba;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
  --radius: 28px;
  --max: 1280px;
  --text-secondary: #c5c3db;
  --btn-text: #191724;
  --code-bg: rgba(156, 207, 216, 0.12);
  --code-text: var(--accent-2);
  --code-border: rgba(156, 207, 216, 0.2);
  --pre-bg: #13111d;
  --details-bg: rgba(25, 23, 36, 0.7);
  --details-open-bg: rgba(25, 23, 36, 0.85);
  --details-summary: #c5c3db;
  --quote-text: #e0def4;
  --quote-muted: rgba(224, 222, 244, 0.6);
  --mermaid-fill: #e0def4;
  --mermaid-node-fill: #13111d;
  --mermaid-node-stroke: #6e6a86;
  --mermaid-label-bg: #13111d;
  --overlay-bg: rgba(19, 17, 29, 0.9);
  --overlay-inner-bg: #0f0d1a;
  --close-hint: rgba(224, 222, 244, 0.45);
  --close-hint-hover: rgba(224, 222, 244, 0.7);
  --body-bg:
    radial-gradient(circle at 12% 8%, rgba(196, 167, 231, 0.06), transparent 30%),
    radial-gradient(circle at 88% 12%, rgba(235, 188, 186, 0.05), transparent 28%),
    linear-gradient(180deg, #191724 0%, #13111d 60%, #0f0d1a 100%);
}

* {
  box-sizing: border-box;
}

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

html {
  scroll-behavior: smooth;
  /* `clip` (not `hidden`) avoids creating a scroll container on the root,
     which would force scrolling off the browser's fast compositor path and
     cause the clunky/jittery scrolling. Older browsers fall back to hidden. */
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  background: var(--body-bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  overflow-wrap: break-word;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(46, 80, 144, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46, 80, 144, 0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 88%);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 88%);
  z-index: 1;
  /* Pin the fixed overlay to its own compositor layer so the masked grid does
     not force the entire page to repaint on every scroll frame. */
  transform: translateZ(0);
  will-change: transform;
}

a {
  color: inherit;
  text-decoration: none;
}

p {
  margin: 0;
}

.shell {
  width: min(calc(100% - 48px), var(--max));
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(12px) saturate(140%);
  background: rgba(244, 249, 255, 0.62);
  border-bottom: 1px solid var(--line);
  /* Promote to its own compositor layer so the blur is re-composited rather
     than triggering a full-page repaint on every scroll frame. */
  transform: translateZ(0);
  will-change: transform;
  contain: layout paint;
}

.topbar {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.brand-role, .eyebrow, .micro-label, .meta {
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.brand-role {
  font-size: 0.72rem;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 20px;
}

.nav a {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  transition: color 180ms ease;
}

.nav-toggle {
  display: none;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(46, 80, 144, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px);
  color: var(--text);
  cursor: pointer;
}

.nav-toggle-lines {
  display: inline-grid;
  gap: 5px;
}

.nav-toggle-lines span {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
  transition: transform 180ms ease, opacity 180ms ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-lines span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-lines span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-lines span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav a:hover, .nav a:focus-visible, .inline-link:hover, .inline-link:focus-visible {
  color: var(--accent);
}

main {
  padding: 40px 0 96px;
}

section {
  margin-top: 48px;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 56px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 10px);
  background:
    radial-gradient(circle at 80% 12%, rgba(91, 141, 239, 0.22), transparent 22%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(232, 241, 248, 0.68));
  backdrop-filter: blur(16px) saturate(150%);
  box-shadow: var(--shadow);
}

.hero-layout, .panel-grid, .project-grid, .stack-grid, .coverage-grid, .closing-grid {
  display: grid;
  gap: 24px;
}

.hero-layout {
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.82fr);
  align-items: center;
}

.hero-side {
  display: grid;
  gap: 24px;
}

.panel-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
}

.project-grid, .stack-grid, .coverage-grid, .closing-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.eyebrow {
  font-size: 0.78rem;
  margin-bottom: 20px;
}

h1, h2, h3 {
  margin: 0;
  line-height: 1;
  letter-spacing: -0.05em;
  font-weight: 700;
}

h1 {
  max-width: 14ch;
  font-size: clamp(3.0rem, 6.5vw, 5.2rem);
  line-height: 0.94;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  margin-top: 10px;
}

.hero-copy p {
  margin-top: 26px;
  max-width: 62ch;
  font-size: 1.14rem;
  color: var(--text-secondary);
}

.hero-actions, .link-row, .meta-row, .footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 18px;
}

.button, .button-muted {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

.button:hover, .button-muted:hover, .button:focus-visible, .button-muted:focus-visible {
  transform: translateY(-2px);
}

.button {
  background: var(--text);
  color: var(--btn-text);
  border-color: var(--text);
}

.button:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.button-muted {
  border-color: rgba(46, 80, 144, 0.18);
  background: rgba(255, 255, 255, 0.62);
  color: var(--text);
}

.button-muted:hover {
  border-color: var(--accent-2);
  color: var(--accent-2);
  background: rgba(255, 255, 255, 0.78);
}

.hero-panel, .card, .feature, .timeline-card, .quote-card {
  padding: 30px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 10px 24px rgba(22, 48, 85, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.hero-panel {
  background: rgba(255, 255, 255, 0.48);
}

.hero-panel h2, .card h3, .feature h3, .timeline-card h3, .quote-card h3 {
  font-size: 1.55rem;
  line-height: 1.05;
}

.hero-avatar {
  width: min(100%, 320px);
  aspect-ratio: 1;
  justify-self: center;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 18px 44px rgba(22, 48, 85, 0.18);
  background: rgba(255, 255, 255, 0.55);
  margin: 0;
}

.hero-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-list {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 16px;
}

.hero-list li {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(46, 80, 144, 0.12);
}

.hero-list li:first-child {
  padding-top: 0;
  border-top: 0;
}

.hero-list strong, .meta {
  font-size: 0.76rem;
  color: var(--accent-2);
}

.metrics, .signal-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.metrics {
  margin-top: 28px;
}

.metric, .signal {
  padding: 24px 22px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 8px 20px rgba(22, 48, 85, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.metric {
  min-height: 178px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric strong {
  display: block;
  font-size: clamp(1.55rem, 3vw, 2.4rem);
  letter-spacing: -0.05em;
  color: var(--accent);
}

.metric span, .signal span, .section-head p {
  color: var(--muted);
}

.metric span, .signal span {
  display: block;
  margin-top: 8px;
  font-size: 0.96rem;
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 6px 24px;
  margin-bottom: 20px;
}

.section-head .micro-label {
  grid-column: 1 / 2;
  grid-row: 1 / 2;
}

.section-head h2 {
  grid-column: 1 / 2;
  grid-row: 2 / 3;
  margin-top: 0;
}

.section-head p {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
  align-self: center;
  max-width: 72ch;
}

.feature {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(226, 235, 244, 0.58));
}

.timeline {
  display: grid;
  gap: 16px;
}

.timeline-card {
  position: relative;
  overflow: hidden;
}

.timeline-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: linear-gradient(180deg, var(--accent), var(--accent-3));
}

.card-header, .project-top, .footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.card p + p, .feature p + p, .timeline-card p + p {
  margin-top: 12px;
}

.bullet-list, .project-list, .coverage-list, .pub-list, .stack-list {
  margin: 18px 0 0;
  padding-left: 18px;
}

.bullet-list li, .project-list li, .coverage-list li, .pub-list li, .stack-list li {
  margin-top: 10px;
  color: var(--text);
}

.bullet-list li:first-child, .project-list li:first-child, .coverage-list li:first-child, .pub-list li:first-child, .stack-list li:first-child {
  margin-top: 0;
}

.inline-link {
  color: var(--accent);
  font-weight: 600;
}

.signal {
  background: rgba(91, 141, 239, 0.10);
  border-color: rgba(46, 80, 144, 0.16);
}

.signal strong {
  display: block;
  font-size: 1.05rem;
  color: var(--accent-2);
}

.quote-card {
  display: grid;
  align-content: space-between;
  gap: 24px;
  background: linear-gradient(135deg, rgba(46, 80, 144, 0.88), rgba(22, 48, 85, 0.94));
  color: var(--quote-text);
}

.quote-card p {
  font-size: clamp(1.4rem, 2.5vw, 2.2rem);
  line-height: 1.25;
  letter-spacing: -0.04em;
}

.quote-card span {
  font-family: "IBM Plex Mono", monospace;
  color: rgba(240, 247, 255, 0.72);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

.project-card, .pub-card {
  display: grid;
  gap: 14px;
}

.project-card h3 {
  font-size: 1.5rem;
}

.pub-card strong {
  display: block;
  font-size: 1.02rem;
}

.stack-category {
  margin-top: 18px;
}

.stack-category:first-of-type {
  margin-top: 0;
}

.stack-category h4 {
  margin: 0 0 6px 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-2);
}

.stack-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  background: rgba(46, 80, 144, 0.07);
  padding: 3px 10px;
  border-radius: 99px;
  border: 1px solid rgba(46, 80, 144, 0.12);
  color: var(--text);
}

.footer {
  margin-top: 48px;
  padding: 26px 0 50px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
  color: var(--muted);
}

.footer-note {
  width: 100%;
  margin-bottom: 16px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
  opacity: 0.8;
}

.reveal {
  opacity: 0;
  transform: translate3d(0, 14px, 0);
  transition: opacity 520ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 520ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
  backface-visibility: hidden;
}

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

/* Drop the compositing hint once the element has settled so we don't keep
   dozens of GPU layers alive (which itself hurts scroll smoothness). */
.reveal.is-done {
  will-change: auto;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button, .button-muted, .reveal {
    animation: none;
    transition: none;
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 980px) {
  .hero-layout, .panel-grid, .project-grid, .stack-grid, .coverage-grid, .closing-grid { grid-template-columns: 1fr; }
  .metrics, .signal-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { padding: 32px; }
  .section-head {
    grid-template-columns: 1fr;
    gap: 8px 0;
  }
  .section-head .micro-label {
    grid-column: 1 / -1;
    grid-row: 1 / 2;
  }
  .section-head h2 {
    grid-column: 1 / -1;
    grid-row: 2 / 3;
  }
  .section-head p {
    grid-column: 1 / -1;
    grid-row: 3 / 4;
    align-self: start;
  }
  .hero-avatar { width: min(100%, 280px); }
}

/* Disable the remaining backdrop blur on small screens where the GPU is most
   constrained and scroll jank is most noticeable. */
@media (max-width: 720px) {
  .site-header,
  .hero,
  .nav-toggle,
  .mermaid-overlay,
  .mermaid-overlay-inner {
    backdrop-filter: none;
  }
}

@media (max-width: 720px) {
  .shell { width: min(calc(100% - 24px), var(--max)); }
  .topbar { padding: 14px 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .brand { min-width: 0; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav {
    display: none;
    grid-column: 1 / -1;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 0 4px;
  }
  .nav.is-open { display: flex; }
  main { padding-top: 18px; }
  .hero, .hero-panel, .card, .feature, .timeline-card, .quote-card { padding: 22px; }
  h1 { max-width: 100%; font-size: clamp(2.4rem, 10vw, 3.8rem); }
  .metrics, .signal-bar { grid-template-columns: 1fr; }
  .hero-list li { grid-template-columns: 1fr; gap: 6px; }
  .project-top, .card-header, .footer { flex-direction: column; }
  .hero-actions { flex-direction: column; }
  .hero-actions .button, .hero-actions .button-muted { width: 100%; justify-content: center; }
}

/* Blog styles */
.blog-post {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 0;
}

.post-header {
  margin-bottom: 40px;
}

.post-back {
  display: inline-block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 20px;
}

.post-back:hover {
  color: var(--accent);
}

.post-header h1 {
  max-width: 100%;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.05;
  margin-bottom: 16px;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.post-meta time {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.85rem;
  color: var(--muted);
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.post-content {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

.post-content h2 {
  font-size: 1.8rem;
  margin: 40px 0 16px;
  letter-spacing: -0.03em;
}

.post-content h3 {
  font-size: 1.3rem;
  margin: 32px 0 12px;
}

.post-content p {
  margin: 16px 0;
}

.post-content pre {
  background: var(--pre-bg);
  color: var(--text);
  padding: 20px 24px;
  border-radius: 16px;
  overflow-x: auto;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.88rem;
  line-height: 1.6;
  margin: 20px 0;
  max-width: 100%;
  border: 1px solid var(--line);
}

.post-content code {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.88em;
  background: rgba(46, 80, 144, 0.09);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
}

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

.post-content hr {
  border: none;
  height: 1px;
  background: var(--line);
  margin: 40px 0;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin: 20px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.post-content th,
.post-content td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.post-content th {
  font-weight: 600;
  background: rgba(46, 80, 144, 0.08);
  color: var(--text);
}

.post-content tr:last-child td {
  border-bottom: none;
}

.post-content tbody tr:nth-child(even) {
  background: rgba(46, 80, 144, 0.03);
}

@media (max-width: 720px) {
  .post-content table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
}

.post-content details {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px 20px;
  margin: 32px 0;
  background: rgba(255, 255, 255, 0.62);
  transition: background 0.15s ease;
}

.post-content details[open] {
  background: rgba(255, 255, 255, 0.58);
}

.post-content details > summary {
  list-style: none;
  cursor: pointer;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--details-summary);
  padding: 12px 0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  user-select: none;
}

.post-content details > summary::-webkit-details-marker {
  display: none;
}

.post-content details > summary::before {
  content: "▸";
  display: inline-block;
  font-size: 0.9em;
  color: var(--accent-2);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.post-content details[open] > summary::before {
  transform: rotate(90deg);
}

.post-content details > summary:hover {
  color: var(--accent);
}

.post-content details > *:not(summary) {
  margin-left: 24px;
}

.post-content details > h3:first-of-type,
.post-content details > p:first-of-type {
  margin-top: 8px;
}

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

.post-content li {
  margin-top: 8px;
}

.post-content li:first-child {
  margin-top: 0;
}

.post-content strong {
  font-weight: 600;
}

.post-content a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

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

/* Blog index */
.blog-index {
  padding: 40px 0;
}

.post-list {
  display: grid;
  gap: 20px;
}

.post-card {
  padding: 28px 30px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 10px 24px rgba(22, 48, 85, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  display: grid;
  gap: 10px;
}

.post-card .post-date {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
  color: var(--muted);
}

.post-card h3 {
  font-size: 1.4rem;
  line-height: 1.15;
}

.post-card h3 a {
  color: var(--text);
}

.post-card h3 a:hover {
  color: var(--accent);
}

.post-card p {
  color: var(--text-secondary);
  font-size: 0.96rem;
}

.post-card .stack-tags {
  margin-top: 4px;
}

@media (max-width: 720px) {
  .blog-post { padding: 24px 0; }
  .post-header h1 { font-size: clamp(1.6rem, 6vw, 2.4rem); }
  .post-content { font-size: 1rem; }
  .post-content pre { padding: 16px 18px; font-size: 0.82rem; }
  .post-card { padding: 22px; }
}

.post-content .mermaid {
  margin: 28px auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 10px 24px rgba(22, 48, 85, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  overflow-x: auto;
  display: flex;
  justify-content: center;
  cursor: zoom-in;
  position: relative;
  transition: box-shadow 200ms ease;
  max-width: 100%;
}

.post-content .mermaid:hover {
  box-shadow: 0 18px 44px rgba(22, 48, 85, 0.16);
}

.post-content .mermaid svg {
  max-width: 100%;
  width: auto;
  height: auto;
  min-width: 0;
  flex-shrink: 1;
}

.post-content .mermaid .node rect,
.post-content .mermaid .node circle,
.post-content .mermaid .node polygon {
  stroke-width: 1.5px;
}

.post-content .mermaid .edgeLabel {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
}

.post-content .mermaid svg text {
  font-size: 13px;
  font-family: inherit;
  fill: var(--mermaid-fill) !important;
}

.post-content .mermaid .label text,
.post-content .mermaid .node text,
.post-content .mermaid .entityLabel,
.post-content .mermaid .entityAttribute,
.post-content .mermaid .er .entityLabel,
.post-content .mermaid .er .entityAttribute,
.post-content .mermaid .er .attribute,
.post-content .mermaid .er .attributeLabel,
.post-content .mermaid .er .attributeValue,
.post-content .mermaid .er .attr,
.post-content .mermaid .er text {
  fill: var(--mermaid-fill) !important;
}

.mermaid-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(12, 20, 30, 0.88);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  opacity: 0;
  visibility: hidden;
  transition: opacity 250ms ease, visibility 250ms ease;
}

.mermaid-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.mermaid-overlay-inner {
  width: 96vw;
  max-height: 94vh;
  overflow: auto;
  padding: 32px;
  border-radius: var(--radius);
  background: rgba(244, 249, 255, 0.88);
  backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--line);
  box-shadow: 0 24px 64px rgba(22, 48, 85, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
}

.mermaid-overlay-inner svg {
  max-width: 94vw;
  max-height: 90vh;
  width: auto;
  height: auto;
}

.mermaid-overlay .mermaid-close-hint {
  position: absolute;
  top: 16px;
  right: 20px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  color: rgba(244, 237, 227, 0.6);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
  transition: color 200ms ease;
}

.mermaid-overlay:hover .mermaid-close-hint {
  color: rgba(244, 237, 227, 0.85);
}

@media (max-width: 720px) {
  .post-content .mermaid {
    padding: 16px;
    border-radius: 18px;
  }
  .mermaid-overlay-inner {
    padding: 12px;
    border-radius: 20px;
    width: 92vw;
  }
}

/* Dark-mode element overrides (color variables are defined per-theme above) */
:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) body {
  background: var(--body-bg);
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) body::before {
  background-image:
    linear-gradient(rgba(176, 159, 138, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(176, 159, 138, 0.05) 1px, transparent 1px);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent 88%);
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .site-header {
  background: rgba(28, 24, 20, 0.80);
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .nav-toggle {
  border-color: rgba(176, 159, 138, 0.18);
  background: rgba(55, 48, 42, 0.6);
  color: var(--text);
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .hero {
  background:
    radial-gradient(circle at 80% 12%, rgba(215, 155, 53, 0.12), transparent 20%),
    linear-gradient(135deg, rgba(55, 48, 42, 0.95), rgba(42, 36, 32, 0.92));
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .hero-panel {
  background: rgba(55, 48, 42, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .hero-copy p,
:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .bullet-list li,
:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .project-list li,
:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .coverage-list li,
:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .pub-list li,
:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .post-card p {
  color: var(--text-secondary);
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .hero-avatar {
  border-color: var(--line);
  background: rgba(55, 48, 42, 0.82);
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .hero-list li {
  border-top-color: rgba(176, 159, 138, 0.10);
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .metric, :is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .signal {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .hero-panel, :is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .card, :is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .feature, :is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .timeline-card {
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2);
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .feature {
  background: linear-gradient(180deg, rgba(55, 48, 42, 0.92), rgba(42, 36, 32, 0.92));
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .signal {
  background: rgba(31, 75, 71, 0.14);
  border-color: rgba(110, 196, 178, 0.16);
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .quote-card {
  background: linear-gradient(135deg, rgba(31, 75, 71, 0.85), rgba(16, 35, 33, 0.9));
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .post-content {
  color: var(--text-secondary);
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .post-content a {
  color: var(--accent-2);
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .post-content a:hover {
  color: var(--accent);
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .post-content code {
  background: var(--code-bg);
  color: var(--code-text);
  border: 1px solid var(--code-border);
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .post-content pre {
  background: var(--pre-bg);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: inset 0 0 0 1px var(--line);
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .post-content pre code {
  background: transparent;
  color: inherit;
  border: none;
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .post-content th {
  background: rgba(110, 196, 178, 0.10);
  color: var(--text);
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .post-content tbody tr:nth-child(even) {
  background: rgba(110, 196, 178, 0.04);
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .post-content details {
  background: var(--details-bg);
  border-color: var(--line);
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .post-content details[open] {
  background: var(--details-open-bg);
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .post-content details > summary {
  color: var(--text-secondary);
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .post-content details > summary::before {
  color: var(--muted);
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .post-content .mermaid {
  background: var(--panel);
  border-color: var(--line);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.25);
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .post-content .mermaid .label text,
:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .post-content .mermaid .node text,
:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .post-content .mermaid .entityLabel,
:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .post-content .mermaid .entityAttribute,
:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .post-content .mermaid .er .entityLabel,
:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .post-content .mermaid .er .entityAttribute,
:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .post-content .mermaid .er .attribute,
:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .post-content .mermaid .er .attributeLabel,
:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .post-content .mermaid .er .attributeValue,
:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .post-content .mermaid .er .attr,
:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .post-content .mermaid .er text {
  fill: var(--mermaid-fill) !important;
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .post-content .mermaid .node rect,
:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .post-content .mermaid .node circle,
:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .post-content .mermaid .node polygon {
  stroke: var(--mermaid-node-stroke);
  fill: var(--mermaid-node-fill);
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .post-content .mermaid .edgeLabel {
  background-color: var(--mermaid-label-bg);
  color: var(--text);
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .post-content .mermaid:hover {
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .mermaid-overlay {
  background: var(--overlay-bg);
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .mermaid-overlay-inner {
  background: var(--overlay-inner-bg);
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .post-card {
  background: var(--panel);
  border-color: var(--line);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2);
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .post-card h3 a {
  color: var(--text);
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .post-card h3 a:hover {
  color: var(--accent-2);
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .tag {
  background: rgba(176, 159, 138, 0.10);
  border-color: rgba(176, 159, 138, 0.16);
  color: var(--text);
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .button {
  background: var(--text);
  color: #1c1814;
  border-color: var(--text);
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .button:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: #1c1814;
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .button-muted {
  border-color: rgba(176, 159, 138, 0.16);
  background: rgba(55, 48, 42, 0.56);
  color: var(--text);
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .button-muted:hover {
  border-color: var(--accent-2);
  color: var(--accent-2);
  background: rgba(55, 48, 42, 0.9);
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .timeline-card::before {
  background: linear-gradient(180deg, var(--accent-2), var(--accent-3));
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .footer {
  border-top-color: var(--line);
}

/* Theme picker dropdown */
.theme-picker {
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.8rem;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  cursor: pointer;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.theme-picker:hover,
.theme-picker:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent);
}

@media (max-width: 720px) {
  .theme-picker {
    align-self: flex-start;
    margin-top: 2px;
  }

  .nav .theme-picker {
    order: 1;
    margin-bottom: 4px;
  }
}

/* Table of contents (blog post sidebar) */
.post-toc {
  display: none;
}

@media (min-width: 1180px) {
  .post-toc {
    display: block;
    position: fixed;
    top: 120px;
    right: max(24px, calc(50% - 640px));
    width: 220px;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    padding: 6px 14px 6px 18px;
    border-left: 1px solid var(--line);
    z-index: 5;
  }

  .post-toc-label {
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    margin-bottom: 12px;
  }

  .post-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
  }

  .post-toc-link {
    display: block;
    font-size: 0.86rem;
    line-height: 1.35;
    color: var(--muted);
    text-decoration: none;
    padding: 2px 0 2px 10px;
    border-left: 2px solid transparent;
    margin-left: -10px;
    transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease;
  }

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

  .post-toc-link.is-active {
    color: var(--accent);
    border-left-color: var(--accent);
    font-weight: 600;
  }
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .post-toc {
  border-left-color: var(--line);
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .post-toc-link {
  color: var(--muted);
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .post-toc-link:hover {
  color: var(--accent-2);
}

:is(.theme-dark, .theme-catppuccin, .theme-tokyo-night, .theme-dracula, .theme-nord, .theme-gruvbox, .theme-rose-pine) .post-toc-link.is-active {
  color: var(--accent-2);
  border-left-color: var(--accent-2);
}
