/* ============================================================
   nabalote.ru: направление «Торфяной туман».
   Тёмная сцена, единственный тёплый акцент (свет фонаря),
   документальный слой в архивных врезках.
   Тема одна: сайт живёт в сумерках всегда.
   ============================================================ */

:root {
  --bg: #0B0F0D;
  --bg-deep: #060907;
  --panel: #141A16;
  --panel-2: #1A231D;
  --line: #2A332C;
  --fog: #8FA39A;
  /* Основной текст чуть тусклее заголовков: на чёрном фоне светлый
     сериф визуально «искрится» из-за иррадиации, полная яркость режет глаз. */
  --ink: #E6E3DA;
  --ink-body: #DCD8CE;
  --ink-dim: #9BA69E;
  --ink-mute: #5E6A61;
  --lamp: #E8A33D;
  --lamp-deep: #C4821F;

  --wrap: 1120px;
  --gap: clamp(16px, 2.4vw, 28px);
  --radius: 4px;

  /* Шкала отступов с шагом кратно 8: раньше в файле было 11 разных
     значений (28, 30, 34, 46, 68...), которые не складывались в систему. */
  --s-2: 16px;
  --s-3: 24px;
  --s-4: 32px;
  --s-5: 48px;
  --s-6: 72px;

  /* Мера строки. Комфортный диапазон для PT Serif это 58-64 знака:
     короче даёт рваный правый край, длиннее трудно вести взгляд
     на тёмном фоне. */
  --measure: 62ch;
  --measure-lead: 42ch;
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  scroll-behavior: smooth;
  /* Шапка фиксированная: без этого запаса заголовок секции при переходе
     по якорю уезжает под неё. */
  scroll-padding-top: 84px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-body);
  font-family: 'PT Serif', Georgia, serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Заголовки держим на полной яркости: они крупные, не искрят. */
h1, h2, h3 { color: var(--ink); }

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--lamp);
  outline-offset: 3px;
}

.wrap { width: min(100% - 40px, var(--wrap)); margin-inline: auto; }

/* ── Типографика ── */
h1, h2, h3, .brand, .foot-brand, .d-day, .btn, .ps-name {
  font-family: 'Oswald', 'Arial Narrow', 'Segoe UI', sans-serif;
  font-weight: 600;
}

h1 {
  font-size: clamp(40px, 8vw, 86px);
  line-height: .96;
  letter-spacing: .01em;
  text-transform: uppercase;
  margin: 0 0 18px;
  text-wrap: balance;
}

h2 {
  font-size: clamp(28px, 4.4vw, 48px);
  line-height: 1.04;
  text-transform: uppercase;
  letter-spacing: .01em;
  margin: 0 0 10px;
  text-wrap: balance;
}

h3 {
  font-family: 'PT Serif', Georgia, serif;
  font-weight: 700;
  font-size: 19px;
  margin: 0 0 6px;
}

p { margin: 0 0 14px; }

.eyebrow {
  font-family: 'Oswald', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--lamp);
  margin: 0 0 12px;
}

.sub { color: var(--ink-dim); margin: -4px 0 24px; }
.note { color: var(--ink-mute); font-size: 15px; max-width: var(--measure); }

/* ── Шапка ── */
.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: var(--gap);
  /* Тот же горизонтальный отступ, что у .wrap: логотип встаёт ровно
     на левую границу колонки контента. */
  padding: 14px max(20px, calc((100% - var(--wrap)) / 2));
  background: transparent;
  transition: background .3s ease, border-color .3s ease;
  border-bottom: 1px solid transparent;
}

/* Затемнение под шапкой рисуем отдельным слоем и выпускаем НИЖЕ её края:
   если градиент ограничен высотой шапки, он обрывается ступенькой и на
   светлом фото видна тёмная полоса. */
.topbar::before {
  content: '';
  position: absolute;
  inset: 0 0 -70px;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(6, 9, 7, .78) 0%,
    rgba(6, 9, 7, .55) 38%,
    rgba(6, 9, 7, .22) 68%,
    rgba(6, 9, 7, 0) 100%);
  transition: opacity .3s ease;
}
.topbar > * { position: relative; z-index: 1; }

.topbar.is-stuck {
  background: rgba(6, 9, 7, .95);
  border-bottom-color: var(--line);
  backdrop-filter: blur(6px);
}
/* Когда шапка «прилипла», она уже непрозрачная: растяжка не нужна */
.topbar.is-stuck::before { opacity: 0; }

/* Написание «НаБолоте.ру» с заглавными внутри: верхний регистр и широкая
   разрядка здесь неуместны, они сломали бы читаемость домена. */
.brand {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .01em;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
}
.brand-tld { color: var(--lamp); font-weight: 500; }

/* Навигация набрана Oswald: узкий гротеск строже засечного шрифта
   и лучше держит форму в мелком кегле. */
.topnav {
  margin-left: auto;
  display: flex;
  gap: 30px;
  font-family: 'Oswald', 'Arial Narrow', sans-serif;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.topnav a {
  color: var(--ink-dim);
  text-decoration: none;
  transition: color .2s;
  position: relative;
  padding-bottom: 3px;
}
/* Подчёркивание вырастает при наведении: спокойнее, чем смена цвета фона */
.topnav a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--lamp);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.topnav a:hover { color: var(--ink); }
.topnav a:hover::after { transform: scaleX(1); }
@media (max-width: 860px) { .topnav { display: none; } }

.btn-ghost {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 22px;
  font-family: 'Oswald', 'Arial Narrow', sans-serif;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  transition: border-color .2s, color .2s, background .2s;
}
.btn-ghost:hover { background: rgba(232, 163, 61, .1); }
.btn-ghost:hover { border-color: var(--lamp); color: var(--lamp); }
@media (max-width: 860px) { .topnav { display: none; } .brand { font-size: 11px; } }

/* ── Кнопки ── */
.btn {
  display: inline-block;
  background: var(--lamp);
  color: #0B0F0D;
  border: 0;
  border-radius: var(--radius);
  padding: 13px 34px;
  font-size: 16px;
  letter-spacing: .02em;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s, transform .15s;
}
.btn:hover { background: #F0B155; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { background: var(--ink-mute); cursor: not-allowed; }
.btn-wide { width: 100%; text-align: center; }

.btn-link {
  color: var(--fog);
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
  font-size: 15.5px;
  transition: color .2s;
}
.btn-link:hover { color: var(--ink); }

/* ── Первый экран ── */
.hero {
  position: relative;
  min-height: min(94vh, 880px);
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 120px 0 70px;
}

.hero-media { position: absolute; inset: 0; z-index: 0; }

.hero-photo {
  /* Стартовая точка света совпадает с фарой на фото (правая часть кадра). */
  --lx: 72%;
  --ly: 48%;
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 45% at 68% 62%, rgba(232, 163, 61, .18), transparent 62%),
    linear-gradient(180deg, #060907 0%, #0B0F0D 46%, #131A15 100%);
  background-size: cover;
  background-position: center;
}

/* Свой кадр автомотрисы ночью, отзеркаленный: кабина с фарами справа,
   слева тёмный корпус вагона. Текст ложится на корпус, фара светит
   внутрь кадра к заголовку и остаётся открытой. */
.hero-photo.has-photo {
  background-color: #060907;
  background-image:
    linear-gradient(90deg,
      rgba(6, 9, 7, .9) 0%,
      rgba(6, 9, 7, .72) 34%,
      rgba(6, 9, 7, .34) 62%,
      rgba(6, 9, 7, .1) 82%,
      rgba(6, 9, 7, .28) 100%),
    linear-gradient(180deg, rgba(6, 9, 7, .5) 0%, transparent 26%, rgba(6, 9, 7, .62) 100%),
    url('/img/hero-wide.jpg');
  /* Кадр заранее обрезан под 16:9, поэтому cover уже ничего не срезает:
     автомотриса и рука с фонарём остаются в кадре на любой ширине. */
  background-size: cover, cover, cover;
  background-position: center, center, center 42%;
}

/* На узких экранах текст занимает всю ширину: затемняем сильнее и ровнее,
   а кадр сдвигаем вправо, чтобы в видимую область попала кабина. */
@media (max-width: 999px) {
  .hero-photo.has-photo {
    background-image:
      linear-gradient(180deg, rgba(6, 9, 7, .74) 0%, rgba(6, 9, 7, .45) 40%, rgba(6, 9, 7, .92) 100%),
      url('/img/hero-wide.jpg');
    background-size: cover, cover;
    background-position: center, center center;
  }
}

/* Пятно света за курсором: отдельный слой поверх фото */
.hero-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle 340px at var(--lx) var(--ly), rgba(232, 163, 61, .11), transparent 70%);
  transition: background-position .2s ease-out;
}

.fog {
  position: absolute;
  inset: auto -20% -10%;
  height: 62%;
  pointer-events: none;
  will-change: transform;
}
.fog-a {
  background: radial-gradient(ellipse 60% 60% at 60% 100%, rgba(143, 163, 154, .22), transparent 68%);
  animation: drift-a 38s ease-in-out infinite alternate;
}
.fog-b {
  background: radial-gradient(ellipse 45% 50% at 22% 100%, rgba(143, 163, 154, .14), transparent 72%);
  animation: drift-b 52s ease-in-out infinite alternate;
}
@keyframes drift-a { from { transform: translate3d(-3%, 0, 0); } to { transform: translate3d(5%, -2%, 0); } }
@keyframes drift-b { from { transform: translate3d(4%, 1%, 0); } to { transform: translate3d(-4%, -1%, 0); } }

.grain {
  position: absolute;
  inset: 0;
  opacity: .05;
  pointer-events: none;
  background-image: url('/img/grain.svg');
  background-size: 128px 128px;
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(100% - 40px, var(--wrap));
  margin-inline: auto;
}
/* Текст держим в левой половине: справа в кадре фара и корпус автомотрисы */
@media (min-width: 1000px) {
  .hero-inner > * { max-width: 54%; }
  .hero-inner h1 { max-width: 62%; }
}

/* Надзаголовок над h1: тот же приём, что и .eyebrow, но на фото */
.kicker {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(11px, 1.1vw, 13px);
  font-weight: 500;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--lamp);
  margin: 0 0 18px;
}

.hero-sub {
  font-size: clamp(17px, 1.6vw, 21px);
  color: #D9D5CA;
  max-width: 40ch;
  margin-bottom: 22px;
}

.hero-facts {
  font-family: 'Oswald', sans-serif;
  font-size: 14px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 30px;
}
.hero-facts span { color: var(--ink-mute); margin: 0 6px; }

.hero-cta { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.hero-next { margin-top: 26px; font-size: 15px; color: var(--fog); }

/* ── Секции ── */
.section { padding: clamp(64px, 9vw, 118px) 0; position: relative; }
.section + .section { border-top: 1px solid var(--line); }

/* Появление по скроллу. Класс js-anim ставит скрипт: без JS контент
   виден сразу, ничего не прячем от поисковиков и от читалок. */
.js-anim .section .wrap > * {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .7s ease, transform .7s ease;
}
/* Карусель из анимации исключаем: transform на родителе создаёт новую
   систему координат, и абсолютно спозиционированные слайды рассыпаются
   в столбик вместо того, чтобы лежать друг на друге. */
.js-anim .section .wrap > .pg-aside {
  opacity: 1;
  transform: none;
  transition: none;
}
.js-anim .section .wrap > *.is-in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .js-anim .section .wrap > * { opacity: 1; transform: none; transition: none; }
}

/* ── Легенда ── */
.legend-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  margin-top: var(--s-4);
}
.legend-grid.reverse { margin-top: var(--s-5); }
@media (max-width: 820px) {
  .legend-grid, .legend-grid.reverse { grid-template-columns: 1fr; }
  .legend-grid.reverse .archive { order: -1; }
}

.legend-text p { color: #D9D5CA; max-width: var(--measure); }

.archive { margin: 0; position: relative; }
/* Подложка видна, пока не загружено фото: не битая картинка, а тёмное поле */
.archive img {
  width: 100%;
  aspect-ratio: 12 / 7;
  object-fit: cover;
  background:
    repeating-linear-gradient(135deg, #10160f 0 12px, #131a15 12px 24px);
  border: 1px solid var(--line);
  border-radius: 2px;
  filter: grayscale(1) contrast(1.06) brightness(.82) sepia(.14);
}
/* Уголки архивной карточки */
.archive::before, .archive::after {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  border: 1px solid var(--fog);
  opacity: .5;
}
.archive::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.archive::after { top: -1px; right: -1px; border-left: 0; border-bottom: 0; }
.archive figcaption {
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--ink-mute);
  letter-spacing: .02em;
}

/* Широкая архивная врезка: третий снимок во всю колонку */
.legend-wide { margin-top: var(--s-5); }
.legend-wide .archive img { aspect-ratio: 16 / 8; }

/* Легенда набрана по-журнальному: боковой колонтитул слева, текстовая
   колонка справа, первый абзац с буквицей. Ничего не центрируем:
   в печати текст выключен влево, и читать его так заметно легче. */
.legend-tale {
  display: grid;
  grid-template-columns: minmax(100px, 160px) minmax(0, 1fr);
  gap: clamp(20px, 3.5vw, 52px);
  margin: clamp(52px, 7vw, 88px) 0 0;
  padding-top: clamp(26px, 3.5vw, 40px);
  border-top: 1px solid var(--line);
}
.lt-kicker {
  font-family: 'Oswald', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--lamp);
  margin: 6px 0 0;
}
.lt-body { max-width: none; }
.lt-body p { color: var(--ink-body); max-width: none; }

/* Фото справа с обтеканием: текст обходит его, как в журнальной полосе */
.lt-photo {
  float: right;
  width: min(42%, 380px);
  margin: 4px 0 20px 32px;
  shape-outside: margin-box;
}
.lt-photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 2px;
}
.lt-photo figcaption {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-mute);
}
/* Сноска не должна залезать под фото */
.lt-note { clear: both; }

@media (max-width: 620px) {
  .lt-photo { float: none; width: 100%; margin: 0 0 20px; }
}

/* Буквица: классический журнальный приём, задаёт точку входа в текст */
.lt-first::first-letter {
  float: left;
  font-family: 'Oswald', sans-serif;
  font-size: 3.6em;
  line-height: .82;
  padding: 4px 12px 0 0;
  color: var(--lamp);
}
.lt-first::first-line { letter-spacing: .01em; }

.lt-note {
  margin-top: clamp(22px, 2.8vw, 30px);
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 15.5px;
  color: var(--ink-mute);
  font-style: italic;
}

@media (max-width: 720px) {
  .legend-tale { grid-template-columns: 1fr; gap: 14px; }
  .lt-kicker { margin-top: 0; }
}

/* Программа: всё содержимое слева, карусель справа во всю высоту секции.
   Карусель идёт первой в разметке и ставится во вторую колонку через
   grid-column, поэтому на мобильном она оказывается сверху, где и нужна. */
.pg-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}
.pg-head { grid-column: 1; }
.pg-aside {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: 96px;
}
.pg-main { min-width: 0; }

@media (max-width: 900px) {
  /* Одна колонка: карусель встаёт над текстом. Сбрасываем и колонку,
     и строку, иначе элемент остаётся во второй колонке несуществующей
     сетки и вылезает за край экрана. */
  .pg-wrap { grid-template-columns: minmax(0, 1fr); }
  .pg-head { grid-column: 1; grid-row: 2; }
  .pg-aside {
    grid-column: 1;
    grid-row: 1;
    position: static;
    width: 100%;
    max-width: none;
    margin-bottom: var(--s-4);
  }
}

/* ── Карусель у программы ──
   Слайды лежат друг на друге и сменяются прозрачностью: так высота блока
   не скачет при переключении, а текст программы слева не дёргается. */
.carousel {
  position: relative;
  /* max-width страхует от выхода за край, если родитель окажется шире
     экрана: в гриде элемент по умолчанию не сжимается меньше содержимого. */
  width: 100%;
  max-width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
}
/* Затемнение под полосками: на светлом кадре они иначе теряются.
   Полоски внизу, поэтому и градиент идёт снизу вверх. */
.carousel::before {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 70px;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(0deg, rgba(6, 9, 7, .72), transparent);
}
.slides {
  position: relative;
  width: 100%;
  /* Высоту задаём явно, а не через aspect-ratio: так раскладка не зависит
     от того, успел ли браузер вычислить пропорции контейнера. */
  height: 300px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-deep);
}
.slide {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity .5s ease, visibility .5s;
}
.slide.is-on { opacity: 1; visibility: visible; }

.slide-video video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 1;
}

/* Вертикальный ролик в горизонтальном слайде: показываем целиком,
   по бокам размытая копия кадра вместо чёрных полей. */
.slide-video.is-vertical video {
  width: auto;
  max-width: 100%;
  margin-inline: auto;
  object-fit: contain;
}
.slide-blur {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(26px) brightness(.45) saturate(.8);
  transform: scale(1.15);
  z-index: 0;
}
/* Подпись сидит над полосками, поэтому нижний отступ увеличен */
.slide-cap {
  position: absolute;
  inset: auto 0 0;
  z-index: 3;
  margin: 0;
  padding: 28px 16px 24px;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--ink-dim);
  background: linear-gradient(180deg, transparent, rgba(6, 9, 7, .92));
}

/* Текстовый слайд: крупный лозунг на тёмном поле */
.slide-quote {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(20px, 4vw, 36px);
  background:
    radial-gradient(ellipse 70% 90% at 78% 30%, rgba(232, 163, 61, .1), transparent 65%),
    var(--panel);
}
.slide-text {
  font-family: 'Oswald', sans-serif;
  font-weight: 500;
  font-size: clamp(22px, 3.4vw, 34px);
  line-height: 1.1;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0;
}
.slide-note {
  margin: 14px 0 0;
  font-size: 13.5px;
  color: var(--lamp);
}

/* Высота слайда фиксирована на каждом брейкпоинте: при узкой колонке
   полоса 16:9 превращалась в едва заметную ленту, куда не помещался ни
   кадр, ни текст лозунга. */
@media (min-width: 1100px) { .slides { height: 340px; } }
@media (max-width: 900px) { .slides { height: 380px; } }

/* Полоски-индикаторы поверх слайда, как в сторис */
.bars {
  position: absolute;
  inset: auto 10px 10px;
  z-index: 4;
  display: flex;
  gap: 5px;
}
.bar {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 3px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: rgba(230, 227, 218, .28);
  cursor: pointer;
  overflow: hidden;
  position: relative;
}
/* Заливка растёт слева направо, показывая, сколько осталось до перехода */
.bar-fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ink);
  border-radius: 2px;
}
/* Пройденные слайды залиты полностью */
.bar.is-done .bar-fill { width: 100%; }
/* Активный слайд: ширина анимируется через инлайновый transition из скрипта */
.bar.is-on .bar-fill { background: var(--lamp); }

/* ── Видео с маршрута ── */
.video-frame {
  margin: 0;
  position: relative;
  background: var(--bg-deep);
}
.video-frame video {
  width: 100%;
  aspect-ratio: 848 / 464;
  object-fit: cover;
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.video-frame figcaption {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-mute);
}
/* Кнопка запуска: пока видео не тронули, вместо него постер */
/* Кнопка накрывает слайд с видео целиком */
.video-play {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  border: 0;
  background: rgba(6, 9, 7, .25);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .25s, opacity .25s;
}
.video-play:hover { background: rgba(6, 9, 7, .12); }

/* Матовое стекло: полупрозрачный круг с размытием фона под ним */
.video-play span {
  width: 74px; height: 74px;
  border-radius: 50%;
  position: relative;
  background: rgba(230, 227, 218, .16);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  border: 1px solid rgba(230, 227, 218, .28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .25),
    0 10px 34px rgba(0, 0, 0, .45);
  transition: background .25s, transform .25s, border-color .25s;
}
.video-play:hover span {
  background: rgba(232, 163, 61, .22);
  border-color: rgba(232, 163, 61, .5);
  transform: scale(1.06);
}
.video-play span::after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-38%, -50%);
  border: 11px solid transparent;
  border-left-color: var(--ink);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .4));
  transition: border-left-color .25s;
}
.video-play:hover span::after { border-left-color: var(--lamp); }
/* Видео стартует само, поэтому кнопка видна только пока оно не играет
   (например, если браузер заблокировал автозапуск). */
.slide.is-playing .video-play,
.video-frame.is-playing .video-play { opacity: 0; pointer-events: none; }

/* Мобильные правила карусели идут ПОСЛЕ базовых: иначе базовые
   объявления ниже по файлу перебивают их при равной специфичности. */
@media (max-width: 560px) {
  .slides { height: 340px; }
  .slide-quote { padding: 22px 20px; }
  .slide-text { font-size: 26px; }
  .slide-note { font-size: 13px; margin-top: 12px; }
  .slide-cap { font-size: 12px; padding: 24px 14px 22px; }
  .video-play span { width: 62px; height: 62px; }
  .bars { inset: auto 8px 8px; gap: 4px; }
}

/* ── Автомотриса ── */
/* Круглое фото справа, текст обтекает его по дуге. shape-outside заставляет
   строки обходить именно окружность, а не прямоугольную рамку вокруг неё. */
.railcar-body { margin-top: var(--s-4); }
.railcar-body > p { max-width: none; }

.railcar-lead {
  font-size: clamp(19px, 2.2vw, 24px);
  color: var(--ink);
  line-height: 1.35;
  margin-bottom: 16px;
}
.railcar-body p { color: var(--ink-dim); }
.railcar-body .railcar-lead { color: var(--ink); }

/* Круглый кадр: уходим от острых углов и перекликаемся с формой фары */
.railcar-photo {
  float: right;
  /* Небольшой круг: текст обтекает его полностью, пустоты под фото нет. */
  width: clamp(110px, 14%, 155px);
  margin: 4px 0 14px 28px;
  shape-outside: circle(50% at 50% 50%);
  shape-margin: 16px;
  text-align: center;
}
.railcar-photo img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: center 40%;
  border-radius: 50%;
  border: 1px solid var(--line);
  /* Тёплое свечение по кромке: тот же «свет фонаря», что и в акценте.
     Пропорции подогнаны под уменьшенный круг. */
  box-shadow:
    0 0 0 5px rgba(20, 26, 22, .9),
    0 0 24px rgba(232, 163, 61, .18),
    0 10px 28px rgba(0, 0, 0, .5);
}
.railcar-photo figcaption {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--ink-mute);
}

/* На узком экране обтекание теряет смысл: фото встаёт по центру */
@media (max-width: 720px) {
  .railcar-photo {
    float: none;
    width: min(78%, 300px);
    margin: 0 auto var(--s-4);
    shape-outside: none;
  }
}
/* Таблица идёт во всю ширину, поэтому обтекание сбрасываем полностью:
   иначе первая ячейка залезет под круг. */
.railcar-body .railcar-facts { clear: both; margin-top: var(--s-4); }

/* Цифры в ряд: четыре ячейки с разделителями, как в справочной таблице.
   Компактнее длинного списка и читается одним взглядом. */
.railcar-facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.railcar-facts li {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 18px;
  border-left: 1px solid var(--line);
}
.railcar-facts li:first-child { border-left: 0; padding-left: 0; }

@media (max-width: 860px) {
  .railcar-facts { grid-template-columns: repeat(2, 1fr); }
  /* При двух колонках левая граница не нужна у первой ячейки каждой строки,
     а между рядами появляется горизонтальный разделитель. */
  .railcar-facts li:nth-child(odd) { border-left: 0; padding-left: 0; }
  .railcar-facts li:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 520px) {
  .railcar-facts { grid-template-columns: 1fr; }
  .railcar-facts li { border-left: 0; padding-left: 0; }
  .railcar-facts li + li { border-top: 1px solid var(--line); }
}
/* Это главные цифры секции: они должны быть крупнее цен и дат,
   иначе иерархия акцентов на странице переворачивается. */
.rf-num {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(36px, 4.4vw, 52px);
  line-height: 1;
  color: var(--lamp);
  font-variant-numeric: tabular-nums;
}
.rf-text {
  color: var(--ink-dim);
  font-size: 14px;
  line-height: 1.4;
}

@media (max-width: 520px) {
  /* В одну колонку возвращаем горизонтальную раскладку: так строка
     не растягивается на две высоты ради одной цифры. */
  .railcar-facts li { flex-direction: row; align-items: baseline; gap: 14px; }
  .rf-num { min-width: 62px; font-size: 34px; }
}


/* ── Программа ── */
.timeline { list-style: none; margin: var(--s-4) 0 var(--s-3); padding: 0; }
.timeline li {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 20px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.timeline li:last-child { border-bottom: 1px solid var(--line); }
.t-time {
  font-family: 'Oswald', sans-serif;
  font-size: 19px;
  color: var(--lamp);
  font-variant-numeric: tabular-nums;
  padding-top: 1px;
}
.t-body p { color: var(--ink-dim); margin: 0; max-width: var(--measure); }
@media (max-width: 620px) {
  .timeline li { grid-template-columns: 1fr; gap: 4px; }
}

/* ── Переключатель программ ── */
.progswitch {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
  margin: var(--s-4) 0 var(--s-4);
  max-width: 640px;
}
.pg-btn {
  /* -webkit-appearance обязателен: на iOS без него кнопка получает
     системный светлый фон, и на тёмном сайте появляются белые плашки. */
  -webkit--webkit-appearance: none;appearance: none;
  -webkit-appearance: none;
  appearance: none;
  background: var(--panel);
  background-image: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink-dim);
  padding: 16px 20px;
  font: inherit;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 64px;
  transition: border-color .2s, background .2s, color .2s;
}
.pg-btn:hover { border-color: var(--fog); }
.pg-btn.is-on {
  border-color: var(--lamp);
  background: var(--panel-2);
  color: var(--ink);
}
.pg-name { font-family: 'Oswald', sans-serif; font-size: 17px; }
.pg-price {
  font-family: 'Oswald', sans-serif;
  font-size: 20px;
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
  transition: color .2s;
}
.pg-btn.is-on .pg-price { color: var(--lamp); }

.progpane[hidden] { display: none; }
.pg-lead { margin-bottom: var(--s-3); max-width: var(--measure); }
.pg-lead p { color: var(--ink-body); }
.pg-meta {
  font-family: 'Oswald', sans-serif;
  font-size: 15px;
  letter-spacing: .04em;
  color: var(--lamp);
  margin-bottom: 0;
}
.progpane .ticks { margin-top: var(--s-3); }

/* Кнопка записи прямо под программой: гость выбрал формат, прочитал
   расписание и сразу видит, куда идти дальше. */
.pg-cta {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: var(--s-4);
  padding-top: var(--s-3);
  border-top: 1px solid var(--line);
}
.pg-cta-note { color: var(--ink-mute); font-size: 14px; max-width: 42ch; }

/* На телефоне кнопка и пояснение встают в столбик с воздухом между ними,
   иначе текст читается как продолжение кнопки. */
@media (max-width: 620px) {
  .pg-cta { flex-direction: column; align-items: stretch; gap: 14px; }
  .pg-cta .btn { width: 100%; text-align: center; }
  .pg-cta-note { max-width: none; text-align: center; }
}

/* ── Бронирование ── */
.booking { background: var(--bg-deep); position: relative; overflow: hidden; }

.datestrip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(150px, 1fr);
  gap: 12px;
  margin: 30px 0 22px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}
@media (max-width: 900px) {
  .datestrip { grid-auto-flow: row; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); overflow-x: visible; }
}

.datecard {
  -webkit-appearance: none;
  appearance: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  padding: 18px 12px 14px;
  text-align: center;
  cursor: pointer;
  font: inherit;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: border-color .2s, background .2s, transform .15s;
}
.datecard:hover { border-color: var(--fog); }
.datecard[aria-pressed="true"] { border-color: var(--lamp); background: var(--panel-2); }
.d-day {
  font-family: 'Oswald', sans-serif;
  font-size: 38px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.d-month { font-size: 16px; }
.d-week {
  font-size: 12.5px;
  color: var(--ink-mute);
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.d-state { font-size: 13.5px; color: var(--ink-dim); }
.datecard.is-low .d-state { color: var(--lamp); }


/* Распроданная дата не выключена: она ведёт в лист ожидания */
.datecard.is-sold { opacity: .62; }
.datecard.is-sold .d-day { text-decoration: line-through; }
.datecard.is-sold:hover { border-color: var(--fog); opacity: .8; }
.d-wait {
  font-size: 11.5px;
  line-height: 1.3;
  color: var(--fog);
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}
.datecard.is-hidden { display: none; }

/* ── Шаги формы ── */
.steps { margin-top: var(--s-4); }
.step {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  margin-bottom: 10px;
  overflow: hidden;
}
.step.is-open { border-color: var(--fog); }
.step.is-done .step-n { background: var(--lamp); color: #0B0F0D; border-color: var(--lamp); }

.step-head {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  background: none;
  border: 0;
  color: var(--ink);
  font: inherit;
  text-align: left;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}
.step.is-open .step-head { cursor: default; }
.step-n {
  flex: none;
  width: 28px; height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: 'Oswald', sans-serif;
  font-size: 14px;
  color: var(--ink-dim);
  transition: background .2s, color .2s, border-color .2s;
}
.step-title {
  font-family: 'Oswald', sans-serif;
  font-size: 17px;
  letter-spacing: .02em;
  flex: none;
}
.step-sum {
  color: var(--ink-dim);
  font-size: 14.5px;
  margin-left: auto;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.step-edit {
  flex: none;
  color: var(--lamp);
  font-size: 13.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
  display: none;
}
.step.is-done:not(.is-open) .step-edit { display: inline; }
.step.is-open .step-sum { display: none; }

.step-body { display: none; padding: 0 18px 20px; }
.step.is-open .step-body { display: block; }
.step-note { color: var(--ink-mute); font-size: 13.5px; margin: 14px 0 0; }
/* Отбиваем кнопку от блока счётчиков, иначе она липнет к рамке */
.step-next { margin-top: var(--s-4); }
.step-next .btn { min-width: 180px; }
@media (max-width: 620px) {
  .step-next { margin-top: var(--s-3); }
  .step-next .btn { width: 100%; }
}

@media (max-width: 560px) {
  .step-head { gap: 10px; padding: 14px 14px; }
  .step-title { font-size: 15.5px; }
  .step-sum { font-size: 13px; }
  .step-body { padding: 0 14px 18px; }
}

/* ── Карточки формата ── */
.prodcards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.pc { cursor: pointer; display: block; }
.pc input { position: absolute; opacity: 0; pointer-events: none; }
.pc-face {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  height: 100%;
  transition: border-color .2s, background .2s;
}
.pc input:checked + .pc-face { border-color: var(--lamp); background: var(--panel-2); }
.pc input:focus-visible + .pc-face { outline: 2px solid var(--lamp); outline-offset: 2px; }
.pc.is-blocked { cursor: default; }
.pc.is-blocked .pc-face { opacity: .75; border-style: dashed; }
.pc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.pc-name { font-family: 'Oswald', sans-serif; font-size: 17px; color: var(--ink); }
.pc-price {
  font-family: 'Oswald', sans-serif;
  font-size: 22px;
  color: var(--lamp);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pc-price em { font-style: normal; font-size: 14px; color: var(--ink-dim); }
.pc-sub { font-size: 14px; color: var(--ink-dim); }
.pc-desc { font-size: 14px; color: var(--ink-mute); line-height: 1.45; }
.pc-block {
  font-size: 14px;
  color: var(--lamp);
  line-height: 1.45;
  padding-top: 10px;
  margin-top: 4px;
  border-top: 1px solid var(--line);
}
.pc-block button {
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: 0;
  color: var(--lamp);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 0;
  margin-top: 6px;
  display: block;
}

/* ── Липкая панель итога ── */
.totalbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-top: 14px;
}
.tb-left { min-width: 0; }
.tb-sum { margin: 0; font-size: 17px; color: var(--ink-dim); }
.tb-sum b {
  font-family: 'Oswald', sans-serif;
  font-size: 32px;
  color: var(--lamp);
  font-variant-numeric: tabular-nums;
  margin: 0 4px;
}
.tb-detail { margin: 2px 0 0; font-size: 13.5px; color: var(--ink-mute); }
.btn-pay { min-width: 210px; }

@media (max-width: 720px) {
  /* На телефоне итог всегда перед глазами */
  .totalbar {
    position: fixed;
    inset: auto 0 0;
    z-index: 30;
    margin: 0;
    border-radius: 0;
    border-left: 0; border-right: 0; border-bottom: 0;
    background: rgba(20, 26, 22, .97);
    backdrop-filter: blur(10px);
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    flex-wrap: nowrap;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, .5);
  }
  .totalbar[hidden] { display: none; }
  .tb-sum { font-size: 14px; }
  .tb-sum b { font-size: 24px; }
  .btn-pay { min-width: 0; flex: 0 0 auto; padding: 13px 22px; }
  /* Чтобы панель не перекрывала последний блок формы */
  .booking { padding-bottom: 120px; }
}

.empty-dates {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  margin-top: 26px;
  max-width: 560px;
}
.subscribe { display: flex; gap: 10px; flex-wrap: wrap; }
.subscribe input {
  flex: 1 1 200px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  padding: 12px 14px;
  font: inherit;
}

/* Тело формы: скрывается целиком, когда даты сезона ещё не открыты */
.booking-body { display: grid; gap: 12px; }
.booking-body[hidden] { display: none; }

/* Переключатель формата */
.prodswitch {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.ps-item { cursor: pointer; }
.ps-item input { position: absolute; opacity: 0; pointer-events: none; }
.ps-face {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  transition: border-color .2s, background .2s;
}
.ps-item input:checked + .ps-face { border-color: var(--lamp); background: var(--panel-2); }
.ps-item input:focus-visible + .ps-face { outline: 2px solid var(--lamp); outline-offset: 2px; }
.ps-name { font-size: 17px; }
.ps-price { color: var(--lamp); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Счётчики */
.counters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.counter { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.c-label { display: flex; flex-direction: column; font-size: 16.5px; }
.c-label em { font-style: normal; font-size: 13px; color: var(--ink-mute); }
.c-controls { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); }
.c-controls button {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--ink);
  width: 40px; height: 40px;
  font-size: 20px;
  cursor: pointer;
  transition: color .2s, background .2s;
}
.c-controls button:hover { color: var(--lamp); background: rgba(232, 163, 61, .08); }
.c-controls output {
  min-width: 42px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  border-inline: 1px solid var(--line);
  padding: 8px 0;
}

/* Форма заказа */
.order { margin-top: 12px; }
/* Поля в столбик: ряд из трёх на мобильном всё равно ломается,
   а на десктопе провоцирует ошибки при переходе по табуляции. */
.fields {
  display: grid;
  gap: 14px;
  margin-bottom: 4px;
  max-width: 460px;
}
.fields label { display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; color: var(--ink-dim); }
.fields input {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  padding: 13px 15px;
  font: inherit;
  font-size: 16px;
  transition: border-color .2s;
}
.fields input:focus { border-color: var(--lamp); outline: none; }

.total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px;
}
.total { margin: 0; font-size: 20px; }
.total b {
  font-family: 'Oswald', sans-serif;
  font-size: 38px;
  color: var(--lamp);
  font-variant-numeric: tabular-nums;
  margin: 0 4px 0 8px;
}
.total span { color: var(--ink-dim); font-size: 16px; }
@media (min-width: 721px) { .btn-pay { min-width: 220px; } }
.paynote { margin: 12px 0 0; font-size: 14px; color: var(--ink-mute); }
.formerror { margin: 12px 0 0; color: #E07A5F; font-size: 15px; }

/* ── Экран после отправки заявки ── */
.success-box {
  background: var(--panel);
  border: 1px solid var(--lamp);
  border-radius: var(--radius);
  padding: clamp(22px, 3.5vw, 34px);
}
.su-title {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(24px, 3.4vw, 32px);
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 14px;
}
.su-line { color: var(--ink); font-size: 17px; margin: 4px 0; }
.su-people { color: var(--ink-dim); }
.su-id {
  margin: 16px 0;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: var(--radius);
  font-size: 15px;
  color: var(--ink-dim);
}
.su-id b { color: var(--lamp); font-family: 'Oswald', sans-serif; font-size: 18px; letter-spacing: .04em; }
.su-next { margin: 18px 0; }
.su-next-title {
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 8px;
}
.su-next ol { margin: 0; padding-left: 20px; }
.su-next li { color: var(--ink-dim); margin: 7px 0; }
.su-mail { color: var(--ink-mute); font-size: 14px; margin: 16px 0 0; }

/* Подсказка под полем: объясняет, зачем мы спрашиваем */
.field-hint {
  font-style: normal;
  font-size: 12.5px;
  color: var(--ink-mute);
  line-height: 1.4;
}

/* ── Модальное окно (лист ожидания) ── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(6, 9, 7, .78);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal[hidden] { display: none; }
.modal-inner {
  width: min(100%, 460px);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
  animation: modal-in .2s ease-out;
}
@keyframes modal-in { from { transform: translateY(14px); opacity: .5; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .modal-inner { animation: none; } }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  font-family: 'Oswald', sans-serif;
  font-size: 17px;
  color: var(--ink);
}
.modal-close {
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: 0;
  color: var(--ink-dim);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.modal-body { padding: 18px 20px 22px; overflow-y: auto; }
.modal-lead { color: var(--ink); margin: 0 0 10px; }
.modal-note { color: var(--ink-dim); font-size: 14.5px; margin: 0 0 18px; }
.modal-body label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--ink-dim);
  margin-bottom: 12px;
}
.modal-body input {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  padding: 13px 15px;
  font: inherit;
  font-size: 16px;
}
.modal-body input:focus { border-color: var(--lamp); outline: none; }
.modal-fine { color: var(--ink-mute); font-size: 13px; margin: 12px 0 0; text-align: center; }
.modal-done { text-align: center; padding: 10px 0; }
.modal-done h4 {
  font-family: 'Oswald', sans-serif;
  font-size: 20px;
  color: var(--ink);
  margin: 0 0 10px;
}
.modal-dates { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 16px; }
.modal-dates button {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border: 1px solid var(--lamp);
  border-radius: var(--radius);
  color: var(--lamp);
  padding: 10px 18px;
  font: inherit;
  font-size: 14.5px;
  cursor: pointer;
}

/* На телефоне окно выезжает снизу: привычнее и не спорит с клавиатурой */
@media (max-width: 560px) {
  .modal { align-items: flex-end; padding: 0; }
  .modal-inner {
    width: 100%;
    max-height: 92dvh;
    border-radius: 12px 12px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}

/* Силуэт по низу блока бронирования */
.silhouette {
  position: absolute;
  inset: auto 0 0;
  height: 132px;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 100% at 50% 100%, rgba(143, 163, 154, .16), transparent 70%),
    url('/img/silhouette.svg') repeat-x bottom center / auto 132px;
  opacity: .85;
}

/* ── FAQ ── */
/* Две колонки: вопросы распределяются по ним, как в журнальной вёрстке,
   и правая половина полосы перестаёт пустовать. */
.faq {
  margin-top: var(--s-4);
  columns: 2;
  column-gap: clamp(28px, 4vw, 56px);
}
.faq details {
  border-top: 1px solid var(--line);
  break-inside: avoid;
  page-break-inside: avoid;
}
.faq details:last-child { border-bottom: 1px solid var(--line); }
@media (max-width: 860px) {
  .faq { columns: 1; }
}
.faq summary {
  cursor: pointer;
  padding: 18px 34px 18px 0;
  font-size: 17.5px;
  line-height: 1.35;
  position: relative;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  color: var(--lamp);
  font-size: 22px;
  transition: transform .2s;
}
.faq details[open] summary::after { content: '\2212'; }
.faq details p { color: var(--ink-dim); margin: 0 0 20px; max-width: var(--measure); }

/* ── Как добраться ── */
.road-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  margin-top: var(--s-4);
}
@media (max-width: 820px) { .road-grid { grid-template-columns: 1fr; } }
.road-grid h3 { margin-top: 22px; }
.road-grid h3:first-child { margin-top: 0; }
.road-grid p { color: var(--ink-dim); max-width: var(--measure); }

.mapbox {
  position: relative;
  min-height: 320px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.mapbox iframe { width: 100%; height: 100%; border: 0; position: absolute; inset: 0; }
.maploading { color: var(--ink-mute); font-size: 15px; }

/* Подстраховка: если встроенная тёмная схема API не применится,
   приглушаем сами тайлы. Метка, балун и кнопки лежат в других слоях
   и фильтром не задеваются. */
.mapbox.is-dimmed [class*="-ground-pane"] {
  filter: brightness(.72) saturate(.8) contrast(1.08);
}
/* Подписи на карте после затемнения читаются хуже, добавляем им контраста */
.mapbox.is-dimmed [class*="-places-pane"] {
  filter: brightness(1.15);
}
.mapfail { text-align: center; padding: 20px; }
.mapfail p { color: var(--ink-mute); margin-bottom: 14px; }
/* Балуны и элементы Яндекс Карт светлые: не даём им спорить с тёмной темой */
.mapbox .ymaps-2-1-79-balloon__content,
.mapbox [class*="balloon__content"] { font-family: 'PT Serif', Georgia, serif; }

/* ── Футер ── */
.footer { background: var(--bg-deep); border-top: 1px solid var(--line); padding: 56px 0 30px; }
.foot-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: var(--gap);
}
@media (max-width: 820px) { .foot-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); } }
.foot-brand { font-size: 21px; letter-spacing: .01em; margin-bottom: 8px; color: var(--ink); }
.foot-sub { color: var(--ink-mute); font-size: 14.5px; max-width: 30ch; }
.foot-title {
  font-family: 'Oswald', sans-serif;
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 10px;
}
.footer p { margin: 0 0 8px; font-size: 15px; }
.footer a { color: var(--ink-dim); text-decoration: none; transition: color .2s; }
.footer a:hover { color: var(--lamp); }
.foot-legal {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--ink-mute);
  font-size: 13.5px;
}

/* ── Страницы благодарности ── */
.page-plain { display: grid; place-items: center; min-height: 100vh; }
.thanks { padding: 60px 0; text-align: center; }
.thanks h1 { font-size: clamp(34px, 6vw, 60px); }
.thanks p { color: var(--ink-dim); max-width: var(--measure); margin-inline: auto; }
.thanks-sub { color: var(--ink); font-size: 19px; }
.thanks-note { color: var(--ink-mute); font-size: 15px; margin-bottom: 26px; }

/* ── Юридические страницы ── */
.page-doc { padding: 60px 0; }
.doc-page h1 {
  font-size: clamp(28px, 4.6vw, 48px);
  margin-bottom: 24px;
}
.doc-page .eyebrow a { color: var(--lamp); text-decoration: none; }
.doc-page .eyebrow a:hover { text-decoration: underline; }
.doc-body { max-width: var(--measure); }
.doc-body p { color: var(--ink-dim); margin-bottom: 16px; }
.doc-body a { color: var(--lamp); }

/* ── Ассистент ── */
.assistant { position: fixed; right: 20px; bottom: 20px; z-index: 60; }
.assist-toggle {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--lamp);
  color: #0B0F0D;
  border: 0;
  border-radius: 40px;
  padding: 12px 22px;
  font-family: 'Oswald', sans-serif;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .5);
}
/* Значок собеседника: сразу видно, что это разговор, а не форма */
.at-icon {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #0B0F0D;
  position: relative;
  flex: none;
}
.at-icon::after {
  content: '';
  position: absolute;
  left: 4px; bottom: -3px;
  border: 4px solid transparent;
  border-top-color: #0B0F0D;
}

.ah-who { display: flex; align-items: center; gap: 11px; min-width: 0; }
.ah-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  flex: none;
  background: radial-gradient(circle at 50% 38%, var(--lamp) 0 34%, transparent 36%),
              var(--panel-2);
  border: 1px solid var(--line);
}
.ah-name { display: flex; flex-direction: column; min-width: 0; }
.ah-name strong {
  font-family: 'Oswald', sans-serif;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: .03em;
  color: var(--ink);
}
.ah-name em {
  font-style: normal;
  font-size: 12.5px;
  color: var(--fog);
}
.assist-panel {
  position: absolute;
  right: 0; bottom: 58px;
  width: min(92vw, 360px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .6);
  display: flex;
  flex-direction: column;
  max-height: min(70vh, 520px);
}
/* Явный display выше перебивает атрибут hidden, поэтому гасим отдельно.
   Без этого правила панель висит открытой при загрузке страницы. */
.assist-panel[hidden] { display: none; }
.assist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.assist-head p { margin: 0; font-family: 'Oswald', sans-serif; font-size: 15px; letter-spacing: .04em; }
.assist-close {
  -webkit-appearance: none;
  appearance: none; background: none; border: 0; color: var(--ink-dim);
  font-size: 22px; cursor: pointer; line-height: 1;
}
.assist-log { padding: 14px 16px; overflow-y: auto; flex: 1; font-size: 15.5px; }
.assist-hello { color: var(--ink-mute); font-size: 14.5px; }
.assist-msg { margin-bottom: 12px; }
.assist-msg.user { color: var(--ink); text-align: right; }
.assist-msg.user b { display: block; font-size: 12px; color: var(--ink-mute); }
.assist-msg.bot { color: var(--ink-dim); }
/* Ссылки, телефоны и почта в ответах ассистента: кликабельные и заметные */
.assist-link {
  color: var(--lamp);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  word-break: break-word;
}
.assist-link:hover { color: #F0B155; }
.assist-form { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.assist-form input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
  font-size: 15px;
}
.assist-form button {
  -webkit-appearance: none;
  appearance: none;
  background: var(--lamp);
  color: #0B0F0D;
  border: 0;
  border-radius: var(--radius);
  width: 42px;
  font-size: 18px;
  cursor: pointer;
}
@media (max-width: 520px) {
  .assistant { right: 12px; bottom: 12px; }
}

/* Липкая панель итога и кнопка ассистента живут в одном углу экрана.
   Разводим их: ассистент уходит влево и превращается в компактный кружок,
   чтобы не соперничать с кнопкой заявки за внимание и место. */
@media (max-width: 720px) {
  .assistant { left: 14px; right: auto; bottom: 92px; }
  .assist-toggle { padding: 12px 14px; }
  .at-text { display: none; }
  .at-icon { width: 22px; height: 22px; }
  .assist-panel { left: 0; right: auto; }
}
