/* Design tokens — Precision Obsidian (default) / Architectural Paper */
:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --bg-canvas: #09090B;
  --bg-surface: #111114;
  --bg-surface-hover: #18181B;
  --border-subtle: #27272A;
  --border-strong: #3F3F46;
  --text-primary: #FAFAFA;
  --text-secondary: #A1A1AA;
  --text-muted: #71717A;
  --accent: #2563EB;
  --accent-hover: #1D4ED8;
  --accent-contrast: #FFFFFF;
  --status-green: #10B981;
  --nav-bg: rgba(9, 9, 11, 0.88);

  /* Secondary accents */
  --accent-2: #06B6D4;
  --accent-3: #6366F1;
  --accent-index: #3B82F6;
  --accent-border-hover: rgba(59, 130, 246, 0.4);

  /* Atmosphere */
  --dot-color: rgba(250, 250, 250, 0.15);
  --spotlight: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(37, 99, 235, 0.18), transparent);
  --hl-gradient: linear-gradient(135deg, #FFFFFF 30%, #93C5FD 100%);

  /* Surfaces */
  --card-highlight: rgba(255, 255, 255, 0.05);
  --card-shadow: none;
  --win-highlight: rgba(255, 255, 255, 0.08);

  /* Syntax colors (spec card) */
  --syn-key: #67E8F9;
  --syn-str: #34D399;
  --syn-alt: #FBBF24;

  /* Tinted badges */
  --tone-green-fg: #34D399; --tone-green-bg: rgba(16, 185, 129, 0.10); --tone-green-bd: rgba(16, 185, 129, 0.30);
  --tone-blue-fg: #60A5FA;  --tone-blue-bg: rgba(59, 130, 246, 0.10);  --tone-blue-bd: rgba(59, 130, 246, 0.30);
  --tone-indigo-fg: #A5B4FC; --tone-indigo-bg: rgba(99, 102, 241, 0.12); --tone-indigo-bd: rgba(99, 102, 241, 0.32);

  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --tracking-heading: -0.03em;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;

  --radius: 6px;
  --nav-height: 64px;
  --container-max: 1200px;
  --gutter: 24px;
  --transition: 150ms ease;

  color-scheme: dark;
}

[data-theme="light"] {
  --bg-canvas: #FAFAFA;
  --bg-surface: #FFFFFF;
  --bg-surface-hover: #F4F4F5;
  --border-subtle: #E4E4E7;
  --border-strong: #D4D4D8;
  --text-primary: #09090B;
  --text-secondary: #52525B;
  --text-muted: #71717A;
  --nav-bg: rgba(250, 250, 250, 0.88);
  --accent-index: #2563EB;
  --dot-color: rgba(9, 9, 11, 0.25);
  --spotlight: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(37, 99, 235, 0.08), transparent);
  --hl-gradient: linear-gradient(135deg, #09090B 40%, #2563EB 100%);
  --card-highlight: rgba(255, 255, 255, 0.9);
  --card-shadow: 0 1px 2px rgba(9, 9, 11, 0.04);
  --win-highlight: rgba(255, 255, 255, 0.9);
  --syn-key: #0E7490;
  --syn-str: #047857;
  --syn-alt: #B45309;
  --tone-green-fg: #047857; --tone-green-bg: rgba(16, 185, 129, 0.10); --tone-green-bd: rgba(16, 185, 129, 0.35);
  --tone-blue-fg: #1D4ED8;  --tone-blue-bg: rgba(37, 99, 235, 0.08);  --tone-blue-bd: rgba(37, 99, 235, 0.28);
  --tone-indigo-fg: #4338CA; --tone-indigo-bg: rgba(99, 102, 241, 0.10); --tone-indigo-bd: rgba(99, 102, 241, 0.30);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { max-width: 100%; overflow-x: hidden; -webkit-text-size-adjust: 100%; scroll-padding-top: var(--nav-height); }

body {
  margin: 0;
  max-width: 100%;
  overflow-x: clip; /* clip (not hidden) keeps the sticky navbar working */
  overflow-wrap: break-word;
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { letter-spacing: var(--tracking-heading); line-height: 1.15; margin: 0; font-weight: 600; }

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

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

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

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0ms !important; }
}
