/* =========================================================================
   Anvesh Docs — Design System (VaagaTech Unified Theme)
   Matches www.vaagatech.com visual language
   ========================================================================= */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* -- Design Tokens -------------------------------------------------------- */
:root {
  --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --c-bg: #FFFFFF;
  --c-bg-soft: #F2F4F7;
  --c-bg-mute: #E8ECF1;
  --c-border: rgba(11, 18, 32, 0.08);
  --c-border-dark: rgba(11, 18, 32, 0.15);

  --c-text-1: #0B1220;
  --c-text-2: #4B5568;
  --c-text-3: #64748B;

  --c-brand: #1D4ED8;
  --c-brand-soft: #EFF6FF;
  --c-brand-text: #1E40AF;
  --c-accent: #3B82F6;
  --c-green: #10B981;
  --c-signal: #F59E0B;

  --nav-h: 60px;
  --sidebar-w: 260px;
  --content-max: 780px;
  --radius: 8px;
  --shadow-sm: 0 1px 3px rgba(11, 18, 32, 0.05);
  --shadow-md: 0 4px 14px rgba(11, 18, 32, 0.08);
}

[data-theme="dark"] {
  --c-bg: #10243F;
  --c-bg-soft: #1A3560;
  --c-bg-mute: #23457A;
  --c-border: rgba(255, 255, 255, 0.12);
  --c-border-dark: rgba(255, 255, 255, 0.2);

  --c-text-1: #F2F4F7;
  --c-text-2: #C7D2FE;
  --c-text-3: #94A3B8;

  --c-brand: #3B82F6;
  --c-brand-soft: rgba(59, 130, 246, 0.18);
  --c-brand-text: #93C5FD;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
}

/* -- Reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--c-bg);
  color: var(--c-text-1);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s, color 0.2s;
}
a { color: var(--c-brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* -- Skip link ------------------------------------------------------------ */
.skip-link {
  position: absolute; top: -100px; left: 1rem;
  padding: 0.5rem 1rem; background: var(--c-brand); color: #fff;
  border-radius: var(--radius); z-index: 999;
}
.skip-link:focus { top: 0.5rem; }

/* =========================================================================
   TOP NAV — minimal: Logo · Docs · GitHub · CTA
   ========================================================================= */
.topnav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center;
  padding: 0 1.5rem;
}
.topnav-inner {
  max-width: 1280px; width: 100%;
  margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
}
.topnav-brand {
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 1.15rem; font-weight: 700; color: var(--c-text-1);
  text-decoration: none;
}
.topnav-brand img { height: 30px; width: auto; }
.topnav-brand:hover { text-decoration: none; }

.topnav-right {
  display: flex; align-items: center; gap: 0.75rem;
}
.topnav-link {
  font-size: 0.9rem; font-weight: 500; color: var(--c-text-2);
  padding: 0.4rem 0.7rem; border-radius: 6px;
  transition: background 0.12s, color 0.12s;
  text-decoration: none;
}
.topnav-link:hover { background: var(--c-bg-mute); color: var(--c-text-1); text-decoration: none; }

.topnav-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 1rem; font-size: 0.88rem; font-weight: 600;
  border-radius: 6px; text-decoration: none;
  transition: opacity 0.15s;
}
.topnav-btn:hover { text-decoration: none; opacity: 0.9; }
.topnav-btn--ghost {
  background: var(--c-bg-mute); color: var(--c-text-1); border: 1px solid var(--c-border);
}
.topnav-btn--primary {
  background: var(--c-brand); color: #fff;
}

.theme-btn {
  background: none; border: none; cursor: pointer;
  color: var(--c-text-3); padding: 0.35rem; border-radius: 6px;
  display: flex; align-items: center;
  transition: color 0.15s, background 0.15s;
}
.theme-btn:hover { color: var(--c-text-1); background: var(--c-bg-mute); }

/* =========================================================================
   DOCS LAYOUT — sidebar + content
   ========================================================================= */
.docs-layout {
  display: flex;
  max-width: 1280px;
  margin: 0 auto;
  min-height: calc(100vh - var(--nav-h));
}

/* -- Sidebar -------------------------------------------------------------- */
.docs-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky; top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  padding: 1.5rem 1rem 2rem;
  border-right: 1px solid var(--c-border);
}
.sidebar-section { margin-bottom: 1.75rem; }
.sidebar-title {
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--c-text-3);
  padding: 0 0.5rem; margin-bottom: 0.4rem;
}
.sidebar-links { list-style: none; }
.sidebar-links a {
  display: block;
  padding: 0.35rem 0.6rem;
  font-size: 0.88rem; font-weight: 500;
  color: var(--c-text-2);
  border-radius: 6px;
  transition: all 0.1s;
  text-decoration: none;
}
.sidebar-links a:hover { background: var(--c-bg-mute); color: var(--c-text-1); }
.sidebar-links a.current {
  background: var(--c-brand-soft); color: var(--c-brand-text); font-weight: 600;
}
[data-theme="dark"] .sidebar-links a.current {
  color: #A5B4FC;
}

/* -- Main content --------------------------------------------------------- */
.docs-main {
  flex: 1; min-width: 0;
  padding: 2.5rem 3rem 4rem;
}
.docs-main > * { max-width: var(--content-max); }

/* Page header */
.page-label {
  font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--c-brand); margin-bottom: 0.35rem;
}
.page-title {
  font-size: 2rem; font-weight: 800;
  letter-spacing: -0.02em; line-height: 1.2;
  margin-bottom: 0.6rem;
}
.page-desc {
  font-size: 1.05rem; color: var(--c-text-2);
  line-height: 1.6; margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--c-border);
}

/* -- Prose ---------------------------------------------------------------- */
.prose h2 {
  font-size: 1.4rem; font-weight: 700;
  margin: 2.5rem 0 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--c-border);
  letter-spacing: -0.01em;
}
.prose h2:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.prose h3 { font-size: 1.1rem; font-weight: 700; margin: 1.5rem 0 0.5rem; }
.prose p { margin-bottom: 1rem; color: var(--c-text-2); }
.prose ul, .prose ol { margin-bottom: 1rem; padding-left: 1.5rem; color: var(--c-text-2); }
.prose li { margin-bottom: 0.35rem; }
.prose li strong { color: var(--c-text-1); }
.prose code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--c-bg-mute);
  padding: 0.15em 0.35em;
  border-radius: 4px;
  color: var(--c-brand-text);
}
.prose pre {
  background: var(--c-bg-soft);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  line-height: 1.6;
}
.prose pre code {
  background: none; padding: 0; border-radius: 0;
  color: var(--c-text-1);
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}
.prose th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  font-weight: 700;
  background: var(--c-bg-soft);
  border-bottom: 2px solid var(--c-border);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--c-text-3);
}
.prose td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--c-border);
  color: var(--c-text-2);
}
.prose td strong { color: var(--c-text-1); }

/* Callout */
.callout {
  background: var(--c-brand-soft);
  border-left: 3px solid var(--c-brand);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.92rem;
  color: var(--c-text-2);
}
.callout strong { color: var(--c-brand-text); }

/* =========================================================================
   LANDING PAGE — Hero, metrics, features, etc.
   ========================================================================= */
.landing-hero {
  text-align: center;
  padding: 5rem 1.5rem 3rem;
  max-width: 800px;
  margin: 0 auto;
}
.landing-hero h1 {
  font-size: 3rem; font-weight: 800;
  letter-spacing: -0.03em; line-height: 1.15;
  margin-bottom: 1rem;
}
.landing-hero h1 .highlight { color: var(--c-brand); }
.landing-hero .lead {
  font-size: 1.15rem; color: var(--c-text-2);
  max-width: 620px; margin: 0 auto 2rem; line-height: 1.7;
}
.hero-actions {
  display: flex; gap: 0.75rem;
  justify-content: center; flex-wrap: wrap;
}
.hero-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.5rem; font-size: 0.95rem; font-weight: 600;
  border-radius: var(--radius); text-decoration: none;
  transition: all 0.15s;
}
.hero-btn:hover { text-decoration: none; transform: translateY(-1px); }
.hero-btn--primary { background: var(--c-brand); color: #fff; box-shadow: 0 2px 8px rgba(79,70,229,0.25); }
.hero-btn--secondary { background: var(--c-bg-soft); color: var(--c-text-1); border: 1px solid var(--c-border); }

/* Metrics strip */
.metrics {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: var(--c-border);
  border: 1px solid var(--c-border); border-radius: var(--radius);
  overflow: hidden;
  max-width: 760px; margin: 3rem auto;
}
.metric {
  background: var(--c-bg);
  padding: 1.5rem 1rem; text-align: center;
}
.metric-val {
  font-size: 1.75rem; font-weight: 800;
  color: var(--c-brand); letter-spacing: -0.02em;
}
.metric-label {
  font-size: 0.78rem; color: var(--c-text-3);
  margin-top: 0.25rem; font-weight: 500;
}

/* Feature cards */
.features-section {
  max-width: 960px; margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}
.section-label {
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--c-brand); text-align: center;
  margin-bottom: 0.5rem;
}
.section-title {
  font-size: 2rem; font-weight: 800; text-align: center;
  margin-bottom: 0.5rem; letter-spacing: -0.02em;
}
.section-desc {
  font-size: 1rem; color: var(--c-text-2); text-align: center;
  max-width: 600px; margin: 0 auto 2.5rem;
}
.feature-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.feature-card {
  background: var(--c-bg-soft);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.feature-card h3 {
  font-size: 1rem; font-weight: 700;
  margin-bottom: 0.5rem;
}
.feature-card p {
  font-size: 0.88rem; color: var(--c-text-2); line-height: 1.6;
}

/* CTA banner */
.cta-banner {
  max-width: 960px; margin: 0 auto 4rem;
  padding: 3rem 2rem; text-align: center;
  background: var(--c-brand); border-radius: var(--radius);
  color: #fff;
}
.cta-banner h2 { font-size: 1.75rem; font-weight: 800; margin-bottom: 0.75rem; color: #fff; }
.cta-banner p { font-size: 1rem; opacity: 0.9; margin-bottom: 1.5rem; color: rgba(255,255,255,0.9); }
.cta-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1.5rem; font-size: 0.95rem; font-weight: 700;
  background: #fff; color: var(--c-brand); border-radius: 6px;
  text-decoration: none; transition: transform 0.15s;
}
.cta-btn:hover { transform: translateY(-1px); text-decoration: none; }

/* =========================================================================
   FOOTER
   ========================================================================= */
.site-footer {
  border-top: 1px solid var(--c-border);
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.85rem; color: var(--c-text-3);
}
.site-footer a { color: var(--c-text-2); }
.site-footer a:hover { color: var(--c-text-1); }

/* =========================================================================
   DEMO SANDBOX
   ========================================================================= */
.demo-container { max-width: var(--content-max); }
.demo-bar {
  display: flex; gap: 0.75rem; margin-bottom: 1rem;
}
.demo-bar input {
  flex: 1;
  padding: 0.65rem 1rem; font-size: 0.92rem;
  border: 1px solid var(--c-border); border-radius: var(--radius);
  background: var(--c-bg); color: var(--c-text-1);
  font-family: inherit; outline: none;
}
.demo-bar input:focus { border-color: var(--c-brand); }
.demo-bar button {
  padding: 0 1.25rem; font-size: 0.88rem; font-weight: 600;
  background: var(--c-brand); color: #fff; border: none;
  border-radius: var(--radius); cursor: pointer;
}
.demo-chips {
  display: flex; gap: 0.5rem; margin-bottom: 1.25rem; flex-wrap: wrap;
}
.demo-chip {
  padding: 0.3rem 0.75rem; font-size: 0.8rem; font-weight: 600;
  background: var(--c-bg-mute); color: var(--c-text-2);
  border: 1px solid var(--c-border); border-radius: 999px;
  cursor: pointer; transition: all 0.12s;
}
.demo-chip:hover { border-color: var(--c-brand); color: var(--c-text-1); }
.demo-chip.active { background: var(--c-brand-soft); border-color: var(--c-brand); color: var(--c-brand-text); }
.demo-result {
  background: var(--c-bg-soft); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}
.demo-result h4 { font-size: 1rem; font-weight: 700; margin-bottom: 0.3rem; }
.demo-result p { font-size: 0.88rem; color: var(--c-text-2); margin-bottom: 0.5rem; }
.demo-tag {
  display: inline-block;
  font-size: 0.72rem; font-weight: 600;
  background: var(--c-bg-mute); color: var(--c-text-3);
  padding: 1px 6px; border-radius: 4px;
  margin-right: 0.35rem;
}
.demo-timing {
  font-family: var(--font-mono); font-size: 0.82rem;
  color: var(--c-green); font-weight: 600;
  margin-bottom: 1rem;
}

/* Comparison table highlight */
.col-anvesh { background: var(--c-brand-soft) !important; }
[data-theme="dark"] .col-anvesh { background: rgba(99,102,241,0.12) !important; }

/* =========================================================================
   DEFAULT LAYOUT — site-header, doc-shell, doc-sidebar, doc-content
   These classes are used by _layouts/default.html (GitHub Pages)
   ========================================================================= */

/* Ambient background glow */
.ambient-glow {
  position: fixed;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(79, 70, 229, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
[data-theme="dark"] .ambient-glow {
  background: radial-gradient(ellipse, rgba(129, 140, 248, 0.06) 0%, transparent 70%);
}

/* Site Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
}

.header-container {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  flex-shrink: 0;
}
.brand-wrapper img {
  height: 30px;
  width: auto;
}
.brand-wrapper:hover {
  text-decoration: none;
}

/* Main navigation links */
.nav-links {
  display: flex;
  list-style: none;
  gap: 0.25rem;
  align-items: center;
  margin: 0;
  padding: 0;
}
.nav-links li a {
  display: block;
  padding: 0.4rem 0.7rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--c-text-2);
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
}
.nav-links li a:hover {
  background: var(--c-bg-mute);
  color: var(--c-text-1);
  text-decoration: none;
}
.nav-links li a.active {
  background: var(--c-brand-soft);
  color: var(--c-brand-text);
  font-weight: 600;
}

/* Header actions (theme toggle, buttons) */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.theme-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--c-text-3);
  padding: 0.35rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: color 0.15s, background 0.15s;
}
.theme-toggle-btn:hover {
  color: var(--c-text-1);
  background: var(--c-bg-mute);
}

/* Buttons in header (reusing .btn from index.html pages) */
.site-header .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  transition: opacity 0.15s;
  border: none;
  cursor: pointer;
}
.site-header .btn:hover { text-decoration: none; opacity: 0.9; }
.site-header .btn-secondary {
  background: var(--c-bg-mute);
  color: var(--c-text-1);
  border: 1px solid var(--c-border);
}
.site-header .btn-primary {
  background: var(--c-brand);
  color: #fff;
}

/* Doc Shell — sidebar + content layout */
.doc-shell {
  display: flex;
  max-width: 1280px;
  margin: 0 auto;
  min-height: calc(100vh - var(--nav-h));
  position: relative;
}

/* Doc Sidebar */
.doc-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  padding: 1.25rem 1rem 2rem;
  border-right: 1px solid var(--c-border);
}

.sidebar-search input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  font-family: var(--font-sans);
  color: var(--c-text-1);
  background: var(--c-bg-mute);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  outline: none;
  margin-bottom: 1.25rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.sidebar-search input:focus {
  border-color: var(--c-brand);
  box-shadow: 0 0 0 3px var(--c-brand-soft);
}
.sidebar-search input::placeholder {
  color: var(--c-text-3);
}

.sidebar-group {
  margin-bottom: 1.5rem;
}
.sidebar-heading {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-text-3);
  padding: 0 0.5rem;
  margin-bottom: 0.4rem;
}
.sidebar-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidebar-menu a {
  display: block;
  padding: 0.35rem 0.6rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--c-text-2);
  border-radius: 6px;
  transition: all 0.1s;
  text-decoration: none;
}
.sidebar-menu a:hover {
  background: var(--c-bg-mute);
  color: var(--c-text-1);
  text-decoration: none;
}
.badge-new {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--c-brand-soft);
  color: var(--c-brand-text);
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 0.35rem;
  vertical-align: middle;
}

/* Doc Content */
.doc-content {
  flex: 1;
  min-width: 0;
  padding: 2.5rem 3rem 4rem;
}
.doc-content > * {
  max-width: var(--content-max);
}

.doc-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--c-border);
}
.doc-eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-brand);
  margin-bottom: 0.35rem;
}
.doc-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 0.6rem;
}
.doc-lead {
  font-size: 1.05rem;
  color: var(--c-text-2);
  line-height: 1.6;
}

/* Mobile hamburger for site-header — hidden on desktop */
.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  color: var(--c-text-1);
  padding: 0.4rem 0.5rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
}
.mobile-menu-toggle:hover {
  background: var(--c-bg-mute);
}
.mobile-menu-toggle svg {
  display: block;
}

/* =========================================================================
   RESPONSIVE — index.html (topnav) & default.html (site-header)
   ========================================================================= */

/* --- Tablet: ≤960px --- */
@media (max-width: 960px) {
  /* Index page */
  .docs-sidebar { display: none; }
  .docs-main { padding: 2rem 1.5rem; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .landing-hero h1 { font-size: 2.2rem; }

  /* Default layout */
  .doc-sidebar { display: none; }
  .doc-content { padding: 2rem 1.5rem; }
  .nav-links { display: none; }

  /* Show mobile hamburger */
  .mobile-menu-toggle {
    display: inline-flex;
  }

  /* Mobile sidebar overlay */
  .doc-sidebar.mobile-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--nav-h);
    left: 0;
    bottom: 0;
    width: 280px;
    height: calc(100vh - var(--nav-h));
    z-index: 90;
    background: var(--c-bg);
    border-right: 1px solid var(--c-border);
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    padding: 1rem;
  }

  /* Mobile nav overlay for default.html */
  .nav-links.mobile-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--c-bg);
    border-bottom: 1px solid var(--c-border);
    box-shadow: var(--shadow-md);
    padding: 0.75rem 1rem;
    z-index: 99;
    gap: 0.25rem;
  }
  .nav-links.mobile-open li a {
    padding: 0.65rem 0.75rem;
  }
}

/* --- Mobile: ≤640px --- */
@media (max-width: 640px) {
  /* Index page */
  .feature-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; align-items: center; }
  .topnav-link { display: none; }
  .landing-hero { padding: 3rem 1rem 2rem; }
  .landing-hero h1 { font-size: 1.85rem; }
  .metrics { grid-template-columns: 1fr 1fr; }

  /* Default layout */
  .doc-content { padding: 1.25rem 1rem; }
  .doc-title { font-size: 1.5rem; }
  .doc-lead { font-size: 0.95rem; }
  .header-container { padding: 0; }

  /* Header actions compact */
  .header-actions .btn-secondary,
  .header-actions .btn-primary {
    display: none;
  }

  /* CTA banner */
  .cta-banner { padding: 2rem 1.25rem; }
  .cta-banner h2 { font-size: 1.35rem; }

  /* Prose table scroll */
  .prose table { display: block; overflow-x: auto; }
}

