/* v4: светлый спокойный вариант. Цвета и шрифт — из варианта Kimi */
:root {
  --bg: #e5e1d8;
  --paper: #efece5;
  --surface: #dad5ca;
  --ink: #2a1d17;
  --muted: #4a3d34;
  --accent: #456f3a;
  --accent-deep: #385c2f;
  --accent-soft: #d7e0cf;
  --accent-ink: #ffffff;
  --res: #b8892c;
  --r: 20px;

  --s-small: 0.9375rem;
  --s-body: 1.125rem;
  --s-lead: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --s-head: clamp(1.875rem, 1.3rem + 1.8vw, 2.75rem);
  --s-display: clamp(2.25rem, 1.4rem + 3vw, 3.75rem);
  --s-sum: clamp(3rem, 2rem + 4vw, 5.5rem);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --m: clamp(16px, 4vw, 64px);
  --gap: clamp(88px, 10vw, 160px);
}
:root[data-large] { --s-small: 1.0625rem; --s-body: 1.3125rem; --s-lead: 1.625rem; }

* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--ink);
  font: 400 var(--s-body)/1.55 "Literata", Georgia, serif;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
h1, h2 { font-weight: 500; line-height: 1.12; letter-spacing: -0.015em; text-wrap: balance; }
h2 { font-size: var(--s-head); }
p + p { margin-top: 0.9em; }
b { font-weight: 600; }
section, footer { scroll-margin-top: 84px; }
.note { margin-top: 20px; font-size: var(--s-small); color: var(--muted); }

/* Кнопки */
.btn, .btn-quiet {
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
  min-height: 48px; padding: 0 24px; border-radius: 999px;
  font: 600 var(--s-small)/1 "Literata", Georgia, serif; cursor: pointer; text-decoration: none;
  transition: transform 140ms var(--ease-out), background-color 150ms ease;
}
.btn { background: var(--accent); color: var(--accent-ink); border: 0; }
.btn-quiet { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn:active, .btn-quiet:active { transform: scale(0.97); }
.btn-quiet[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.btn-big { min-height: 56px; padding: 0 32px; font-size: var(--s-body); }
@media (hover: hover) and (pointer: fine) { .btn:hover { background: var(--accent-deep); } }

/* АДС — без анимации */
.ads-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 8px var(--m); background: var(--ink); color: var(--paper); font-size: var(--s-small);
}
.ads-phone { font-size: var(--s-lead); font-weight: 600; text-decoration: none; font-variant-numeric: tabular-nums; }

.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 40px; padding: 14px var(--m); background: var(--bg);
}
.wordmark { font-size: 1.375rem; font-weight: 600; text-decoration: none; }
.nav nav { display: flex; gap: 24px; font-size: var(--s-small); }
.nav-actions { display: flex; gap: 10px; margin-left: auto; }

/* Первый экран */
.hero {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(32px, 4vw, 64px);
  padding: clamp(32px, 4vw, 56px) var(--m) 0; align-items: stretch;
}
.hero h1 { font-size: var(--s-display); max-width: 18ch; }
.lead { margin-top: 20px; font-size: var(--s-lead); line-height: 1.45; color: var(--muted); max-width: 36ch; }
.hero-photo { border-radius: var(--r); overflow: hidden; min-height: 520px; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; }

.calc { margin-top: 36px; background: var(--paper); border-radius: var(--r); padding: clamp(22px, 2.6vw, 36px); }
.calc-top { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: end; }
.area span:first-child, .lvl legend { display: block; font-size: var(--s-small); color: var(--muted); margin-bottom: 8px; }
.area-field { display: flex; align-items: baseline; gap: 6px; font-size: var(--s-lead); }
.area-field input {
  width: 3.4ch; font: 600 var(--s-head)/1.1 "Literata", Georgia, serif; color: var(--ink);
  background: var(--bg); border: 0; border-radius: 12px; padding: 6px 10px; -moz-appearance: textfield;
}
.area-field input::-webkit-inner-spin-button { -webkit-appearance: none; }
.lvl { border: 0; padding: 0; min-width: 0; }
.lvl-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: var(--bg); border-radius: 14px; padding: 6px; }
.lvl-opts label { position: relative; cursor: pointer; }
.lvl-opts input { position: absolute; opacity: 0; }
.lvl-opts span {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px;
  font-weight: 600; font-size: var(--s-small); line-height: 1.25;
  transition: background-color 150ms ease, color 150ms ease;
}
.lvl-opts small { font-weight: 400; font-size: 0.875rem; color: var(--muted); }
.lvl-opts input:checked + span { background: var(--accent); color: var(--accent-ink); }
.lvl-opts input:checked + span small { color: var(--accent-ink); }
.lvl-opts input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.calc-result { margin: 28px 0 24px; }
.sum { font-size: var(--s-sum); font-weight: 600; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.sum .per { font-size: var(--s-lead); font-weight: 400; letter-spacing: 0; color: var(--muted); }
.sum-note { margin-top: 10px; font-size: var(--s-small); color: var(--muted); }
.sum-inc { list-style: none; padding: 0; margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: var(--s-small); }
.sum-inc li::before { content: "— "; color: var(--accent); }

/* Секции */
.levels, .why, .residents, .houses, .switch, .faq { padding: var(--gap) var(--m) 0; }
.sec-head { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: end; margin-bottom: 36px; }
.sec-head p { color: var(--muted); max-width: 44ch; }

/* Таблица на всю ширину */
.compare { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--paper); border-radius: var(--r); overflow: hidden; }
.compare th, .compare td { text-align: left; vertical-align: top; padding: 18px 22px; }
.compare thead th { font-weight: 600; font-size: var(--s-body); padding-top: 26px; padding-bottom: 22px; background: var(--surface); }
.compare thead th:first-child { color: var(--muted); font-weight: 400; vertical-align: bottom; }
.compare thead b { display: block; margin-top: 6px; font-size: var(--s-head); font-weight: 600; line-height: 1; }
.compare tbody th { font-weight: 600; width: 24%; }
.compare tbody tr + tr > * { border-top: 1px solid rgba(42, 29, 23, 0.1); }
.compare td { color: var(--muted); }
.compare .good { background: var(--accent-soft); color: var(--ink); }
.compare thead .good { background: var(--accent); color: var(--accent-ink); }

/* Почему без запаса */
.why { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 80px); align-items: start; }
.why-text h2 { margin-bottom: 24px; }
.why-text p { max-width: 46ch; }
.split { margin-top: 36px; }
.split-row + .split-row { margin-top: 22px; }
.split-row > p { font-size: var(--s-lead); }
.split-row > p b { font-size: var(--s-head); }
.bar { display: flex; height: 52px; margin-top: 10px; border-radius: 12px; overflow: hidden; background: var(--surface); }
.bar i {
  flex: 0 0 var(--w); display: flex; align-items: center; padding: 0 12px; overflow: hidden; white-space: nowrap;
  font-style: normal; font-size: 0.875rem; transform-origin: left;
  transition: transform 700ms var(--ease-out);
}
.bar .must { background: var(--muted); color: var(--paper); }
.bar .qual { background: var(--accent); color: var(--accent-ink); }
.bar .res { background: var(--res); color: var(--ink); }
.js .split:not(.in) .bar i { transform: scaleX(0); }
.split-row + .split-row .bar i { transition-delay: 150ms; }
.why-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; position: sticky; top: 96px; }
.why-photos figure { margin: 0; }
.why-photos img { width: 100%; aspect-ratio: 4 / 5; max-height: 62svh; object-fit: cover; border-radius: var(--r); }
.why-photos figcaption { margin-top: 10px; font-size: var(--s-small); color: var(--muted); }

/* Жителям */
.actions { list-style: none; padding: 0; margin-top: 32px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.actions a {
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px; min-height: 168px;
  padding: 24px; background: var(--paper); border-radius: var(--r); text-decoration: none;
  transition: background-color 150ms ease, transform 140ms var(--ease-out);
}
.actions span { font-size: var(--s-lead); font-weight: 600; line-height: 1.2; }
.actions small { font-size: var(--s-small); color: var(--muted); }
.actions a:active { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) { .actions a:hover { background: var(--accent-soft); } }

/* Дома */
.houses { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 80px); align-items: start; }
.houses-photo { margin: 0; }
.houses-photo img { width: 100%; aspect-ratio: 5 / 4; object-position: 50% 60%; object-fit: cover; border-radius: var(--r); }
.find { margin: 28px 0 24px; }
.find label { display: block; font-size: var(--s-small); color: var(--muted); margin-bottom: 8px; }
.find-row { display: flex; gap: 8px; }
.find input {
  flex: 1; min-width: 0; min-height: 52px; padding: 0 18px; border-radius: 999px; border: 0;
  font: inherit; color: var(--ink); background: var(--paper);
}
.find input::placeholder { color: var(--muted); }
.status { background: var(--paper); border-radius: var(--r); padding: 22px 26px; }
.status-addr { font-size: var(--s-lead); font-weight: 600; margin-bottom: 10px; }
.status-list div { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; }
.status-list div + div { border-top: 1px solid rgba(42, 29, 23, 0.1); }
.status-list dd { font-weight: 600; text-align: right; transition: opacity 200ms ease; }
.status-list dd.warn { color: #8a4b12; }
.status-list.changing dd { opacity: 0.25; }

/* Как перейти */
.switch h2 { max-width: 22ch; }
.steps { list-style: none; padding: 0; margin: 36px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.steps li { display: flex; flex-direction: column; gap: 10px; padding: 24px; background: var(--paper); border-radius: var(--r); }
.steps li:last-child { background: var(--accent-soft); }
.steps b { font-size: var(--s-lead); line-height: 1.2; }
.steps span { color: var(--muted); }

/* Вопросы */
.faq { display: grid; grid-template-columns: 1fr 2.6fr; gap: 48px; padding-bottom: var(--gap); }
.faq-text { columns: 2; column-gap: 48px; }
.faq-text p { break-inside: avoid; margin: 0 0 20px; }

/* Подвал на вечерней фотографии */
.footer { position: relative; color: var(--paper); padding: 72px var(--m) 32px; min-height: 92svh; display: flex; flex-direction: column; justify-content: space-between; gap: 48px; overflow: hidden; }
.footer-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; }
.footer::before { content: ""; position: absolute; inset: auto 0 0 0; height: 46%; background: rgba(20, 14, 10, 0.72); z-index: -1; }
.footer-card { align-self: flex-end; width: min(400px, 100%); background: var(--paper); color: var(--ink); border-radius: var(--r); padding: 30px; }
.footer-card h2 { font-size: 1.75rem; margin-bottom: 12px; }
.hours { margin: 14px 0; }
.hours div { display: flex; justify-content: space-between; padding: 4px 0; font-variant-numeric: tabular-nums; }
.btn-wide { width: 100%; margin-top: 20px; min-height: 52px; }
.footer-legal { font-size: var(--s-small); }
.footer-name { font-size: clamp(3rem, 1rem + 8vw, 8rem); font-weight: 600; line-height: 1; margin-bottom: 20px; letter-spacing: -0.02em; }
.footer-legal a { color: var(--paper); }

/* Появление блоков (контент виден и без скрипта) */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 260ms var(--ease-out), transform 260ms var(--ease-out); }
.js .reveal.in { opacity: 1; transform: none; }

/* Планшет */
@media (max-width: 1080px) {
  .nav nav { display: none; }
  .hero { grid-template-columns: 1fr; }
  .hero-photo { min-height: 0; aspect-ratio: 16 / 10; order: -1; }
  .why, .houses, .faq, .sec-head { grid-template-columns: 1fr; }
  .why-photos { position: static; }
  .actions, .steps { grid-template-columns: 1fr 1fr; }
}
/* Телефон */
@media (max-width: 640px) {
  .nav { gap: 12px; }
  .btn, .btn-quiet { padding: 0 16px; }
  #large-mode { font-size: 0; padding: 0 14px; }
  #large-mode::before { content: "Аа"; font-size: var(--s-small); }
  .calc-top { grid-template-columns: 1fr; gap: 18px; }
  .lvl-opts { grid-template-columns: 1fr; }
  .lvl-opts span { flex-direction: row; justify-content: space-between; align-items: baseline; }
  .calc .btn-big { width: 100%; }
  .actions, .steps { grid-template-columns: 1fr; }
  .actions a { min-height: 0; gap: 8px; }
  .faq-text { columns: 1; }
  /* таблица превращается в список */
  .compare thead { display: none; }
  .compare, .compare tbody, .compare tr, .compare th, .compare td { display: block; width: auto; }
  .compare { background: transparent; }
  .compare tr { background: var(--paper); border-radius: var(--r); padding: 16px 18px; margin-bottom: 10px; }
  .compare tbody tr + tr > * { border-top: 0; }
  .compare tbody th { padding: 0 0 8px; font-size: var(--s-lead); width: auto; }
  .compare td { padding: 6px 0; display: flex; justify-content: space-between; gap: 16px; border-radius: 0; }
  .compare td::before { content: attr(data-l); color: var(--ink); font-weight: 600; flex: 0 0 auto; }
  .compare td.good { background: var(--accent-soft); margin: 4px -10px 0; padding: 8px 10px; border-radius: 10px; }
  .compare td { text-align: right; }
  .why-photos { grid-template-columns: 1fr 1fr; gap: 8px; }
  .footer-card { align-self: stretch; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { transform: none; transition: opacity 150ms ease; }
  .js .split:not(.in) .bar i { transform: none; }
  .bar i { transition: none; }
}

/* v5: логотип и факты о компании */
.wordmark { display: inline-flex; align-items: center; gap: 10px; }
.facts { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: var(--s-small); color: var(--muted); }
.facts b { color: var(--ink); }
.ads-phones { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.footer-card h3 { font-size: var(--s-body); font-weight: 600; margin: 16px 0 4px; }
.footer-card .hours { margin: 8px 0 0; }
.contact-lines { margin-top: 16px; }
