/* Nexus docs theme — tokens mirrored from frontend/src/styles/theme.js
   so the documentation site reads as part of the same product. */
:root {
  --primary: #1a7f7c;
  --primary-light: #d6ede9;
  --primary-dark: #0f4c4e;
  --primary-muted: #7fc8c0;
  --primary-faint: #eef7f5;
  --secondary: #146466;
  --accent: #2e9a93;
  --human: #c2643c;
  --human-light: #fae6da;

  --n0: #ffffff;
  --n25: #fbfcfc;
  --n50: #f7f9f9;
  --n100: #edf1f1;
  --n200: #dce3e3;
  --n300: #bfc9c9;
  --n400: #93a0a1;
  --n500: #6b7878;
  --n600: #4e5a5a;
  --n700: #3a4444;
  --n800: #262e2e;
  --n900: #151b1b;

  --chrome-900: #071f21;
  --chrome-800: #0a2a2c;
  --chrome-700: #0d3436;
  --gradient-sidebar: linear-gradient(180deg, #0d3436 0%, #0a2a2c 40%, #071f21 100%);
  --gradient-header: linear-gradient(135deg, #1a7f7c 0%, #0f4c4e 100%);
  --chrome-ink: #d7ece9;
  --chrome-ink-dim: #8fb5b2;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 3px rgba(11,59,60,0.08), 0 1px 2px rgba(11,59,60,0.05);
  --shadow-md: 0 8px 16px -4px rgba(11,59,60,0.10), 0 2px 4px -2px rgba(11,59,60,0.05);

  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --topbar-h: 64px;
  --sidebar-w: 268px;
  --toc-w: 240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--n50);
  color: var(--n800);
  font-size: 15px;
  line-height: 1.65;
}
a { color: var(--primary); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; }

.nav-toggle-state { display: none; }

/* ── Topbar ─────────────────────────────────────────────────────────── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h);
  display: flex; align-items: center; gap: 16px;
  padding-inline: 20px;
  background: var(--n0);
  border-bottom: 1px solid var(--n200);
  z-index: 50;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { height: 28px; width: 28px; }
.brand-name { font-weight: 700; color: var(--primary-dark); font-size: 1.05rem; letter-spacing: -0.01em; }
.topbar-tagline { color: var(--n500); font-size: 0.8125rem; border-left: 1px solid var(--n200); padding-left: 16px; }
.topbar-nav { margin-inline-start: auto; display: flex; gap: 20px; }
.topbar-nav a { color: var(--n600); text-decoration: none; font-size: 0.875rem; font-weight: 500; }
.topbar-nav a:hover { color: var(--primary); }

.nav-burger {
  display: none; flex-direction: column; justify-content: center; gap: 4px;
  width: 32px; height: 32px; cursor: pointer;
}
.nav-burger span { display: block; height: 2px; width: 20px; background: var(--n700); border-radius: 2px; }

/* ── Shell / Sidebar ────────────────────────────────────────────────── */
.shell { display: flex; margin-top: var(--topbar-h); min-height: calc(100vh - var(--topbar-h)); }
.nav-scrim { display: none; }
.sidebar {
  width: var(--sidebar-w); flex: none;
  background: var(--gradient-sidebar);
  color: var(--chrome-ink);
  padding: 24px 14px;
  position: sticky; top: var(--topbar-h); align-self: flex-start;
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
}
.sidebar-group { margin-bottom: 24px; }
.sidebar-heading {
  text-transform: uppercase; font-size: 0.6875rem; letter-spacing: 0.06em;
  color: var(--chrome-ink-dim); padding: 0 12px 8px;
}
.sidebar-link {
  display: block; padding: 8px 12px; margin-bottom: 2px;
  border-radius: var(--radius-md); color: var(--chrome-ink);
  text-decoration: none; font-size: 0.875rem;
}
.sidebar-link:hover { background: rgba(255,255,255,0.06); color: var(--chrome-ink); }
.sidebar-link.active { background: var(--primary); color: #fff; font-weight: 600; }

/* ── Content ────────────────────────────────────────────────────────── */
.content { flex: 1; min-width: 0; }
.content-inner { max-width: 1180px; margin: 0 auto; padding: 40px 48px 24px; }

.article-layout { display: grid; grid-template-columns: 1fr var(--toc-w); gap: 56px; align-items: start; }
.article-layout--wide { grid-template-columns: 1fr; }
.article { min-width: 0; }

.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; font-weight: 600; color: var(--accent); margin: 0 0 8px; }
.lede { color: var(--n600); font-size: 1.05rem; }

.article h1 { font-size: 2rem; color: var(--n900); margin: 0 0 12px; letter-spacing: -0.01em; }
.article h2 { font-size: 1.375rem; color: var(--primary-dark); margin: 40px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--n200); }
.article h3 { font-size: 1.1rem; color: var(--n900); margin: 28px 0 8px; }
.article h4 { font-size: 0.95rem; color: var(--n800); margin: 20px 0 6px; }
.article p { color: var(--n700); margin: 0 0 14px; }
.article ul, .article ol { color: var(--n700); padding-inline-start: 22px; margin: 0 0 14px; }
.article li { margin-bottom: 4px; }
.article strong { color: var(--n900); }
.article hr { border: none; border-top: 1px solid var(--n200); margin: 32px 0; }

.article code { font-family: var(--font-mono); font-size: 0.85em; background: var(--n100); color: var(--secondary); padding: 2px 6px; border-radius: var(--radius-sm); }
.article pre { background: var(--chrome-900); color: var(--chrome-ink); padding: 16px 18px; border-radius: var(--radius-md); overflow-x: auto; margin: 0 0 18px; }
.article pre code { background: none; color: inherit; padding: 0; font-size: 0.8125rem; line-height: 1.6; }

.article blockquote { margin: 0 0 18px; padding: 10px 18px; border-left: 3px solid var(--accent); background: var(--primary-faint); color: var(--n700); border-radius: 0 var(--radius-md) var(--radius-md) 0; }

.article table { width: 100%; border-collapse: collapse; margin: 0 0 20px; font-size: 0.875rem; display: block; overflow-x: auto; }
.article th { text-align: start; background: var(--n50); color: var(--n600); font-weight: 600; padding: 8px 12px; border-bottom: 2px solid var(--primary-light); white-space: nowrap; }
.article td { padding: 8px 12px; border-bottom: 1px solid var(--n100); color: var(--n700); vertical-align: top; }
.article tr:hover td { background: var(--n25); }

/* ── TOC ────────────────────────────────────────────────────────────── */
.toc { position: sticky; top: calc(var(--topbar-h) + 24px); }
.toc-inner { border-left: 1px solid var(--n200); padding-left: 16px; }
.toc-heading { text-transform: uppercase; font-size: 0.6875rem; letter-spacing: 0.06em; color: var(--n400); margin-bottom: 10px; }
.toc #TableOfContents ul { list-style: none; margin: 0; padding: 0; }
.toc #TableOfContents ul ul { padding-inline-start: 14px; }
.toc #TableOfContents a { display: block; padding: 4px 0; color: var(--n500); text-decoration: none; font-size: 0.8125rem; line-height: 1.4; }
.toc #TableOfContents a:hover { color: var(--primary); }

/* ── Cards ──────────────────────────────────────────────────────────── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-top: 20px; }
.card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 18px 20px; background: var(--n0); border: 1px solid var(--n200);
  border-radius: var(--radius-lg); text-decoration: none; box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--primary-muted); }
.card-title { color: var(--n900); font-weight: 600; font-size: 0.95rem; }
.card-desc { color: var(--n500); font-size: 0.8125rem; }

/* ── Hero (home) ────────────────────────────────────────────────────── */
.hero {
  background: var(--gradient-header); color: #fff;
  text-align: center; padding: 56px 24px 64px;
}
.hero-mark { height: 56px; width: 56px; margin-bottom: 16px; }
.hero h1 { margin: 0 0 10px; font-size: 2.25rem; letter-spacing: -0.01em; }
.hero .lede { color: var(--primary-light); font-size: 1.1rem; margin: 0 auto; max-width: 560px; }

/* ── Footer ─────────────────────────────────────────────────────────── */
.site-footer { text-align: center; color: var(--n400); font-size: 0.8125rem; padding: 24px 0 40px; }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .topbar-tagline { display: none; }
  .nav-burger { display: flex; }
  .content-inner { padding: 28px 20px 24px; }
  .article-layout { grid-template-columns: 1fr; }
  .toc { display: none; }

  .sidebar {
    position: fixed; z-index: 40; left: 0; top: var(--topbar-h);
    height: calc(100vh - var(--topbar-h));
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow-md);
  }
  .nav-toggle-state:checked ~ .shell .sidebar { transform: translateX(0); }
  .nav-toggle-state:checked ~ .shell .nav-scrim {
    display: block; position: fixed; inset: var(--topbar-h) 0 0 0;
    background: rgba(7, 31, 33, 0.45); z-index: 35;
  }
}
