/* ==========================================================================
   NEXSIZ Documentation — Design System
   Aesthetic: Dark Ops / Cyan Accent
   ========================================================================== */

:root {
  --bg-primary: #0a0e14;
  --bg-secondary: #0f1419;
  --bg-tertiary: #151b23;
  --bg-elevated: #1a222d;
  --bg-hover: #1f2a36;

  --border: #243040;
  --border-subtle: #1a2533;

  --text-primary: #e6edf3;
  --text-secondary: #8b9cb3;
  --text-muted: #5c6d82;
  --text-inverse: #0a0e14;

  --accent: #00d4c8;
  --accent-dim: #00a89e;
  --accent-glow: rgba(0, 212, 200, 0.15);
  --accent-hover: #00f0e2;

  --danger: #f85149;
  --warning: #d29922;
  --success: #3fb950;

  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "SF Mono", Consolas, monospace;

  --sidebar-width: 280px;
  --topbar-height: 56px;
  --content-max: 860px;
  --radius: 6px;
  --radius-lg: 10px;
  --transition: 0.15s ease;
}

[data-theme="light"] {
  --bg-primary: #f6f8fa;
  --bg-secondary: #ffffff;
  --bg-tertiary: #eef1f5;
  --bg-elevated: #ffffff;
  --bg-hover: #e8ecf1;
  --border: #d0d7de;
  --border-subtle: #e6ebf0;
  --text-primary: #1f2328;
  --text-secondary: #656d76;
  --text-muted: #8c959f;
  --text-inverse: #ffffff;
  --accent: #0891b2;
  --accent-dim: #0e7490;
  --accent-glow: rgba(8, 145, 178, 0.12);
  --accent-hover: #06b6d4;
}

*, *::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);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, h5, h6 {
  font-weight: 650;
  line-height: 1.3;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h1 { font-size: 2rem; margin-bottom: 1rem; }
h2 { font-size: 1.45rem; margin: 2.2rem 0 0.85rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--border-subtle); }
h3 { font-size: 1.15rem; margin: 1.6rem 0 0.6rem; }
h4 { font-size: 1rem; margin: 1.2rem 0 0.5rem; }

p { margin-bottom: 1rem; color: var(--text-secondary); }
ul, ol { margin: 0 0 1rem 1.4rem; color: var(--text-secondary); }
li { margin-bottom: 0.35rem; }
strong, b { color: var(--text-primary); font-weight: 600; }

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-tertiary);
  color: var(--accent);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
}

pre {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  overflow-x: auto;
  margin: 1rem 0 1.4rem;
  line-height: 1.55;
  position: relative;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-primary);
  font-size: inherit;
}

blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.6rem 1rem;
  margin: 1.2rem 0;
  background: var(--accent-glow);
  color: var(--text-secondary);
  border-radius: 0 var(--radius) var(--radius) 0;
}

table { width: 100%; border-collapse: collapse; margin: 1.2rem 0 1.6rem; font-size: 0.9rem; }
th, td { border: 1px solid var(--border); padding: 0.55rem 0.85rem; text-align: left; }
th { background: var(--bg-tertiary); color: var(--text-primary); font-weight: 600; }
td { color: var(--text-secondary); }
tr:hover td { background: var(--bg-hover); }
hr { border: none; border-top: 1px solid var(--border-subtle); margin: 2rem 0; }

.app { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.25s ease;
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg-tertiary);
}

.sidebar-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  letter-spacing: -0.03em;
}

.sidebar-brand span { color: var(--accent); }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0 2rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.nav-section { margin-bottom: 0.35rem; }

.nav-section-title {
  display: block;
  padding: 0.55rem 1.15rem 0.3rem;
  font-size: 0.7rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.nav-link {
  display: block;
  padding: 0.38rem 1.15rem 0.38rem 1.35rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  border-left: 2px solid transparent;
  transition: all var(--transition);
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.nav-link.active {
  color: var(--accent);
  background: var(--accent-glow);
  border-left-color: var(--accent);
  font-weight: 500;
}

.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-height);
  background: rgba(10, 14, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 50;
}

[data-theme="light"] .topbar { background: rgba(246, 248, 250, 0.9); }

.topbar-left { display: flex; align-items: center; gap: 0.75rem; }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: var(--radius);
}

.menu-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }
.menu-toggle svg { width: 22px; height: 22px; }

.topbar-actions { display: flex; align-items: center; gap: 0.5rem; }

.icon-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border);
}

.icon-btn svg { width: 18px; height: 18px; }

.content {
  flex: 1;
  padding: 2rem 2.5rem 4rem;
  max-width: calc(var(--content-max) + 5rem);
}

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

.breadcrumb {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { margin: 0 0.4rem; }

.page-header { margin-bottom: 2rem; }
.page-header h1 { margin-bottom: 0.4rem; }
.page-header .lead {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin: 0;
}

.callout {
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  margin: 1.2rem 0;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  font-size: 0.9rem;
}

.callout-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.callout.info { border-left: 3px solid var(--accent); }
.callout.warning { border-left: 3px solid var(--warning); }
.callout.danger { border-left: 3px solid var(--danger); }
.callout.success { border-left: 3px solid var(--success); }

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-accent {
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid var(--accent-dim);
}

.badge-muted {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}

.feature-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
  transition: border-color var(--transition), transform var(--transition);
}

.feature-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-2px);
}

.feature-card h3 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  color: var(--accent);
}

.feature-card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.hero {
  text-align: center;
  padding: 2.5rem 0 2rem;
}

.hero-logo {
  width: 120px;
  height: 120px;
  margin: 0 auto 1.25rem;
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 0 40px var(--accent-glow);
}

.hero h1 { font-size: 2.4rem; margin-bottom: 0.5rem; }

.hero .tagline {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto 1.5rem;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 550;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--text-inverse);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--text-inverse);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--text-muted);
  color: var(--text-primary);
}

.footer {
  border-top: 1px solid var(--border-subtle);
  padding: 1.5rem 2.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.code-block { position: relative; }

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition);
}

.code-block:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--accent); border-color: var(--accent-dim); }

.placeholder {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  margin: 1.5rem 0;
  background: var(--bg-secondary);
}

.placeholder strong { color: var(--text-secondary); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 90;
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .main { margin-left: 0; }
  .menu-toggle { display: flex; }
  .content { padding: 1.5rem 1.25rem 3rem; }
  .footer { padding: 1.25rem; }
  .hero h1 { font-size: 1.85rem; }
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
