@font-face {
  font-family: Onest;
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("./fonts/onest-cyrillic-300.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: Onest;
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("./fonts/onest-latin-300.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: Onest;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/onest-cyrillic-400.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: Onest;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/onest-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: Onest;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("./fonts/onest-cyrillic-500.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: Onest;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("./fonts/onest-latin-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: Onest;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("./fonts/onest-cyrillic-600.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: Onest;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("./fonts/onest-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;
  --bg: #1a1a1a;
  --surface: #2a2a2a;
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.6);
  --accent: #c8ff00;
  --line: rgba(255, 255, 255, 0.14);
  --page-gutter: clamp(16px, 4vw, 32px);
  --page-pad-left: max(var(--page-gutter), env(safe-area-inset-left));
  --page-pad-right: max(var(--page-gutter), env(safe-area-inset-right));
  --document-toc-width: 320px;
  --document-column-gap: 72px;
  --document-text-width: 700px;
  --document-tracks: calc(
    var(--document-toc-width) + var(--document-column-gap) + var(--document-text-width)
  );
  --page-content-width: var(--document-text-width);
  --page-max: calc(var(--page-content-width) + var(--page-pad-left) + var(--page-pad-right));
  --brand-logo-width: 128px;
  --brand-logo-height: calc(var(--brand-logo-width) * 127 / 643);
  --footer-social-icon-size: var(--brand-logo-height);
  --footer-social-gap: 16px;
  --footer-stack-gap: 16px;
  --header-height: 72px;
  --footer-height: calc(var(--header-height) * 1.5);
  --header-occupied-height: calc(var(--header-height) + env(safe-area-inset-top));
  --anchor-offset: calc(var(--header-occupied-height) + 24px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  margin: 0;
  min-height: 100%;
  overflow-y: scroll;
  scrollbar-gutter: stable;
  background: var(--bg);
  scroll-padding-top: var(--anchor-offset);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  .toc__link {
    transition:
      background-color 140ms ease,
      color 140ms ease;
  }

  .site-header__cta::after {
    transition: opacity 160ms ease;
  }

  .toc--mobile {
    interpolate-size: allow-keywords;
  }

  .toc--mobile::details-content {
    display: block;
    height: 0;
    overflow: clip;
    transition:
      height 240ms ease,
      content-visibility 240ms allow-discrete;
  }

  .toc--mobile[open]::details-content {
    height: auto;
  }

  .toc--mobile summary::after {
    transition: transform 240ms ease;
  }
}

body {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: Onest, system-ui, sans-serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a,
a:visited,
a:active {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}

.skip-link,
.skip-link:visited,
.skip-link:active {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(calc(-100% - 24px));
}

.skip-link:focus {
  transform: translateY(0);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

main {
  flex: 1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, var(--bg));
  background: color-mix(in srgb, var(--bg) 76%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

@media (prefers-reduced-transparency: reduce) {
  .site-header {
    background: var(--bg);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header {
    background: var(--bg);
  }
}

.site-shell {
  width: 100%;
  max-width: var(--page-max);
  margin-right: auto;
  margin-left: auto;
  padding-right: var(--page-pad-right);
  padding-left: var(--page-pad-left);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-height);
}

.site-header__cta,
.site-header__cta:link,
.site-header__cta:visited,
.site-header__cta:active,
.site-header__cta:focus {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 4px;
  background: var(--accent);
  color: var(--bg);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  text-decoration-thickness: 0;
  text-underline-offset: 0;
  white-space: nowrap;
}

.site-header__cta span {
  position: relative;
  z-index: 1;
}

.site-header__cta::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: #000;
  opacity: 0;
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .site-header__cta:hover:not(:active)::after {
    opacity: 0.35;
  }
}

.site-header__cta:active::after {
  opacity: 0.45;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}

.brand__logo {
  display: block;
  width: var(--brand-logo-width);
  max-width: 100%;
  height: auto;
}

.home {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  align-content: start;
  justify-items: stretch;
  row-gap: 32px;
  padding-top: 20px;
  padding-bottom: 20px;
  text-align: left;
}

.home-copy-block {
  min-width: 0;
  max-width: 560px;
}

.home-lead,
.home-copy {
  max-width: 560px;
  margin: 0;
  text-align: left;
}

.home-lead {
  margin-bottom: 24px;
  color: var(--text);
  font-size: clamp(26px, 3.8vw, 44px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.22;
}

.home-lead__max {
  color: #b06aee;
  background-image: linear-gradient(
    90deg,
    #6cc8ff 0%,
    #5a9dff 28%,
    #6b74ff 58%,
    #b06aee 82%,
    #d08aff 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.home-copy {
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(16px, 1.65vw, 20px);
  font-weight: 300;
  line-height: 1.55;
}

.home-copy + .home-copy {
  margin-top: 16px;
}

.home-hero {
  display: block;
  width: min(100%, 560px);
  height: auto;
}

.document {
  padding-top: clamp(28px, 4.5vw, 52px);
  padding-bottom: clamp(72px, 10vw, 112px);
}

.not-found {
  max-width: var(--document-text-width);
}

.document-grid {
  display: grid;
  grid-template-columns: minmax(0, var(--document-text-width));
  justify-content: start;
}

.document-heading {
  margin-bottom: 56px;
}

.document-heading h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.08;
  text-align: left;
}

.document-aside {
  display: none;
}

.toc--mobile {
  margin: 0 0 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  overflow: hidden;
}

.toc--mobile summary {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 16px;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.toc--mobile summary::-webkit-details-marker,
.toc--mobile summary::marker {
  display: none;
  content: none;
}

.toc--mobile summary::after {
  margin-left: auto;
  margin-right: 4px;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: translateY(-1px) rotate(45deg);
  content: "";
  flex-shrink: 0;
}

.toc--mobile[open] summary::after {
  transform: translateY(1px) rotate(225deg);
}

.toc--mobile nav {
  padding: 10px 16px 14px;
  border-top: 1px solid var(--line);
}

.toc__label {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.72;
}

.toc__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc__item + .toc__item {
  margin-top: 4px;
}

.toc__link,
.toc__link:visited,
.toc__link:active {
  display: block;
  padding: 8px 12px;
  border-radius: 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  text-decoration: none;
}

.toc__link[aria-current="location"],
.toc__link[aria-current="location"]:visited,
.toc__link[aria-current="location"]:active {
  color: var(--accent);
}

.toc--mobile .toc__link {
  display: flex;
  align-items: center;
  min-height: 44px;
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0.14);
}

.toc--mobile .toc__link:active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.toc--mobile .toc__link[aria-current="location"],
.toc--mobile .toc__link[aria-current="location"]:visited,
.toc--mobile .toc__link[aria-current="location"]:active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent);
}

.document-content {
  min-width: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 17px;
  font-weight: 300;
  line-height: 1.72;
}

.document-content > :first-child {
  margin-top: 0;
}

.document-content p {
  margin: 0 0 16px;
}

.document-content h2 {
  margin: 58px 0 18px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
  color: var(--text);
  font-size: clamp(23px, 3vw, 28px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.document-content h3 {
  margin: 32px 0 12px;
  color: var(--text);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.35;
}

.document-content ul {
  margin: 0 0 20px;
  padding-left: 1.4em;
}

.document-content li + li {
  margin-top: 7px;
}

.document-content li::marker {
  color: var(--accent);
}

.document-content strong {
  color: var(--text);
  font-weight: 500;
}

.document-content code {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--surface);
  color: var(--accent);
  font-family: inherit;
  font-size: 0.92em;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.document-content a,
.document-content td {
  overflow-wrap: anywhere;
}

.document-content th:first-child,
.document-content td:first-child {
  white-space: nowrap;
  overflow-wrap: normal;
}

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  margin: 0 0 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  scrollbar-color: var(--muted) var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.5;
}

th,
td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.025em;
}

tr:last-child td {
  border-bottom: 0;
}

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
}

.site-footer__inner {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  min-height: var(--footer-height);
  column-gap: 32px;
  padding-bottom: env(safe-area-inset-bottom);
  color: var(--muted);
  font-size: 14px;
}

.site-footer__start,
.site-footer__end {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
}

.site-footer__start {
  align-items: flex-start;
  min-width: 0;
}

.site-footer__end {
  align-items: flex-end;
  flex: 0 0 auto;
}

.site-footer .brand {
  transform: translateY(10px);
}

.site-footer__social {
  display: flex;
  align-items: center;
  transform: translateY(10px);
  gap: var(--footer-social-gap);
  line-height: 0;
}

.site-footer__social-link,
.site-footer__social-link:link,
.site-footer__social-link:visited,
.site-footer__social-link:hover,
.site-footer__social-link:active,
.site-footer__social-link:focus {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  color: inherit;
  line-height: 0;
  text-decoration: none;
  text-decoration-thickness: 0;
  text-underline-offset: 0;
}

.site-footer__social-icon {
  display: block;
  width: var(--footer-social-icon-size);
  height: var(--footer-social-icon-size);
  object-fit: contain;
  vertical-align: middle;
}

.site-footer__links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 28px;
  /* Onest 14px: у «П» ~1px left side-bearing; полоски лого flush-left. */
  margin-inline-start: -1px;
}

.site-footer__links a,
.site-footer__links a:link,
.site-footer__links a:visited,
.site-footer__links a:hover,
.site-footer__links a:active,
.site-footer__links a:focus,
.site-footer__mail,
.site-footer__mail:link,
.site-footer__mail:visited,
.site-footer__mail:hover,
.site-footer__mail:active,
.site-footer__mail:focus {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  font-weight: 400;
  text-decoration: none;
  text-decoration-thickness: 0;
  text-underline-offset: 0;
}

.site-footer__links a.is-current,
.site-footer__links a.is-current:link,
.site-footer__links a.is-current:visited,
.site-footer__links a.is-current:hover,
.site-footer__links a.is-current:active,
.site-footer__links a.is-current:focus {
  color: var(--accent);
  text-decoration: none;
  text-decoration-thickness: 0;
}

.site-footer__mail {
  flex: 0 0 auto;
}

@media (hover: hover) and (pointer: fine) {
  .toc__link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
  }

  .toc__link[aria-current="location"]:hover {
    background: var(--surface);
    color: var(--accent);
  }

  .site-footer__links a:hover,
  .site-footer__mail:hover {
    color: var(--text);
  }

  .site-footer__social-link:hover {
    opacity: 0.82;
    color: inherit;
    text-decoration: none;
    text-decoration-thickness: 0;
  }

  .site-footer__links a.is-current:hover {
    color: var(--accent);
    text-decoration: none;
  }
}

@media (min-width: 960px) {
  :root {
    --page-content-width: var(--document-tracks);
  }

  .home {
    grid-template-columns: minmax(0, 560px) minmax(72px, 1fr) auto;
    align-items: stretch;
    align-content: start;
    column-gap: 0;
    row-gap: 0;
    padding-top: clamp(72px, 12vh, 140px);
    padding-bottom: clamp(72px, 12vh, 140px);
  }

  .home-copy-block {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .home-lead {
    margin-bottom: 0;
  }

  .home-copy + .home-copy {
    margin-top: 0;
  }

  .home-hero {
    grid-column: 3;
    justify-self: end;
    align-self: start;
    width: 424px;
    max-width: 40vw;
    height: auto;
  }

  .document-grid {
    grid-template-columns: var(--document-toc-width) minmax(0, var(--document-text-width));
    column-gap: var(--document-column-gap);
  }

  .document-heading {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .document-aside {
    display: block;
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
  }

  .toc--desktop {
    position: sticky;
    top: calc(var(--header-occupied-height) + 28px);
    max-height: calc(100vh - var(--header-occupied-height) - 56px);
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-color: var(--muted) transparent;
  }

  .toc--desktop .toc__link {
    padding: 8px 12px;
    white-space: nowrap;
  }

  .toc--desktop .toc__link[aria-current="location"] {
    background: var(--surface);
  }

  .toc--mobile {
    display: none;
  }

  .document-content {
    grid-column: 2;
    grid-row: 2;
  }
}

@media (max-width: 959px) {
  :root {
    --footer-social-icon-size: 28px;
  }

  .home {
    row-gap: 16px;
  }

  .home-copy-block,
  .home-lead,
  .home-copy {
    max-width: none;
  }

  .home-lead {
    margin-bottom: 22px;
  }

  .home-hero {
    width: 100%;
  }

  .document {
    padding-top: 22px;
    padding-bottom: 24px;
  }

  .document-heading {
    margin-bottom: 24px;
  }

  .toc--mobile {
    margin-bottom: 24px;
  }

  .document-content > :last-child {
    margin-bottom: 0;
  }

  .document-content h2 {
    margin-top: 32px;
    padding-top: 16px;
  }

  .document-content h3 {
    margin-top: 28px;
  }

  .site-footer__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "brand"
      "social"
      "mail"
      "links";
    align-items: start;
    row-gap: var(--footer-stack-gap);
    padding-top: 24px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .site-footer__start,
  .site-footer__end {
    display: contents;
  }

  .site-footer .brand {
    grid-area: brand;
    justify-self: start;
    min-height: auto;
    transform: none;
    margin-bottom: 8px;
  }

  .site-footer__social {
    grid-area: social;
    justify-self: start;
    transform: none;
    margin-bottom: 8px;
  }

  .site-footer__social-link,
  .site-footer__social-link:link,
  .site-footer__social-link:visited,
  .site-footer__social-link:hover,
  .site-footer__social-link:active,
  .site-footer__social-link:focus {
    min-height: var(--footer-social-icon-size);
  }

  .site-footer__mail {
    grid-area: mail;
    justify-self: start;
    margin-bottom: 8px;
  }

  .site-footer__links {
    grid-area: links;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 12px;
  }

  .site-footer__links a,
  .site-footer__links a:link,
  .site-footer__links a:visited,
  .site-footer__links a:hover,
  .site-footer__links a:active,
  .site-footer__links a:focus,
  .site-footer__mail,
  .site-footer__mail:link,
  .site-footer__mail:visited,
  .site-footer__mail:hover,
  .site-footer__mail:active,
  .site-footer__mail:focus {
    min-height: auto;
    line-height: 1.4;
    white-space: nowrap;
    text-decoration: none;
    text-decoration-thickness: 0;
  }
}

@media (max-width: 640px) {
  :root {
    --header-height: 64px;
    --brand-logo-width: 112px;
    --footer-social-icon-size: 28px;
  }

  body {
    font-size: 16px;
    min-height: auto;
  }

  .site-header__inner {
    min-height: var(--header-height);
  }

  .home {
    row-gap: 56px;
    padding-top: 48px;
    padding-bottom: 40px;
    min-height: calc(100vh - var(--header-height) + 24px);
    min-height: calc(100svh - var(--header-height) + 24px);
  }

  .home-copy-block {
    transform: translateY(-16px);
  }

  .home-lead {
    margin-bottom: 32px;
  }

  .home-copy + .home-copy {
    margin-top: 28px;
    transform: translateY(-12px);
  }

  .home-hero {
    width: 90%;
    justify-self: center;
    transform: translate(-8px, -32px);
  }

  .document-content {
    font-size: 16px;
    line-height: 1.68;
  }

  th,
  td {
    padding: 10px 11px;
  }

  table {
    font-size: 14px;
  }
}

@media (max-width: 420px) {
  .document-heading h1 {
    font-size: clamp(26px, 8vw, 32px);
  }
}

@media (max-width: 380px) {
  :root {
    --brand-logo-width: 108px;
  }
}
