:root {
    --color-primary-from: #ff5d62;
    --color-primary-to: #6e39ff;
    --color-gradient: linear-gradient(90deg, var(--color-primary-from), var(--color-primary-to));
    --color-black: #000;
    --color-white: #fff;
    --color-grey: #71717a;
    --color-stroke-grey: #e3e3e4;
    --color-light-grey: #f5f5f5;
    --color-bg: #fff;
    --color-bg-dark: #000;
    --color-violet: #6e3aff;
    --font-primary: "Roboto Flex", sans-serif;
    --d1-size: 22px;
    --d1-lh: 1;
    --d2-size: 18px;
    --d2-lh: 1;
    --d3-size: 14px;
    --d3-lh: 1.2;
    --h1-size: 55px;
    --h1-lh: 1;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font-primary);
    color: var(--color-black);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
img { max-width: 100%; display: block; }

.d2 {
    font-size: var(--d2-size);
    line-height: var(--d2-lh);
    font-weight: 500;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    font-family: var(--font-primary);
    transition: background .2s, color .2s;
}
.btn--primary {
    background: var(--color-gradient);
    color: var(--color-white);
    font-size: var(--d2-size);
    line-height: var(--d2-lh);
    border-radius: 15px;
    padding: 15px 35px;
    font-weight: 500;
}
.btn--primary:hover { background: var(--color-violet); }

.header {
    z-index: 200;
    background: var(--color-white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100px;
    padding: 25px 80px;
    position: sticky;
    top: 0;
    border-bottom: 1px solid rgba(0,0,0,.04);
}
.header__logo-wrap { height: 51px; padding: 4px 0; display: flex; align-items: center; }
.header__logo { height: 100%; width: auto; }
.header__actions { display: flex; align-items: center; gap: 35px; }
.header__burger {
    display: none;
    background: none;
    border: none;
    color: var(--color-black);
    padding: 4px;
}
.navbar { display: flex; gap: 20px; position: absolute; left: 50%; transform: translateX(-50%); }
.navbar__link { cursor: pointer; }
.navbar__link--active { font-weight: 700; }

.mobile-menu {
    display: none;
    background: var(--color-white);
    z-index: 199;
    flex-direction: column;
    gap: 40px;
    width: 100%;
    padding: 50px 25px;
    position: fixed;
    top: 70px;
    left: 0;
    transform: translateX(-100%);
    transition: transform .3s;
    height: calc(100% - 70px);
}
.mobile-menu--open { transform: translateX(0); }
.mobile-menu__nav { display: flex; flex-direction: column; gap: 20px; }
.mobile-menu__link { font-size: 32px; line-height: 1; font-weight: 600; }

.footer {
    background: var(--color-bg-dark);
    color: var(--color-white);
    font-size: var(--d2-size);
    line-height: var(--d2-lh);
    font-weight: 500;
}
.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1440px;
    margin: 0 auto;
    padding: 25px 80px;
}
.footer-brand, .footer-brand__info { display: flex; align-items: center; }
.footer-brand__info a { margin-left: 23px; }
.footer-brand__info span { color: #fff9; margin-left: 9px; }
.footer-logo-wrap { height: 51px; padding: 4px 0; }
.footer-logo { height: 43px; width: auto; }
.footer-nav, .footer-socials { display: flex; align-items: center; gap: 20px; }

.layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 80px 64px;
}
.layout--wide { grid-template-columns: 1fr; }
.layout__content { min-width: 0; }
.sidebar {
    position: sticky;
    top: 112px;
    max-height: calc(100vh - 136px);
    overflow: auto;
}

.doc {
    max-width: 860px;
    font-size: 18px;
    line-height: 1.65;
    color: #111;
}
.doc h1, .doc h2, .doc h3, .doc h4, .doc h5, .doc h6 {
    line-height: 1.2;
    margin: 28px 0 12px;
    letter-spacing: -0.01em;
    font-weight: 650;
}
.doc h1 { font-size: 44px; margin-top: 0; }
.doc h2 { font-size: 30px; margin-top: 40px; }
.doc h3 { font-size: 22px; margin-top: 28px; }
.doc h4 { font-size: 18px; margin-top: 22px; opacity: 0.95; }
.doc p { margin: 12px 0; }
.doc strong { font-weight: 700; }
.doc ul, .doc ol { margin: 12px 0 12px 22px; }
.doc li { margin: 6px 0; }
.doc a {
    text-decoration: underline;
    text-underline-offset: 3px;
    color: var(--color-violet);
}
.doc :not(pre) > code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.95em;
    background: rgba(0,0,0,.06);
    padding: 0.15em 0.35em;
    border-radius: 6px;
}
.doc pre {
    margin: 16px 0;
    padding: 14px 16px;
    border-radius: 12px;
    background: #0b1020;
    color: #e7eaf3;
    overflow: auto;
}
.doc pre code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 14px;
    line-height: 1.6;
}
.doc blockquote {
    margin: 18px 0;
    padding: 14px 16px;
    border-left: 4px solid var(--color-violet);
    background: rgba(110,58,255,.08);
    border-radius: 10px;
}
.doc blockquote > :first-child { margin-top: 0; }
.doc blockquote > :last-child { margin-bottom: 0; }
.doc-table-wrapper {
    width: 100%;
    margin: 16px 0;
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,.10);
}
.doc table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: 16px;
}
.doc thead th {
    text-align: left;
    background: rgba(0,0,0,.04);
    font-weight: 700;
    white-space: nowrap;
}
.doc th, .doc td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(0,0,0,.08);
    vertical-align: top;
}
.doc img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}
.doc hr {
    margin: 28px 0;
    border: 0;
    border-top: 1px solid rgba(0,0,0,.12);
}
.doc a.doc-image { display: inline-block; text-decoration: none; }
.doc a.doc-image img { cursor: zoom-in; }

.sb { padding: 8px 4px 20px; }
.sb__head { margin: 0 0 10px; }
.sb__brand { font-weight: 700; font-size: 14px; letter-spacing: .2px; opacity: .9; }
.sb__section {
    margin: 10px 0 0;
    border: 1px solid rgba(0,0,0,.06);
    border-radius: 12px;
    background: rgba(255,255,255,.7);
}
.sb__sectionTitle {
    list-style: none;
    cursor: pointer;
    user-select: none;
    padding: 10px 12px;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sb__sectionTitle::-webkit-details-marker { display: none; }
.sb__sectionTitle::before { content: "▸"; opacity: .7; transition: transform .15s ease; }
.sb__section[open] > .sb__sectionTitle::before { transform: rotate(90deg); }
.sb__sectionTitle:hover { background: rgba(110,58,255,.06); border-radius: 12px; }
.sb__group { margin: 6px 8px 10px; border-top: 1px solid rgba(0,0,0,.06); padding-top: 6px; }
.sb__group:first-of-type { border-top: 0; padding-top: 0; }
.sb__groupTitle {
    list-style: none;
    cursor: pointer;
    user-select: none;
    padding: 8px 8px;
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 10px;
}
.sb__groupTitle::-webkit-details-marker { display: none; }
.sb__groupTitle::before { content: "▸"; opacity: .65; transition: transform .15s ease; }
.sb__group[open] > .sb__groupTitle::before { transform: rotate(90deg); }
.sb__groupTitle:hover { background: rgba(0,0,0,.04); }
.sb__list { list-style: none; margin: 4px 0 0; padding: 0 0 0 20px; }
.sb__list--section { padding: 10px 10px 12px; margin: 0; }
.sb__item { margin: 0; }
.sb__link {
    display: block;
    padding: 7px 8px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 13px;
    line-height: 1.2;
}
.sb__link:hover { background: rgba(110,58,255,.06); }
.sb__link.is-active {
    background: linear-gradient(90deg, rgba(255,93,98,.12), rgba(110,58,255,.12));
    font-weight: 700;
}

@media (max-width: 1024px) {
    .header { padding: 25px 24px; }
    .navbar { display: none; }
    .header__actions { display: none; }
    .header__burger { display: flex; margin-left: auto; }
    .mobile-menu { display: flex; }
    .layout { grid-template-columns: 1fr; padding: 24px; }
    .sidebar { position: static; max-height: none; }
    .footer-inner { flex-direction: column; align-items: flex-start; gap: 40px; padding: 50px 25px; }
    .doc { font-size: 16px; }
    .doc h1 { font-size: 34px; }
    .doc h2 { font-size: 26px; }
}

@media (max-width: 768px) {
    .header { height: 70px; padding: 16px 25px; }
    .header__logo-wrap { height: 36px; }
    .mobile-menu { top: 70px; height: calc(100% - 70px); }
}
