:root {
  --bg: #0b0d14;
  --navy: #0e1624;
  --surface: #101a2a;
  --panel: #1a2030;
  --sidebar: #070c14;
  --border: rgba(168, 194, 228, 0.22);
  --text: #f4f6fb;
  --muted: #a8b8cc;
  --primary: #2068e0;
  --ring: #3d8bff;
  --font-ui: "IBM Plex Sans", "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --font-editorial: "Cormorant", Georgia, serif;
  --font-data: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  display: flex;
  font-family: var(--font-ui);
  font-size: 1rem;
  letter-spacing: 0.01em;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
.skip {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  z-index: 2;
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transform: translateY(-200%);
}
.skip:focus { transform: none; outline: 2px solid var(--ring); outline-offset: 2px; }
.sidebar {
  width: 260px;
  flex: 0 0 260px;
  border-right: 1px solid var(--border);
  background: var(--sidebar);
  padding: 1.25rem 0.75rem 2rem;
  overflow: auto;
}
.brand {
  margin: 0 0.65rem 0.15rem;
  font-family: var(--font-editorial);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
}
.sub {
  margin: 0 0.65rem 1.25rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--muted);
}
.nav a {
  display: block;
  padding: 0.4rem 0.65rem;
  margin: 1px 0;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
}
.nav a.nested { padding-left: 0.9rem; }
.nav a:hover { background: var(--panel); color: var(--text); }
.nav a:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 1px;
}
.nav a.is-active {
  background: rgba(32, 104, 224, 0.18);
  color: var(--text);
}
.group { margin-top: 1.25rem; }
.group-label {
  margin: 0 0.65rem 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}
.main {
  flex: 1;
  min-width: 0;
  overflow: auto;
  padding: 2rem 2.5rem 3.5rem;
  background: var(--navy);
}
.article {
  max-width: 68ch;
  margin: 0 auto;
  line-height: 1.55;
}
.article h1 {
  font-family: var(--font-editorial);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
  margin: 0 0 0.75rem;
}
.article h2 {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.25;
  margin: 2rem 0 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}
.article h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 1.5rem 0 0.35rem;
}
.article p { margin: 0 0 0.9rem; color: var(--text); }
.article li { margin: 0.25rem 0; }
.article ul, .article ol { margin: 0 0 1rem; padding-left: 1.25rem; }
.article a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.article a:hover { color: var(--ring); }
.article a:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 2px; }
.article table {
  border-collapse: collapse;
  width: 100%;
  margin: 0 0 1.15rem;
  font-size: 0.9375rem;
}
.article th, .article td {
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0.65rem 0.5rem 0;
  text-align: left;
  vertical-align: top;
}
.article th {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}
.article tr:last-child td { border-bottom: 0; }
.article code, .article kbd {
  font-family: var(--font-data);
  font-size: 0.875rem;
  letter-spacing: 0;
}
.article code {
  color: var(--muted);
  background: var(--panel);
  padding: 0.08em 0.35em;
  border-radius: 6px;
}
.article pre {
  margin: 0 0 1.15rem;
  padding: 0.85rem 1rem;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.article pre code {
  background: none;
  padding: 0;
  color: var(--text);
}
@media (max-width: 720px) {
  body { flex-direction: column; }
  .sidebar {
    width: 100%;
    flex: none;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 1rem 0.85rem 0.85rem;
  }
  .nav { display: flex; flex-wrap: wrap; gap: 0.15rem 0.25rem; }
  .group { margin-top: 0.65rem; flex: 1 1 100%; }
  .main { padding: 1.5rem 1.15rem 2.5rem; }
}
