/* ==========================================================================
   System Design Ultimatum — site.css
   Vercel/Nextra-style documentation theme.
   Edit this file; build-site.js copies it to docs/assets/site.<hash>.css.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');

/* ── Design tokens ─────────────────────────────────────────────────────── */
:root {
  --bg: #ffffff;
  --bg-subtle: #fafafa;
  --bg-muted: #f4f4f5;
  --text: #0a0a0a;
  --text-secondary: #52525b;
  --text-muted: #a1a1aa;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --accent: #0070f3;
  --accent-bg: rgba(0, 112, 243, 0.08);
  --accent-border: rgba(0, 112, 243, 0.22);
  --nav-bg: #fbfbfc;
  --nav-hover: #f1f5f9;
  --nav-active-bg: #eaf3ff;
  --nav-active-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  --info: #0070f3;
  --warn: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;

  --code-bg: #0a0a0a;
  --code-text: #e4e4e7;

  --topbar-h: 56px;
  --sidebar-w: clamp(248px, 20vw, 304px);
  --sidebar-compact-w: clamp(204px, 16vw, 232px);
  --sidebar-mobile-gutter: clamp(0.75rem, 4vw, 1rem);
  --toc-w: 240px;
  --content-max: 720px;

  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 10px;

  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);

  --font-sans: 'Geist', Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

html.nav-compact {
  --sidebar-w: var(--sidebar-compact-w);
}

html[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-subtle: #111111;
  --bg-muted: #18181b;
  --text: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --border: #27272a;
  --border-strong: #3f3f46;
  --accent: #3b82f6;
  --accent-bg: rgba(59, 130, 246, 0.14);
  --accent-border: rgba(59, 130, 246, 0.35);
  --nav-bg: #0d0d0f;
  --nav-hover: #18181b;
  --nav-active-bg: rgba(59, 130, 246, 0.18);
  --nav-active-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
  --code-bg: #000000;
  --code-text: #e4e4e7;
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6), 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* ── Reset + base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.2s ease, color 0.2s ease;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--bg);
  color: var(--text);
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 1000;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ── Article typography ────────────────────────────────────────────────── */
.content-body h1,
.content-body h2,
.content-body h3,
.content-body h4 {
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.02em;
  scroll-margin-top: calc(var(--topbar-h) + 1rem);
}
.content-body h1 {
  font-size: 2rem;
  margin: 0 0 1rem;
  line-height: 1.2;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.content-body h2 {
  font-size: 1.5rem;
  margin: 2.5rem 0 0.75rem;
  line-height: 1.3;
}
.content-body h3 {
  font-size: 1.2rem;
  margin: 2rem 0 0.5rem;
  line-height: 1.4;
}
.content-body h4 {
  font-size: 1rem;
  margin: 1.5rem 0 0.5rem;
}

.content-body p { margin: 0 0 1rem; color: var(--text-secondary); }
.content-body strong { color: var(--text); font-weight: 600; }
.content-body a { border-bottom: 1px solid transparent; transition: border-color 0.15s; }
.content-body a:hover { text-decoration: none; border-bottom-color: var(--accent); }

.content-body ul, .content-body ol { margin: 0 0 1rem 1.5rem; color: var(--text-secondary); }
.content-body li { margin: 0.3rem 0; }

.content-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  background: var(--accent-bg);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-secondary);
}
.content-body blockquote p:last-child { margin-bottom: 0; }

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

.content-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 1.25rem 0;
  border: 1px solid var(--border);
}

/* Heading anchor links */
.content-body h2, .content-body h3, .content-body h4 { position: relative; }
.heading-anchor {
  position: absolute;
  left: -1.25rem;
  top: 0;
  bottom: 0;
  display: inline-flex;
  align-items: center;
  padding-right: 0.25rem;
  color: var(--text-muted);
  opacity: 0;
  border: 0;
  text-decoration: none;
  font-weight: 400;
  transition: opacity 0.15s;
}
.content-body h2:hover .heading-anchor,
.content-body h3:hover .heading-anchor,
.content-body h4:hover .heading-anchor { opacity: 1; }
.heading-anchor:hover { color: var(--accent); }

/* ── App shell layout ──────────────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  min-height: calc(100vh - var(--topbar-h));
  transition: grid-template-columns 0.18s ease;
}
@media (max-width: 1280px) { .app { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); } }
@media (max-width: 900px)  { .app { grid-template-columns: minmax(0, 1fr); } }

/* ── Top bar ──────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0 1.1rem;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text);
  font-size: 0.95rem;
  white-space: nowrap;
  min-width: 0;
}
.topbar-brand:hover { text-decoration: none; color: var(--text); }
.topbar-brand:hover .topbar-mark {
  border-color: var(--accent-border);
  color: var(--accent);
  background: var(--accent-bg);
}
.topbar-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.topbar-spacer { flex: 1; }
@media (max-width: 560px) { .topbar-brand { font-size: 0; gap: 0; } }

.topbar-search {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.58rem 0.42rem 0.72rem;
  min-width: 260px;
  max-width: 380px;
  background: color-mix(in srgb, var(--bg-subtle) 88%, var(--bg));
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38);
  transition: border-color 0.15s, color 0.15s, background 0.15s, box-shadow 0.15s;
}
.topbar-search:hover {
  border-color: var(--border-strong);
  color: var(--text-secondary);
  background: var(--bg);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}
.topbar-search:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.topbar-search-icon { flex-shrink: 0; opacity: 0.7; }
.topbar-search > span:first-of-type {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-search .kbd {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 1px 5px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
}

.topbar-icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.topbar-icon-btn:hover { background: var(--bg-muted); border-color: var(--border); color: var(--text); }
.topbar-icon-btn[aria-pressed="true"] {
  color: var(--accent);
  background: var(--accent-bg);
  border-color: var(--accent-border);
}

.topbar-hamburger { display: none; }
@media (max-width: 900px) {
  .topbar-hamburger { display: inline-flex; }
  .topbar-sidebar-toggle { display: none; }
  .topbar-search { min-width: 0; flex: 1; }
}

/* ── Sidebar ──────────────────────────────────────────────────────────── */
.sidebar {
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border-right: 1px solid var(--border);
  padding: 0.7rem 0.75rem 3rem;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--nav-bg) 94%, var(--bg)) 0%, var(--nav-bg) 100%);
  transition: padding 0.18s ease;
}
/* Scrollbar stays out of the way until the sidebar is actually in use. */
.sidebar::-webkit-scrollbar { width: 10px; }
.sidebar::-webkit-scrollbar-thumb {
  background: transparent;
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
}
.sidebar:hover::-webkit-scrollbar-thumb { background: var(--border-strong); background-clip: content-box; }
.sidebar::-webkit-scrollbar-thumb:hover { background: var(--text-muted); background-clip: content-box; }

.nav-section-label {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.95rem 0.6rem 0.48rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.105em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: linear-gradient(var(--nav-bg) 72%, color-mix(in srgb, var(--nav-bg) 78%, transparent));
}
.nav-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
  opacity: 0.72;
}

.nav-folder { margin: 0.05rem 0; }
.nav-folder > summary {
  list-style: none;
  cursor: pointer;
  min-height: 34px;
  min-width: 0;
  padding: 0.44rem 0.55rem 0.44rem 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.48rem;
  font-size: 0.835rem;
  font-weight: 560;
  line-height: 1.35;
  color: var(--text-secondary);
  border: 1px solid transparent;
  border-radius: 8px;
  user-select: none;
  transition: background 0.12s, color 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.nav-folder > summary::-webkit-details-marker { display: none; }
.nav-folder > summary:hover {
  background: var(--nav-hover);
  border-color: color-mix(in srgb, var(--border) 78%, transparent);
  color: var(--text);
}
.nav-folder > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.nav-chevron {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  padding: 2px;
  border-radius: 5px;
  color: var(--text-muted);
  transition: transform 0.18s ease, background 0.12s, color 0.12s;
}
.nav-folder > summary:hover .nav-chevron { background: var(--bg); color: var(--text-secondary); }
.nav-folder[open] > summary .nav-chevron { transform: rotate(90deg); }
.nav-folder-emoji {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  line-height: 1;
}
.nav-folder-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  overflow-wrap: anywhere;
}
.nav-folder-count {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  opacity: 0;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  transition: opacity 0.12s;
}
.nav-folder > summary:hover .nav-folder-count,
.nav-folder[open] > summary .nav-folder-count { opacity: 1; }

/* Guide rail ties nested items back to their parent folder. */
.nav-folder-body {
  margin: 0.12rem 0 0.42rem 1.08rem;
  padding-left: 0.52rem;
  border-left: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.52rem;
  min-height: 33px;
  min-width: 0;
  padding: 0.37rem 0.55rem;
  font-size: 0.83rem;
  line-height: 1.35;
  color: var(--text-secondary);
  border: 1px solid transparent;
  border-radius: 8px;
  transition: background 0.12s, color 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.nav-item-icon {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
}
.nav-file-icon {
  width: 14px;
  height: 14px;
  display: block;
}
.nav-item-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  overflow-wrap: anywhere;
}
/* Diagram pages get a quiet marker so they read differently from notes. */
.nav-item.is-diagram .nav-item-label::after {
  content: none;
}
.nav-item.is-diagram .nav-item-icon {
  color: color-mix(in srgb, var(--accent) 70%, var(--text-muted));
}
.nav-item:hover {
  background: var(--nav-hover);
  border-color: color-mix(in srgb, var(--border) 76%, transparent);
  color: var(--text);
  text-decoration: none;
}
.nav-item:hover .nav-item-icon {
  color: var(--text-secondary);
  background: var(--bg);
}
.nav-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.nav-item.is-active {
  color: var(--accent);
  background: var(--nav-active-bg);
  border-color: var(--accent-border);
  box-shadow: var(--nav-active-shadow);
  font-weight: 650;
}
.nav-item.is-active .nav-item-icon {
  color: var(--accent);
  background: color-mix(in srgb, var(--bg) 72%, var(--accent-bg));
}
/* Active marker sits on the rail rather than shifting the row. */
.nav-folder-body .nav-item.is-active::before {
  content: '';
  position: absolute;
  left: calc(-0.52rem - 1px);
  top: 0.3rem;
  bottom: 0.3rem;
  width: 3px;
  border-radius: 999px;
  background: var(--accent);
}
.sidebar > .nav-item.is-active::before {
  content: '';
  position: absolute;
  left: -0.35rem;
  top: 0.38rem;
  bottom: 0.38rem;
  width: 3px;
  border-radius: 999px;
  background: var(--accent);
}
.nav-item.is-hidden, .nav-folder.is-hidden { display: none; }

/* ── Main + content column ────────────────────────────────────────────── */
.main {
  min-width: 0;
  padding: 2rem 2.5rem 4rem;
}
.content-layout {
  display: block;
  max-width: var(--content-max);
  margin: 0 auto;
}
.content-body { min-width: 0; }

/* ── HPC roadmap working surface ─────────────────────────────────────── */
.hpc-roadmap-page {
  --roadmap-ink: #071423;
  --roadmap-cyan: #22d3ee;
  --roadmap-amber: #fbbf24;
}
.hpc-roadmap-page .page-header,
.hpc-roadmap-page .content-layout { max-width: 1180px; }
.hpc-roadmap-page .toc-sidebar { display: none; }
.hpc-roadmap-page .app { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
.roadmap-intro {
  position: relative;
  overflow: hidden;
  padding: clamp(1.4rem, 3vw, 2.5rem);
  border: 1px solid color-mix(in srgb, var(--roadmap-cyan) 32%, transparent);
  border-radius: 18px;
  color: #e6f8ff;
  background:
    radial-gradient(circle at 90% 12%, rgba(34, 211, 238, 0.22), transparent 28%),
    radial-gradient(circle at 12% 90%, rgba(251, 191, 36, 0.12), transparent 30%),
    linear-gradient(135deg, #071423 0%, #0b2034 58%, #102a42 100%);
  box-shadow: 0 20px 60px rgba(2, 12, 27, 0.18);
}
.roadmap-intro::after {
  content: 'HPC';
  position: absolute;
  right: -0.05em;
  bottom: -0.36em;
  font-family: var(--font-mono);
  font-size: clamp(5rem, 13vw, 10rem);
  font-weight: 700;
  letter-spacing: -0.09em;
  color: rgba(255, 255, 255, 0.035);
  pointer-events: none;
}
.roadmap-intro p {
  position: relative;
  z-index: 1;
  max-width: 760px;
  color: #c5dcea;
  font-size: 1rem;
}
.roadmap-intro p:first-child {
  max-width: 820px;
  margin-bottom: 1.25rem;
  color: #ffffff;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  line-height: 1.55;
  letter-spacing: -0.012em;
}
.roadmap-intro blockquote {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 1rem 0 0;
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--roadmap-amber);
}
.roadmap-intro blockquote p { color: #dff5ff; margin: 0; font-size: 0.92rem; }
.roadmap-jumpbar {
  display: flex;
  gap: 0.55rem;
  margin: 1rem 0 1.35rem;
  padding: 0.6rem;
  overflow-x: auto;
  scrollbar-width: thin;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 92%, var(--bg-muted));
}
.roadmap-jumpbar a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex: 0 0 auto;
  padding: 0.48rem 0.68rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  background: var(--bg);
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.2;
}
.roadmap-jumpbar a:hover {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--accent-bg);
  text-decoration: none;
}
.roadmap-jumpbar a span {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  color: var(--text-muted);
}
.roadmap-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}
.roadmap-domain {
  min-width: 0;
  padding: 1.15rem 1.2rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-subtle) 70%, var(--bg)) 0%, var(--bg) 30%);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
.roadmap-domain:hover { border-color: color-mix(in srgb, var(--accent) 36%, var(--border)); }
.content-body .roadmap-domain h2 {
  display: flex;
  align-items: center;
  min-height: 2.35rem;
  margin: -0.2rem 0 0.8rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
  font-size: 1.1rem;
}
.content-body .roadmap-domain h3 {
  margin: 1rem 0 0.4rem;
  font-size: 0.88rem;
  letter-spacing: 0;
}
.roadmap-domain p,
.roadmap-domain li { font-size: 0.86rem; line-height: 1.6; }
.roadmap-domain ul { margin: 0.25rem 0 0.75rem; padding-left: 1.15rem; }
.roadmap-domain li { margin: 0.2rem 0; }
.roadmap-domain > p:last-child { margin: 0.9rem 0 0; }
.roadmap-domain > p:last-child a {
  display: inline-flex;
  padding: 0.42rem 0.62rem;
  border: 1px solid var(--accent-border);
  border-radius: 7px;
  background: var(--accent-bg);
  font-size: 0.78rem;
  font-weight: 600;
}
.roadmap-domain > p:last-child a:hover { text-decoration: none; }
@media (max-width: 1050px) {
  .roadmap-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .hpc-roadmap-page .main { padding-left: 1rem; padding-right: 1rem; }
  .roadmap-domain { padding: 1rem; }
  .roadmap-intro { border-radius: 14px; }
}

.page-header { margin-bottom: 1.5rem; max-width: var(--content-max); margin-left: auto; margin-right: auto; }
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); text-decoration: none; }
.breadcrumb .bc-sep { opacity: 0.5; }

.page-header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  margin: 0;
  line-height: 1.2;
}

/* ── TOC right rail ───────────────────────────────────────────────────── */
.toc-sidebar {
  position: sticky;
  top: var(--topbar-h);
  align-self: flex-start;
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 2rem 1rem 2rem 0;
}
.toc-sidebar nav {
  border-left: 1px solid var(--border);
  padding-left: 1rem;
}
.toc-title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}
.toc-sidebar a {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0.25rem 0;
  line-height: 1.45;
  border-left: 1px solid transparent;
  margin-left: -1rem;
  padding-left: 1rem;
  transition: color 0.15s, border-color 0.15s;
}
.toc-sidebar a:hover { color: var(--text); text-decoration: none; }
.toc-sidebar a.is-active { color: var(--accent); border-left-color: var(--accent); font-weight: 500; }
.toc-sidebar a.toc-h3 { padding-left: 1.75rem; font-size: 0.75rem; }
@media (max-width: 1280px) { .toc-sidebar { display: none; } }

/* ── Progress bar ─────────────────────────────────────────────────────── */
.progress-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: transparent;
  z-index: 100;
  pointer-events: none;
}
.progress-bar .progress-fill {
  height: 100%;
  width: calc(var(--progress, 0) * 100%);
  background: var(--accent);
  transition: width 80ms linear;
}

/* ── Inline + block code ──────────────────────────────────────────────── */
.content-body code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--bg-muted);
  color: var(--text);
  padding: 0.12em 0.4em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.content-body pre {
  position: relative;
  background: var(--code-bg);
  color: var(--code-text);
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius-lg);
  overflow-x: auto;
  margin: 1.25rem 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.65;
  border: 1px solid var(--border);
}
.content-body pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border: 0;
  font-size: inherit;
}
.code-copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.25rem 0.55rem;
  font-size: 0.7rem;
  font-family: var(--font-sans);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}
.content-body pre:hover .code-copy-btn { opacity: 1; }
.code-copy-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.12); }
.code-copy-btn.is-copied { color: var(--success); }

/* ── Tables ───────────────────────────────────────────────────────────── */
.content-body .table-wrap { overflow-x: auto; margin: 1.25rem 0; border: 1px solid var(--border); border-radius: var(--radius); }
.content-body table { border-collapse: collapse; width: 100%; font-size: 0.88rem; }
.content-body th, .content-body td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.content-body th {
  background: var(--bg-subtle);
  font-weight: 600;
  color: var(--text);
  font-size: 0.82rem;
}
.content-body tr:last-child td { border-bottom: 0; }
.content-body tr:hover td { background: var(--bg-subtle); }

/* ── Details/summary ──────────────────────────────────────────────────── */
.content-body details {
  margin: 1rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}
.content-body details > summary {
  cursor: pointer;
  padding: 0.7rem 1rem;
  font-weight: 600;
  color: var(--text);
  font-size: 0.9rem;
  user-select: none;
}
.content-body details[open] > summary { border-bottom: 1px solid var(--border); }
.content-body details > *:not(summary) { padding: 0.75rem 1rem; }

/* ── Prev/Next ────────────────────────────────────────────────────────── */
.page-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 3rem 0 0;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.page-nav a {
  display: block;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.page-nav a:hover { border-color: var(--accent); background: var(--accent-bg); text-decoration: none; }
.page-nav .nav-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.page-nav .nav-title { font-size: 0.9rem; font-weight: 600; margin-top: 0.2rem; }
.page-nav .nav-next { text-align: right; }
@media (max-width: 640px) { .page-nav { grid-template-columns: 1fr; } }

/* ── Back to top ──────────────────────────────────────────────────────── */
.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, border-color 0.15s, color 0.15s;
  z-index: 40;
}
.back-to-top.is-visible { opacity: 1; pointer-events: auto; }
.back-to-top:hover { color: var(--accent); border-color: var(--accent); }

/* ── Dashboard / homepage ─────────────────────────────────────────────── */
.dashboard { max-width: 1100px; margin: 0 auto; padding: 3rem 2rem 4rem; }
.dash-hero { text-align: center; padding: 2rem 1rem 2.5rem; }
.dash-hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0 0 0.75rem;
}
.dash-hero p { color: var(--text-secondary); font-size: 1.05rem; max-width: 620px; margin: 0 auto; }
.dash-stats { display: flex; justify-content: center; gap: 1rem; margin: 2rem 0; flex-wrap: wrap; }
.dash-stat {
  padding: 0.75rem 1.25rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 120px;
  text-align: center;
}
.dash-stat .stat-num { font-size: 1.4rem; font-weight: 700; color: var(--text); }
.dash-stat .stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.dash-section-title {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 2.5rem 0 1rem;
}
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.75rem;
}
.category-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.15rem;
  background: var(--bg);
  transition: border-color 0.15s;
}
.category-card:hover { border-color: var(--border-strong); }
.category-card .cc-header { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.4rem; }
.category-card .cc-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem; color: #fff;
  flex-shrink: 0;
}
.category-card .cc-name { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.category-card .cc-desc { font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 0.6rem; }
.category-card .cc-links { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.category-card .cc-links a {
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}
.category-card .cc-links a:hover { background: var(--accent-bg); border-color: var(--accent-border); color: var(--accent); text-decoration: none; }

/* ── Footer ──────────────────────────────────────────────────────────── */
footer {
  padding: 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 3rem;
}

/* ── Diagram container ───────────────────────────────────────────────── */
.diagram-container {
  background: var(--bg-subtle);
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  margin: 1.25rem 0;
  border: 1px solid var(--border);
}
.diagram-info {
  background: var(--accent-bg);
  padding: 0.85rem 1.1rem;
  border-left: 3px solid var(--accent);
  margin-bottom: 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.diagram-preview {
  background: var(--bg);
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-align: center;
  min-height: 200px;
}
.diagram-preview svg, .diagram-preview img { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.diagram-viewer-container {
  width: 100%;
  height: 600px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: #fff;
}
.diagram-tabs { display: flex; gap: 0.4rem; margin-bottom: 0.85rem; }
.diagram-tab {
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
}
.diagram-tab:hover { border-color: var(--accent); color: var(--accent); }
.diagram-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.diagram-json {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 1rem;
  border-radius: var(--radius);
  max-height: 400px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ── Command palette (modal) ─────────────────────────────────────────── */
.cmdk-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  opacity: 0;
  transition: opacity 0.15s;
}
.cmdk-backdrop.is-open { display: flex; opacity: 1; }

.cmdk {
  width: min(640px, calc(100vw - 2rem));
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.cmdk-input {
  width: 100%;
  padding: 0.95rem 1.1rem;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font-sans);
}
.cmdk-input:focus { outline: none; }
.cmdk-input::placeholder { color: var(--text-muted); }

.cmdk-results { flex: 1; overflow-y: auto; padding: 0.35rem; }
.cmdk-empty { padding: 2rem 1rem; text-align: center; color: var(--text-muted); font-size: 0.85rem; }

.cmdk-result {
  display: block;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
}
.cmdk-result.is-focused { background: var(--accent-bg); }
.cmdk-result:hover { text-decoration: none; }
.cmdk-result .cr-title { font-size: 0.9rem; font-weight: 500; }
.cmdk-result .cr-folder { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.cmdk-result .cr-snippet { font-size: 0.76rem; color: var(--text-secondary); margin-top: 3px; line-height: 1.4; }
.cmdk-result .cr-snippet mark { background: var(--accent-bg); color: inherit; padding: 0 2px; border-radius: 2px; }

.cmdk-footer {
  display: flex;
  gap: 1rem;
  padding: 0.55rem 0.85rem;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  font-size: 0.72rem;
  color: var(--text-muted);
}
.cmdk-footer kbd {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--text-secondary);
}

/* ── Mobile drawer ────────────────────────────────────────────────────── */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 70;
}
html.nav-open .nav-overlay { opacity: 1; pointer-events: auto; }

@media (max-width: 900px) {
  .hpc-roadmap-page .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 50%;
    width: min(calc(100vw - (var(--sidebar-mobile-gutter) * 2)), 320px);
    height: calc(100vh - var(--topbar-h));
    transform: translateX(calc(-50% - 105vw));
    transition: transform 0.25s ease;
    z-index: 80;
    background: var(--bg);
    border: 1px solid var(--border);
    border-top: 0;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  }
  html.nav-open .sidebar { transform: translateX(-50%); }
  .main { padding: 1.25rem 1rem 3rem; }
  .dashboard { padding: 2rem 1rem 3rem; }
  .dash-hero h1 { font-size: 1.75rem; }
}

/* ── Reduced motion ──────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  html { scroll-behavior: auto !important; }
}
html { scroll-behavior: smooth; }
