:root {
  --bg: #0b0d10;
  --surface: #11151b;
  --surface-2: #171c24;
  --surface-3: #202632;
  --ink: #f4f1ec;
  --muted: #aeb7c6;
  --soft: #8792a4;
  --line: #313946;
  --line-strong: #485363;
  --red: #f04a38;
  --gold: #e7bd63;
  --blue: #69a7ff;
  --green: #78d18b;
  --code: #101318;
  --max: 1220px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.58;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
code {
  background: var(--code);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  color: #f7d78b;
  font-size: .92em;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 13, 16, .94);
  backdrop-filter: blur(14px);
}
.topbar--root { justify-content: center; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 800;
  text-decoration: none;
}
.brand img {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  object-fit: cover;
  object-position: left center;
  background: #050506;
}
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lang-switch {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.lang-switch a,
.badges span,
.root-lang {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 6px;
  text-decoration: none;
}
.lang-switch a {
  padding: 8px 11px;
  font-weight: 800;
  color: #dbe1eb;
}
.lang-switch a[aria-current="true"] {
  background: var(--red);
  border-color: var(--red);
  color: white;
}

.layout {
  width: min(100%, 1480px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 220px;
  gap: 28px;
  padding: 26px 20px 0;
}
.side-nav,
.toc {
  position: sticky;
  top: 72px;
  align-self: start;
  max-height: calc(100vh - 92px);
  overflow: auto;
}
.side-nav {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 12px;
}
.side-nav__title,
.toc__title,
.section-kicker,
.eyebrow {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 12px;
  font-weight: 900;
}
.side-nav a,
.toc a {
  display: block;
  text-decoration: none;
  color: var(--muted);
}
.side-nav a {
  margin-top: 4px;
  padding: 8px 9px;
  border-radius: 6px;
  font-weight: 700;
}
.side-nav a:hover,
.side-nav a[aria-current="page"] {
  background: var(--surface-3);
  color: var(--ink);
}
.toc {
  padding: 10px 0;
  border-left: 1px solid var(--line);
}
.toc__title { padding: 0 0 8px 14px; }
.toc a {
  padding: 6px 0 6px 14px;
  font-size: 14px;
}
.toc a:hover { color: var(--ink); }

.content { min-width: 0; }
.doc {
  max-width: 920px;
  margin: 0 auto;
}
.breadcrumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--soft);
  font-size: 13px;
  margin-bottom: 22px;
}
.breadcrumbs a { color: #c7d0dd; }
.doc-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 390px);
  gap: 24px;
  align-items: center;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
h1,
h2,
h3 {
  margin: 0;
  line-height: 1.08;
}
h1 {
  max-width: 780px;
  font-size: 40px;
  letter-spacing: 0;
}
h2 {
  font-size: 30px;
  margin-top: 5px;
}
p { color: var(--muted); }
.lead {
  max-width: 720px;
  color: #d9dee8;
  font-size: 18px;
}
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.badges span {
  padding: 7px 9px;
  color: #dce3ef;
  font-size: 13px;
  font-weight: 700;
}
.hero-media {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #050506;
}
.hero-media img {
  width: 100%;
  aspect-ratio: 480 / 230;
  object-fit: cover;
}
.hero-media figcaption {
  border-top: 1px solid var(--line);
  padding: 8px 10px;
  color: var(--soft);
  font-size: 13px;
}
.doc-section {
  position: relative;
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
}
.doc-section p {
  max-width: 820px;
}
.doc-section ul,
.doc-section ol {
  margin: 16px 0 0;
  padding-left: 22px;
  color: #d8deea;
}
.doc-section li {
  margin: 8px 0;
}
.table-wrap {
  margin-top: 18px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
}
th,
td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
tr:last-child td { border-bottom: 0; }
th {
  color: var(--gold);
  background: var(--surface-2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
td { color: #d9e0eb; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0 4px;
}
.doc-card {
  min-height: 170px;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  text-decoration: none;
}
.doc-card:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}
.doc-card span {
  display: block;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.doc-card strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
  line-height: 1.15;
}
.doc-card p {
  margin-bottom: 0;
  font-size: 14px;
}

.footer {
  max-width: 920px;
  margin: 30px auto 60px;
  padding: 0 20px;
  color: var(--soft);
  font-size: 13px;
}

.root {
  max-width: 1120px;
  margin: 0 auto;
  padding: 60px 20px;
}
.root-hero {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(240, 74, 56, .10), transparent 42%),
    var(--surface);
  padding: 34px;
}
.root h1 {
  font-size: 56px;
}
.root-langs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}
.root-lang {
  padding: 18px;
}
.root-lang strong {
  display: block;
  font-size: 22px;
}
.root-lang span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

@media (max-width: 1120px) {
  .layout {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .toc { display: none; }
}

@media (max-width: 780px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }
  .lang-switch { justify-content: flex-start; }
  .layout {
    display: block;
    padding: 18px 14px 0;
  }
  .side-nav {
    position: static;
    max-height: none;
    margin-bottom: 22px;
  }
  .side-nav a {
    display: inline-block;
    margin: 4px 3px 0 0;
  }
  .doc-hero {
    display: block;
  }
  .hero-media {
    margin-top: 20px;
  }
  h1 {
    font-size: 32px;
  }
  h2 {
    font-size: 26px;
  }
  .card-grid,
  .root-langs {
    grid-template-columns: 1fr;
  }
  .root {
    padding: 30px 14px;
  }
  .root h1 {
    font-size: 40px;
  }
  .root-hero {
    padding: 22px;
  }
}
