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

@font-face {
  font-family: "Golos";
  src: url("golos-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
  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: light dark;
  --wall: #eef0ec;
  --paper: #ffffff;
  --ink: #232826;
  --muted: #5a6460;
  --line: #c9cfca;
  --paint: #3d6b5c;
  --stripe: #2a4a40;
  --act: #3d6b5c;
  --act-ink: #ffffff;
  --link: #2f5b4d;
  --pen: #2b3990;
  --soft: rgb(61 107 92 / .12);
  --bad: #b42318;
  --good: #2f6b45;
  --fast: 140ms;
  --text: "Golos", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --wall: #1c2522;
    --paper: #24302b;
    --ink: #e2e7e3;
    --muted: #a3b0aa;
    --line: #3a4a43;
    --paint: #2c473c;
    --stripe: #4d7565;
    --act: #8cc5ad;
    --act-ink: #10201a;
    --link: #8cc5ad;
    --pen: #a3adf5;
    --soft: rgb(140 197 173 / .14);
    --bad: #ff8a80;
    --good: #8cc5ad;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background: var(--wall);
  color: var(--ink);
  font: 16px/1.6 var(--text);
  text-rendering: optimizeLegibility;
}

[hidden] {
  display: none !important;
}

::selection {
  background: rgb(43 57 144 / .22);
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

h1, h2, h3 {
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-weight: 900;
  letter-spacing: -.025em;
  line-height: 1.05;
}

h2 {
  margin-bottom: 16px;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.012em;
  line-height: 1.2;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
}

p, ul, ol {
  margin: 0 0 1em;
}

code {
  padding: .08em .32em;
  border-radius: 4px;
  background: var(--soft);
  font: .86em var(--mono);
  overflow-wrap: anywhere;
}

:focus-visible {
  outline: 2px solid var(--pen);
  outline-offset: 2px;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

.muted {
  color: var(--muted);
}

.lead {
  max-width: 40em;
  color: var(--muted);
  font-size: 1.125rem;
}

.lead code {
  white-space: nowrap;
}

.top .bar {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 68px;
}

.top::after {
  content: "";
  display: block;
  height: 13px;
  border-top: 3px solid var(--stripe);
  background: var(--paint);
}

.brand {
  margin-right: auto;
  color: var(--ink);
  font-size: 1.0625rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.brand b {
  font-weight: 900;
}

.menu {
  display: flex;
  gap: 24px;
}

.menu a {
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
}

.menu a:hover {
  text-decoration: underline;
}

.menu a[aria-current] {
  text-decoration: underline 3px var(--paint);
  text-underline-offset: 8px;
}

.key {
  padding: 6px 14px;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--fast), color var(--fast);
}

.key:hover {
  background: var(--ink);
  color: var(--wall);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 56px;
  align-items: start;
  padding-top: 56px;
}

.hero h1 {
  margin-bottom: 20px;
  font-size: clamp(2.375rem, 4.4vw, 3rem);
}

.hero .lead {
  max-width: 26em;
}

.shown > p {
  margin-bottom: 8px;
  font-size: .875rem;
}

.shown .code pre {
  font-size: 13px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 26px;
  margin: 28px 0 0;
}

.actions a {
  font-weight: 600;
}

.act {
  padding: 11px 20px;
  border-radius: 6px;
  background: var(--act);
  color: var(--act-ink);
  text-decoration: none;
}

.actions .act:hover {
  text-decoration: underline;
}

.start {
  padding-top: 72px;
}

.steps {
  display: grid;
  gap: 24px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps > li {
  display: grid;
  grid-template-columns: 3.75rem minmax(0, 1fr);
  counter-increment: step;
}

.steps > li::before {
  content: counter(step);
  grid-row: 1 / span 4;
  color: var(--link);
  font-size: 2.25rem;
  font-weight: 900;
  line-height: 1;
}

.steps > li > * {
  grid-column: 2;
  max-width: 46em;
}

.steps > li > .code {
  max-width: none;
}

.columns {
  columns: 13rem 4;
  column-gap: 32px;
  margin: 0;
  padding: 0 0 72px;
  list-style: none;
}

.columns li {
  display: grid;
  padding: 8px 0 9px;
  border-bottom: 1px solid var(--line);
  break-inside: avoid;
}

.columns a {
  font-size: 1.0625rem;
  font-weight: 700;
}

.columns span {
  color: var(--muted);
  font-size: .875rem;
}

.code {
  display: grid;
  margin: 0 0 1.25em;
  border: 1px solid var(--line);
  background: var(--paper);
}

.code.json {
  border-style: dashed;
  border-color: var(--muted);
  background: transparent;
}

.code pre {
  margin: 0;
  padding: 0 18px 16px;
  font: 13.5px/1.6 var(--mono);
  tab-size: 4;
  overflow-x: auto;
}

.copy {
  justify-self: end;
  margin: 4px 6px 0 0;
  padding: 4px 8px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--muted);
  font: 500 .8125rem var(--text);
  cursor: pointer;
}

.copy:hover {
  color: var(--ink);
  text-decoration: underline;
}

.copy[data-state="done"] {
  color: var(--good);
}

table {
  display: block;
  max-width: 100%;
  margin: 0 0 1.5em;
  border-collapse: collapse;
  font-size: .9375rem;
  font-variant-numeric: tabular-nums;
  overflow-x: auto;
}

th, td {
  padding: 9px 16px 9px 0;
  text-align: left;
  vertical-align: top;
}

th {
  border-bottom: 2px solid var(--ink);
  font-weight: 700;
  white-space: nowrap;
  vertical-align: bottom;
}

td {
  border-bottom: 1px solid var(--line);
}

td:first-child {
  white-space: nowrap;
}

td code,
.steps code {
  overflow-wrap: normal;
  white-space: nowrap;
}

.docs {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 56px;
  padding-top: 48px;
  padding-bottom: 72px;
}

.toc {
  position: sticky;
  top: 24px;
  align-self: start;
}

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

.toc a {
  display: block;
  padding: 4px 0 4px 14px;
  border-left: 3px solid var(--line);
  color: var(--muted);
  text-decoration: none;
}

.toc a:hover {
  color: var(--ink);
}

.toc a[aria-current] {
  border-left-color: var(--paint);
  color: var(--ink);
  font-weight: 600;
}

.doc {
  max-width: 780px;
}

.doc h1,
.page h1 {
  margin-bottom: 18px;
  font-size: clamp(2rem, 4.6vw, 3rem);
}

.doc section {
  padding-top: 48px;
}

.doc h3 {
  margin-top: 32px;
}

.doc li {
  margin-bottom: .45em;
}

.note {
  padding: 2px 0 2px 16px;
  border-left: 4px solid var(--paint);
}

.page {
  padding-top: 44px;
  padding-bottom: 72px;
}

.page > section {
  padding-top: 48px;
}

.back {
  margin-bottom: 10px;
}

.places td:first-child a {
  font-size: 1.0625rem;
  font-weight: 700;
}

.places td:nth-child(3) {
  color: var(--muted);
}

.filter {
  padding: 28px 0 12px;
  border-top: 1px solid var(--line);
}

.filter h3 {
  font-size: 1.3125rem;
}

.filter h3 code,
.field .head code {
  font-size: .8125rem;
  font-weight: 400;
  vertical-align: .12em;
}

.facts {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  gap: 4px 20px;
  margin: 0 0 1.2em;
  font-size: .9375rem;
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0;
}

.options summary {
  margin-bottom: 10px;
  color: var(--link);
  font-weight: 600;
  cursor: pointer;
}

.slow {
  cursor: help;
}

.builder {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 40px;
  align-items: start;
  margin-top: 24px;
}

.fields {
  display: grid;
  border-top: 2px solid var(--ink);
}

.field {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 16px 0 18px;
  border-bottom: 1px solid var(--line);
}

.field .head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
}

.field .title {
  font-weight: 700;
}

.field .about {
  margin: 0;
  color: var(--muted);
  font-size: .90625rem;
}

.field.inline {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.field.inline .about {
  grid-column: 1 / -1;
}

.samples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sample {
  padding: 2px 9px;
  border: 1px dashed var(--muted);
  border-radius: 6px;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: .875rem;
  cursor: pointer;
}

.sample:hover {
  border-style: solid;
}

.opts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.opts label {
  position: relative;
}

.opts input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.opts span {
  display: inline-block;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  font-size: .9375rem;
}

.opts label:hover span {
  border-color: var(--muted);
}

.opts input:checked + span {
  border-color: var(--act);
  background: var(--act);
  color: var(--act-ink);
}

.opts input:focus-visible + span {
  outline: 2px solid var(--pen);
  outline-offset: 2px;
}

.opts input:disabled + span {
  opacity: .45;
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

input::placeholder {
  color: var(--muted);
  opacity: .8;
}

input.bad {
  border-color: var(--bad);
}

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pair label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: .875rem;
}

.error {
  margin: 0;
  color: var(--bad);
  font-size: .875rem;
}

.switch {
  position: relative;
  display: inline-block;
  flex: none;
  width: 44px;
  height: 26px;
}

.switch input {
  position: absolute;
  inset: 0;
  z-index: 1;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.switch span {
  position: absolute;
  inset: 0;
  border: 1px solid var(--muted);
  border-radius: 13px;
  background: var(--paper);
  transition: background var(--fast);
}

.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform var(--fast), background var(--fast);
}

.switch input:checked + span {
  border-color: var(--act);
  background: var(--act);
}

.switch input:checked + span::after {
  background: var(--act-ink);
  transform: translateX(18px);
}

.switch input:focus-visible + span {
  outline: 2px solid var(--pen);
  outline-offset: 2px;
}

.place,
.tree {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.place p {
  margin: 0;
  color: var(--muted);
  font-size: .875rem;
}

.place .code {
  margin: 0;
}

.picked {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.picked:empty {
  display: none;
}

.chip {
  padding: 3px 10px;
  border: 1px solid var(--act);
  border-radius: 6px;
  background: var(--act);
  color: var(--act-ink);
  font: inherit;
  font-size: .875rem;
  cursor: pointer;
}

.chip:hover {
  text-decoration: line-through;
}

.path {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-size: .875rem;
}

.path button {
  padding: 2px 4px;
  border: 0;
  background: none;
  color: var(--link);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.path button:disabled {
  color: var(--ink);
  text-decoration: none;
  cursor: default;
}

.list {
  max-height: 290px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  list-style: none;
  overflow-y: auto;
}

.list li {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
}

.list li:last-child {
  border-bottom: 0;
}

.list label {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
}

.list input {
  flex: none;
  accent-color: var(--act);
}

.list .go {
  flex: none;
  padding: 0 16px;
  border: 0;
  border-left: 1px solid var(--line);
  background: none;
  color: var(--link);
  font: inherit;
  font-size: 1.25rem;
  cursor: pointer;
}

.list .go:hover {
  background: var(--soft);
}

.result {
  position: sticky;
  top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

.line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.line h3 {
  margin: 0;
  font-size: 1.3125rem;
}

.reset {
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--link);
  font: inherit;
  font-size: .875rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.tabbar {
  display: flex;
  gap: 22px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.tabbar button {
  flex: none;
  margin-bottom: -1px;
  padding: 8px 0;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.tabbar button:hover {
  color: var(--ink);
}

.tabbar button[aria-pressed="true"] {
  border-bottom-color: var(--paint);
  color: var(--ink);
}

.hint {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: .875rem;
}

.result .code {
  margin: 0;
}

.result .code pre {
  max-height: 62vh;
}

.to-result {
  display: none;
}

.lost {
  min-height: 50vh;
}

.foot {
  padding: 28px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .9375rem;
}

.foot .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
}

.foot p {
  margin: 0;
}

@media (max-width: 1100px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .hero .pitch {
    max-width: 40rem;
  }
}

@media (max-width: 900px) {
  .docs,
  .builder {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .toc,
  .result {
    position: static;
    max-height: none;
  }

  .toc ul {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
  }

  .toc a {
    padding: 2px 0;
    border: 0;
    color: var(--link);
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  .to-result {
    position: sticky;
    bottom: 14px;
    z-index: 5;
    display: block;
    justify-self: end;
    padding: 10px 18px;
    border: 2px solid var(--stripe);
    border-radius: 6px;
    background: var(--act);
    color: var(--act-ink);
    font-weight: 700;
    text-decoration: none;
  }
}

@media (max-width: 560px) {
  .wrap {
    padding: 0 16px;
  }

  .top .bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 12px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .menu {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .hero {
    padding-top: 32px;
  }

  .start {
    padding-top: 56px;
  }

  .steps > li {
    grid-template-columns: 2.5rem minmax(0, 1fr);
  }

  .steps > li::before {
    font-size: 1.75rem;
  }

  .docs,
  .page {
    padding-top: 32px;
  }

  .facts {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .facts dd {
    margin-bottom: 8px;
  }

  .places {
    display: block;
    overflow: visible;
  }

  .places thead {
    display: none;
  }

  .places tbody,
  .places tr,
  .places td {
    display: block;
  }

  .places tr {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }

  .places td {
    padding: 0;
    border: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    transition: none !important;
  }
}
