/* Главная: одна колонка, плотный ритм. В фоне — поле замеров на canvas,
   которое реагирует на курсор. Все цвета — из переменных темы. */

.home {
  padding: 0;
  position: relative;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

/* ---------- фон: поле замеров ---------- */

.field {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: .85;
}
.field-veil {
  position: fixed; inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(101deg,
    color-mix(in oklab, var(--bg) 88%, transparent) 0%,
    color-mix(in oklab, var(--bg) 46%, transparent) 26%,
    color-mix(in oklab, var(--bg) 10%, transparent) 50%,
    transparent 66%);
}

.page {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- герой ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(272px, 348px);
  gap: clamp(28px, 4vw, 64px);
  align-items: stretch;
  padding-block: clamp(34px, 4.6vw, 64px) clamp(28px, 3.4vw, 44px);
}

.headline {
  margin: 0;
  font-size: clamp(2rem, 4.1vw, 3.5rem);
  line-height: 1.04;
  letter-spacing: -.035em;
  font-weight: 700;
  text-wrap: balance;
}
.headline-line { display: block; overflow: hidden; padding-bottom: .06em; }
.headline-line > span { display: block; }
html.js .headline-line > span {
  transform: translateY(108%);
  animation: line-in .78s cubic-bezier(.22,.68,.16,1) forwards;
}
html.js .headline-line:nth-child(2) > span { animation-delay: .08s; }
html.js .headline-line:nth-child(3) > span { animation-delay: .16s; }
@keyframes line-in { to { transform: translateY(0); } }

.lede {
  margin: 20px 0 0;
  max-width: 54ch;
  font-size: clamp(1rem, 1.1vw, 1.0625rem);
  line-height: 1.62;
  color: var(--text-soft);
}

.acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.btn.big { padding: 13px 22px; font-size: 15px; border-radius: 11px; }

/* ---------- панель состояния ---------- */

.panel {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px 14px;
  background: color-mix(in oklab, var(--surface) 82%, transparent);
  backdrop-filter: blur(3px);
}
.panel-fresh {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 14px;
  font-size: 12.5px;
  color: var(--text-soft);
}
.panel-nums {
  margin: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.panel-nums > div {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 9px 0;
  border-top: 1px solid var(--line-soft);
}
.panel-nums dt { font-size: 12.5px; color: var(--muted); }
.panel-nums dd {
  margin: 0;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 19px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  color: var(--text);
}
.panel-note {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

/* ---------- секции ---------- */

.sec {
  padding-block: clamp(34px, 4vw, 58px);
  border-top: 1px solid var(--line);
}
.sec-head { max-width: 68ch; }
.sec-kicker {
  margin: 0 0 10px;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 12px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
}
h2 {
  margin: 0;
  font-size: clamp(1.4rem, 2.2vw, 1.95rem);
  line-height: 1.16;
  letter-spacing: -.025em;
  font-weight: 650;
  text-wrap: balance;
}
.sec-lede {
  margin: 12px 0 0;
  font-size: clamp(.9375rem, 1.05vw, 1rem);
  line-height: 1.62;
  color: var(--text-soft);
  max-width: 62ch;
}

/* ---------- шаги ---------- */

.steps {
  list-style: none;
  margin: clamp(24px, 3vw, 36px) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px 28px;
  counter-reset: none;
}
.steps li { min-width: 0; }
.step-num {
  display: block;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line-hover);
}
.steps h3 {
  margin: 0 0 8px;
  font-size: 15.5px;
  line-height: 1.32;
  letter-spacing: -.01em;
  font-weight: 620;
}
.steps p { margin: 0; font-size: 13.5px; line-height: 1.58; color: var(--text-soft); }

/* ---------- схема расчёта ---------- */

.calc {
  margin: clamp(26px, 3vw, 38px) 0 0;
  padding: 18px 20px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in oklab, var(--surface) 78%, transparent);
  backdrop-filter: blur(3px);
}
.calc-title {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 14px;
  font-family: var(--mono, ui-monospace, monospace);
}
.calc-body {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 26px;
  align-items: center;
}
.calc-graph { width: 100%; height: auto; display: block; color: var(--accent); }
.calc-nums {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.calc-nums dt {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  line-height: 1.35;
}
.calc-nums dd {
  margin: 0;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 20px;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1.1;
}
.calc-nums dd span {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  letter-spacing: 0;
  color: var(--muted);
}
.calc-out { padding-left: 18px; border-left: 1px solid var(--line); }
.calc-out dd { color: var(--link); }
.calc-note {
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 78ch;
}

/* ---------- словарь ---------- */

.digits {
  list-style: none;
  margin: clamp(24px, 3vw, 34px) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 32px;
}
.digits li {
  padding-top: 14px;
  border-top: 1px solid var(--line);
  min-width: 0;
}
.dg-sample {
  display: inline-block;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 9px;
}
.dg-dash { color: var(--muted); }
.digits p {
  margin: 10px 0 0;
  font-size: 13.5px;
  line-height: 1.58;
  color: var(--text-soft);
  max-width: 46ch;
}

/* ---------- живые примеры ---------- */

.live { list-style: none; margin: clamp(22px, 2.6vw, 32px) 0 0; padding: 0; }
.live-card {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.live-card:last-child { border-bottom: 1px solid var(--line); }
.live-thumb {
  display: block;
  border-radius: 9px;
  overflow: hidden;
  background: var(--thumb-grad);
  aspect-ratio: 4/5;
}
.live-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.live-ph {
  display: grid; place-items: center; height: 100%;
  font-size: 11px; color: var(--thumb-ph); font-family: var(--mono, monospace);
}
.live-comm {
  display: inline-block;
  font-weight: 620;
  font-size: 15px;
  letter-spacing: -.01em;
  color: var(--text);
  max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.live-comm:hover { color: var(--link); }
.live-nums {
  margin: 5px 0 0;
  display: flex; flex-wrap: wrap; gap: 5px 16px;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.live-vph { color: var(--link); }
.live-txt {
  margin: 7px 0 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-soft);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.more {
  display: inline-block;
  margin-top: 16px;
  font-size: 14px;
  color: var(--link);
  border-bottom: 1px solid color-mix(in oklab, var(--link) 40%, transparent);
  padding-bottom: 2px;
}
.more:hover { border-bottom-color: var(--link); }
.empty-note {
  margin: 20px 0 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-soft);
  padding: 14px 16px;
  border: 1px dashed var(--line-hover);
  border-radius: 12px;
  max-width: 60ch;
}

/* график (появляется, когда в базе достаточно замеров) */

.speed {
  margin: 26px 0 0;
  padding: 16px 18px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in oklab, var(--surface) 80%, transparent);
  backdrop-filter: blur(3px);
}
.speed-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding-bottom: 8px;
  font-size: 12.5px; color: var(--muted);
}
.speed-title { font-family: var(--mono, ui-monospace, monospace); }
.speed-read {
  font-family: var(--mono, ui-monospace, monospace);
  font-variant-numeric: tabular-nums;
  color: var(--text-soft);
  min-height: 1.2em;
  text-align: right;
  flex: 1 1 auto;
  min-width: 0;
}
.speed-plot { position: relative; }
.speed-plot canvas { display: block; width: 100%; height: 240px; }
.speed-cursor {
  position: absolute; top: 0; left: 0; width: 1px; height: 100%;
  background: var(--line-hover);
  opacity: 0;
  transition: opacity .12s ease;
  pointer-events: none;
}
.speed-cursor.on { opacity: 1; }
.speed figcaption {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
}

/* ---------- границы ---------- */

.limits {
  list-style: none;
  margin: clamp(24px, 3vw, 34px) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px 30px;
}
.limits li { padding-top: 14px; border-top: 1px solid var(--line); min-width: 0; }
.limits h3 {
  margin: 0 0 7px;
  font-size: 14.5px;
  line-height: 1.32;
  font-weight: 620;
  letter-spacing: -.01em;
}
.limits p { margin: 0; font-size: 13px; line-height: 1.58; color: var(--text-soft); }

/* ---------- доступ ---------- */

.free {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(26px, 4vw, 56px);
  align-items: start;
}
.sec--free .acts { margin-top: 22px; }

.facts {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
}
.facts > div { padding: 12px 16px 12px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd {
  margin: 5px 0 0;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  letter-spacing: -.02em;
}

/* ---------- якоря и фокус ---------- */

.sec { scroll-margin-top: 96px; }

.home a:focus-visible,
.home button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- адаптив ---------- */

@media (max-width: 1080px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 26px; align-items: start; }
  .panel { max-width: 420px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .limits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .free { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 820px) {
  .field { opacity: .4; }
  .field-veil { display: none; }
  .calc-body { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .calc-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .calc-out { padding-left: 0; border-left: 0; }
  .digits { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}

@media (max-width: 620px) {
  .page { padding: 0 18px; }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .limits { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .acts .btn { flex: 1 1 100%; justify-content: center; }
  .live-card { grid-template-columns: 72px minmax(0, 1fr); gap: 14px; }
  .facts dd { font-size: 16px; }
}

/* ---------- без анимации ---------- */

@media (prefers-reduced-motion: reduce) {
  html.js .headline-line > span { transform: none; animation: none; }
  .speed-cursor { transition: none; }
}

/* ===== компактнее: без пустых провалов, но с ритмом ===== */
.hero{padding-block:clamp(26px,3.2vw,44px) clamp(18px,2.2vw,28px)}
.hero .lede{margin-top:16px;max-width:52ch}
.hero .acts{margin-top:20px}
.sec{padding-block:clamp(24px,2.8vw,40px)}
.sec-head{max-width:60ch}
.sec-lede{margin-top:8px}
.steps{margin-top:clamp(18px,2vw,26px);gap:14px}
.steps h3{margin-bottom:6px}
.steps p{font-size:13.5px;line-height:1.5}
.digits{margin-top:clamp(16px,1.8vw,22px)}
.digits p{line-height:1.45}
.calc{margin-top:clamp(20px,2.2vw,28px)}
.live{margin-top:clamp(14px,1.6vw,20px)}
.speed{margin-top:clamp(18px,2vw,26px)}
.sec--free{padding-block:clamp(26px,3vw,40px)}
.free{gap:clamp(18px,2vw,28px)}
.panel{padding:14px 16px 12px}
.panel-note{margin-top:10px;padding-top:10px}

/* заголовки секций ближе к своему содержимому */
.sec-kicker{margin-bottom:7px}
.sec-head h2{margin:0}

/* превью в ленте: если картинка VK протухла, остаётся аккуратная заглушка */
.live-thumb{position:relative;overflow:hidden}
.live-thumb .live-ph{position:absolute;inset:0;z-index:0}
.live-thumb img{position:relative;z-index:1}
