:root {
  color-scheme: light;

  --blue: #4c60d8;
  --blue-soft: #f4f6fa;
  --blue-line: #dbdff7;
  --on-blue: #fff;
  --ink: #1c2333;
  --body: #5a6377;
  --mute: #8a92a6;
  --hair: #e3e7f0;
  --hair-strong: #c9d1e2;
  --bg: #fff;
  --card: #fff;
  --topbar-bg: var(--blue);
  --topbar-fg: #fff;

  
  --deep-bg: #0f1422;
  --deep-text: #eef0f7;
  --deep-quote: #c3c9db;

  --disp: 'Golos Text', 'Manrope', system-ui, sans-serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;

    --blue: #8b9bf0;
    --blue-soft: #171d2e;
    --blue-line: #2c3452;
    --on-blue: #0f1422;
    --ink: #eef0f7;
    --body: #a2abc0;
    --mute: #737d94;
    --hair: #222a40;
    --hair-strong: #333c58;
    --bg: #0d1220;
    --card: #161d2f;
    --topbar-bg: #1a2044;
    --topbar-fg: #d3d8f6;
    --deep-bg: #070a14;
  }
}

:root[data-theme='dark'] {
  color-scheme: dark;

  --blue: #8b9bf0;
  --blue-soft: #171d2e;
  --blue-line: #2c3452;
  --on-blue: #0f1422;
  --ink: #eef0f7;
  --body: #a2abc0;
  --mute: #737d94;
  --hair: #222a40;
  --hair-strong: #333c58;
  --bg: #0d1220;
  --card: #161d2f;
  --topbar-bg: #1a2044;
  --topbar-fg: #d3d8f6;
  --deep-bg: #070a14;
}

html, body { margin: 0; background: var(--bg); }

.oc {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
.oc *, .oc *::before, .oc *::after { box-sizing: border-box; }
.oc p, .oc h1, .oc h2, .oc h3, .oc ul { margin: 0; }
.oc ul { padding: 0; list-style: none; }
.oc a { color: inherit; text-decoration: none; }
.oc :focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.w { width: 100%; max-width: 1000px; margin: 0 auto; padding: 0 32px; }

.oc h1 { font-family: var(--disp); font-weight: 700; letter-spacing: -.04em; line-height: 1.1; font-size: clamp(1.9rem, 4vw, 2.6rem); }
.oc h2 { font-family: var(--disp); font-weight: 600; letter-spacing: -.03em; line-height: 1.2; font-size: 1.25rem; }
.oc h3 { font-family: var(--disp); font-weight: 600; letter-spacing: -.02em; font-size: 1.0625rem; line-height: 1.4; }
.lead { font-size: 1.15rem; color: var(--body); line-height: 1.6; }
.s { font-size: .9375rem; color: var(--mute); }
a.l { color: var(--blue); font-weight: 500; }
a.l:hover { text-decoration: underline; text-underline-offset: 3px; }

.oc .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; height: 50px; padding: 0 26px;
  background: var(--blue); color: var(--on-blue); font-family: var(--disp); font-weight: 600; font-size: .9688rem; border-radius: 8px;
}
.oc .btn:hover { filter: brightness(1.07); }
.oc .btn.sm { height: 40px; padding: 0 18px; font-size: .9063rem; border-radius: 7px; }

.topbar { background: var(--topbar-bg); color: var(--topbar-fg); }
.topbar-in {
  max-width: 1000px; margin: 0 auto; padding: 11px 32px; display: flex; align-items: center; gap: 12px;
  font-size: .875rem; flex-wrap: wrap;
}
.topbar b { font-family: var(--disp); font-weight: 600; }
.topbar span { opacity: .88; }

.topbar a {
  margin-left: auto; font-weight: 500;
  border-bottom: 1px solid currentColor; padding-bottom: 1px; opacity: .75;
}
.topbar a:hover { opacity: 1; }
.sup {
  font-family: var(--disp); font-weight: 600; font-size: .5rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--blue); vertical-align: super; margin-left: 2px; line-height: 0;
}
.sup-lg { font-size: .5625rem; margin-left: 3px; }

.nav { display: flex; align-items: center; gap: 34px; height: 80px; }
.m { font-family: var(--disp); font-weight: 700; font-size: 1.0625rem; letter-spacing: -.035em; }
.m s { text-decoration: none; color: var(--mute); font-weight: 500; }
.nav ul { margin-left: auto; display: flex; gap: 30px; font-size: .9375rem; color: var(--body); }
.nav ul a:hover { color: var(--ink); }

.nav a.lang { font-size: .8125rem; letter-spacing: .06em; color: var(--mute); }
.nav a.lang:hover { color: var(--blue); }
.nav-end { display: flex; align-items: center; gap: 12px; }

.tgl {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px;
  padding: 0; border: 1px solid var(--hair); border-radius: 7px; background: var(--card); color: var(--body);
  cursor: pointer; font: inherit;
}
.tgl:hover { color: var(--ink); border-color: var(--hair-strong); }
.tgl[hidden] { display: none; }

.tgl .sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .tgl .sun { display: block; }
  :root:not([data-theme='light']) .tgl .moon { display: none; }
}
:root[data-theme='dark'] .tgl .sun { display: block; }
:root[data-theme='dark'] .tgl .moon { display: none; }

.doc { display: grid; gap: 40px; padding: 48px 0 96px; align-items: start; }

.toc { font-size: .9375rem; }
.toc-h { font-family: var(--disp); font-weight: 600; font-size: .8125rem; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); }
.toc ul { margin-top: 14px; display: grid; gap: 2px; }
.toc li { padding: 5px 0; }
.toc a { color: var(--body); }
.toc a:hover { color: var(--ink); }
.toc a.on { color: var(--blue); font-weight: 500; }

.toc li.soon { color: var(--mute); }
.toc li.soon em { font-style: normal; font-size: .6875rem; letter-spacing: .04em; margin-left: 8px; white-space: nowrap; opacity: .8; }

.page { min-width: 0; max-width: 70ch; }
.page h1 { font-size: clamp(1.8rem, 3.6vw, 2.4rem); }
.page h2 { margin-top: 44px; }
.page h3 { margin-top: 28px; }
.page > p, .page > ul, .page > ol { margin-top: 16px; color: var(--body); }
.page .lead { color: var(--body); }
.page h1 + p { font-size: 1.15rem; line-height: 1.6; margin-top: 18px; }
.page ul, .page ol { padding-left: 1.2em; }
.page ul { list-style: disc; }
.page ol { list-style: decimal; }
.page li { margin: 6px 0; }
.page li::marker { color: var(--mute); }
.page a { color: var(--blue); font-weight: 500; }
.page a:hover { text-decoration: underline; text-underline-offset: 3px; }
.page strong { color: var(--ink); font-weight: 600; }
.page code {
  font-family: var(--mono); font-size: .875em;
  background: var(--blue-soft); border: 1px solid var(--blue-line); border-radius: 5px; padding: 1px 5px;
}
.page blockquote {
  margin: 22px 0; padding: 16px 20px; border-radius: 10px; background: var(--blue-soft);
  border: 1px solid var(--blue-line); color: var(--body); font-size: .9688rem;
}
.page blockquote p + p { margin-top: 10px; }

.code { position: relative; margin: 18px 0; }
.code pre {
  margin: 0; padding: 18px 20px; overflow-x: auto; border-radius: 10px; background: var(--deep-bg); color: var(--deep-text);
  font-family: var(--mono); font-size: .875rem; line-height: 1.6;
}
.code .copy {
  position: absolute; top: 10px; right: 10px; padding: 5px 10px; border-radius: 6px; cursor: pointer;
  background: rgba(255, 255, 255, .1); color: var(--deep-quote); border: 0; font-family: var(--sans); font-size: .75rem;
}
.code .copy:hover { background: rgba(255, 255, 255, .18); color: #fff; }

.tw { margin: 22px 0; overflow-x: auto; }
.page table { border-collapse: collapse; width: 100%; font-size: .9375rem; }
.page th, .page td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--hair); vertical-align: top; }
.page th { font-family: var(--disp); font-weight: 600; font-size: .875rem; color: var(--ink); border-bottom-color: var(--blue-line); }
.page td { color: var(--body); }

.index { margin-top: 34px; display: grid; }
.index li { display: grid; gap: 2px; padding: 18px 4px; border-top: 1px solid var(--hair); margin: 0; }
.index li:last-child { border-bottom: 1px solid var(--hair); }
.index b { font-family: var(--disp); font-weight: 600; font-size: 1.0313rem; }
.index span { color: var(--body); font-size: .9375rem; }
.index li.soon b, .index li.soon span { color: var(--mute); }
.index li.soon em { font-style: normal; font-size: .75rem; color: var(--mute); }

.foot { padding: 36px 0 64px; border-top: 1px solid var(--hair); font-size: .875rem; color: var(--mute); }
.foot-in { display: flex; gap: 18px 36px; flex-wrap: wrap; align-items: baseline; }
.foot ul { display: flex; gap: 24px; margin-left: auto; flex-wrap: wrap; }
.foot a:hover { color: var(--ink); }

@media (min-width: 900px) {
  
  .doc { grid-template-columns: 220px 1fr; gap: 56px; }
  .toc { position: sticky; top: 32px; }
}
@media (max-width: 720px) {
  .oc { font-size: 16px; }
  .nav ul { display: none; }
  
  .nav { gap: 12px; }
  .nav-end { margin-left: auto; gap: 8px; }
  .m { font-size: 1rem; }
  .tgl { width: 36px; height: 36px; }
  .w { padding-left: 22px; padding-right: 22px; }
  .doc { padding: 32px 0 72px; gap: 28px; }
  
  .page { order: 1; }
  .toc { order: 2; padding-top: 26px; border-top: 1px solid var(--hair); }
}

@media (max-width: 359px) {
  .tgl { width: 30px; height: 30px; border-color: transparent; }
  .oc .btn.sm { padding: 0 12px; }
}
