:root {
  --bg: #fbfbf9;
  --bg-alt: #f1f2ee;
  --text: #16191d;
  --muted: #5b6168;
  --line: #dcdfd8;
  --accent: #1f5f4a;
  --accent-ink: #ffffff;
  --code-bg: #1b1f23;
  --code-text: #d7dbd3;
  --code-comment: #8a9187;
  --ok: #2f8a4f;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

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

/* Шапка */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.top__row {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 64px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--accent);
}
.logo span { color: var(--text); }
.nav {
  display: flex;
  gap: 24px;
  margin-right: auto;
  font-size: 15px;
}
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover { color: var(--text); }

/* Кнопки */
.btn {
  display: inline-block;
  padding: 10px 18px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: #174a39; border-color: #174a39; }
.btn--ghost { background: transparent; color: var(--accent); }
.btn--ghost:hover { background: var(--accent); color: var(--accent-ink); }
.link { color: var(--accent); font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* Первый экран */
.hero { padding-block: 88px 72px; border-bottom: 1px solid var(--line); }
.hero__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 64px;
  align-items: end;
}
h1 {
  margin: 0 0 20px;
  font-size: clamp(30px, 4.2vw, 46px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 700;
  max-width: 18ch;
}
.lead { margin: 0 0 32px; font-size: 18px; color: var(--muted); max-width: 52ch; }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }

.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.facts div {
  padding: 18px 20px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.facts dt { font-size: 13px; color: var(--muted); }
.facts dd {
  margin: 4px 0 0;
  font-size: 26px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* Секции */
.section { padding-block: 72px; }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
h2 { margin: 0 0 12px; font-size: 28px; letter-spacing: -0.015em; }
h3 { margin: 0 0 8px; font-size: 17px; }
.sub { margin: 0 0 32px; color: var(--muted); max-width: 68ch; }

.cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin-top: 32px;
}
.cols article { border-top: 2px solid var(--text); padding-top: 16px; }
.cols p { margin: 0; color: var(--muted); font-size: 15px; }

/* Таблицы */
.table-scroll { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  background: var(--bg);
}
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); }
th { font-size: 13px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--text); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.section--alt table { border: 1px solid var(--line); }
.price { max-width: 720px; }
.notes { margin: 24px 0 0; padding-left: 18px; color: var(--muted); font-size: 15px; }
.notes li + li { margin-top: 4px; }

/* API */
.api {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 48px;
  align-items: start;
}
.api p { color: var(--muted); }
.code {
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 6px;
  overflow-x: auto;
}
.code pre {
  margin: 0;
  padding: 22px 24px;
  font: 13.5px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
.code .c { color: var(--code-comment); }
code {
  font: 0.92em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--bg-alt);
  padding: 1px 5px;
  border-radius: 3px;
}

/* Подключение */
.steps ol {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li { counter-increment: step; color: var(--muted); font-size: 15px; }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  margin-bottom: 8px;
  font: 600 13px ui-monospace, Menlo, Consolas, monospace;
  color: var(--accent);
}
.steps strong { display: block; color: var(--text); margin-bottom: 4px; }

/* Контакты */
.contacts { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.contacts p { color: var(--muted); max-width: 46ch; }
.contact-list { margin: 0; }
.contact-list div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.contact-list div:first-child { border-top: 1px solid var(--line); }
.contact-list dt { font-size: 13px; color: var(--muted); }
.contact-list dd { margin: 2px 0 0; font-weight: 600; }

/* Подвал */
.foot { padding-block: 28px; font-size: 14px; color: var(--muted); }
.foot__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.foot__status { display: inline-flex; align-items: center; gap: 8px; }
.foot__status i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }

/* Страница ошибки */
.error { padding-block: 120px; }
.error h1 { max-width: none; }
.error p { color: var(--muted); }

@media (max-width: 920px) {
  .hero__grid, .api, .contacts { grid-template-columns: 1fr; gap: 40px; }
  .cols, .steps ol { grid-template-columns: 1fr 1fr; }
  .nav { display: none; }
  .top__row { justify-content: space-between; }
}
@media (max-width: 560px) {
  .wrap { padding-inline: 16px; }
  .hero { padding-block: 56px 48px; }
  .section { padding-block: 56px; }
  .cols, .steps ol { grid-template-columns: 1fr; gap: 24px; }
  .facts dd { font-size: 22px; }
}
