:root {
  --bg: #07080d;
  --bg-2: #0c0e16;
  --panel: #11131f;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #eceef6;
  --text-2: #a6abc2;
  --text-3: #6d7290;
  --violet: #8b7bff;
  --violet-2: #a597ff;
  --teal: #2ee6c5;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --top: 60px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 16px); }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--sans); }
a { color: var(--violet-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.top {
  position: sticky; top: 0; z-index: 20; height: var(--top);
  display: flex; align-items: center; gap: 14px; padding: 0 24px;
  background: rgba(7, 8, 13, 0.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 17px; }
.brand:hover { text-decoration: none; }
.brand svg { width: 26px; height: 26px; }
.brand em { font-style: normal; font-weight: 500; color: var(--text-3); }
.top-links { margin-left: auto; display: flex; gap: 22px; font-size: 14px; }
.top-links a { color: var(--text-2); }
.top-links a:hover { color: var(--text); text-decoration: none; }
.menu { display: none; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line-2); border-radius: 8px; background: transparent; cursor: pointer; position: relative; }
.menu span, .menu span::before, .menu span::after { position: absolute; left: 9px; width: 16px; height: 2px; background: var(--text-2); border-radius: 1px; content: ""; }
.menu span { top: 16px; }
.menu span::before { top: -5px; left: 0; }
.menu span::after { top: 5px; left: 0; }

.layout { display: grid; grid-template-columns: 260px minmax(0, 1fr) 220px; max-width: 1360px; margin: 0 auto; }
.side, .toc { position: sticky; top: var(--top); align-self: start; max-height: calc(100vh - var(--top)); overflow-y: auto; padding: 28px 20px 40px; font-size: 14px; }
.side { border-right: 1px solid var(--line); }
.side p { margin: 22px 0 6px; color: var(--text); }
.side p:first-child { margin-top: 0; }
.side strong { font-weight: 600; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.side p:first-child strong { font-size: 14px; letter-spacing: 0; text-transform: none; }
.side p:first-child strong a { color: var(--text); }
.side ul { list-style: none; margin: 0; padding: 0; }
.side ul ul { margin: 2px 0 4px 10px; padding-left: 10px; border-left: 1px solid var(--line); }
.side li a { display: block; padding: 4px 10px; border-radius: 6px; color: var(--text-2); line-height: 1.4; }
.side li a:hover { background: var(--bg-2); color: var(--text); text-decoration: none; }
.side a[aria-current] { background: rgba(139, 123, 255, 0.14); color: var(--text); font-weight: 500; }
.toc { border-left: 1px solid var(--line); }
.toc p { margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc a { display: block; padding: 3px 0; color: var(--text-2); line-height: 1.4; }
.toc a:hover { color: var(--text); text-decoration: none; }

.content { padding: 36px 48px 64px; min-width: 0; }
article { max-width: 780px; }
article h1 { font-size: 36px; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 20px; }
article h2 { font-size: 24px; line-height: 1.3; margin: 44px 0 12px; padding-top: 16px; border-top: 1px solid var(--line); }
article h3 { font-size: 18px; margin: 30px 0 8px; }
article h4 { font-size: 16px; margin: 24px 0 6px; }
article :is(h1, h2, h3, h4) { position: relative; }
.anchor { position: absolute; left: -1em; width: 1em; color: var(--text-3); opacity: 0; font-weight: 400; }
:is(h1, h2, h3, h4):hover .anchor { opacity: 1; text-decoration: none; }
article p, article li { color: #d4d7e5; }
article ul, article ol { padding-left: 1.4em; }
article li + li { margin-top: 4px; }
article strong { color: var(--text); }
article hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
article blockquote { margin: 18px 0; padding: 10px 18px; border-left: 3px solid var(--violet); background: var(--bg-2); border-radius: 0 8px 8px 0; color: var(--text-2); }
article blockquote p { margin: 6px 0; }
code { font-family: var(--mono); font-size: .88em; background: var(--panel); border: 1px solid var(--line); border-radius: 5px; padding: .1em .35em; color: #e3e0ff; }
pre { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; overflow-x: auto; line-height: 1.55; }
pre code { background: none; border: 0; padding: 0; font-size: 13.5px; color: var(--text); }
.table-wrap { overflow-x: auto; margin: 18px 0; border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th, td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--bg-2); font-weight: 600; color: var(--text); }
tr:last-child td { border-bottom: 0; }
.foot { max-width: 780px; margin-top: 56px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14px; }
.foot a { color: var(--text-3); }
.foot a:hover { color: var(--text-2); }

@media (max-width: 1100px) {
  .layout { grid-template-columns: 240px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 780px) {
  .top { padding: 0 16px; }
  .menu { display: block; }
  .top-links { gap: 14px; }
  .layout { display: block; }
  .side { position: fixed; top: var(--top); left: 0; bottom: 0; width: min(300px, 85vw); max-height: none; z-index: 15; background: var(--bg); transform: translateX(-100%); transition: transform .2s ease; }
  .side-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .5); }
  .content { padding: 24px 16px 48px; }
  article h1 { font-size: 28px; }
  .anchor { display: none; }
}
