/* ============================================
   HoxCore Documentation — Production Stylesheet
   ============================================ */

/* ============================================
   CSS Variables
   ============================================ */
:root {
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-primary-light: #3b82f6;
  --color-primary-subtle: #eff6ff;
  --color-secondary: #10b981;
  --color-accent: #f59e0b;

  --color-background: #ffffff;
  --color-surface: #f8fafc;
  --color-surface-dark: #f1f5f9;
  --color-border: #e2e8f0;
  --color-border-strong: #cbd5e1;

  --color-text: #0f172a;
  --color-text-light: #475569;
  --color-text-muted: #94a3b8;

  --color-success: #059669;
  --color-success-bg: #ecfdf5;
  --color-warning: #d97706;
  --color-warning-bg: #fffbeb;
  --color-error: #dc2626;
  --color-error-bg: #fef2f2;
  --color-info: #2563eb;
  --color-info-bg: #eff6ff;

  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace;

  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;

  --leading-tight: 1.25;
  --leading-snug:  1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 1.75;

  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;
  --sp-24: 6rem;

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

  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow:    0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -1px rgba(0,0,0,.04);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.04);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,.08), 0 10px 10px -5px rgba(0,0,0,.03);

  --navbar-h: 64px;
  --sidebar-w: 260px;
  --content-max: 760px;
  --site-max: 1280px;

  --ease: cubic-bezier(.4,0,.2,1);
  --ease-out: cubic-bezier(0,0,.2,1);
  --dur-fast: 120ms;
  --dur: 200ms;
  --dur-slow: 350ms;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --color-background: #0f172a;
    --color-surface: #1e293b;
    --color-surface-dark: #263348;
    --color-border: #334155;
    --color-border-strong: #475569;
    --color-text: #f1f5f9;
    --color-text-light: #cbd5e1;
    --color-text-muted: #64748b;
    --color-primary-subtle: #1e3a6e;
    --color-success-bg: #052e16;
    --color-warning-bg: #27180a;
    --color-error-bg: #2a0a0a;
    --color-info-bg: #0f2a5a;
  }
}

html.dark {
  --color-background: #0f172a;
  --color-surface: #1e293b;
  --color-surface-dark: #263348;
  --color-border: #334155;
  --color-border-strong: #475569;
  --color-text: #f1f5f9;
  --color-text-light: #cbd5e1;
  --color-text-muted: #64748b;
  --color-primary-subtle: #1e3a6e;
  --color-success-bg: #052e16;
  --color-warning-bg: #27180a;
  --color-error-bg: #2a0a0a;
  --color-info-bg: #0f2a5a;
}

/* ============================================
   Reset
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text);
  background: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--color-text);
  margin-bottom: var(--sp-4);
}

h1 { font-size: var(--text-4xl); letter-spacing: -0.025em; }
h2 { font-size: var(--text-3xl); letter-spacing: -0.02em; }
h3 { font-size: var(--text-2xl); letter-spacing: -0.015em; }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  margin-bottom: var(--sp-4);
  color: var(--color-text-light);
  line-height: var(--leading-relaxed);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}
a:hover { color: var(--color-primary-dark); text-decoration: underline; }

strong, b { font-weight: 600; color: var(--color-text); }
em, i { font-style: italic; }

ul, ol { margin-bottom: var(--sp-4); padding-left: var(--sp-6); }
li { margin-bottom: var(--sp-2); color: var(--color-text-light); }

/* Inline code */
:not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--color-surface-dark);
  color: var(--color-text);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  white-space: nowrap;
}

/* Code blocks */
pre {
  position: relative;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: #0d1117;
  color: #e6edf3;
  padding: var(--sp-5) var(--sp-6);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-bottom: var(--sp-6);
  border: 1px solid #30363d;
  line-height: 1.65;
}

pre code {
  background: none;
  padding: 0;
  border: none;
  font-size: inherit;
  color: inherit;
  white-space: pre;
}

/* Copy button */
.copy-btn {
  position: absolute;
  top: var(--sp-3);
  right: var(--sp-3);
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-1) var(--sp-3);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 500;
  color: #8b949e;
  background: #21262d;
  border: 1px solid #30363d;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.copy-btn:hover { color: #e6edf3; background: #30363d; }
.copy-btn.copied { color: #3fb950; border-color: #238636; }
.copy-btn svg { width: 12px; height: 12px; flex-shrink: 0; }

blockquote {
  border-left: 3px solid var(--color-primary);
  padding-left: var(--sp-5);
  margin: var(--sp-6) 0;
  color: var(--color-text-light);
  font-style: italic;
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--sp-8) 0;
}

/* ============================================
   Layout
   ============================================ */
.container {
  max-width: var(--site-max);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

/* ============================================
   Skip Link
   ============================================ */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--sp-4);
  z-index: 9999;
  padding: var(--sp-2) var(--sp-4);
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: 600;
  transition: top var(--dur-fast);
}
.skip-link:focus { top: var(--sp-4); }

/* ============================================
   Navbar
   ============================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--navbar-h);
  background: var(--color-background);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-xs);
  transition: background var(--dur) var(--ease);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: var(--sp-4);
}

.nav-brand a {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  text-decoration: none;
}

.nav-logo {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: -0.03em;
  line-height: 1;
}

.nav-version {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-surface-dark);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: var(--sp-1);
  align-items: center;
  padding: 0;
  margin: 0;
}

.nav-menu li { margin: 0; }

.nav-menu a {
  display: block;
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-light);
  border-radius: var(--radius);
  transition: all var(--dur-fast) var(--ease);
}
.nav-menu a:hover { color: var(--color-text); background: var(--color-surface); text-decoration: none; }
.nav-menu a.active { color: var(--color-primary); background: var(--color-primary-subtle); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-shrink: 0;
}

.nav-github {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-surface-dark);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition: all var(--dur-fast) var(--ease);
}
.nav-github:hover { background: var(--color-border); text-decoration: none; }
.nav-github svg { width: 16px; height: 16px; }

/* Dark mode toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--color-text-light);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
  flex-shrink: 0;
}
.theme-toggle:hover { background: var(--color-surface); color: var(--color-text); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
html.dark .theme-toggle .icon-sun { display: block; }
html.dark .theme-toggle .icon-moon { display: none; }

/* Mobile menu toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  padding: var(--sp-2);
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ============================================
   Page Header (interior pages)
   ============================================ */
.page-header {
  padding: var(--sp-12) 0 var(--sp-10);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.page-header-inner {
  max-width: var(--site-max);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

.page-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.page-breadcrumb a { color: var(--color-text-muted); }
.page-breadcrumb a:hover { color: var(--color-primary); text-decoration: none; }
.page-breadcrumb .sep { color: var(--color-border-strong); }

.page-header h1 {
  font-size: var(--text-4xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--color-text);
  margin-bottom: var(--sp-3);
}

.page-header p {
  font-size: var(--text-lg);
  color: var(--color-text-light);
  max-width: 600px;
  margin: 0;
}

/* ============================================
   Documentation layout
   ============================================ */
.doc-wrapper {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  gap: 0;
  max-width: var(--site-max);
  margin: 0 auto;
  min-height: calc(100vh - var(--navbar-h));
  align-items: start;
}

/* Sidebar */
.doc-sidebar {
  position: sticky;
  top: var(--navbar-h);
  height: calc(100vh - var(--navbar-h));
  overflow-y: auto;
  border-right: 1px solid var(--color-border);
  padding: var(--sp-6) 0;
  background: var(--color-surface);
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}
.doc-sidebar::-webkit-scrollbar { width: 4px; }
.doc-sidebar::-webkit-scrollbar-track { background: transparent; }
.doc-sidebar::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 2px; }

.sidebar-section { margin-bottom: var(--sp-6); }

.sidebar-label {
  display: block;
  padding: var(--sp-1) var(--sp-5);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--sp-1);
}

.sidebar-nav { list-style: none; padding: 0; margin: 0; }

.sidebar-nav li { margin: 0; }

.sidebar-nav a {
  display: block;
  padding: var(--sp-2) var(--sp-5);
  font-size: var(--text-sm);
  color: var(--color-text-light);
  border-radius: 0;
  border-left: 2px solid transparent;
  transition: all var(--dur-fast) var(--ease);
  margin: 0;
}
.sidebar-nav a:hover { color: var(--color-text); background: var(--color-surface-dark); text-decoration: none; }
.sidebar-nav a.active { color: var(--color-primary); border-left-color: var(--color-primary); background: var(--color-primary-subtle); font-weight: 500; }

.sidebar-nav-sub { list-style: none; padding: 0; margin: 0; }
.sidebar-nav-sub a { padding-left: calc(var(--sp-5) + var(--sp-4)); font-size: var(--text-xs); color: var(--color-text-muted); }
.sidebar-nav-sub a.active { color: var(--color-primary); }

/* Main content */
.doc-content-area {
  min-width: 0;
  padding: var(--sp-10) var(--sp-8) var(--sp-16);
}

.doc-content {
  max-width: var(--content-max);
}

/* ============================================
   Doc sections
   ============================================ */
.doc-section {
  margin-bottom: var(--sp-12);
  scroll-margin-top: calc(var(--navbar-h) + var(--sp-6));
}

.doc-section h2 {
  font-size: var(--text-2xl);
  font-weight: 700;
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--sp-6);
  scroll-margin-top: calc(var(--navbar-h) + var(--sp-6));
}

.doc-section h3 {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-top: var(--sp-8);
  margin-bottom: var(--sp-4);
  scroll-margin-top: calc(var(--navbar-h) + var(--sp-6));
}

.doc-section h4 {
  font-size: var(--text-base);
  font-weight: 600;
  margin-top: var(--sp-5);
  margin-bottom: var(--sp-3);
  color: var(--color-text);
}

/* ============================================
   Tables
   ============================================ */
.table-wrap { overflow-x: auto; margin-bottom: var(--sp-6); border-radius: var(--radius-md); border: 1px solid var(--color-border); }

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.doc-table thead { background: var(--color-surface); }
.doc-table th {
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  font-weight: 600;
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
}
.doc-table td {
  padding: var(--sp-3) var(--sp-4);
  color: var(--color-text-light);
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}
.doc-table tbody tr:last-child td { border-bottom: none; }
.doc-table tbody tr:hover { background: var(--color-surface); }

.table-note {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--sp-2);
  font-style: italic;
}

/* ============================================
   Callout boxes
   ============================================ */
.callout {
  display: flex;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius-md);
  border: 1px solid;
  margin-bottom: var(--sp-6);
}

.callout-icon {
  flex-shrink: 0;
  font-size: var(--text-lg);
  line-height: 1.5;
}

.callout-body { flex: 1; min-width: 0; }
.callout-body h4 { font-size: var(--text-sm); font-weight: 600; margin-bottom: var(--sp-2); }
.callout-body p:last-child { margin-bottom: 0; }
.callout-body ul:last-child { margin-bottom: 0; }
.callout-body p, .callout-body li { font-size: var(--text-sm); }

.callout-info    { background: var(--color-info-bg);    border-color: #93c5fd; color: var(--color-info); }
.callout-warning { background: var(--color-warning-bg); border-color: #fcd34d; color: var(--color-warning); }
.callout-success { background: var(--color-success-bg); border-color: #6ee7b7; color: var(--color-success); }
.callout-danger  { background: var(--color-error-bg);   border-color: #fca5a5; color: var(--color-error); }

.callout-info    .callout-body h4 { color: #1e40af; }
.callout-warning .callout-body h4 { color: #92400e; }
.callout-success .callout-body h4 { color: #065f46; }
.callout-danger  .callout-body h4 { color: #991b1b; }

.callout-info    .callout-body p,
.callout-info    .callout-body li { color: #1e3a8a; }
.callout-warning .callout-body p,
.callout-warning .callout-body li { color: #78350f; }
.callout-success .callout-body p,
.callout-success .callout-body li { color: #064e3b; }
.callout-danger  .callout-body p,
.callout-danger  .callout-body li { color: #7f1d1d; }

html.dark .callout-info    .callout-body p,
html.dark .callout-info    .callout-body li { color: #bfdbfe; }
html.dark .callout-info    .callout-body h4 { color: #93c5fd; }
html.dark .callout-warning .callout-body p,
html.dark .callout-warning .callout-body li { color: #fde68a; }
html.dark .callout-warning .callout-body h4 { color: #fcd34d; }
html.dark .callout-success .callout-body p,
html.dark .callout-success .callout-body li { color: #a7f3d0; }
html.dark .callout-success .callout-body h4 { color: #6ee7b7; }
html.dark .callout-danger  .callout-body p,
html.dark .callout-danger  .callout-body li { color: #fecaca; }
html.dark .callout-danger  .callout-body h4 { color: #fca5a5; }

/* Legacy aliases for existing pages */
.info-box    { @apply-unused: 0; }
.info-box, .warning-box, .success-box, .concept-box {
  display: flex;
  flex-direction: column; 
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius-md);
  border: 1px solid;
  margin-bottom: var(--sp-6);
  overflow: hidden;
}

.info-box pre,
.warning-box pre,
.success-box pre,
.concept-box pre {
  margin-bottom: 0;
  max-width: 100%;
}

.info-box    { background: var(--color-info-bg);    border-color: #93c5fd; }
.warning-box { background: var(--color-warning-bg); border-color: #fcd34d; }
.success-box { background: var(--color-success-bg); border-color: #6ee7b7; }
.concept-box { background: var(--color-surface);    border-color: var(--color-primary); }

.info-box h4, .warning-box h4, .success-box h4, .concept-box h4 {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--sp-2);
}
.info-box p:last-child, .warning-box p:last-child, .success-box p:last-child, .concept-box p:last-child { margin-bottom: 0; }
.info-box p, .info-box li       { color: #1e3a8a; font-size: var(--text-sm); }
.warning-box p, .warning-box li { color: #78350f; font-size: var(--text-sm); }
.success-box p, .success-box li { color: #064e3b; font-size: var(--text-sm); }
html.dark .info-box p, html.dark .info-box li       { color: #bfdbfe; }
html.dark .warning-box p, html.dark .warning-box li { color: #fde68a; }
html.dark .success-box p, html.dark .success-box li { color: #a7f3d0; }

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.25;
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.btn-primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: #fff;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-secondary:hover {
  background: var(--color-primary);
  color: #fff;
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-light);
  border-color: var(--color-border);
}
.btn-ghost:hover { background: var(--color-surface); color: var(--color-text); }

.btn-sm { padding: var(--sp-2) var(--sp-3); font-size: var(--text-xs); }
.btn-lg { padding: var(--sp-4) var(--sp-6); font-size: var(--text-base); }

/* ============================================
   Hero Section
   ============================================ */
.hero {
  padding: var(--sp-20) 0 var(--sp-16);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  overflow: hidden;
}

.hero-content {
  max-width: 680px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-3);
  background: var(--color-primary-subtle);
  color: var(--color-primary);
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: var(--sp-6);
}

.hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: var(--leading-tight);
  letter-spacing: -0.04em;
  color: var(--color-text);
  margin-bottom: var(--sp-5);
}

.hero-tagline {
  font-size: var(--text-xl);
  color: var(--color-text-light);
  margin-bottom: var(--sp-4);
  font-weight: 500;
  line-height: var(--leading-snug);
}

.hero-desc {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-bottom: var(--sp-8);
  max-width: 520px;
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-bottom: var(--sp-8);
}

.hero-install {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text-light);
  max-width: fit-content;
}

.hero-install .prompt { color: var(--color-text-muted); user-select: none; }
.hero-install .cmd { color: var(--color-text); font-weight: 500; }

.hero-install-copy {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: var(--sp-1);
  border-radius: var(--radius-sm);
  transition: color var(--dur-fast);
  display: flex;
}
.hero-install-copy:hover { color: var(--color-primary); }
.hero-install-copy svg { width: 16px; height: 16px; }

/* ============================================
   Feature grid
   ============================================ */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
}

.feature-card {
  padding: var(--sp-6);
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: all var(--dur) var(--ease);
}
.feature-card:hover { border-color: var(--color-primary); box-shadow: var(--shadow-md); transform: translateY(-2px); }

.feature-icon {
  font-size: 1.5rem;
  line-height: 1;
  margin-bottom: var(--sp-4);
}

.feature-card h3 {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--sp-2);
  color: var(--color-text);
}

.feature-card p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0;
  line-height: var(--leading-relaxed);
}

/* ============================================
   Quick start steps
   ============================================ */
.steps { display: flex; flex-direction: column; gap: var(--sp-6); }

.step {
  display: flex;
  gap: var(--sp-4);
}

.step-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 700;
  margin-top: 2px;
}

.step-body { flex: 1; min-width: 0; }
.step-body h3 { font-size: var(--text-base); font-weight: 600; margin-bottom: var(--sp-3); }

/* ============================================
   Concept cards
   ============================================ */
.concept-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
}

.concept-card {
  padding: var(--sp-5);
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: all var(--dur) var(--ease);
}
.concept-card:hover { border-color: var(--color-primary); transform: translateY(-2px); }
.concept-card h3 { font-size: var(--text-base); font-weight: 600; margin-bottom: var(--sp-2); }
.concept-card p { font-size: var(--text-sm); color: var(--color-text-muted); margin: 0; }

/* ============================================
   Entity type cards
   ============================================ */
.entity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sp-5);
}

.entity-card {
  padding: var(--sp-6);
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: all var(--dur) var(--ease);
}
.entity-card:hover { border-color: var(--color-primary); box-shadow: var(--shadow); }

.entity-card-icon { font-size: 2rem; margin-bottom: var(--sp-3); }

.entity-card h3 {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--sp-2);
}

.entity-card .entity-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-style: italic;
  margin-bottom: var(--sp-4);
}

.entity-card h4 {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--sp-2);
}

.entity-card ul { margin-bottom: var(--sp-4); }
.entity-card li { font-size: var(--text-sm); }

/* ============================================
   Status cards
   ============================================ */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--sp-4);
}

.status-card {
  padding: var(--sp-4);
  border-radius: var(--radius-md);
  border: 1px solid;
  text-align: center;
}
.status-card h4 { font-family: var(--font-mono); font-size: var(--text-sm); margin-bottom: var(--sp-2); font-weight: 600; }
.status-card p  { font-size: var(--text-xs); margin: 0; }

.status-active    { background: #ecfdf5; border-color: #a7f3d0; }
.status-active    h4 { color: #065f46; }
.status-active    p  { color: #064e3b; }
.status-completed { background: #eff6ff; border-color: #bfdbfe; }
.status-completed h4 { color: #1e40af; }
.status-completed p  { color: #1e3a8a; }
.status-on-hold   { background: #fffbeb; border-color: #fde68a; }
.status-on-hold   h4 { color: #92400e; }
.status-on-hold   p  { color: #78350f; }
.status-canceled  { background: #fef2f2; border-color: #fecaca; }
.status-canceled  h4 { color: #991b1b; }
.status-canceled  p  { color: #7f1d1d; }

/* ============================================
   Provider / Integration cards
   ============================================ */
.provider-card, .integration-detail, .use-case-example {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  margin-bottom: var(--sp-6);
}

.provider-card h4, .integration-detail h4 {
  color: var(--color-primary);
  margin-bottom: var(--sp-4);
}

/* ============================================
   Principles
   ============================================ */
.principle-item {
  display: flex;
  gap: var(--sp-4);
  padding: var(--sp-5);
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--sp-4);
}

.principle-icon { font-size: 1.5rem; flex-shrink: 0; line-height: 1.4; }
.principle-content h3 { font-size: var(--text-base); margin-bottom: var(--sp-1); }
.principle-content p { font-size: var(--text-sm); margin: 0; }

.principles-detailed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-4);
}

.principle-detailed {
  padding: var(--sp-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
.principle-detailed h3 { color: var(--color-primary); font-size: var(--text-base); }
.principle-detailed > p { font-size: var(--text-sm); font-weight: 600; margin-bottom: var(--sp-3); }
.principle-detailed li { font-size: var(--text-sm); }

/* ============================================
   Next steps grid
   ============================================ */
.next-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--sp-4);
}

.next-step-card {
  padding: var(--sp-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  transition: all var(--dur) var(--ease);
}
.next-step-card:hover { border-color: var(--color-primary); box-shadow: var(--shadow); }
.next-step-card h3 { font-size: var(--text-base); margin-bottom: var(--sp-2); }
.next-step-card p { font-size: var(--text-sm); flex: 1; margin-bottom: var(--sp-4); color: var(--color-text-muted); }

/* ============================================
   Capabilities / AI feature cards
   ============================================ */
.capabilities-grid, .integration-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--sp-4);
}

.capability-card, .category-card {
  padding: var(--sp-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
.capability-card h4, .category-card h4 { color: var(--color-primary); font-size: var(--text-sm); margin-bottom: var(--sp-3); }
.capability-card p, .category-card p { font-size: var(--text-sm); }

/* ============================================
   Translation example
   ============================================ */
.translation-example {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--sp-4);
  align-items: start;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  margin-bottom: var(--sp-6);
}
.translation-input, .translation-output { min-width: 0; }
.translation-input h4, .translation-output h4 { font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-text-muted); margin-bottom: var(--sp-3); }
.translation-arrow { font-size: var(--text-xl); color: var(--color-primary); font-weight: 700; align-self: center; }

/* ============================================
   Best practice blocks
   ============================================ */
.best-practice {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--sp-5);
  margin-bottom: var(--sp-5);
}
.best-practice h4 { font-size: var(--text-sm); margin-bottom: var(--sp-3); }
.best-practice li { font-size: var(--text-sm); }

/* ============================================
   Hero (index) sections
   ============================================ */
.section-title {
  font-size: var(--text-3xl);
  font-weight: 800;
  text-align: center;
  letter-spacing: -0.025em;
  margin-bottom: var(--sp-10);
}

section.site-section { padding: var(--sp-16) 0; }
section.site-section:nth-child(even) { background: var(--color-surface); }

/* Use case cards */
.use-cases-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
}

.use-case-card {
  padding: var(--sp-5);
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
.use-case-card h3 { font-size: var(--text-base); color: var(--color-primary); margin-bottom: var(--sp-2); }
.use-case-card p { font-size: var(--text-sm); margin: 0; }

/* ============================================
   CTA banner
   ============================================ */
.cta-banner {
  background: var(--color-primary);
  padding: var(--sp-12) 0;
  text-align: center;
}
.cta-banner h2 { color: #fff; margin-bottom: var(--sp-3); }
.cta-banner p { color: rgba(255,255,255,.85); font-size: var(--text-lg); margin-bottom: var(--sp-8); }
.cta-banner .btn-primary { background: #fff; color: var(--color-primary); border-color: #fff; }
.cta-banner .btn-primary:hover { background: var(--color-surface); }
.cta-banner .btn-secondary { color: #fff; border-color: rgba(255,255,255,.6); }
.cta-banner .btn-secondary:hover { background: rgba(255,255,255,.1); color: #fff; }
.cta-buttons { display: flex; gap: var(--sp-3); justify-content: center; flex-wrap: wrap; }

/* ============================================
   Footer
   ============================================ */
.footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: var(--sp-12) 0 var(--sp-8);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--sp-10);
  margin-bottom: var(--sp-10);
}

.footer-brand p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--sp-4);
  max-width: 240px;
}

.footer-section h4 {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--sp-4);
}

.footer-section ul { list-style: none; padding: 0; margin: 0; }
.footer-section li { margin-bottom: var(--sp-2); }
.footer-section a { font-size: var(--text-sm); color: var(--color-text-light); transition: color var(--dur-fast); }
.footer-section a:hover { color: var(--color-primary); text-decoration: none; }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--sp-6);
  border-top: 1px solid var(--color-border);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ============================================
   Scroll to top
   ============================================ */
.scroll-top {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  width: 40px;
  height: 40px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(12px);
  transition: all var(--dur) var(--ease);
  pointer-events: none;
  z-index: 50;
}
.scroll-top.visible { opacity: 1; transform: none; pointer-events: auto; }
.scroll-top:hover { background: var(--color-primary-dark); }
.scroll-top svg { width: 18px; height: 18px; }

/* ============================================
   404 page
   ============================================ */
.not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--navbar-h) - 200px);
  text-align: center;
  padding: var(--sp-16);
}
.not-found-code {
  font-size: 6rem;
  font-weight: 800;
  color: var(--color-border-strong);
  line-height: 1;
  margin-bottom: var(--sp-4);
  letter-spacing: -0.05em;
}
.not-found h1 { margin-bottom: var(--sp-3); }
.not-found p { max-width: 400px; margin-bottom: var(--sp-8); }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
  .doc-wrapper {
    grid-template-columns: 1fr;
  }

  .doc-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    display: none; /* Collapsed on mobile, toggled via JS */
  }

  .doc-sidebar.open { display: block; }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-8);
  }
}

@media (max-width: 768px) {
  :root { --navbar-h: 56px; }

  .nav-menu {
    display: none;
    position: absolute;
    top: var(--navbar-h);
    left: 0;
    right: 0;
    background: var(--color-background);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    gap: 0;
    padding: var(--sp-3) 0;
    box-shadow: var(--shadow-md);
  }
  .nav-menu.open { display: flex; }
  .nav-menu a { border-radius: 0; padding: var(--sp-3) var(--sp-5); }

  .nav-toggle { display: flex; }

  .hero { padding: var(--sp-12) 0 var(--sp-10); }
  .hero h1 { font-size: var(--text-3xl); }

  .translation-example {
    grid-template-columns: 1fr;
  }
  .translation-arrow { transform: rotate(90deg); text-align: center; }

  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; gap: var(--sp-2); text-align: center; }

  .doc-content-area { padding: var(--sp-6) var(--sp-4) var(--sp-12); }
}

/* Tablet — 2 columns */
@media (max-width: 900px) {
  .feature-grid,
  .concept-grid,
  .use-cases-grid {
    grid-template-columns: 1fr;
  }
}



@media (max-width: 480px) {
  .hero-cta { flex-direction: column; align-items: flex-start; }
  .hero h1 { font-size: var(--text-2xl); }
  .feature-grid, .entity-grid, .next-steps-grid, .concept-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .section-title { font-size: var(--text-2xl); }
}


/* ============================================
   Print
   ============================================ */
@media print {
  .navbar, .doc-sidebar, .footer, .scroll-top, .theme-toggle,
  .cta-banner, .next-steps-grid, .hero-cta, .copy-btn { display: none !important; }
  body { font-size: 12pt; color: #000; background: #fff; }
  .doc-wrapper { display: block; }
  .doc-content-area { padding: 0; }
  pre { border: 1px solid #ccc; white-space: pre-wrap; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #666; }
}

/* ============================================
   Accessibility
   ============================================ */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 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;
}

/* ============================================
   Highlight.js overrides
   ============================================ */
.hljs { background: transparent !important; padding: 0 !important; }