:root {
  --bg: #0b1220;
  --surface: #0f1a2f;
  --text: #e8eefc;
  --muted: #a9b7d6;
  --primary: #6ea8fe;
  --border: rgba(255,255,255,0.10);

  --radius: 14px;
  --shadow: 0 10px 30px rgba(0,0,0,0.35);

  --font-sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, monospace;

  --content-max: 1100px;
  --sidebar-w: 280px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 16px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 12px;
  background: var(--surface);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.skip-link:focus { left: 12px; z-index: 9999; }

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 65%, transparent);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 12px;
}
.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.brand-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}
.brand-name {
  font-weight: 700;
  letter-spacing: 0.2px;
}

.header-actions { display: inline-flex; gap: 10px; align-items: center; }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
}
.nav-toggle-icon {
  width: 18px;
  height: 2px;
  background: var(--text);
  position: relative;
  display: inline-block;
  border-radius: 2px;
}
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}
.nav-toggle-icon::before { top: -6px; }
.nav-toggle-icon::after { top: 6px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}
.btn-primary {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  background: color-mix(in srgb, var(--primary) 22%, var(--surface));
}

.nav {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 85%, var(--surface));
}
.nav .nav-list {
  list-style: none;
  margin: 0;
  padding: 10px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}
.nav .nav-list a {
  display: inline-flex;
  padding: 8px 10px;
  border-radius: 10px;
}
.nav .nav-list a:hover {
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  text-decoration: none;
}
.nav .nav-list ul {
  list-style: none;
  margin: 8px 0 0 0;
  padding: 0 0 0 14px;
  border-left: 1px solid var(--border);
}
.nav .nav-list li { position: relative; }

.app { min-height: calc(100vh - 64px); }

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 18px 16px;
}

.sidebar-inner { display: grid; gap: 12px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}
.card-title {
  margin: 0 0 10px 0;
  font-size: 14px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--muted);
}

.main { min-width: 0; }

.content {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.content h1 { font-size: clamp(28px, 4vw, 44px); margin-top: 0; }
.content h2 { font-size: 24px; margin-top: 26px; }
.content h3 { font-size: 18px; margin-top: 18px; }

.content p, .content li { color: var(--text); }
.muted, .page-meta { color: var(--muted); }

.content pre {
  overflow: auto;
  padding: 14px;
  border-radius: 14px;
  background: #07101f;
  border: 1px solid var(--border);
  font-family: var(--font-mono);
}
.content code { font-family: var(--font-mono); }

.breadcrumb { margin-bottom: 14px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--text); }

.footer {
  border-top: 1px solid var(--border);
  padding: 18px 0;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
}

/* Responsive: on wider screens show sidebar */
@media (min-width: 980px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) var(--sidebar-w);
    align-items: start;
  }
  .sidebar { position: sticky; top: 140px; height: fit-content; }
}

/* Mobile nav collapse: JS toggles .nav-open on body */
@media (max-width: 820px) {
  .nav { display: none; }
  body.nav-open .nav { display: block; }
  .nav .nav-list { flex-direction: column; }
}

.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;
}
