@font-face {
  font-family:'Golos Text';
  font-style:normal;
  font-weight:400;
  font-display:swap;
  src:local('Golos Text Regular'),local('GolosText-Regular'),local('Golos Text'),url(https://fonts.gstatic.com/s/golostext/v7/q5uCsoe9Lv5t7Meb31EcExd8hK5SAMqbpw.woff2) format('woff2');
  unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family:'Golos Text';
  font-style:normal;
  font-weight:400;
  font-display:swap;
  src:local('Golos Text Regular'),local('GolosText-Regular'),local('Golos Text'),url(https://fonts.gstatic.com/s/golostext/v7/q5uCsoe9Lv5t7Meb31EcExN8hK5SAMo.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:'Golos Text';
  font-style:normal;
  font-weight:500;
  font-display:swap;
  src:local('Golos Text Medium'),local('GolosText-Medium'),url(https://fonts.gstatic.com/s/golostext/v7/q5uCsoe9Lv5t7Meb31EcExd8hK5SAMqbpw.woff2) format('woff2');
  unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family:'Golos Text';
  font-style:normal;
  font-weight:500;
  font-display:swap;
  src:local('Golos Text Medium'),local('GolosText-Medium'),url(https://fonts.gstatic.com/s/golostext/v7/q5uCsoe9Lv5t7Meb31EcExN8hK5SAMo.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:'Golos Text';
  font-style:normal;
  font-weight:600;
  font-display:swap;
  src:local('Golos Text SemiBold'),local('GolosText-SemiBold'),url(https://fonts.gstatic.com/s/golostext/v7/q5uCsoe9Lv5t7Meb31EcExd8hK5SAMqbpw.woff2) format('woff2');
  unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family:'Golos Text';
  font-style:normal;
  font-weight:600;
  font-display:swap;
  src:local('Golos Text SemiBold'),local('GolosText-SemiBold'),url(https://fonts.gstatic.com/s/golostext/v7/q5uCsoe9Lv5t7Meb31EcExN8hK5SAMo.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:'Golos Text';
  font-style:normal;
  font-weight:700;
  font-display:swap;
  src:local('Golos Text Bold'),local('GolosText-Bold'),url(https://fonts.gstatic.com/s/golostext/v7/q5uCsoe9Lv5t7Meb31EcExd8hK5SAMqbpw.woff2) format('woff2');
  unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family:'Golos Text';
  font-style:normal;
  font-weight:700;
  font-display:swap;
  src:local('Golos Text Bold'),local('GolosText-Bold'),url(https://fonts.gstatic.com/s/golostext/v7/q5uCsoe9Lv5t7Meb31EcExN8hK5SAMo.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 {
  --bg: #fbfbfa;
  --surface: #ffffff;
  --surface-2: #f7f6f3;
  --text: #2f3437;
  --strong: #111111;
  --muted: #787774;
  --border: #eaeaea;
  --red-bg: #fdebec; --red: #9f2f2d;
  --blue-bg: #e1f3fe; --blue: #1f6c9f;
  --green-bg: #edf3ec; --green: #346538;
  --yellow-bg: #fbf3db; --yellow: #956400;
  --ide-bg: #1e1e1e;
  --ide-bar: #252526;
  --ide-border: #333333;
  --ide-text: #d4d4d4;
  --ide-muted: #858585;
  --ide-kw: #569cd6;
  --ide-flow: #c586c0;
  --ide-str: #ce9178;
  --ide-num: #b5cea8;
  --ide-fn: #dcdcaa;
  --ide-type: #4ec9b0;
  --ide-var: #9cdcfe;
  --ide-com: #6a9955;
  --ambient: rgba(214, 170, 110, 0.10);
  --font: 'Golos Text', system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #191918;
    --surface: #202020;
    --surface-2: #252524;
    --text: #d4d4d1;
    --strong: #f1f1ef;
    --muted: #8f8e8a;
    --border: #2e2e2d;
    --red-bg: #3a2322; --red: #f0a19c;
    --blue-bg: #1d3140; --blue: #8cc8ef;
    --green-bg: #22301f; --green: #a3cf9f;
    --yellow-bg: #362d17; --yellow: #e2c178;
    --ambient: rgba(214, 170, 110, 0.05);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 32px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.ambient {
  position: fixed;
  inset: -20vmax;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(40vmax 40vmax at 20% 10%, var(--ambient), transparent 70%),
    radial-gradient(35vmax 35vmax at 85% 60%, var(--ambient), transparent 70%);
  animation: drift 40s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(4vmax, 3vmax, 0); }
}

.layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px;
}

main { min-width: 0; max-width: 780px; width: 100%; margin: 0 auto; }

.sidebar { display: none; }

@media (min-width: 1100px) {
  .layout {
    grid-template-columns: 240px minmax(0, 780px);
    gap: 72px;
    padding: 0 40px;
  }
  main { margin: 0; }
  .sidebar { display: block; }
  .sidebar nav {
    position: sticky;
    top: 0;
    max-height: 100vh;
    overflow-y: auto;
    padding: 96px 0 48px;
    scrollbar-width: none;
  }
}

.sidebar-title {
  margin: 0 0 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.toc, .toc ol { list-style: none; margin: 0; padding: 0; }
.toc > li + li { margin-top: 20px; }
.toc ol { margin-top: 6px; border-left: 1px solid var(--border); }

.toc a {
  display: block;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.4;
  transition: color 200ms var(--ease);
}

.toc a:hover { color: var(--strong); }
.toc ol a { padding: 4px 0 4px 14px; margin-left: -1px; border-left: 1px solid transparent; }
.toc ol a.is-active { color: var(--strong); border-left-color: var(--strong); }
.toc-h2 { font-weight: 600; color: var(--text) !important; }
.toc-h2 span { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 500; color: var(--muted); }

.burger {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 20;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--strong);
  cursor: pointer;
}

.burger:active { transform: scale(0.96); }

.drawer {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(320px, 86vw);
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 16px 20px 40px;
  overflow-y: auto;
  background: var(--surface);
  border: 0;
  border-right: 1px solid var(--border);
  color: var(--text);
  transform: translateX(-100%);
  transition: transform 320ms var(--ease), overlay 320ms allow-discrete, display 320ms allow-discrete;
}

.drawer:popover-open { transform: none; }

@starting-style {
  .drawer:popover-open { transform: translateX(-100%); }
}

.drawer::backdrop {
  background: rgba(17, 17, 17, 0);
  transition: background 320ms var(--ease), overlay 320ms allow-discrete, display 320ms allow-discrete;
}

.drawer:popover-open::backdrop { background: rgba(17, 17, 17, 0.28); }

@starting-style {
  .drawer:popover-open::backdrop { background: rgba(17, 17, 17, 0); }
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 -8px 20px 0;
}

.drawer-head .sidebar-title { margin: 0; }

.drawer-close {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
}

.drawer-close:hover { color: var(--strong); background: var(--surface-2); }

.drawer .toc a { font-size: 15px; }
.drawer .toc ol a { padding-top: 6px; padding-bottom: 6px; }

.hero { padding: 96px 0 56px; }

.eyebrow {
  margin: 0 0 16px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

h1, h2, h3, h4 { color: var(--strong); font-weight: 600; }

h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 700;
  text-wrap: balance;
}

.lead {
  margin: 28px 0 0;
  max-width: 640px;
  font-size: 20px;
  line-height: 1.55;
  color: var(--muted);
  text-wrap: pretty;
}

.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tag-red { background: var(--red-bg); color: var(--red); }
.tag-blue { background: var(--blue-bg); color: var(--blue); }
.tag-green { background: var(--green-bg); color: var(--green); }
.tag-yellow { background: var(--yellow-bg); color: var(--yellow); }

.part { padding: 72px 0 24px; border-top: 1px solid var(--border); }
.part:first-of-type { border-top: 0; }

.section-head { margin-bottom: 20px; }
.hero + .part { padding-top: 16px; }
.section-head .eyebrow { margin-bottom: 10px; }

h2 {
  margin: 0;
  font-size: clamp(28px, 3.8vw, 36px);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 48px 0 12px;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h4 {
  margin: 40px 0 10px;
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.codes { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.codes .tag { font-family: var(--mono); letter-spacing: 0.02em; }

p, ul, ol { margin: 0 0 16px; }
main > section p, main > section li { text-wrap: pretty; }
main section ul, main section ol { padding-left: 22px; }
main section li + li { margin-top: 6px; }
main section li::marker { color: var(--muted); }

strong { color: var(--strong); font-weight: 600; }

a { color: var(--strong); text-decoration-color: var(--border); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: currentColor; }

:not(pre) > code {
  padding: 1px 5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.86em;
  color: var(--strong);
  overflow-wrap: anywhere;
}

h3 code, h4 code { font-size: 0.9em; }

.code {
  margin: 12px 0 20px;
  background: var(--ide-bg);
  border: 1px solid var(--ide-border);
  border-radius: 8px;
  overflow: hidden;
  color-scheme: dark;
}

.code figcaption {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 6px 8px 6px 14px;
  background: var(--ide-bar);
  border-bottom: 1px solid var(--ide-border);
  font-size: 12px;
  color: var(--ide-muted);
}

.code-label { font-family: var(--mono); font-size: 12px; }

.dots { display: inline-flex; gap: 6px; margin-right: 4px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: #4a4a4a; }

.copy {
  margin-left: auto;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  font: inherit;
  font-size: 12px;
  color: var(--ide-muted);
  cursor: pointer;
  transition: color 200ms var(--ease), border-color 200ms var(--ease), background 200ms var(--ease);
}

.copy:hover { color: var(--ide-text); border-color: var(--ide-border); background: #2d2d2d; }
.copy:active { transform: scale(0.98); }
.copy.is-done { color: var(--ide-type); }

.code pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ide-text);
  tab-size: 4;
}

.code-bad .tag { background: rgba(244, 135, 113, 0.16); color: #f48771; }
.code-good .tag { background: rgba(137, 209, 133, 0.16); color: #89d185; }
.code-before .tag { background: rgba(204, 204, 204, 0.12); color: #c8c8c8; }
.code-after .tag { background: rgba(86, 156, 214, 0.18); color: #7fb8e8; }

.code .k, .code .kd, .code .kc, .code .ow, .code .bp, .code .si { color: var(--ide-kw); }
.code .kn, .code .kf { color: var(--ide-flow); }
.code .s, .code .s1, .code .s2, .code .sa, .code .sd, .code .se, .code .dl { color: var(--ide-str); }
.code .m, .code .mi, .code .mf { color: var(--ide-num); }
.code .nf, .code .nd, .code .nb, .code .fm { color: var(--ide-fn); }
.code .nc, .code .nn { color: var(--ide-type); }
.code .na, .code .nv { color: var(--ide-var); }
.code .c, .code .c1, .code .cm, .code .ch { color: var(--ide-com); }
.code .o, .code .p { color: var(--ide-text); }
.code .err { color: inherit; background: none; }

.table {
  margin: 12px 0 24px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }

.part:last-of-type { padding-bottom: 120px; }

@supports (animation-timeline: view()) {
  .reveal {
    animation: reveal linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 40%;
  }
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .drawer, .drawer::backdrop { transition: none; }
  .ambient { animation: none; }
  .reveal { animation: none !important; }
}

@media (min-width: 1100px) {
  .burger, .drawer { display: none; }
}

.crumbs { margin: 0 0 20px; font-size: 14px; line-height: 1.4; }

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.crumbs li { display: inline-flex; align-items: center; min-width: 0; }

.crumbs a {
  color: var(--muted);
  text-decoration: none;
  transition: color 200ms var(--ease);
}

.crumbs a:hover { color: var(--strong); }

.crumbs-sep { display: inline-flex; margin: 0 8px; color: var(--muted); opacity: 0.6; }

.crumbs [aria-current="page"] {
  overflow: hidden;
  color: var(--strong);
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1099px) {
  .hero { padding-top: 48px; }
  .hero:has(> .crumbs) { padding-top: 12px; }
  .hero .crumbs { display: flex; align-items: center; min-height: 44px; margin-bottom: 40px; padding-right: 56px; }
}

.layout-single { grid-template-columns: minmax(0, 1fr); }
.layout-single main { margin: 0 auto; }

@media (min-width: 1100px) {
  .layout-single { grid-template-columns: minmax(0, 780px); justify-content: center; }
}

.guides { list-style: none; margin: 0 0 120px; padding: 0; border-top: 1px solid var(--border); }
.guides li { border-bottom: 1px solid var(--border); }

.guide-link {
  position: relative;
  display: block;
  padding: 24px 48px 24px 0;
  color: var(--text);
  text-decoration: none;
}

.guide-title { font-size: 24px; font-weight: 600; line-height: 1.25; letter-spacing: -0.02em; color: var(--strong); }

.guide-go {
  position: absolute;
  top: 50%;
  right: 4px;
  color: var(--muted);
  transform: translateY(-50%);
  transition: transform 200ms var(--ease), color 200ms var(--ease);
}

.guide-link:hover .guide-go { color: var(--strong); transform: translate(3px, -50%); }
