/**
 * Стили главной и служебных страниц. Подключается после core.css.
 *
 * Раньше раскладку держали утилиты Tailwind прямо в разметке, а анимации жили
 * в блоках <style> внутри компонентов. Сборщика больше нет, поэтому всё
 * собрано здесь, руками, в том же порядке, в каком секции идут на странице.
 *
 * Порядок разделов зафиксирован, см. SPEC-site.md:
 *   1. каркас          6. услуги            11. до и после
 *   2. кнопки          7. витрина демо      12. форма заявки
 *   3. шапка           8. как работаю       13. подвал
 *   4. первый экран    9. вопросы           14. служебные страницы
 *   5. (свободен)     10. калькулятор       15. движение выключено
 *
 * Номер 5 занимала полоса доверия, её убрали (SPEC-design.md). Номер
 * оставлен пустым, чтобы остальные разделы не перенумеровались.
 *
 * Движение (.reveal, .rise, заставка) живёт в core.css: оно нужно и демо,
 * которые site.css не подключают.
 */

/* ========================================================================
   1. Каркас
   ======================================================================== */

.container-page {
  margin-inline: auto;
  max-width: 80rem;
  padding-inline: 1rem;
}

@media (min-width: 768px) {
  .container-page {
    padding-inline: 1.5rem;
  }
}

/* Скрытый элемент остаётся скрытым, даже если классу задан display. */
[hidden] {
  display: none !important;
}

/* ========================================================================
   2. Кнопки
   ------------------------------------------------------------------------
   Пилюля, отклик на нажатие, подъём на наведении.
   ======================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 9999px;
  padding: 0.875rem 1.75rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  transition:
    transform var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
  will-change: transform;
}

/*
 * На узком экране надпись переносится, а не распирает страницу.
 *
 * «Оставить заявку на сайте» в одну строку - это 253 px плюс поля пилюли
 * и поля карточки: на экране 320 px (iPhone SE первого поколения, дешёвые
 * андроиды) страница становилась шире окна на девять точек, и весь сайт
 * ездил вбок. Одна кнопка тянула за собой всё: сетка калькулятора не может
 * стать уже самого широкого своего содержимого.
 */
@media (max-width: 380px) {
  .btn {
    white-space: normal;
    padding-inline: 1.25rem;
  }
}

.btn-primary {
  background-color: var(--accent-press);
  color: #ffffff;
}

.btn-primary:hover {
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-ghost {
  border: 1px solid var(--border);
  background-color: var(--surface);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--text);
  transform: translateY(-2px);
}

.btn-ghost:active {
  transform: scale(0.97);
}

/* ========================================================================
   3. Шапка
   ======================================================================== */

.header-sentinel {
  display: block;
  width: 100%;
  height: 1px;
}

.header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 68px;
  border-bottom: 1px solid transparent;
  background-color: color-mix(in srgb, var(--bg) 85%, transparent);
  /* Префикс нужен Safari до 18-й версии, то есть половине живых iPhone. */
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition:
    border-color 300ms var(--ease-out),
    box-shadow 300ms var(--ease-out);
}

[data-header].is-stuck {
  border-color: var(--border);
  box-shadow: 0 8px 24px -20px rgb(28 25 23 / 0.5);
}

.header__inner {
  display: flex;
  height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header__logo {
  display: flex;
  align-items: center;
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.header__logo-accent {
  color: var(--accent-press);
}

.header__nav {
  display: none;
  align-items: center;
  gap: 1.75rem;
}

/* Подчёркивание разделов растёт от левого края, а не появляется целиком. */
.nav-link {
  position: relative;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text-muted);
  transition: color var(--dur-fast) var(--ease-out);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  height: 2px;
  width: 100%;
  background-color: var(--accent-press);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--dur-base) var(--ease-out);
}

.nav-link:hover {
  color: var(--text);
}

.nav-link:hover::after,
.nav-link:focus-visible::after {
  transform: scaleX(1);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header__cta {
  display: none;
  height: 2.5rem;
  padding: 0 1.25rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.header__burger {
  height: 2.5rem;
  width: 2.5rem;
  padding: 0;
}

@media (min-width: 768px) {
  .header__nav {
    display: flex;
  }

  .header__cta {
    display: inline-flex;
  }

  .header__burger {
    display: none;
  }
}

/* ------------------------------------------------------------------------
   Мобильное меню
   ------------------------------------------------------------------------ */

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 50;
  background-color: var(--bg);
  padding-inline: 1rem;
  padding-top: 68px;
}

@media (min-width: 768px) {
  .mobile-menu {
    display: none;
  }
}

.mobile-menu__inner {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-block: 1.5rem;
}

.mobile-menu__link {
  border-bottom: 1px solid var(--border);
  padding-block: 1rem;
  font-size: 1.5rem;
  line-height: 2rem;
}

.mobile-menu__cta {
  margin-top: 1.5rem;
}

[data-mobile-menu] .menu-item {
  opacity: 0;
  transform: translateY(14px);
}

[data-mobile-menu].is-open .menu-item {
  opacity: 1;
  transform: none;
  transition:
    opacity var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out);
  transition-delay: calc(var(--step, 0) * 55ms);
}

/* ========================================================================
   4. Первый экран
   ------------------------------------------------------------------------
   Текст сверху, без надписи над заголовком. Справа скриншоты двух демо:
   компьютер и телефон поверх его левого нижнего угла.
   ======================================================================== */

.hero {
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

.hero__inner {
  display: grid;
  width: 100%;
  align-items: center;
  gap: 2.5rem;
}

.hero__text {
  display: grid;
  gap: 1rem;
}

.hero__title {
  max-width: 20ch;
  font-size: 2.1rem;
  line-height: 1.05;
}

.hero__lead {
  max-width: 46ch;
  font-size: 1rem;
  line-height: 1.5rem;
  color: var(--text-muted);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .hero__title {
    font-size: 2.6rem;
  }
}

@media (min-width: 768px) {
  .hero {
    padding-top: 4rem;
    padding-bottom: 5rem;
  }

  .hero__text {
    gap: 1.5rem;
  }

  .hero__title {
    font-size: 3.75rem;
  }

  .hero__lead {
    font-size: 1.125rem;
    line-height: 1.75rem;
  }
}

@media (min-width: 1024px) {
  .hero__inner {
    grid-template-columns: 0.9fr 1.1fr;
    gap: 3rem;
  }

  /* Заголовок в две строки рядом со скриншотами, а не в три. */
  .hero__title {
    font-size: 3.25rem;
  }
}

/*
 * Скриншоты. Экран компьютера занимает колонку, телефон лежит поверх его
 * левого нижнего угла: вместе они читаются как «сайт работает везде».
 */
.shots {
  position: relative;
  padding-bottom: 12%;
  padding-left: 8%;
}

.shots__screen,
.shots__phone {
  display: block;
  overflow: hidden;
  background-color: var(--surface);
  opacity: 0;
  transform: translateY(20px);
  animation: shot-in var(--dur-slow) var(--ease-out) forwards;
  animation-delay: calc(var(--step, 0) * 90ms);
}

html.is-loading .shots__screen,
html.is-loading .shots__phone {
  animation-play-state: paused;
}

.shots__screen {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: 0 24px 48px -32px rgb(28 25 23 / 0.45);
}

.shots__phone {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 26%;
  border: 5px solid var(--text);
  border-radius: 22px;
  box-shadow: 0 20px 40px -24px rgb(28 25 23 / 0.6);
}

.shots img {
  width: 100%;
  height: auto;
  transition: transform 700ms var(--ease-out);
}

.shots__screen:hover img,
.shots__phone:hover img {
  transform: scale(1.03);
}

@keyframes shot-in {
  to {
    opacity: 1;
    transform: none;
  }
}

/* ========================================================================
   6. Услуги
   ------------------------------------------------------------------------
   Список в две колонки под тонкими линейками. Первая строка - главная
   услуга, её название цветом акцента.
   ======================================================================== */

.services {
  padding-block: 5rem;
}

.services__title {
  max-width: 18ch;
  font-size: 1.875rem;
  line-height: 2.25rem;
}

.services__list {
  margin-top: 2.5rem;
  display: grid;
  column-gap: 3rem;
  padding: 0;
  list-style: none;
}

.services__item {
  display: grid;
  gap: 0.375rem;
  align-content: start;
  padding-block: 1.5rem;
  border-top: 1px solid var(--border);
}

.services__name {
  font-size: 1.375rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.services__item--lead .services__name {
  color: var(--accent-press);
}

.services__summary {
  max-width: 48ch;
  color: var(--text-muted);
}

@media (min-width: 768px) {
  .services__title {
    font-size: 3rem;
    line-height: 1;
  }

  .services__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .services__name {
    font-size: 1.625rem;
  }
}

/* ========================================================================
   7. Витрина демо
   ------------------------------------------------------------------------
   Скриншоты первых экранов. «Кислица» во всю ширину, шесть остальных -
   сеткой 3x2 с одной пропорцией 16:10, подпись под картинкой.
   ======================================================================== */

.demos {
  padding-block: 5rem;
  background-color: var(--surface);
}

.demos__title {
  font-size: 1.875rem;
  line-height: 2.25rem;
}

.demos__lead {
  margin-top: 1rem;
  max-width: 60ch;
  color: var(--text-muted);
}

.demos__grid {
  margin-top: 2.5rem;
  display: grid;
  gap: 2rem 1.5rem;
}

.demo-card {
  display: grid;
  gap: 0.875rem;
  align-content: start;
}

.demo-card__shot {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  transition: transform var(--dur-base) var(--ease-out);
}

.demo-card:hover .demo-card__shot {
  transform: translateY(-4px);
}

.demo-card:active .demo-card__shot {
  transform: scale(0.99);
}

.demo-card__caption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
}

.demo-card__brand {
  font-weight: 600;
}

.demo-card__style {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.demo-card--lead .demo-card__shot {
  aspect-ratio: 2 / 1;
}

.demo-card--lead .demo-card__brand {
  font-family: var(--font-display);
  font-size: 1.375rem;
}

@media (min-width: 768px) {
  .demos__title {
    font-size: 3rem;
    line-height: 1;
  }

  .demos__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .demo-card--lead {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1024px) {
  .demos__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ========================================================================
   8. Как проходит работа
   ------------------------------------------------------------------------
   Расписание по дням: слева когда, справа что происходит. На телефоне
   день стоит над шагом.
   ======================================================================== */

.process {
  padding-block: 5rem;
}

.process__title {
  font-size: 1.875rem;
  line-height: 2.25rem;
}

.process__list {
  margin-top: 2.5rem;
  display: grid;
  padding: 0;
  list-style: none;
}

.process__step {
  display: grid;
  gap: 0.5rem;
  padding-block: 1.5rem;
  border-top: 1px solid var(--border);
}

.process__when {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--accent-press);
}

.process__verb {
  font-size: 1.375rem;
  line-height: 1.2;
}

.process__text {
  margin-top: 0.375rem;
  max-width: 52ch;
  color: var(--text-muted);
}

@media (min-width: 768px) {
  .process__title {
    font-size: 3rem;
    line-height: 1;
  }

  .process__step {
    grid-template-columns: 12rem minmax(0, 1fr);
    gap: 2rem;
  }

  .process__when {
    font-size: 1.5rem;
  }
}

/* ========================================================================
   9. Вопросы
   ======================================================================== */

.faq-section {
  border-top: 1px solid var(--border);
  padding-block: 5rem;
}

.faq-section__inner {
  display: grid;
  gap: 2.5rem;
}

.faq-section__title {
  font-size: 1.875rem;
  line-height: 2.25rem;
}

.faq-section__list {
  display: grid;
}

.faq {
  border-bottom: 1px solid var(--border);
}

.faq__question {
  display: flex;
  cursor: pointer;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1.25rem;
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 600;
  list-style: none;
}

.faq__question::-webkit-details-marker {
  display: none;
}

/* Раскрытие работает без JavaScript: это обычный details. */
.faq__sign {
  flex-shrink: 0;
  transition: transform var(--dur-base) var(--ease-out);
}

.faq[open] .faq__sign {
  transform: rotate(45deg);
}

.faq__answer {
  max-width: 62ch;
  padding-bottom: 1.25rem;
  color: var(--text-muted);
}

.faq[open] .faq__answer {
  animation: answer-in var(--dur-base) var(--ease-out);
}

@keyframes answer-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

@media (min-width: 768px) {
  .faq-section {
    padding-block: 7rem;
  }

  .faq-section__title {
    font-size: 3rem;
    line-height: 1;
  }
}

@media (min-width: 1024px) {
  .faq-section__inner {
    grid-template-columns: 0.8fr 1.2fr;
    align-items: start;
  }

  .faq-section__title {
    position: sticky;
    top: 7rem;
  }
}

/* ========================================================================
   10. Калькулятор
   ------------------------------------------------------------------------
   Считает браузер. Без JavaScript вместо калькулятора показывается таблица
   базовых цен: путь к разговору должен быть всегда.
   ======================================================================== */

.calc {
  border-top: 1px solid var(--border);
  background-color: var(--surface);
  padding-block: 5rem;
}

.calc__intro {
  display: grid;
  gap: 0.75rem;
}

.calc__title {
  font-size: 1.875rem;
  line-height: 2.25rem;
}

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

/* Разделение путей: с JavaScript показываем калькулятор, без него - таблицу. */
.js-only {
  display: none;
}

html.has-js .js-only {
  display: grid;
}

html.has-js .no-js-only {
  display: none;
}

/* Скрипт не доехал - считать некому. Возвращаем таблицу базовых цен:
   неработающий калькулятор с нулём в итоге хуже, чем честный прайс. */
html.js-failed .js-only {
  display: none;
}

html.js-failed .no-js-only {
  display: grid;
}

.calc__fallback {
  margin-top: 2.5rem;
  display: grid;
  gap: 1rem;
}

.calc__table {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.calc__row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
}

.calc__row + .calc__row {
  border-top: 1px solid var(--border);
}

.calc__row-label {
  font-weight: 600;
}

.calc__row-price {
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text-muted);
}

.calc__fallback-cta {
  justify-self: start;
}

.calc__form {
  margin-top: 3rem;
  gap: 2.5rem;
}

.calc__fields {
  display: grid;
  gap: 2.25rem;
}

.calc__group {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  border: 0;
  padding: 0;
  min-width: 0;
}

.calc__legend {
  padding: 0;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
}

.calc__choices {
  display: grid;
  gap: 0.5rem;
}

.choice {
  display: grid;
  gap: 0.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-field);
  background-color: var(--bg);
  padding: 0.875rem 1rem;
  cursor: pointer;
  transition:
    transform var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out);
}

.choice:hover {
  transform: translateY(-2px);
  border-color: var(--text-muted);
}

.choice:active {
  transform: scale(0.99);
}

.choice:has(input:checked) {
  border-color: var(--accent-press);
  background-color: var(--surface);
  box-shadow: inset 0 0 0 1px var(--accent-press);
}

.choice:has(input:focus-visible) {
  outline: 2px solid var(--accent-press);
  outline-offset: 3px;
}

.choice[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}

.choice[aria-disabled="true"]:hover {
  transform: none;
  border-color: var(--border);
}

.choice__title {
  font-weight: 600;
  line-height: 1.3;
}

.choice__hint {
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--text-muted);
}

.field-error {
  color: var(--accent-press);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.calc__pages {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.calc__range {
  height: 0.5rem;
  width: 100%;
  accent-color: var(--accent-press);
}

.calc__pages-value {
  width: 3.5rem;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-field);
  padding-block: 0.5rem;
  text-align: center;
  font-weight: 600;
}

.calc__hint {
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text-muted);
}

.calc__card {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background-color: var(--bg);
  padding: 1.5rem;
}

.calc__card-label {
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text-muted);
}

.calc__total {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.5rem;
  font-size: 1.875rem;
  line-height: 2.25rem;
  font-weight: 700;
}

.calc__total-word {
  font-size: 1rem;
  line-height: 1.5rem;
  font-weight: 400;
  color: var(--text-muted);
}

.calc__total-number {
  font-variant-numeric: tabular-nums;
}

.calc__note {
  margin-top: 1rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text-muted);
}

.calc__actions {
  margin-top: 1.75rem;
  display: grid;
  gap: 0.75rem;
}

.calc__summary {
  margin-top: 1.75rem;
  display: grid;
  gap: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text-muted);
}

/* Итог подрагивает при пересчёте: видно, что число изменилось. */
[data-total-from].is-bumped,
[data-total-to].is-bumped {
  animation: bump var(--dur-base) var(--ease-out);
}

@keyframes bump {
  0% {
    transform: translateY(6px);
    opacity: 0.35;
  }
  100% {
    transform: none;
    opacity: 1;
  }
}

@media (min-width: 640px) {
  .calc__choices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .calc {
    padding-block: 7rem;
  }

  .calc__title {
    font-size: 3rem;
    line-height: 1;
  }

  .calc__intro {
    max-width: 52ch;
  }

  .calc__card {
    padding: 2rem;
  }

  .calc__total {
    font-size: 2.25rem;
    line-height: 2.5rem;
  }
}

@media (min-width: 1024px) {
  html.has-js .calc__form {
    grid-template-columns: 1.35fr 1fr;
    align-items: start;
  }

  .calc__result {
    position: sticky;
    top: 6rem;
  }
}

@media (min-width: 1280px) {
  .calc__choices--wide {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ========================================================================
   11. Блок «до и после»
   ------------------------------------------------------------------------
   Цвет и хаос живут только внутри рамки. Палитра главной не меняется.
   ======================================================================== */

.restore-section {
  border-top: 1px solid var(--border);
  background-color: var(--surface);
  padding-block: 5rem;
}

.restore-section__intro {
  display: grid;
  gap: 0.75rem;
}

.restore-section__title {
  font-size: 1.875rem;
  line-height: 2.25rem;
}

.restore-section__lead {
  color: var(--text-muted);
}

/* ---------- Рамка и шторка ---------- */

.restore {
  margin-top: 2.5rem;
  margin-inline: auto;
  max-width: 68rem;
}

.stage {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background-color: var(--surface);
  aspect-ratio: 3 / 4;
  touch-action: pan-y;
}

.pane {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

/* Шторка режет верхний слой. Один знак, никакой арифметики во flex. */
.pane-old {
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}

.range {
  position: absolute;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  cursor: ew-resize;
  opacity: 0;
  appearance: none;
  background: transparent;
  /* Палец тянет шторку вбок, а страницу по-прежнему листает вверх и вниз. */
  touch-action: pan-y;
}

/* Бегунок на всю высоту: тянуть можно из любой точки рамки. */
.range::-webkit-slider-thumb {
  appearance: none;
  width: 44px;
  height: 100%;
}

.range::-moz-range-thumb {
  width: 44px;
  height: 100%;
  border: 0;
  border-radius: 0;
}

.handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  display: grid;
  place-items: center;
  width: 2px;
  background-color: #ffffff;
  box-shadow: 0 0 0 1px rgb(28 25 23 / 0.25);
  transform: translateX(-1px);
  pointer-events: none;
}

.grip {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background-color: #ffffff;
  color: var(--text);
  box-shadow: 0 6px 20px rgb(28 25 23 / 0.2);
}

.range:focus-visible + .handle .grip {
  outline: 2px solid var(--accent-press);
  outline-offset: 3px;
}

/* ---------- Подписи половин ---------- */

.tag {
  position: absolute;
  top: 8px;
  z-index: 2;
  border-radius: 9999px;
  padding: 3px 11px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  /* Подпись половины, которой сейчас меньше на экране, приглушается. */
  transition: opacity var(--dur-base) var(--ease-out);
}

.tag-old {
  left: 8px;
  background-color: #1c1917;
  color: #ffffff;
}

.tag-new {
  right: 8px;
  background-color: var(--accent-press);
  color: #ffffff;
}

.restore[data-side="before"] .tag-new,
.restore[data-side="after"] .tag-old {
  opacity: 0.45;
}

/* ---------- Обвязка окна ---------- */

.chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
}

.url {
  overflow: hidden;
  flex: 1;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 11px;
}

.chrome-new {
  border-bottom: 1px solid var(--border);
  background-color: var(--bg);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 9999px;
  background-color: var(--border);
}

.url-new {
  margin-left: 6px;
  border-radius: 9999px;
  background-color: var(--surface);
  padding: 4px 10px;
  color: var(--text-muted);
  font-family: var(--font-body);
}

.chrome-old {
  border-bottom: 2px solid #808080;
  background: linear-gradient(#e8e6df, #cfcabb);
}

.win {
  width: 13px;
  height: 12px;
  border: 1px solid #5a5a5a;
  background: linear-gradient(#fdfdfd, #c9c4b6);
}

.url-old {
  margin-left: 6px;
  border: 1px solid;
  border-color: #7a7a7a #ffffff #ffffff #7a7a7a;
  background-color: #ffffff;
  padding: 2px 6px;
  color: #202020;
  font-family: "Tahoma", "Verdana", sans-serif;
}

/* ---------- Половина «было»: конец нулевых ---------- */

.page-old {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  padding: 28px 10px 0;
  background-color: #dcd6ff;
  background-image: repeating-linear-gradient(
    45deg,
    rgb(255 255 255 / 0.55) 0 9px,
    rgb(140 110 255 / 0.18) 9px 18px
  );
  color: #101010;
  font-family: "Times New Roman", "Liberation Serif", serif;
  font-size: 12px;
  line-height: 1.35;
}

/* Главное у старой версии стоит слева: там его и видно на середине шторки. */
.old-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 10px;
}

.old-main {
  border: 1px solid #9a9a9a;
  background-color: #fffef2;
  padding: 8px;
}

.old-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

/* Заголовок-WordArt: градиентная заливка и обводка, как в редакторах тех лет. */
.old-title {
  margin: 0;
  background: linear-gradient(#fff45a, #ff7a00 55%, #d40000);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  font-family: "Comic Sans MS", "Trebuchet MS", cursive;
  font-size: clamp(14px, 3.4vw, 22px);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.1;
  text-shadow: 1px 1px 0 rgb(0 0 0 / 0.3);
}

.old-new {
  flex-shrink: 0;
  border: 1px solid #a00000;
  background-color: #ff0000;
  padding: 1px 5px;
  color: #ffff00;
  font-family: "Tahoma", sans-serif;
  font-size: 10px;
  font-weight: 700;
  animation: old-blink 900ms steps(1, end) infinite;
}

@keyframes old-blink {
  50% {
    opacity: 0.15;
  }
}

.old-tagline {
  margin: 5px 0 0;
  font-style: italic;
}

.old-marquee {
  overflow: hidden;
  margin-top: 7px;
  border: 1px solid #008000;
  background-color: #ccff00;
  padding: 2px 0;
  white-space: nowrap;
  font-family: "Tahoma", sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #b1005e;
}

.old-marquee span {
  display: inline-block;
  padding-left: 20%;
  animation: old-run 16s linear infinite;
}

@keyframes old-run {
  to {
    transform: translateX(-120%);
  }
}

.old-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 9px;
  margin-top: 7px;
  border-top: 1px solid #9a9a9a;
  border-bottom: 1px solid #9a9a9a;
  padding: 4px 0;
  font-family: "Tahoma", sans-serif;
  font-size: 11px;
}

.old-menu span {
  color: #0000ee;
  text-decoration: underline;
}

.old-table {
  width: 100%;
  margin-top: 8px;
  border-collapse: collapse;
  background-color: #ffffff;
}

.old-table td {
  border: 1px solid #9a9a9a;
  padding: 4px 6px;
  vertical-align: top;
}

.old-table tr:nth-child(even) td {
  background-color: #eaffea;
}

.old-table td:last-child {
  width: 36%;
  color: #c00000;
  font-weight: 700;
}

.old-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.old-button {
  border: 2px outset #d8d4c8;
  background-color: #d8d4c8;
  padding: 3px 10px;
  font-family: "Tahoma", sans-serif;
  font-size: 11px;
}

.old-phone {
  font-weight: 700;
}

.old-news {
  margin-top: 8px;
  border-top: 1px solid #9a9a9a;
  padding-top: 6px;
}

.old-news-head {
  display: block;
  margin-bottom: 3px;
  color: #000080;
  font-family: "Tahoma", sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-decoration: underline;
}

.old-news p {
  margin: 0 0 3px;
}

.old-aside {
  display: grid;
  align-content: start;
  gap: 6px;
  font-family: "Tahoma", sans-serif;
  font-size: 10px;
  color: #202020;
}

.old-banner {
  border: 2px ridge #ff00ff;
  background: linear-gradient(90deg, #ffe600, #ff9000);
  padding: 6px 4px;
  text-align: center;
  font-weight: 700;
  color: #0000aa;
}

.old-counter {
  border: 1px solid #000000;
  background-color: #000000;
  padding: 2px 5px;
  text-align: center;
  color: #00ff66;
  font-family: "Courier New", monospace;
  letter-spacing: 0.06em;
}

.old-guest,
.old-badge {
  border: 1px solid #9a9a9a;
  background-color: #fffef2;
  padding: 4px 5px;
}

.old-copy {
  margin: 10px -10px 0;
  border-top: 2px solid #9a9a9a;
  background-color: #c9c4f5;
  padding: 5px 10px;
  font-family: "Tahoma", sans-serif;
  font-size: 10px;
}

/* ---------- Половина «стало»: сегодняшняя вёрстка ---------- */

.page-new {
  position: relative;
  display: grid;
  /* minmax(0, 1fr), а не 1fr: иначе фото распирает строку и выдавливает полосу вниз. */
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  overflow: hidden;
  padding: 28px 12px 0;
  background-color: var(--surface);
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.4;
}

.new-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 9px;
}

.new-brand {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.new-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--text-muted);
  font-size: 11px;
}

/* Главное у новой версии стоит справа: там его и видно на середине шторки. */
.new-body {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
}

.new-photo {
  width: 100%;
  height: 92px;
  min-height: 0;
  border-radius: var(--radius-field);
  background-color: var(--bg);
  object-fit: cover;
}

.new-title {
  margin: 0;
  font-size: clamp(16px, 3.6vw, 26px);
  line-height: 1.1;
}

.new-tagline {
  margin: 6px 0 0;
  color: var(--text-muted);
}

.new-items {
  display: grid;
  gap: 5px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.new-items li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--border);
  padding-top: 5px;
}

.new-items b {
  white-space: nowrap;
}

.new-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.new-action {
  border-radius: 9999px;
  background-color: var(--accent-press);
  padding: 7px 16px;
  color: #ffffff;
  font-weight: 600;
}

.new-phone {
  font-weight: 600;
  white-space: nowrap;
}

.new-promises {
  display: grid;
  grid-auto-flow: column;
  gap: 10px;
  margin: 0 -12px;
  border-top: 1px solid var(--border);
  padding: 8px 12px;
  background-color: var(--bg);
  list-style: none;
  color: var(--text-muted);
  font-size: 11px;
}

/* ---------- Факты под рамкой ---------- */

.restore__caption {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text-muted);
}

.restore__facts {
  margin-top: 2rem;
  display: grid;
  gap: 1rem;
}

.fact {
  border-top: 2px solid var(--border);
  padding-top: 10px;
}

.fact__label {
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text-muted);
}

.fact__values {
  margin: 0.25rem 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
}

.fact-before {
  color: var(--text-muted);
  text-decoration-color: var(--accent);
}

.fact-after {
  font-size: 1.125rem;
  line-height: 1.75rem;
}

/* ---------- Узкий экран ---------- */

/* На телефоне видна половина рамки, поэтому кегли мельче: текст успевает лечь. */
@media (max-width: 767px) {
  .page-old,
  .page-new {
    font-size: 11px;
    line-height: 1.3;
  }

  .old-menu,
  .old-marquee,
  .old-news-head {
    font-size: 10px;
  }

  .new-photo {
    height: 74px;
  }

  .new-promises {
    font-size: 10px;
  }
}

@media (min-width: 640px) {
  .restore__facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---------- Широкий экран ---------- */

@media (min-width: 768px) {
  .restore-section {
    padding-block: 7rem;
  }

  .restore-section__title {
    font-size: 3rem;
    line-height: 1;
  }

  .restore-section__intro {
    max-width: 56ch;
  }

  .stage {
    aspect-ratio: 16 / 10;
  }

  .page-old,
  .page-new {
    padding-inline: 18px;
    font-size: 13px;
  }

  /* Левая колонка укладывается в половину рамки: на середине её видно целиком.
     Боковая панель начинается правее шторки, поэтому в середине не мелькает. */
  .old-body {
    grid-template-columns: minmax(0, 48%) minmax(0, 1fr);
    gap: 40px;
  }

  .old-copy {
    margin-inline: -18px;
    padding-inline: 18px;
  }

  /* Текстовая колонка начинается правее середины рамки: на середине её не режет. */
  .new-body {
    grid-template-columns: minmax(0, 52%) minmax(0, 1fr);
    align-items: stretch;
    gap: 20px;
  }

  .new-text {
    align-self: center;
  }

  .new-photo {
    height: 100%;
    min-height: 180px;
  }

  .new-promises {
    margin-inline: -18px;
    padding-inline: 18px;
  }
}

/* ---------- Без скриптов ---------- */

/*
 * Шторку двигать некому, поэтому половины ложатся друг под друга и обе
 * читаются целиком. Подписи «Было» и «Стало» остаются на своих местах.
 */
html:not(.has-js) .stage {
  display: grid;
  aspect-ratio: auto;
  gap: 1px;
  background-color: var(--border);
}

html:not(.has-js) .pane {
  position: relative;
  inset: auto;
  min-height: 340px;
}

html:not(.has-js) .pane-old {
  clip-path: none;
  order: -1;
}

html:not(.has-js) .range,
html:not(.has-js) .handle {
  display: none;
}

/* ========================================================================
   12. Форма заявки
   ======================================================================== */

.contact {
  border-top: 1px solid var(--border);
  background-color: var(--surface);
  padding-block: 5rem;
}

.contact__inner {
  display: grid;
  gap: 3rem;
}

.contact__text {
  display: grid;
  gap: 1.5rem;
  align-content: start;
}

.contact__title {
  max-width: 16ch;
  font-size: 1.875rem;
  line-height: 2.25rem;
}

.contact__lead {
  max-width: 44ch;
  font-size: 1.125rem;
  line-height: 1.75rem;
  color: var(--text-muted);
}

.contact__next {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.contact__next-title {
  font-size: 1.125rem;
  font-weight: 600;
}

.contact__next-list {
  display: grid;
  gap: 0.5rem;
  max-width: 40ch;
  padding-left: 1.25rem;
  color: var(--text-muted);
}

.lead-form__alt {
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text-muted);
}

.lead-form {
  display: grid;
  gap: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background-color: var(--bg);
  padding: 1.5rem;
}

.lead-form__row {
  display: grid;
  gap: 0.5rem;
}

.lead-form__label {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
}

.lead-form__hint {
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text-muted);
}

.lead-form__consent {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.lead-form__checkbox {
  margin-top: 0.25rem;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  accent-color: var(--accent-press);
}

.lead-form__link {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.field {
  border: 1px solid var(--border);
  border-radius: var(--radius-field);
  background-color: var(--surface);
  padding: 0.75rem 0.875rem;
  color: var(--text);
  transition:
    border-color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}

.field::placeholder {
  /* Контраст подсказки на белом 4.7 : 1. */
  color: #6d6763;
}

.field:hover {
  border-color: var(--text-muted);
}

.field:focus {
  border-color: var(--accent-press);
}

.honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.form-state {
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text-muted);
}

.form-state--ok {
  color: #1f6f43; /* контраст на #FAFAF9 составляет 5.2 : 1 */
}

.form-state--fail {
  color: var(--accent-press);
}

[data-submit].is-busy {
  opacity: 0.7;
  pointer-events: none;
}

/* Поле с ошибкой коротко подрагивает: видно, куда смотреть. */
.field.is-invalid {
  border-color: var(--accent-press);
  animation: shake var(--dur-base) var(--ease-out);
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  75% {
    transform: translateX(4px);
  }
}

@media (min-width: 768px) {
  .contact {
    padding-block: 7rem;
  }

  .contact__title {
    font-size: 3rem;
    line-height: 1;
  }

  .lead-form {
    padding: 2rem;
  }
}

@media (min-width: 1024px) {
  .contact__inner {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

/* ========================================================================
   13. Подвал
   ======================================================================== */

.footer {
  border-top: 1px solid var(--border);
  background-color: var(--surface);
}

.footer__grid {
  display: grid;
  gap: 2.5rem;
  padding-block: 3.5rem;
}

.footer__logo {
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.footer__logo-accent {
  color: var(--accent-press);
}

.footer__about {
  margin-top: 0.75rem;
  max-width: 38ch;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text-muted);
}

.footer__heading {
  font-family: var(--font-body);
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  letter-spacing: normal;
}

.footer__list {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text-muted);
}

.footer__link {
  transition: color var(--dur-fast) var(--ease-out);
}

/*
 * Пальцем в строку текста высотой 17 px попасть трудно. На сенсорных
 * экранах ссылки подвала получают поле сверху и снизу: сама надпись
 * не меняется, а область нажатия дорастает до 32 px.
 */
@media (hover: none) {
  .footer__link {
    display: inline-block;
    padding-block: 0.4375rem;
  }
}

.footer__link:hover {
  color: var(--text);
}

.footer__bottom {
  border-top: 1px solid var(--border);
  padding-block: 1.5rem;
}

.footer__copyright {
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--text-muted);
}

@media (min-width: 768px) {
  .footer__grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

/* ========================================================================
   14. Служебные страницы: политика и 404
   ======================================================================== */

.page {
  padding-block: 4rem;
}

.page__title {
  max-width: 24ch;
  font-size: 1.875rem;
  line-height: 2.25rem;
}

.page__meta {
  margin-top: 1rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text-muted);
}

.page__body {
  margin-top: 2.5rem;
  display: grid;
  max-width: 68ch;
  gap: 2rem;
}

.page__section {
  display: grid;
  gap: 0.75rem;
}

.page__heading {
  font-size: 1.25rem;
  line-height: 1.75rem;
}

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

.page__list {
  display: grid;
  gap: 0.5rem;
  padding-left: 1.25rem;
  list-style: disc;
  color: var(--text-muted);
}

.page__link {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Якорь #cookie: шапка прилипает сверху и закрыла бы заголовок раздела. */
.page__section[id] {
  scroll-margin-top: 88px;
}

.page__back {
  margin-top: 3rem;
}

/*
 * 404: «404» из плиток, как недостроенный сайт. Единица --u - шаг сетки
 * плиток, вся сцена 17 шагов в ширину и 9 в высоту: 7 строк цифр и место
 * под кучку. Плитки стоят абсолютно, двигаются только transform и
 * translate: падение при загрузке идёт анимацией transform, отталкивание
 * от курсора - свойством translate из not-found.js, друг другу не мешают.
 */
.notfound {
  display: grid;
  min-height: 70dvh;
  align-content: center;
  gap: 3rem;
  padding-block: 4rem;
}

.notfound__text {
  display: grid;
  gap: 1.5rem;
}

.notfound__title {
  max-width: 16ch;
  font-size: 1.875rem;
  line-height: 2.25rem;
  text-wrap: balance;
}

.notfound__lead {
  max-width: 40ch;
  color: var(--text-muted);
}

.notfound__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.notfound__stage {
  --u: clamp(14px, 5vw, 34px);
  --gap: calc(var(--u) * 0.12);
  position: relative;
  order: -1;
  width: calc(var(--u) * 17);
  height: calc(var(--u) * 9);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.nf-tile,
.nf-slot {
  position: absolute;
  left: calc(var(--c) * var(--u));
  top: calc(var(--r) * var(--u));
  width: calc(var(--u) - var(--gap));
  height: calc(var(--u) - var(--gap));
  border-radius: 3px;
}

.nf-tile {
  background-color: var(--text);
  box-shadow: inset 0 -2px 0 rgb(0 0 0 / 0.25);
  transition: translate var(--dur-base) var(--ease-out);
}

.nf-slot {
  border: 1.5px dashed #c9c5c2;
}

/* Плитка из кучки стоит на своём месте, а сдвиг уводит её вниз, в кучку. */
.nf-tile--loose {
  z-index: 1;
  cursor: pointer;
  background-color: var(--accent);
  box-shadow: inset 0 -2px 0 rgb(0 0 0 / 0.18);
  transform: translate(
      calc((var(--pc) - var(--c)) * var(--u)),
      calc((var(--pr) - var(--r)) * var(--u))
    )
    rotate(var(--rot));
  transition:
    transform var(--dur-slow) cubic-bezier(0.34, 1.56, 0.64, 1),
    translate var(--dur-base) var(--ease-out);
}

.nf-tile--loose:hover {
  translate: 0 calc(var(--u) * -0.15);
}

.nf-tile--loose.is-placed {
  cursor: default;
  transform: none;
  translate: 0 0;
}

@media (prefers-reduced-motion: no-preference) {
  .has-js .nf-tile:not(.nf-tile--loose) {
    animation: nf-drop 560ms var(--ease-out) backwards;
    animation-delay: calc(var(--i) * 5ms);
  }

  .has-js .nf-tile--loose {
    animation: nf-fade 420ms var(--ease-out) backwards;
    animation-delay: calc(640ms + var(--n) * 50ms);
  }

  /* Последняя плитка встала: вся надпись подпрыгивает волной слева направо. */
  .notfound__stage.is-done .nf-tile {
    animation: nf-hop 520ms var(--ease-out);
    animation-delay: calc(var(--c) * 22ms);
  }
}

@keyframes nf-drop {
  from {
    opacity: 0;
    transform: translateY(calc(var(--u) * -3));
  }
}

@keyframes nf-fade {
  from {
    opacity: 0;
  }
}

@keyframes nf-hop {
  40% {
    transform: translateY(calc(var(--u) * -0.35));
  }
}

@media (min-width: 1024px) {
  .notfound {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: center;
    gap: 4rem;
  }

  .notfound__stage {
    --u: clamp(24px, 2.6vw, 38px);
    order: 0;
    justify-self: end;
  }
}

@media (min-width: 768px) {
  .page {
    padding-block: 6rem;
  }

  .page__title,
  .notfound__title {
    font-size: 3rem;
    line-height: 1;
  }
}

/* ========================================================================
   15. Движение выключено по просьбе человека
   ------------------------------------------------------------------------
   Общее подавление живёт в core.css. Здесь только то, что нужно снять
   поимённо: скрытые состояния, наклоны и бесконечные анимации.
   ======================================================================== */

@media (prefers-reduced-motion: reduce) {
  .shots__screen,
  .shots__phone {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .shots__screen:hover img,
  .shots__phone:hover img {
    transform: none;
  }

  [data-mobile-menu] .menu-item {
    opacity: 1;
    transform: none;
  }

  .demo-card:hover .demo-card__shot,
  .demo-card:active .demo-card__shot {
    transform: none;
  }

  .faq[open] .faq__answer {
    animation: none;
  }

  .faq[open] .faq__sign {
    transform: none;
  }

  [data-total-from].is-bumped,
  [data-total-to].is-bumped {
    animation: none;
  }

  .old-new,
  .old-marquee span {
    animation: none;
  }

  .old-marquee span {
    padding-left: 0;
  }

  .field.is-invalid {
    animation: none;
  }

  .nf-tile,
  .nf-tile--loose:hover {
    animation: none;
    translate: 0 0;
  }
}
