/* ============================================================
   v5 — v1 как основа + шапка/запись/контакты из v2 и форматы из v4.
   Стили относятся только к новым блокам, чтобы не ломать
   типографику и сетку исходной вёрстки v1.
   ============================================================ */

:root {
  --stone: #e8e6df;
  --stone-2: #f1efe8;
  --pine: #23403a;
  --pine-deep: #1a302b;

  --ink: #1a2624;
  --ink-2: #3d4c48;
  --moss: #5b6b64;
  --brass: #a26e33;

  --line: rgba(26, 38, 36, .16);
  --line-soft: rgba(26, 38, 36, .09);
  --line-light: rgba(232, 230, 223, .22);

  --pad: clamp(20px, 4.4vw, 64px);
  --shell: 1400px;
  --header-h: 92px;

  --font-display: "Cormorant Garamond", "Times New Roman", serif;
  --font-text: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
}

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

/* у исходной вёрстки html/body имели height:100%, из-за этого
   липкая шапка переставала липнуть — возвращаем естественную высоту */
html,
body { height: auto; }

body { min-height: 100%; background: var(--stone); }

/* новые блоки считают размеры одинаково с v2/v4 */
.site-header,
.site-header *,
.menu,
.menu *,
.section.formats,
.section.formats *,
.booking,
.booking *,
.footer,
.footer *,
.floating-booking,
.floating-booking *,
.skip {
  box-sizing: border-box;
}

.site-header,
.menu,
.section.formats,
.booking,
.footer,
.floating-booking {
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.62;
}

:where(.site-header, .menu, .section.formats, .booking, .footer, .floating-booking) a {
  color: inherit;
  text-decoration: none;
}

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--pine);
  color: var(--stone);
  padding: 12px 20px;
}

.skip:focus { left: 12px; top: 12px; }

/* ---------- типографика новых блоков ---------- */

.h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(30px, 3.6vw, 52px);
  line-height: 1.06;
  letter-spacing: -.012em;
  text-wrap: balance;
}

.lead {
  font-size: clamp(18px, 1.55vw, 22px);
  line-height: 1.5;
  color: var(--ink);
  max-width: 42ch;
}

.body-text {
  font-size: 17px;
  line-height: 1.62;
  color: var(--ink-2);
  max-width: 56ch;
}

.body-text + .body-text { margin-top: 16px; }

/* ---------- кнопки и ссылки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 30px;
  border-radius: 2px;
  background: var(--pine);
  color: var(--stone);
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: .005em;
  transition: background-color .25s ease, color .25s ease;
}

.btn:hover { background: var(--pine-deep); }

.btn--wide { width: 100%; }

.link-quiet {
  display: inline-block;
  font-size: 15px;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: color .2s ease, border-color .2s ease;
}

.link-quiet:hover { color: var(--ink); border-color: var(--ink); }

/* ============================================================
   ШАПКА (v2)
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  color: var(--ink);
  background: var(--stone);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease;
}

.site-header.is-scrolled { border-bottom-color: var(--line-soft); }

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 32px;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--pad);
  height: var(--header-h);
}

.site-header__name {
  font-family: var(--font-display);
  font-size: 23px;
  line-height: 1;
  letter-spacing: -.005em;
  white-space: nowrap;
}

.site-header__nav {
  display: flex;
  gap: 26px;
  margin-left: auto;
}

.site-header__nav a {
  font-size: 14px;
  color: var(--ink-2);
  position: relative;
  padding-bottom: 3px;
  transition: color .2s ease;
}

.site-header__nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--brass);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .28s cubic-bezier(.3, .7, .3, 1);
}

.site-header__nav a:hover { color: var(--ink); }
.site-header__nav a.is-active { color: var(--ink); }
.site-header__nav a.is-active::after { transform: scaleX(1); }

.site-header__cta {
  font-size: 14px;
  padding: 11px 20px;
  border: 1px solid var(--pine);
  border-radius: 2px;
  transition: background-color .22s ease, color .22s ease;
}

.site-header__cta:hover {
  background: var(--pine);
  color: var(--stone);
}

.burger { display: none; }

/* ---------- мобильное меню (v2) ---------- */

.menu {
  position: fixed;
  inset: 0;
  z-index: 100;
  color: var(--ink);
  background: var(--stone);
  overflow-y: auto;
}

.menu[hidden] { display: none; }

.menu__inner {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 20px var(--pad) 40px;
}

.menu__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line-soft);
}

.menu__name {
  font-family: var(--font-display);
  font-size: 21px;
}

.menu__close { color: var(--ink-2); line-height: 0; }

.menu__nav {
  display: flex;
  flex-direction: column;
  margin-top: 32px;
}

.menu__nav a {
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1.2;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}

.menu__cta { margin-top: 40px; }

/* ============================================================
   ОБЩИЕ СЕКЦИИ (v4)
   ============================================================ */

.section {
  max-width: var(--shell);
  margin: 0 auto;
  padding: clamp(64px, 7.5vw, 120px) var(--pad);
}

.section.formats { color: var(--ink); }

.rail-layout {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(28px, 5vw, 96px);
  align-items: start;
}

.rail { position: sticky; top: calc(var(--header-h) + 40px); }

.rail__note {
  margin-top: 22px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--moss);
  max-width: 30ch;
}

.rail__content { min-width: 0; }

/* ---------- форматы (v4) ---------- */

.formats__title { margin-bottom: clamp(32px, 4vw, 56px); }

.tariff { border-top: 1px solid var(--line); }

.tariff__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 24px clamp(24px, 4vw, 64px);
  padding: 38px 0;
  border-bottom: 1px solid var(--line);
}

.tariff__name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(26px, 2.9vw, 40px);
  line-height: 1.1;
  letter-spacing: -.012em;
}

.tariff__meta {
  margin-top: 6px;
  font-size: 14px;
  color: var(--moss);
}

.tariff__price {
  font-family: var(--font-display);
  font-size: clamp(24px, 2.2vw, 32px);
  line-height: 1;
  color: var(--brass);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.tariff__price span { font-size: .7em; }

.tariff__link {
  font-size: 14px;
  padding: 12px 22px;
  border: 1px solid var(--line);
  border-radius: 2px;
  white-space: nowrap;
  transition: background-color .22s ease, color .22s ease, border-color .22s ease;
}

.tariff__link:hover {
  background: var(--pine);
  border-color: var(--pine);
  color: var(--stone);
}

.formats__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px 40px;
  margin-top: 28px;
}

.formats__foot p {
  font-size: 14px;
  color: var(--ink-2);
  max-width: 62ch;
}

/* ============================================================
   ЗАПИСЬ (v2)
   ============================================================ */

.booking {
  background: var(--pine);
  color: var(--stone);
  max-width: none;
}

.booking__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(40px, 6vw, 96px);
  max-width: calc(var(--shell) - var(--pad) * 2);
  margin: 0 auto;
  align-items: start;
}

.booking__title {
  color: var(--stone);
  max-width: 14ch;
}

.steps {
  margin-top: 36px;
  counter-reset: step;
  border-top: 1px solid var(--line-light);
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line-light);
  font-size: 15px;
  line-height: 1.5;
  color: rgba(232, 230, 223, .82);
}

.steps li::before {
  content: counter(step);
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.35;
  color: var(--brass);
}

.booking__intro {
  display: flex;
  flex-direction: column;
  align-self: stretch;
}

.booking__alt {
  margin-top: auto;
  padding-top: 28px;
  font-size: 14px;
  color: rgba(232, 230, 223, .66);
}

.booking__alt a {
  color: var(--stone);
  border-bottom: 1px solid var(--line-light);
  transition: border-color .2s ease;
}

.booking__alt a:hover { border-color: var(--stone); }

/* ---------- форма (v2) ---------- */

.form__group {
  border: 0;
  padding: 0;
  margin: 0 0 26px;
}

.form__legend {
  padding: 0;
  margin-bottom: 12px;
  font-size: 13px;
  color: rgba(232, 230, 223, .55);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  position: relative;
  display: inline-flex;
}

.chip input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.chip span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  font-size: 14px;
  color: rgba(232, 230, 223, .78);
  border: 1px solid var(--line-light);
  border-radius: 2px;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.chip span:hover { border-color: rgba(232, 230, 223, .45); }

.chip input:checked + span {
  background: var(--stone);
  border-color: var(--stone);
  color: var(--pine);
}

.chip input:focus-visible + span {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}

.form__fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px 20px;
  margin-top: 6px;
}

.field { display: block; }

.field--wide { grid-column: 1 / -1; }

.field__label {
  display: block;
  font-size: 13px;
  color: rgba(232, 230, 223, .55);
  margin-bottom: 6px;
}

.field input,
.field textarea {
  display: block;
  width: 100%;
  padding: 8px 0;
  font-size: 17px;
  line-height: 1.4;
  color: var(--stone);
  border-bottom: 1px solid var(--line-light);
  resize: vertical;
  transition: border-color .2s ease;
}

.field input:focus,
.field textarea:focus { border-color: var(--stone); }

.field.has-error input,
.field.has-error textarea { border-color: #d08a72; }

.field.has-error .field__label { color: #d9a292; }

.field__hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.35;
  color: rgba(232, 230, 223, .45);
}

.field.has-error .field__hint { color: #d9a292; }

.form__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.consents {
  margin-top: 26px;
  display: grid;
  gap: 10px;
}

.consent {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(232, 230, 223, .62);
  cursor: pointer;
}

.consent input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.consent__box {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 1px solid var(--line-light);
  border-radius: 2px;
  position: relative;
  transition: background-color .2s ease, border-color .2s ease;
}

.consent input:checked + .consent__box {
  background: var(--stone);
  border-color: var(--stone);
}

.consent input:checked + .consent__box::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 4px;
  height: 9px;
  border: solid var(--pine);
  border-width: 0 1.6px 1.6px 0;
  transform: rotate(42deg);
}

.consent input:focus-visible + .consent__box {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

.consent a {
  color: var(--stone);
  border-bottom: 1px solid var(--line-light);
}

.consent.has-error .consent__box { border-color: #d08a72; }

.form .btn {
  margin-top: 26px;
  background: var(--stone);
  color: var(--pine);
}

.form .btn:hover { background: #fff; }

.form .btn:disabled { opacity: .55; cursor: default; }

.form__status {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(232, 230, 223, .82);
}

.form__status:empty { display: none; }

.form__status.is-error { color: #e6b1a0; }

/* ============================================================
   КОНТАКТЫ (v2), тот же цвет, что у блока записи
   ============================================================ */

.footer {
  background: var(--pine);
  color: rgba(232, 230, 223, .78);
  padding: clamp(40px, 4.5vw, 64px) var(--pad) clamp(28px, 3vw, 40px);
}

.footer__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
  max-width: calc(var(--shell) - var(--pad) * 2);
  margin: 0 auto;
  align-items: start;
}

.footer__name {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -.01em;
  color: var(--stone);
}

.footer__role {
  margin-top: 4px;
  font-size: 13px;
}

.footer__col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

.footer__col--row { flex-direction: row; gap: 20px; flex-wrap: wrap; }

.footer__col--legal { font-size: 13px; }

.footer__link:hover,
.footer__soc:hover,
.footer__col--legal a:hover { color: var(--stone); }

/* ============================================================
   ПЛАВАЮЩАЯ ЗАПИСЬ (v4)
   ============================================================ */

.floating-booking {
  position: fixed;
  right: clamp(20px, 6vw, 88px);
  bottom: 24px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 188px;
  min-height: 62px;
  padding: 8px 22px 9px;
  border: 1px solid var(--brass);
  border-radius: 2px;
  background: var(--brass);
  color: var(--stone);
  box-shadow: 0 10px 28px rgba(26, 38, 36, .24);
  transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.floating-booking[hidden] { display: none; }

.floating-booking__label { font-size: 16px; line-height: 1.25; }

.floating-booking__hint {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.2;
  color: rgba(232, 230, 223, .82);
}

.floating-booking:hover {
  border-color: var(--pine-deep);
  background: var(--pine-deep);
  box-shadow: 0 12px 32px rgba(26, 38, 36, .3);
}

/* плавающая кнопка из v4 скрыта по просьбе владельца;
   разметка и поведение сохранены, чтобы её можно было вернуть */
.floating-booking { display: none !important; }

/* ============================================================
   АДАПТИВ (v2/v4)
   ============================================================ */

@media (max-width: 1180px) {
  .site-header__nav { gap: 18px; }
  .site-header__nav a { font-size: 13px; }
}

@media (max-width: 980px) {
  :root { --header-h: 76px; }

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

  .site-header__nav,
  .site-header__cta { display: none; }

  .burger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 40px;
    height: 40px;
    margin-left: auto;
    color: var(--ink);
  }

  .burger span {
    display: block;
    width: 22px;
    height: 1.5px;
    background: currentColor;
  }

  .rail-layout { grid-template-columns: 1fr; gap: 28px; }

  .rail { position: static; }

  .rail__note { margin-top: 14px; max-width: 46ch; }

  .booking__grid { grid-template-columns: 1fr; gap: 40px; }

  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px 32px;
  }
}

@media (max-width: 720px) {
  .tariff__row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "name price"
      "meta meta"
      "link link";
    gap: 10px 16px;
    padding: 24px 0;
  }

  .tariff__main { display: contents; }
  .tariff__name { grid-area: name; }
  .tariff__price { grid-area: price; align-self: start; }
  .tariff__meta { grid-area: meta; margin-top: 0; }

  .tariff__link {
    grid-area: link;
    justify-self: start;
    margin-top: 4px;
  }

  .form__fields { grid-template-columns: 1fr; gap: 18px; }

  .chips { gap: 6px; }

  .chip span { min-height: 42px; padding: 0 14px; font-size: 13px; }

  .footer__grid { grid-template-columns: 1fr; gap: 22px; }

  .floating-booking {
    bottom: max(54px, calc(env(safe-area-inset-bottom) + 54px));
    left: 20px;
    right: 20px;
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}
