/* ==========================================================================
   СтройЭкоДом — дизайн-система «премиум-эко»
   Глубокий зелёный (природа, надёжность) + тёплое дерево (бронза, уют).
   Три состояния темы: светлая по умолчанию, системная тёмная, ручной выбор.
   ========================================================================== */

/* --- 1. Токены ---------------------------------------------------------- */

:root {
  /* Светлая палитра — базовое определение, ни один цвет не живёт только в media */
  --bg: #faf8f4;
  --bg-alt: #f2eee7;
  --surface: #ffffff;
  --surface-2: #f7f4ee;
  --surface-3: #ede8df;

  --text: #16241e;
  --text-2: #3d4f47;
  --muted: #67786f;
  --border: rgba(22, 36, 30, 0.11);
  --border-strong: rgba(22, 36, 30, 0.2);

  --brand: #1e4d3b;
  --brand-2: #2f7053;
  --brand-ink: #ffffff;
  --brand-soft: #e7efea;
  --brand-line: rgba(30, 77, 59, 0.22);

  --wood: #a9793f;
  --wood-2: #c08f4c;
  --wood-ink: #ffffff;
  --wood-soft: #f7ecdc;
  --wood-line: rgba(169, 121, 63, 0.28);

  --ok: #2f7053;
  --warn: #b3521f;

  --shadow-sm: 0 1px 2px rgba(22, 36, 30, 0.06), 0 2px 6px rgba(22, 36, 30, 0.04);
  --shadow: 0 2px 6px rgba(22, 36, 30, 0.06), 0 12px 28px -10px rgba(22, 36, 30, 0.16);
  --shadow-lg: 0 4px 12px rgba(22, 36, 30, 0.08), 0 28px 60px -20px rgba(22, 36, 30, 0.28);

  --hero-scrim: linear-gradient(180deg, rgba(9, 21, 16, 0.72) 0%, rgba(9, 21, 16, 0.55) 45%, rgba(9, 21, 16, 0.82) 100%);

  /* Геометрия */
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --container: 1200px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --section-y: clamp(3.5rem, 7vw, 6.5rem);

  /* Типографика */
  --font-body: 'Manrope', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;

  --step--1: clamp(0.82rem, 0.79rem + 0.14vw, 0.9rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.09rem);
  --step-1: clamp(1.15rem, 1.08rem + 0.36vw, 1.4rem);
  --step-2: clamp(1.4rem, 1.25rem + 0.72vw, 1.9rem);
  --step-3: clamp(1.75rem, 1.45rem + 1.5vw, 2.7rem);
  --step-4: clamp(2.1rem, 1.55rem + 2.75vw, 3.9rem);

  color-scheme: light;
}

/* Системная тёмная — только если пользователь не выбрал светлую вручную */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0e1512;
    --bg-alt: #121a16;
    --surface: #16201b;
    --surface-2: #1c2822;
    --surface-3: #243129;

    --text: #e9eee9;
    --text-2: #c2cec7;
    --muted: #93a49b;
    --border: rgba(233, 238, 233, 0.12);
    --border-strong: rgba(233, 238, 233, 0.22);

    --brand: #5fb08a;
    --brand-2: #7cc5a2;
    --brand-ink: #08150f;
    --brand-soft: rgba(95, 176, 138, 0.14);
    --brand-line: rgba(95, 176, 138, 0.3);

    --wood: #d6a461;
    --wood-2: #e5bb80;
    --wood-ink: #1d1408;
    --wood-soft: rgba(214, 164, 97, 0.14);
    --wood-line: rgba(214, 164, 97, 0.32);

    --ok: #5fb08a;
    --warn: #e08a52;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.42), 0 16px 34px -14px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 6px 18px rgba(0, 0, 0, 0.5), 0 34px 70px -24px rgba(0, 0, 0, 0.72);

    --hero-scrim: linear-gradient(180deg, rgba(5, 12, 9, 0.78) 0%, rgba(5, 12, 9, 0.62) 45%, rgba(5, 12, 9, 0.9) 100%);

    color-scheme: dark;
  }
}

/* Ручной выбор тёмной — выигрывает в обе стороны */
:root[data-theme='dark'] {
  --bg: #0e1512;
  --bg-alt: #121a16;
  --surface: #16201b;
  --surface-2: #1c2822;
  --surface-3: #243129;

  --text: #e9eee9;
  --text-2: #c2cec7;
  --muted: #93a49b;
  --border: rgba(233, 238, 233, 0.12);
  --border-strong: rgba(233, 238, 233, 0.22);

  --brand: #5fb08a;
  --brand-2: #7cc5a2;
  --brand-ink: #08150f;
  --brand-soft: rgba(95, 176, 138, 0.14);
  --brand-line: rgba(95, 176, 138, 0.3);

  --wood: #d6a461;
  --wood-2: #e5bb80;
  --wood-ink: #1d1408;
  --wood-soft: rgba(214, 164, 97, 0.14);
  --wood-line: rgba(214, 164, 97, 0.32);

  --ok: #5fb08a;
  --warn: #e08a52;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.42), 0 16px 34px -14px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 6px 18px rgba(0, 0, 0, 0.5), 0 34px 70px -24px rgba(0, 0, 0, 0.72);

  --hero-scrim: linear-gradient(180deg, rgba(5, 12, 9, 0.78) 0%, rgba(5, 12, 9, 0.62) 45%, rgba(5, 12, 9, 0.9) 100%);

  color-scheme: dark;
}

/* --- 2. Сброс и база ---------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.13;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 {
  font-size: var(--step-4);
}
h2 {
  font-size: var(--step-3);
}
h3 {
  font-size: var(--step-2);
}
h4 {
  font-size: var(--step-1);
}

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

a {
  color: var(--brand);
  text-decoration-color: var(--brand-line);
  text-underline-offset: 3px;
  transition: color 0.18s ease;
}
a:hover {
  color: var(--brand-2);
}

ul,
ol {
  margin: 0 0 1em;
  padding-left: 1.3em;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: var(--brand);
  color: var(--brand-ink);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  z-index: 999;
  padding: 0.75rem 1.25rem;
  background: var(--brand);
  color: var(--brand-ink);
  border-radius: 0 0 var(--r-sm) 0;
}
.skip-link:focus {
  top: 0;
}

/* --- 3. Раскладка ------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow {
  max-width: 820px;
}

.section {
  padding-block: var(--section-y);
}

.section--tight {
  padding-block: clamp(2.5rem, 5vw, 4rem);
}

.section--alt {
  background: var(--bg-alt);
}

.section--surface {
  background: var(--surface);
}

.section-head {
  max-width: 780px;
  margin-bottom: clamp(2rem, 4vw, 3.25rem);
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--wood);
  margin-bottom: 0.9rem;
}
.eyebrow::before {
  content: '';
  width: 1.75rem;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}
.section-head--center .eyebrow::after {
  content: '';
  width: 1.75rem;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.lede {
  font-size: var(--step-1);
  color: var(--text-2);
  line-height: 1.55;
  margin-bottom: 0;
}

.grid {
  display: grid;
  gap: clamp(1rem, 2.2vw, 1.75rem);
}
.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
}
.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}
.grid--4 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}

/* --- 4. Кнопки ---------------------------------------------------------- */

.btn {
  --btn-bg: var(--brand);
  --btn-ink: var(--brand-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.95rem 1.75rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-ink);
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.btn:hover {
  color: var(--btn-ink);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.btn:active {
  transform: translateY(0);
}
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn--accent {
  --btn-bg: var(--wood);
  --btn-ink: var(--wood-ink);
}
.btn--accent:hover {
  --btn-bg: var(--wood-2);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-ink: var(--text);
  border-color: var(--border-strong);
  box-shadow: none;
}
.btn--ghost:hover {
  border-color: var(--brand);
  color: var(--brand);
  box-shadow: none;
}

.btn--light {
  --btn-bg: rgba(255, 255, 255, 0.14);
  --btn-ink: #fff;
  border-color: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(8px);
}
.btn--light:hover {
  --btn-bg: rgba(255, 255, 255, 0.24);
}

.btn--sm {
  padding: 0.6rem 1.1rem;
  font-size: var(--step--1);
}
.btn--wide {
  width: 100%;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
}
.section-head--center .btn-row {
  justify-content: center;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  text-decoration: none;
}
.link-arrow::after {
  content: '→';
  transition: transform 0.18s ease;
}
.link-arrow:hover::after {
  transform: translateX(4px);
}

/* --- 5. Карточки -------------------------------------------------------- */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: clamp(1.4rem, 2.4vw, 2rem);
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.card--link:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--brand-line);
}

.card__icon {
  width: 3.25rem;
  height: 3.25rem;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  background: var(--brand-soft);
  margin-bottom: 1.1rem;
  font-size: 1.5rem;
}
.card__icon img {
  width: 1.9rem;
  height: 1.9rem;
  object-fit: contain;
}
.card__icon svg {
  width: 1.6rem;
  height: 1.6rem;
  color: var(--brand);
}
.strip__icon svg {
  width: 1.6rem;
  height: 1.6rem;
}

.card__title {
  font-size: var(--step-1);
  margin-bottom: 0.5rem;
}

.card__text {
  color: var(--muted);
  margin-bottom: 0;
  font-size: var(--step-0);
}

.card__foot {
  margin-top: auto;
  padding-top: 1.25rem;
}

/* Карточка с фото сверху */
.card--media {
  padding: 0;
  overflow: hidden;
}
.card--media .card__media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface-2);
}
.card--media .card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.card--media:hover .card__media img {
  transform: scale(1.05);
}
.card--media .card__body {
  padding: clamp(1.25rem, 2.2vw, 1.75rem);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--wood-soft);
  color: var(--wood);
  border: 1px solid var(--wood-line);
  font-size: var(--step--1);
  font-weight: 700;
  line-height: 1.4;
}
.badge--brand {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: var(--brand-line);
}

/* --- 6. Шапка ----------------------------------------------------------- */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--border);
}

.header__bar {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 1.4vw, 1.25rem);
  min-height: 4.5rem;
  max-width: 1400px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.logo__mark {
  width: 2.3rem;
  height: 2.3rem;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--brand);
  color: var(--brand-ink);
  flex-shrink: 0;
}
.logo__mark svg {
  width: 1.35rem;
  height: 1.35rem;
}
.logo small {
  display: block;
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1;
  margin-top: 2px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin-left: auto;
}

/* display:contents — чтобы пункты списка стали прямыми flex-элементами .nav
   и одинаково раскладывались и в строку (десктоп), и в столбец (мобильный). */
.nav__list {
  display: contents;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__item {
  position: relative;
}

/* Телефон, кнопка, шапка шторки и иконки нужны только на мобильном */
.nav__contacts,
.nav__head,
.nav__icon,
.nav-backdrop {
  display: none;
}

.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.55rem 0.7rem;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 0.94rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease;
}
.nav__link:hover,
.nav__item:focus-within .nav__link {
  background: var(--surface-2);
  color: var(--text);
}
.nav__link[aria-current='page'] {
  color: var(--brand);
}
.nav__link--parent::after {
  content: '';
  width: 0.4rem;
  height: 0.4rem;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  opacity: 0.65;
  transition: transform 0.2s ease;
}
.nav__item:hover .nav__link--parent::after,
.nav__item:focus-within .nav__link--parent::after {
  transform: rotate(225deg) translate(-3px, -3px);
}

.nav__drop {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  min-width: 16rem;
  padding: 0.5rem;
  margin: 0;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}
.nav__item:hover .nav__drop,
.nav__item:focus-within .nav__drop {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.nav__drop a {
  display: block;
  padding: 0.55rem 0.85rem;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}
.nav__drop a:hover {
  background: var(--brand-soft);
  color: var(--brand);
}
.nav__drop a small {
  display: block;
  font-weight: 500;
  font-size: 0.78rem;
  color: var(--muted);
}

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

.header__phone {
  display: none;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.15;
  white-space: nowrap;
}
.header__phone small {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
}

.icon-btn {
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  padding: 0;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.icon-btn:hover {
  color: var(--brand);
  border-color: var(--brand-line);
}
.icon-btn svg {
  width: 1.15rem;
  height: 1.15rem;
}

.theme-toggle .icon-moon {
  display: none;
}
:root[data-theme='dark'] .theme-toggle .icon-moon {
  display: block;
}
:root[data-theme='dark'] .theme-toggle .icon-sun {
  display: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .theme-toggle .icon-moon {
    display: block;
  }
  :root:not([data-theme='light']) .theme-toggle .icon-sun {
    display: none;
  }
}

.burger {
  display: none;
}

/* Мобильное меню */
@media (min-width: 1320px) {
  .header__phone {
    display: inline-flex;
  }
}

@media (max-width: 1180px) {
  /* backdrop-filter делает шапку containing block'ом для position: fixed —
     из-за этого шторка отмеряла координаты от шапки, а не от экрана.
     На мобильном размытие убираем. */
  .header {
    backdrop-filter: none;
    background: var(--bg);
  }

  /* Затемнение под шторкой: закрывает меню по тапу мимо и отделяет его
     от страницы. */
  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 99;
    background: rgba(8, 18, 14, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s;
  }
  .nav-backdrop[data-open='true'] {
    opacity: 1;
    visibility: visible;
  }

  /* Шторка выезжает справа налево и занимает всю высоту экрана. */
  .nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    z-index: 101;
    width: min(86vw, 23rem);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 0 1.15rem 2rem;
    background: var(--bg);
    border-left: 1px solid var(--border);
    box-shadow: -18px 0 46px -18px rgba(8, 18, 14, 0.45);
    transform: translateX(100%);
    opacity: 1;
    visibility: hidden;
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0.3, 1), visibility 0.3s;
  }
  .nav[data-open='true'] {
    transform: translateX(0);
    visibility: visible;
  }

  .nav__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 2;
    margin: 0 -1.15rem 0.5rem;
    padding: 0.85rem 1.15rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .nav__close {
    width: 2.4rem;
    height: 2.4rem;
  }

  .nav__item {
    display: block;
    width: 100%;
  }

  /* display:flex вместо inline-flex — иначе строка сжимается по тексту
     и подчёркивание обрывается на середине шторки. */
  .nav__link {
    display: flex;
    width: 100%;
    gap: 0.75rem;
    padding: 0.95rem 0.15rem;
    font-size: 1.05rem;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    justify-content: flex-start;
    background: none;
  }
  .nav__link:hover,
  .nav__item:focus-within .nav__link {
    background: none;
  }
  .nav__text {
    flex: 1;
  }
  .nav__icon {
    display: grid;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    flex-shrink: 0;
    border-radius: 9px;
    background: var(--brand-soft);
    color: var(--brand);
  }
  .nav__icon svg {
    width: 1.15rem;
    height: 1.15rem;
  }
  .nav__link--parent::after {
    margin-left: auto;
    margin-right: 0.35rem;
    opacity: 0.55;
  }

  /* Ключевое: десктопные :hover/:focus-within сильнее по специфичности и
     сдвигали подменю на translateX(-50%) за край экрана. Перебиваем их
     селектором той же силы. */
  .nav__drop,
  .nav__item:hover .nav__drop,
  .nav__item:focus-within .nav__drop {
    position: static;
    inset: auto;
    transform: none;
    min-width: 0;
    width: auto;
    max-width: 100%;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    border: 0;
    border-left: 2px solid var(--brand-line);
    border-radius: 0;
    background: transparent;
    margin: 0.5rem 0 1rem 1.05rem;
    padding: 0 0 0 0.9rem;
    display: none;
  }
  .nav__item[data-expanded='true'] .nav__drop {
    display: block;
  }
  .nav__drop li {
    max-width: 100%;
  }
  .nav__drop a {
    padding: 0.65rem 0.25rem;
    font-size: 0.98rem;
    overflow-wrap: anywhere;
  }
  .nav__drop a small {
    margin-top: 0.1rem;
  }
  .nav__item[data-expanded='true'] .nav__link--parent::after {
    transform: rotate(225deg) translate(-3px, -3px);
  }

  /* Телефон и заявка живут внутри шторки — в шапке для них нет места. */
  .nav__contacts {
    display: grid;
    gap: 0.6rem;
    margin-top: 1.75rem;
  }
  .nav__contacts .nav__phone {
    display: flex;
    flex-direction: column;
    padding: 0.9rem 1.1rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--r);
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 1.15rem;
  }
  .nav__contacts .nav__phone small {
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--muted);
  }

  .burger {
    display: grid;
  }
}

@media (max-width: 560px) {
  .header__actions .btn {
    display: none;
  }
  .logo {
    font-size: 1.1rem;
  }
}

/* --- 7. Герой ----------------------------------------------------------- */

.hero {
  position: relative;
  isolation: isolate;
  color: #fff;
  padding-block: clamp(4rem, 10vw, 8rem);
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--hero-scrim);
}

.hero__inner {
  max-width: 46rem;
}

.hero h1 {
  color: #fff;
  margin-bottom: 0.4em;
}
.hero h1 .accent {
  display: block;
  color: var(--wood-2);
  font-style: italic;
}

.hero__lede {
  font-size: var(--step-1);
  color: rgba(255, 255, 255, 0.86);
  max-width: 38rem;
  margin-bottom: 2rem;
}

.hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.75rem;
}
.hero__badges .badge {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.32);
  color: #fff;
  backdrop-filter: blur(6px);
}

.hero__stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-top: clamp(1.5rem, 3vw, 2.25rem);
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  max-width: 54rem;
}
@media (min-width: 620px) {
  .hero__stats {
    grid-template-columns: repeat(4, 1fr);
  }
}
.hero__stat b {
  display: block;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.1;
  color: var(--wood-2);
}
.hero__stat span {
  font-size: var(--step--1);
  color: rgba(255, 255, 255, 0.78);
}

/* --- 8. Полоса-бегущая строка (акция) ----------------------------------- */

.ticker {
  background: var(--brand);
  color: var(--brand-ink);
  padding-block: 0.7rem;
  overflow: hidden;
}
.ticker__track {
  display: flex;
  gap: 3rem;
  width: max-content;
  animation: ticker 38s linear infinite;
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.ticker__track span {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  white-space: nowrap;
}
.ticker__track span::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--wood-2);
  flex-shrink: 0;
}
@keyframes ticker {
  to {
    transform: translateX(-50%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ticker__track {
    animation: none;
  }
}

/* --- 9. Блок «нашли дешевле» и прочие полосы ---------------------------- */

.strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
  padding: clamp(1.25rem, 3vw, 2rem);
  border-radius: var(--r-lg);
  background: var(--wood-soft);
  border: 1px solid var(--wood-line);
}
.strip__icon {
  width: 3.25rem;
  height: 3.25rem;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--wood);
  color: var(--wood-ink);
  font-size: 1.5rem;
}
.strip__text {
  flex: 1 1 18rem;
}
.strip__text b {
  display: block;
  font-family: var(--font-display);
  font-size: var(--step-1);
  line-height: 1.2;
}
.strip__text span {
  color: var(--text-2);
  font-size: var(--step--1);
}

/* --- 10. Материалы и подборки ------------------------------------------ */

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 23rem;
  padding: 1.5rem 1.35rem 1.35rem;
  border-radius: var(--r-lg);
  overflow: hidden;
  isolation: isolate;
  color: #fff;
  text-decoration: none;
  border: 1px solid var(--border);
}
.tile img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.tile::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(8, 20, 15, 0.1) 20%, rgba(8, 20, 15, 0.55) 58%, rgba(8, 20, 15, 0.9) 100%);
}
.tile:hover img {
  transform: scale(1.06);
}
.tile:hover {
  color: #fff;
}
.tile__tag {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.34);
  color: #fff;
  backdrop-filter: blur(6px);
}
.tile h3 {
  color: #fff;
  font-size: clamp(1.3rem, 1.15rem + 0.5vw, 1.6rem);
  line-height: 1.15;
  margin-bottom: 0.45rem;
}
.tile p {
  color: rgba(255, 255, 255, 0.84);
  font-size: var(--step--1);
  line-height: 1.45;
  margin-bottom: 0.9rem;
}
.tile .link-arrow {
  font-size: var(--step--1);
}
.tile .link-arrow {
  color: var(--wood-2);
}

/* --- 11. Ипотека -------------------------------------------------------- */

.mortgage-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}
.mortgage-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface-2);
}
.mortgage-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.mortgage-card:hover .mortgage-card__media img {
  transform: scale(1.05);
}
.mortgage-card__badge {
  position: absolute;
  top: 0.9rem;
  left: 0.9rem;
  background: rgba(255, 255, 255, 0.92);
  color: var(--brand);
  border-color: transparent;
}
.mortgage-card__body {
  padding: clamp(1.25rem, 2.2vw, 1.75rem);
  display: flex;
  flex-direction: column;
  flex: 1;
}
.facts {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  display: grid;
  gap: 0.45rem;
  font-size: var(--step--1);
}
.facts li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px dashed var(--border);
}
.facts li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.facts dt,
.facts .k {
  color: var(--muted);
}
.facts dd,
.facts .v {
  margin: 0;
  font-weight: 700;
  text-align: right;
  color: var(--text);
}

.banks-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  padding: 1.5rem 0;
}
.banks-row img {
  height: 2rem;
  width: auto;
  object-fit: contain;
  opacity: 0.72;
  filter: grayscale(1);
  transition: opacity 0.2s ease, filter 0.2s ease;
}
.banks-row img:hover {
  opacity: 1;
  filter: none;
}
:root[data-theme='dark'] .banks-row img,
:root[data-theme='dark'] .partners-row img {
  filter: grayscale(1) invert(1) brightness(1.6);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .banks-row img,
  :root:not([data-theme='light']) .partners-row img {
    filter: grayscale(1) invert(1) brightness(1.6);
  }
}

/* --- 12. Калькулятор и квиз -------------------------------------------- */

.tool {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: clamp(1.5rem, 3.5vw, 2.75rem);
  box-shadow: var(--shadow);
}

.tool__grid {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 860px) {
  .tool__grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    align-items: start;
  }
}

.field {
  margin-bottom: 1.5rem;
}
.field__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.field__label {
  font-weight: 600;
  font-size: var(--step--1);
  color: var(--text-2);
}
.field__value {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 600;
  color: var(--brand);
  white-space: nowrap;
}

input[type='range'] {
  width: 100%;
  height: 2rem;
  background: transparent;
  appearance: none;
  cursor: pointer;
  margin: 0;
}
input[type='range']::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--brand) 0%,
    var(--brand) var(--fill, 50%),
    var(--surface-3) var(--fill, 50%),
    var(--surface-3) 100%
  );
}
input[type='range']::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-3);
}
input[type='range']::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--brand);
}
input[type='range']::-webkit-slider-thumb {
  appearance: none;
  width: 1.4rem;
  height: 1.4rem;
  margin-top: -0.4rem;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--brand);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease;
}
input[type='range']::-webkit-slider-thumb:hover {
  transform: scale(1.12);
}
input[type='range']::-moz-range-thumb {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--brand);
}

.result {
  background: var(--brand);
  color: var(--brand-ink);
  border-radius: var(--r-lg);
  padding: clamp(1.4rem, 3vw, 2rem);
  text-align: center;
}
.result__label {
  font-size: var(--step--1);
  opacity: 0.82;
  margin-bottom: 0.35rem;
}
.result__value {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.05;
  margin-bottom: 0.15rem;
}
.result__sub {
  font-size: var(--step--1);
  opacity: 0.82;
  margin-bottom: 1.4rem;
}
.result .btn {
  --btn-bg: var(--wood);
  --btn-ink: var(--wood-ink);
  width: 100%;
}
.result__note {
  margin: 1rem 0 0;
  font-size: 0.76rem;
  line-height: 1.5;
  opacity: 0.72;
}

.program-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}
.chip {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: var(--step--1);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}
.chip:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.chip[aria-pressed='true'] {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
}

/* Квиз */
.quiz {
  position: relative;
}
.quiz__progress {
  height: 5px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
  margin-bottom: 1.75rem;
}
.quiz__progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--brand);
  border-radius: 999px;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.quiz__step {
  display: none;
}
.quiz__step[data-active='true'] {
  display: block;
  animation: fade-up 0.35s ease both;
}
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}
.quiz__count {
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--wood);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}
.quiz__q {
  font-size: var(--step-2);
  margin-bottom: 0.35rem;
}
.quiz__hint {
  color: var(--muted);
  font-size: var(--step--1);
  margin-bottom: 1.5rem;
}
.quiz__options {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  margin-bottom: 1.5rem;
}
.quiz__option {
  padding: 1rem 1.25rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.16s ease;
}
.quiz__option:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  transform: translateY(-2px);
}
.quiz__option[aria-pressed='true'] {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--brand-ink);
}
.quiz__nav {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* --- 13. Формы ---------------------------------------------------------- */

.form {
  display: grid;
  gap: 0.9rem;
}
.form label {
  display: block;
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 0.35rem;
}
.input,
input[type='text'],
input[type='tel'],
input[type='email'],
input[type='date'],
select,
textarea {
  width: 100%;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: var(--step-0);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.input:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
}
.form__note {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}
.form__note a {
  color: inherit;
}

.form__status {
  display: none;
  padding: 0.85rem 1.1rem;
  border-radius: var(--r-sm);
  font-size: var(--step--1);
  font-weight: 600;
}
.form__status[data-state='ok'] {
  display: block;
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid var(--brand-line);
}
.form__status[data-state='err'] {
  display: block;
  background: rgba(179, 82, 31, 0.1);
  color: var(--warn);
  border: 1px solid rgba(179, 82, 31, 0.3);
}

/* Слоты записи на замер */
.slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: 0.55rem;
}
.slot {
  padding: 0.7rem 0.5rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: var(--step--1);
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 0.16s ease;
  line-height: 1.3;
}
.slot span {
  display: block;
  font-weight: 500;
  font-size: 0.74rem;
  color: var(--muted);
}
.slot:hover {
  border-color: var(--brand);
}
.slot[aria-pressed='true'] {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--brand-ink);
}
.slot[aria-pressed='true'] span {
  color: inherit;
  opacity: 0.8;
}

/* --- 14. Модальные окна ------------------------------------------------- */

dialog.modal {
  width: min(34rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  overflow: visible;
}
dialog.modal::backdrop {
  background: rgba(6, 14, 11, 0.62);
  backdrop-filter: blur(3px);
}
dialog.modal[open] {
  animation: modal-in 0.24s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}
@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
}
.modal__body {
  padding: clamp(1.5rem, 4vw, 2.25rem);
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
}
.modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.modal__close:hover {
  background: var(--surface-3);
  color: var(--text);
}
.modal h3 {
  margin-bottom: 0.4rem;
  padding-right: 2rem;
}
.modal__sub {
  color: var(--muted);
  font-size: var(--step--1);
  margin-bottom: 1.4rem;
}

/* Модалка с юридическим текстом ипотеки */
.legal-list {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.65;
  color: var(--text-2);
}
.legal-list dt {
  font-weight: 700;
  color: var(--text);
  margin-top: 0.9rem;
}
.legal-list dd {
  margin: 0.15rem 0 0;
}

/* --- 15. Галерея / лайтбокс -------------------------------------------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 0.85rem;
}
.gallery__item {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: zoom-in;
  padding: 0;
  background: var(--surface-2);
}
.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.gallery__item:hover img {
  transform: scale(1.05);
}
.gallery__item--tall {
  grid-row: span 2;
  aspect-ratio: 2 / 3;
}

dialog.lightbox {
  width: min(96vw, 1400px);
  max-height: 94dvh;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}
dialog.lightbox::backdrop {
  background: rgba(4, 10, 8, 0.92);
}
.lightbox img {
  width: 100%;
  max-height: 88dvh;
  object-fit: contain;
  border-radius: var(--r);
}
.lightbox__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: #fff;
  padding: 0.75rem 0.25rem;
  font-size: var(--step--1);
}
.lightbox__nav {
  display: flex;
  gap: 0.5rem;
}
.lightbox__nav button,
.lightbox .modal__close {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.lightbox__nav button:hover {
  background: rgba(255, 255, 255, 0.24);
}

/* --- 16. Отзывы, команда, сертификаты ---------------------------------- */

.review {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.review__text {
  font-size: var(--step-0);
  color: var(--text-2);
  margin: 0;
  flex: 1;
}
.review__text::before {
  content: '“';
  display: block;
  font-family: var(--font-display);
  font-size: 3rem;
  line-height: 0.6;
  color: var(--wood);
  margin-bottom: 0.5rem;
}
.review__who {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.review__ava {
  width: 2.9rem;
  height: 2.9rem;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}
.review__who b {
  display: block;
  line-height: 1.3;
}
.review__who span {
  font-size: var(--step--1);
  color: var(--muted);
}

.person {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 7rem minmax(0, 1fr);
  align-items: start;
}
@media (max-width: 480px) {
  .person {
    grid-template-columns: 1fr;
  }
}
.person__photo {
  aspect-ratio: 1;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.person__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.person__role {
  color: var(--wood);
  font-weight: 700;
  font-size: var(--step--1);
  margin-bottom: 0.5rem;
}
.person__contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  font-size: var(--step--1);
  margin-top: 0.75rem;
}

.certs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  gap: 1rem;
}
.cert {
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  padding: 0.75rem;
  cursor: zoom-in;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.cert:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.cert img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  margin-bottom: 0.6rem;
}
.cert span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
  text-align: center;
}

.partners-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: center;
}
.partners-row img {
  height: 3rem;
  width: 100%;
  object-fit: contain;
  opacity: 0.68;
  filter: grayscale(1);
  transition: opacity 0.2s ease, filter 0.2s ease;
}
.partners-row img:hover {
  opacity: 1;
  filter: none;
}

/* --- 17. Таймлайн этапов ----------------------------------------------- */

.steps {
  display: grid;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
@media (min-width: 720px) {
  .steps--4 {
    grid-template-columns: repeat(4, 1fr);
  }
}
.step {
  background: var(--surface);
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
}
.step__n {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 800;
  font-size: 0.92rem;
  margin-bottom: 0.9rem;
}
.step h3 {
  font-size: var(--step-1);
  margin-bottom: 0.35rem;
}
.step p {
  color: var(--muted);
  font-size: var(--step--1);
  margin: 0;
}

.timeline {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
}
.timeline__item {
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}
.timeline__item img {
  aspect-ratio: 4 / 3;
  width: 100%;
  object-fit: cover;
}
.timeline__item div {
  padding: 0.9rem 1.1rem;
}
.timeline__item b {
  display: block;
  color: var(--wood);
  font-size: var(--step--1);
}

/* --- 18. Хлебные крошки, страницы, статьи ------------------------------ */

.crumbs {
  padding-block: 1rem 0;
  font-size: var(--step--1);
}
.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--muted);
}
.crumbs li:not(:last-child)::after {
  content: '/';
  margin-left: 0.6rem;
  opacity: 0.5;
}
.crumbs a {
  color: var(--muted);
  text-decoration: none;
}
.crumbs a:hover {
  color: var(--brand);
}

.page-head {
  padding-block: clamp(2rem, 4vw, 3.5rem) clamp(1.5rem, 3vw, 2.5rem);
}
.page-head .lede {
  max-width: 46rem;
}

.prose {
  max-width: 44rem;
  font-size: 1.06rem;
  line-height: 1.75;
  color: var(--text-2);
}
.prose h2 {
  font-size: var(--step-2);
  color: var(--text);
  margin-top: 2.25em;
  margin-bottom: 0.5em;
}
.prose h3 {
  font-size: var(--step-1);
  color: var(--text);
  margin-top: 1.75em;
  margin-bottom: 0.4em;
}
.prose h2:first-child,
.prose h3:first-child {
  margin-top: 0;
}
.prose ul,
.prose ol {
  padding-left: 1.35em;
}
.prose li {
  margin-bottom: 0.4em;
}
.prose li::marker {
  color: var(--wood);
}
.prose strong {
  color: var(--text);
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
  margin: 1.5em 0;
}
.prose th,
.prose td {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  text-align: left;
}
.prose th {
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
}
.table-scroll {
  overflow-x: auto;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: var(--step--1);
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.article-cover {
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
  border: 1px solid var(--border);
}
.article-cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.aside-cta {
  position: sticky;
  top: 6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.article-layout {
  display: grid;
  gap: clamp(2rem, 4vw, 3rem);
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 1000px) {
  .article-layout {
    grid-template-columns: minmax(0, 1fr) 20rem;
    align-items: start;
  }
}

/* --- 19. FAQ / аккордеон ----------------------------------------------- */

.faq {
  display: grid;
  gap: 0.75rem;
  max-width: 52rem;
}
.faq details {
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  overflow: hidden;
}
.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.4rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: '+';
  flex-shrink: 0;
  font-size: 1.4rem;
  color: var(--wood);
  line-height: 1;
  transition: transform 0.2s ease;
}
.faq details[open] summary::after {
  transform: rotate(45deg);
}
.faq details > div {
  padding: 0 1.4rem 1.3rem;
  color: var(--text-2);
}
.faq details > div > :last-child {
  margin-bottom: 0;
}

/* --- 20. Финальный CTA и подвал ---------------------------------------- */

.cta-band {
  position: relative;
  isolation: isolate;
  background: var(--brand);
  color: #fff;
  border-radius: var(--r-xl);
  padding: clamp(2rem, 5vw, 4rem);
  overflow: hidden;
}
.cta-band::before {
  content: '';
  position: absolute;
  inset: auto -10% -60% auto;
  width: 28rem;
  height: 28rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(214, 164, 97, 0.32), transparent 68%);
  z-index: -1;
}
.cta-band h2 {
  color: #fff;
}
.cta-band p {
  color: rgba(255, 255, 255, 0.84);
  max-width: 42rem;
}
.cta-band .btn--ghost {
  --btn-ink: #fff;
  border-color: rgba(255, 255, 255, 0.45);
}
.cta-band .btn--ghost:hover {
  color: #fff;
  border-color: #fff;
}

.footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding-block: clamp(2.5rem, 5vw, 4rem) 1.5rem;
  font-size: var(--step--1);
}
.footer__grid {
  display: grid;
  gap: clamp(1.75rem, 4vw, 3rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  margin-bottom: 2.5rem;
}
.footer__grid > div:first-child {
  grid-column: span 1;
  min-width: 0;
}
@media (min-width: 900px) {
  .footer__grid {
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  }
}
.footer h4 {
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}
.footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.footer a {
  color: var(--text-2);
  text-decoration: none;
}
.footer a:hover {
  color: var(--brand);
}
.footer__about p {
  color: var(--muted);
  max-width: 24rem;
}
.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
}
.footer__disclaimer {
  margin-top: 1rem;
  font-size: 0.74rem;
  line-height: 1.55;
  color: var(--muted);
  opacity: 0.8;
}

/* --- 21. Плавающие действия -------------------------------------------- */

.dock {
  position: fixed;
  right: clamp(0.85rem, 2vw, 1.5rem);
  bottom: clamp(0.85rem, 2vw, 1.5rem);
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.6rem;
}
.dock__btn {
  width: 3.25rem;
  height: 3.25rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 0;
  color: #fff;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease;
  text-decoration: none;
}
.dock__btn:hover {
  transform: scale(1.08);
  color: #fff;
}
.dock__btn svg {
  width: 1.5rem;
  height: 1.5rem;
}
.dock__btn--wa {
  background: #25d366;
}
.dock__btn--tg {
  background: #2aabee;
}
.dock__btn--call {
  background: var(--wood);
  position: relative;
}
.dock__btn--call::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--wood);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  to {
    transform: scale(1.7);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dock__btn--call::after {
    animation: none;
  }
}

/* Кнопка «наверх» — справа, над доком (десктоп) или над нижней панелью (моб.) */
.to-top {
  position: fixed;
  right: clamp(0.85rem, 2vw, 1.5rem);
  bottom: calc(clamp(0.85rem, 2vw, 1.5rem) + 12.5rem);
  z-index: 90;
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, color 0.2s ease, border-color 0.2s ease;
}
.to-top[hidden] {
  display: none;
}
.to-top.is-visible {
  opacity: 1;
  transform: none;
}
.to-top:hover {
  color: var(--brand);
  border-color: var(--brand);
}
.to-top svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* Мобильная нижняя панель: мессенджеры + звонок + заявка */
.mobile-bar {
  display: none;
}

@media (max-width: 860px) {
  .mobile-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 95;
    display: grid;
    grid-template-columns: 3.5rem 3.5rem minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 1px;
    background: var(--border);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .mobile-bar > * {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 3.4rem;
    padding: 0.5rem 0.4rem;
    border: 0;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-weight: 700;
    font-size: 0.88rem;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
  }
  .mobile-bar svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
  }
  .mobile-bar__icon--wa {
    color: #25d366;
  }
  .mobile-bar__icon--tg {
    color: #2aabee;
  }
  .mobile-bar__call {
    color: var(--brand);
  }
  .mobile-bar__cta {
    background: var(--wood);
    color: var(--wood-ink);
  }

  /* Мессенджеры переехали в нижнюю панель — плавающий док лишний */
  .dock {
    display: none;
  }
  .to-top {
    bottom: calc(4.2rem + env(safe-area-inset-bottom, 0px));
  }
  body {
    padding-bottom: 3.6rem;
  }
}

@media (max-width: 380px) {
  .mobile-bar__call span {
    display: none;
  }
  .mobile-bar {
    grid-template-columns: 3.2rem 3.2rem 3.2rem minmax(0, 1fr);
  }
}

/* --- 22. Прочее --------------------------------------------------------- */

.iframe-wrap {
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}
.iframe-wrap iframe {
  display: block;
  width: 100%;
  border: 0;
  min-height: 720px;
}

/* Прячем блок до появления в зоне видимости ТОЛЬКО если JS жив: класс js
   ставит инлайновый скрипт в <head>. Иначе контент останется невидимым при
   любой ошибке скрипта — цена такой анимации слишком высока. */
html.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
}
html.js .reveal.is-in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  html.js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html {
    scroll-behavior: auto;
  }
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: clamp(1rem, 3vw, 2rem);
  text-align: center;
}
.stat b {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.05;
  color: var(--brand);
}
.stat span {
  font-size: var(--step--1);
  color: var(--muted);
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.7rem;
}
.checklist li {
  position: relative;
  padding-left: 2rem;
  color: var(--text-2);
}
.checklist li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.35em;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: var(--brand);
}
/* «Галочка» внутри кружка — два бордера, повёрнутых на 45° */
.checklist li::after {
  content: '';
  position: absolute;
  left: 0.4rem;
  top: 0.58em;
  width: 0.3rem;
  height: 0.55rem;
  border: solid var(--brand-ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.split {
  display: grid;
  gap: clamp(1.75rem, 4vw, 3.5rem);
  align-items: center;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 900px) {
  .split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .split--media-right > :first-child {
    order: -1;
  }
}
.split__media {
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.split__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 3;
}

/* Горизонтальная прокрутка карточек на мобильных */
.scroller {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(min(78vw, 20rem), 1fr);
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.75rem;
  margin-inline: calc(var(--gutter) * -1);
  padding-inline: var(--gutter);
  scrollbar-width: thin;
}
.scroller > * {
  scroll-snap-align: start;
}
@media (min-width: 900px) {
  .scroller {
    grid-auto-flow: row;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
    overflow: visible;
    margin-inline: 0;
    padding-inline: 0;
  }
}

@media print {
  .header,
  .dock,
  .mobile-bar,
  .cta-band,
  .ticker {
    display: none !important;
  }
}
