:root {
  color-scheme: dark;
  --bg: #000;
  --fg: #f4f4f4;
  --fg-2: #a6a6a6;
  --muted: #7c7c7c;
  --line: #1d1d1d;
  --line-2: #303030;
  /* серии графиков: основная белая, остальные оттенки серого */
  --main: #f4f4f4;
  --ref: #a6a6a6;
  --ctx: #4a4a4a;
  --neg: #6a6a6a;
  --sans: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 300 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

::selection { background: var(--fg); color: var(--bg); }

a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--fg); }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 32px; }

/* шапка */

.top {
  position: sticky; top: 0; z-index: 10;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 32px; height: 56px; }
.brand {
  font: 500 12px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase;
  text-decoration: none; white-space: nowrap;
}
.nav { display: flex; gap: 28px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--fg-2); text-decoration: none; font-size: 14px; white-space: nowrap; transition: color 0.15s; }
.nav a:hover { color: var(--fg); }

/* первый экран */

.hero { padding: 128px 32px 96px; }
.kicker, .idx, .stat .label, .field, table.data th, .meta, .foot {
  font-family: var(--mono); font-weight: 400; letter-spacing: 0.06em;
}
.kicker { color: var(--muted); font-size: 12px; text-transform: uppercase; margin: 0 0 32px; }
h1 {
  font-weight: 300; font-size: clamp(40px, 7.2vw, 92px); line-height: 1; letter-spacing: -0.045em;
  margin: 0 0 40px; max-width: 13em;
}
.lead { font-size: 19px; line-height: 1.6; color: var(--fg-2); max-width: 36em; margin: 0 0 96px; }

/* крупные числа */

.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line-2); }
.stat { padding: 24px 24px 0 0; min-width: 0; }
.stat + .stat { padding-left: 24px; border-left: 1px solid var(--line); }
.stat .label { font-size: 11px; color: var(--muted); text-transform: uppercase; min-height: 2.6em; }
.stat .value {
  font-size: clamp(32px, 3.6vw, 48px); font-weight: 300; letter-spacing: -0.03em; line-height: 1.1;
  margin: 16px 0 10px; white-space: nowrap;
}
.stat .value.down { color: var(--fg-2); }
.stat .sub { font-size: 13px; color: var(--fg-2); }
.stats-small { margin: 48px 0 24px; }
.stats-small .stat .value { font-size: clamp(26px, 2.6vw, 34px); }

/* разделы */

/* линия раздела идет ровно по ширине контента, без полей .wrap */
.block {
  width: calc(100% - 64px); max-width: 1136px; margin: 0 auto;
  padding: 64px 0 112px; border-top: 1px solid var(--line);
}
.block-head { display: flex; align-items: baseline; gap: 24px; margin-bottom: 48px; }
.block-body { min-width: 0; }
.idx { color: var(--muted); font-size: 12px; min-width: 2.5em; }
h2 { font-weight: 300; font-size: clamp(30px, 3.6vw, 44px); line-height: 1.1; letter-spacing: -0.035em; margin: 0; }
h3 { font-weight: 400; font-size: 18px; letter-spacing: -0.01em; margin: 56px 0 8px; }
h3.first, .cols > div > h3:first-child { margin-top: 0; }
.block-body > p:first-child { margin-top: 0; }
p { max-width: 44em; }
.muted { color: var(--fg-2); font-size: 14px; margin: 0 0 16px; }
.note { color: var(--muted); font-size: 13px; line-height: 1.7; }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.cols > div { min-width: 0; }
.block-body .cols { margin-top: 64px; }
.block-body > .cols:first-child { margin-top: 0; }

/* факты о данных */

.facts { display: grid; grid-template-columns: 1fr auto; margin: 32px 0 0; font-size: 14px; }
.facts dt, .facts dd { padding: 10px 0; border-bottom: 1px solid var(--line); margin: 0; }
.facts dt { color: var(--fg-2); }
.facts dd { font-family: var(--mono); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }

/* таблицы */

.table-wrap { overflow-x: auto; margin: 24px 0; }
table.data { border-collapse: collapse; width: 100%; font-size: 14px; }
table.data th, table.data td { padding: 14px 12px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
table.data th:first-child, table.data td:first-child { text-align: left; padding-left: 0; }
table.data th:last-child, table.data td:last-child { padding-right: 0; }
table.data th {
  color: var(--muted); font-size: 11px; text-transform: uppercase; white-space: normal;
  vertical-align: bottom; min-width: 64px; border-bottom-color: var(--line-2);
}
table.data td { font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; color: var(--fg-2); }
table.data td:first-child { font-family: var(--sans); font-size: 15px; color: var(--fg); }
table.data tr.best td { color: var(--fg); }
table.data .ci { color: var(--muted); font-size: 11px; }
.tag {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px solid var(--fg); padding: 2px 6px; margin-left: 10px; vertical-align: 2px;
}

.chart { width: 100%; height: 360px; margin-top: 8px; }

/* переключатели */

.tabs { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 12px 0 8px; }
.tabs button {
  background: none; border: 0; border-bottom: 1px solid transparent; padding: 4px 0;
  color: var(--muted); font: 400 14px var(--sans); cursor: pointer; transition: color 0.15s, border-color 0.15s;
}
.tabs button:hover { color: var(--fg); }
.tabs button[aria-pressed="true"] { color: var(--fg); border-bottom-color: var(--fg); }
.tabs button:focus-visible, .field :focus-visible { outline: 1px solid var(--fg); outline-offset: 4px; }

/* планировщик */

.controls { display: grid; grid-template-columns: 1.4fr 1.4fr 1fr 1fr 1fr; gap: 32px; margin: 40px 0 0; align-items: end; }
.field { display: flex; flex-direction: column; gap: 12px; font-size: 11px; color: var(--muted); text-transform: uppercase; }
.field output { color: var(--fg); font-size: 11px; margin-left: 8px; }
.field select, .field input[type="number"] {
  font: 300 20px var(--sans); color: var(--fg); background: transparent;
  border: 0; border-bottom: 1px solid var(--line-2); border-radius: 0; padding: 4px 0 8px; width: 100%;
  font-variant-numeric: tabular-nums; transition: border-color 0.15s;
}
.field select:focus, .field input[type="number"]:focus { outline: none; border-bottom-color: var(--fg); }
.field select {
  appearance: none; cursor: pointer; padding-right: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23a6a6a6' fill='none'/%3E%3C/svg%3E") no-repeat right 2px center;
}
.field select option { background: #0b0b0b; color: var(--fg); font-size: 15px; }
.field input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
.field input[type="number"]::-webkit-inner-spin-button,
.field input[type="number"]::-webkit-outer-spin-button { appearance: none; margin: 0; }

.field input[type="range"] { appearance: none; width: 100%; height: 24px; margin: 9px 0 10px; background: transparent; cursor: pointer; }
.field input[type="range"]::-webkit-slider-runnable-track { height: 1px; background: var(--line-2); }
.field input[type="range"]::-moz-range-track { height: 1px; background: var(--line-2); }
.field input[type="range"]::-moz-range-progress { height: 1px; background: var(--fg); }
.field input[type="range"]::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; margin-top: -6px; background: var(--fg); border: 0; border-radius: 0; }
.field input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; background: var(--fg); border: 0; border-radius: 0; }

/* правила */

.rules { margin: 16px 0; border-top: 1px solid var(--line-2); }
.rule { display: grid; grid-template-columns: 1fr auto; gap: 6px 24px; align-items: baseline; padding: 18px 0; border-bottom: 1px solid var(--line); }
.rule .conds { font-size: 14px; color: var(--fg); }
.rule .conds span { display: block; }
.rule .conds span + span::before { content: "и "; color: var(--muted); }
.rule .eff { font-size: 26px; font-weight: 300; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.rule .eff.down { color: var(--fg-2); }
.rule .bar { grid-column: 1 / -1; height: 1px; background: var(--line-2); margin-top: 6px; }
.rule .bar i { display: block; height: 1px; background: var(--fg); }
.rule .meta { grid-column: 1 / -1; font-size: 11px; color: var(--muted); }

/* карточка клиента */

.card { margin-top: 32px; }
.card-grid { display: grid; grid-template-columns: 5fr 7fr; gap: 48px; }
.decision { border-top: 1px solid var(--fg); padding-top: 24px; }
.decision .verdict { font-size: clamp(32px, 3.4vw, 44px); font-weight: 300; letter-spacing: -0.035em; line-height: 1.1; margin: 0 0 16px; }
.decision .verdict.down { color: var(--fg-2); }
.decision .why { font-size: 14px; color: var(--fg-2); margin: 0 0 28px; }
.probs { display: grid; grid-template-columns: 1fr auto; margin: 0; font-size: 14px; }
.probs dt, .probs dd { padding: 10px 0; border-bottom: 1px solid var(--line); margin: 0; }
.probs dt { color: var(--fg-2); }
.probs dd { text-align: right; font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; }
.fact-line { margin-top: 20px; font-size: 12px; color: var(--muted); }
.explain { border-top: 1px solid var(--line-2); padding-top: 24px; }
.explain h3 { margin-top: 0; }
.feature-list { columns: 2; column-gap: 32px; font-size: 13px; margin-top: 16px; }
.feature-list div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); break-inside: avoid; }
.feature-list span:first-child { color: var(--fg-2); }
.feature-list span:last-child { font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; }
details summary { cursor: pointer; color: var(--fg-2); font-size: 14px; margin-top: 20px; list-style: none; }
details summary::before { content: "+ "; font-family: var(--mono); }
details[open] summary::before { content: "- "; }
details summary:hover { color: var(--fg); }

.up { color: var(--fg); }
.down { color: var(--fg-2); }

/* подвал */

.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; text-transform: uppercase; padding: 32px 0 48px; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; }
.foot a { color: var(--fg-2); }

@media (max-width: 1000px) {
  .block { padding: 48px 0 80px; }
  .controls { grid-template-columns: 1fr 1fr; gap: 28px 24px; }
}

@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .block { width: calc(100% - 32px); padding-left: 0; padding-right: 0; }
  .controls .field:nth-child(-n + 2) { grid-column: 1 / -1; }
  .hero { padding: 72px 16px 64px; }
  .lead { font-size: 17px; margin-bottom: 64px; }
  .nav { gap: 20px; }
  .brand { display: none; }
  .cols, .card-grid { grid-template-columns: 1fr; gap: 16px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line); margin-top: 24px; }
  .feature-list { columns: 1; }
  .chart { height: 300px; }
  .block-head { gap: 16px; margin-bottom: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
