/* ЖК «Камергер» — интерактивная презентация · сессия 3, переработка
   Палитра A: айвори/светлый камень + тёмный текст + латунь + мята-акцент (#81CEB2, только UI)
   + тёмно-зелёные перебивки (пентхаусы, клуб). Mobile-first, полноценный десктоп. */

:root {
  --ivory: #f2efe8;
  --stone: #e6e1d6;
  --ink: #211e19;
  --ink-dim: #6f685c;
  --brass: #a08454;
  --mint: #81ceb2;
  --green-deep: #1c352c;
  --green-soft: #24423a;
  --cream: #efece3;
  --cream-dim: #a9b3a6;
  --font-display: "Playfair Display", serif;
  --font-body: "Manrope", sans-serif;
  /* вьюпортные единицы через переменные: на десктопе — живые 1vh/1svh,
     на таче JS замораживает их в px (панели WebView Telegram при смене
     направления скролла меняют вьюпорт и двигали весь layout) */
  --vh: 1vh;
  --svh: 1svh;
  --pad: clamp(20px, 5vw, 72px);
  /* на широких мониторах контент не расползается шире 1680px */
  --pad-x: max(var(--pad), calc((100vw - 1680px) / 2));
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* НЕ ставить scroll-behavior: smooth — GSAP ScrollTrigger официально с ним
   несовместим: браузер анимирует саму позицию скролла, и пин-секции при
   развороте «доезжают»/«уезжают» (особенно в WebView Telegram). */

body {
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; width: 100%; height: 100%; object-fit: cover; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.12; letter-spacing: 0.005em; }

section { padding: clamp(88px, calc(var(--vh) * 14), 160px) var(--pad-x); }

/* ---------- Типографическая система ---------- */

.kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: clamp(18px, 3vw, 26px);
}
.kicker i {
  flex: none;
  width: 28px;
  height: 1px;
  background: var(--mint);
  transform-origin: left center;
}
html.motion .kicker[data-reveal] i { transform: scaleX(0); }
.kicker--light { color: var(--cream-dim); }

/* line-reveal заголовков: строка выезжает из-под маски */
[data-lr] { overflow: hidden; }
[data-lr] .lr__inner { display: block; }
html.motion [data-lr] .lr__inner { transform: translateY(112%); }

/* ---------- Плейсхолдеры слотов (ждут генерации — не трогаем) ---------- */

.slot-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px dashed color-mix(in srgb, var(--brass) 55%, transparent);
  border-radius: 4px;
  background: color-mix(in srgb, var(--stone) 45%, transparent);
  color: color-mix(in srgb, var(--ink-dim) 75%, transparent);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.9;
  padding: 16px;
}
.slot-ph--tall { aspect-ratio: 4 / 5; }
.slot-ph--wide { aspect-ratio: 21 / 9; margin-top: clamp(28px, 5vw, 56px); }
.slot-ph--dark {
  border-color: color-mix(in srgb, var(--cream-dim) 45%, transparent);
  background: rgba(255, 255, 255, 0.03);
  color: color-mix(in srgb, var(--cream-dim) 70%, transparent);
}

/* ---------- Параллакс-обёртка изображений ---------- */

.plx { position: relative; overflow: hidden; height: 100%; border-radius: 4px; }
.plx img { will-change: transform; }
html.motion .plx img { transform: scale(1.12); }

/* ---------- Навигация ---------- */

.nav {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 8px 7px 16px;
  border-radius: 999px;
  /* без backdrop-filter: блюр fixed-навбара — главный источник рывков
     в WebView Telegram; почти непрозрачный фон визуально не отличается */
  background: rgba(244, 241, 234, 0.97);
  box-shadow: 0 8px 30px rgba(33, 30, 25, 0.12);
  white-space: nowrap;
  transition: transform 0.45s ease, opacity 0.45s ease;
}
.nav--hidden {
  transform: translateX(-50%) translateY(-160%);
  opacity: 0;
  pointer-events: none;
}
.nav a { text-decoration: none; color: var(--ink); }
.nav__brand { font-family: var(--font-display); font-size: 13.5px; letter-spacing: 0.14em; text-transform: uppercase; }
.nav__links { display: none; }
.nav__cta {
  font-size: 12px;
  letter-spacing: 0.08em;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--ivory) !important;
  transition: background 0.3s ease;
}
.nav__cta:hover { background: var(--green-soft); }

@media (min-width: 701px) {
  .nav { gap: clamp(14px, 2.5vw, 28px); padding: 10px 12px 10px 20px; }
  .nav__brand { font-size: 15px; }
  .nav__links { display: flex; gap: clamp(12px, 2vw, 22px); }
  .nav__links a { font-size: 12.5px; letter-spacing: 0.06em; color: var(--ink-dim); transition: color 0.3s ease; }
  .nav__links a:hover { color: var(--ink); }
}

/* Десктоп с мышью — возвращаем «матовое стекло»: backdrop-filter там дёшев
   и работал как надо. На тач-устройствах (WebView мессенджеров) остаётся
   плотный фон — блюр fixed-элементов на скролле там и был источником рывков. */
@media (hover: hover) and (pointer: fine) {
  .nav {
    background: rgba(242, 239, 232, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
  .houses__pin {
    background: rgba(33, 30, 25, 0.22);
    backdrop-filter: blur(2.5px);
    -webkit-backdrop-filter: blur(2.5px);
  }
  .city__card figcaption {
    background: rgba(24, 22, 18, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }
  .outro__link {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
}

/* ---------- 01 · Hero: BUILD-01 ---------- */

.hero { position: relative; padding: 0; }
html.motion .hero { height: calc(var(--svh) * 340); }
html:not(.motion) .hero { height: auto; }
.hero .build__stage { display: flex; align-items: flex-end; }

.build__stage {
  position: sticky;
  top: 0;
  height: calc(var(--svh) * 100);
  overflow: hidden;
  background: var(--stone);
}
.build__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.build__fallback { position: absolute; inset: 0; }
html.motion .build__fallback { display: none; }
html:not(.motion) .build__stage { position: relative; height: calc(var(--svh) * 72); }
html:not(.motion) .build__canvas { display: none; }

.hero__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(24, 22, 18, 0.88) 0%, rgba(24, 22, 18, 0.46) 24%, rgba(24, 22, 18, 0.08) 52%, rgba(24, 22, 18, 0.22) 100%);
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: var(--pad) var(--pad-x);
  padding-bottom: clamp(170px, calc(var(--vh) * 26), 250px);
  color: #fff;
}
.hero__kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(11px, 2.8vw, 13px);
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 1px 4px rgba(24, 22, 18, 0.55), 0 4px 22px rgba(24, 22, 18, 0.4);
}
.hero__kicker i { flex: none; width: 28px; height: 1px; background: var(--mint); }
.hero__title {
  font-size: clamp(58px, 14vw, 140px);
  letter-spacing: 0.04em;
  margin: 10px 0 20px;
  text-shadow: 0 2px 30px rgba(24, 22, 18, 0.35);
}
.hero__facts {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: clamp(13px, 3.4vw, 16px);
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 4px rgba(24, 22, 18, 0.5);
}
.hero__facts b { width: 4px; height: 4px; border-radius: 50%; background: var(--mint); }

/* ход строительства: фаза + линия прогресса + срок */
.hero__site {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  padding: 0 var(--pad-x) calc(env(safe-area-inset-bottom, 0px) + clamp(24px, calc(var(--vh) * 4.5), 44px));
  color: #fff;
}
.hero__site-kicker {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--mint);
  margin-bottom: 8px;
}
/* фейд фазы ведёт GSAP (main.js) — CSS-transition здесь не нужен,
   иначе он конфликтует с инлайн-анимацией и даёт жёсткий свитч слов */
.hero__site-phase {
  font-family: var(--font-display);
  font-size: clamp(22px, 5.6vw, 36px);
  line-height: 1.2;
  margin-bottom: 14px;
}
.hero__site-bar {
  position: relative;
  height: 1px;
  background: rgba(255, 255, 255, 0.28);
  margin-bottom: 12px;
}
.hero__site-bar i {
  position: absolute;
  inset: 0;
  background: var(--mint);
  transform-origin: left center;
  transform: scaleX(0);
}
.hero__site-deadline {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}
@media (min-width: 900px) {
  .hero__site { max-width: 560px; left: auto; right: 0; }
}
html:not(.motion) .hero__site { display: none; }

/* ---------- 02 · Манифест ---------- */

.manifesto {
  position: relative;
  display: grid;
  gap: clamp(36px, 6vw, 80px);
  align-items: center;
}
/* мягкий стык с тёмным финалом hero: дымка тает в айвори */
.manifesto::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: clamp(120px, calc(var(--vh) * 20), 220px);
  background: linear-gradient(to bottom, rgba(24, 22, 18, 0.55), rgba(24, 22, 18, 0));
  pointer-events: none;
}
.manifesto__quote {
  font-family: var(--font-display);
  font-size: clamp(26px, 5.6vw, 46px);
  line-height: 1.32;
  margin-bottom: 28px;
  max-width: 21ch;
}
.manifesto__note {
  font-size: clamp(14px, 3.6vw, 17px);
  color: var(--ink-dim);
  max-width: 46ch;
}
.manifesto__media { aspect-ratio: 4 / 5; max-height: calc(var(--svh) * 76); }
@media (min-width: 900px) {
  .manifesto { grid-template-columns: 1.15fr 0.85fr; }
  .manifesto__media { aspect-ratio: 3 / 4; }
}

/* ---------- 03а · История ---------- */

.history { display: grid; gap: clamp(36px, 6vw, 80px); background: var(--stone); }
.history__title { font-size: clamp(30px, 6.4vw, 52px); margin-bottom: 24px; max-width: 18ch; }
.history__p { color: var(--ink-dim); margin-bottom: 16px; max-width: 52ch; }
.history__p:last-child { margin-bottom: 0; }
.history__media { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 14px; align-items: end; }
.history__photo { position: relative; }
.history__photo .plx { aspect-ratio: 4 / 5; }
.history__photo--wide .plx { aspect-ratio: 4 / 3; }
.history__photo figcaption,
.inner__item figcaption,
.dev__photo figcaption,
.pent__half figcaption,
.rez__detail figcaption {
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
  padding-top: 10px;
  line-height: 1.7;
}
.pent__half figcaption { color: var(--cream-dim); }
@media (min-width: 900px) {
  .history { grid-template-columns: 1.05fr 1fr; align-items: center; }
}

/* ---------- 03б · Карта ---------- */

/* пин-сцена карты — только десктоп; на мобиле обычный поток,
   анимация карты идёт по мере проезда секции */
@media (min-width: 900px) {
  /* calc(var(--svh) * 150): пин держит карту ~пол-экрана скролла — анимация успевает, задержка не тянется */
  html.motion .geo { height: calc(var(--svh) * 150); padding: 0; }
  html.motion .geo__pin {
    position: sticky;
    top: 0;
    height: calc(var(--svh) * 100);
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    padding: calc(env(safe-area-inset-top, 0px) + 76px) var(--pad-x) clamp(28px, calc(var(--vh) * 5), 56px);
  }
}
.geo__head { margin-bottom: clamp(20px, calc(var(--vh) * 4), 44px); }
.geo__title { font-size: clamp(26px, 5.6vw, 46px); max-width: 24ch; }

.geo__wrap {
  display: grid;
  gap: clamp(20px, 4vw, 56px);
  align-items: center;
  min-height: 0;
}
.geo__map { min-height: 0; }
@media (min-width: 900px) {
  .geo__wrap { grid-template-columns: 1.35fr 1fr; }
}

/* реальная карта (OSM), тонированная под «бумагу» палитры.
   Кроп подложки (img cover) и оверлея (svg slice) согласованы,
   поэтому фрейм может быть любой пропорции — заполняет ячейку */
.geo__frame {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1237 / 941;
  background: var(--stone);
}
/* десктоп-пин: карта занимает высоту сцены, без мёртвой зоны снизу */
@media (min-width: 900px) {
  .geo__frame { width: min(100%, calc(calc(var(--svh) * 68) * 1.3146)); margin-inline: auto; }
}
.geo__osm {
  filter: grayscale(1) sepia(0.22) brightness(1.03) contrast(0.9);
  opacity: 0.8;
}
/* карта тает в фон секции по краям */
.geo__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 88% 88% at 50% 48%, transparent 68%, var(--stone) 115%);
  pointer-events: none;
}
.geo__overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}
.geo__credit {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: color-mix(in srgb, var(--ink-dim) 65%, transparent);
  text-align: right;
  padding-top: 6px;
}

.map-label--home {
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  fill: var(--ink);
}
.map-kvartal {
  fill: color-mix(in srgb, var(--mint) 42%, transparent);
  stroke: var(--mint);
  stroke-width: 3;
  animation: kvartal-glow 3.6s ease-in-out infinite alternate;
}
@keyframes kvartal-glow {
  from { fill-opacity: 0.6; stroke-opacity: 0.75; }
  to { fill-opacity: 1; stroke-opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .map-kvartal { animation: none; }
}
.map-marker circle { fill: var(--brass); stroke: var(--ivory); stroke-width: 2; }
.map-marker text {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  fill: var(--ink);
  paint-order: stroke;
  stroke: var(--ivory);
  stroke-width: 4;
  stroke-linejoin: round;
}
.map-marker { transform-box: fill-box; }
.map-marker--kremlin path { fill: var(--ink); stroke: var(--ivory); stroke-width: 1.5; }
.map-dist {
  fill: none;
  stroke: var(--mint);
  stroke-width: 3;
  stroke-dasharray: 7 8;
  stroke-linecap: round;
}
.map-dist-label text {
  font-family: var(--font-display);
  font-size: 30px;
  fill: var(--ink);
  paint-order: stroke;
  stroke: var(--ivory);
  stroke-width: 5;
  stroke-linejoin: round;
}

.geo__list { list-style: none; }
.geo__list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: clamp(10px, calc(var(--vh) * 1.8), 16px) 0;
  border-bottom: 1px solid color-mix(in srgb, var(--brass) 35%, transparent);
}
.geo__dist {
  font-family: var(--font-display);
  font-size: clamp(18px, 4.6vw, 26px);
  color: var(--ink);
  white-space: nowrap;
}
.geo__name { font-size: clamp(13px, 3.4vw, 16px); color: var(--ink-dim); text-align: right; }


/* ---------- 03б' · Значимые места рядом ---------- */

.near__title { font-size: clamp(26px, 5.6vw, 46px); margin-bottom: clamp(24px, 5vw, 44px); }
.near__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(14px, 2.5vw, 24px);
}
.near__item img { aspect-ratio: 4 / 5; border-radius: 4px; height: auto; }
.near__item figcaption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
}
.near__item b {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(15px, 3.8vw, 20px);
  line-height: 1.3;
}
.near__item span {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brass);
  white-space: nowrap;
}
@media (min-width: 900px) {
  .near__grid { grid-template-columns: repeat(4, 1fr); }
}
@media (hover: hover) and (pointer: fine) {
  .near__item img { transition: transform 0.5s ease; }
  .near__item:hover img { transform: translateY(-6px); }
}

/* ---------- 03в · Погружение: полноэкранные слои с кроссфейдом ---------- */

.dive { position: relative; padding: 0; background: var(--green-deep); }
html.motion .dive { height: calc(var(--svh) * 380); }

.dive__stage {
  position: sticky;
  top: 0;
  height: calc(var(--svh) * 100);
  overflow: hidden;
}
.dive__layer { position: absolute; inset: 0; }
.dive__layer img { will-change: transform; }
html.motion .dive__layer:not(:first-child) { opacity: 0; }
/* нижняя дымка — под подписи */
.dive__layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(24, 22, 18, 0.62) 0%, rgba(24, 22, 18, 0.08) 40%, transparent 60%);
  pointer-events: none;
}
.dive__captions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 0 var(--pad-x) calc(env(safe-area-inset-bottom, 0px) + clamp(40px, calc(var(--vh) * 8), 84px));
}
.dive__caption {
  position: absolute;
  left: var(--pad-x);
  right: var(--pad-x);
  bottom: calc(env(safe-area-inset-bottom, 0px) + clamp(40px, calc(var(--vh) * 8), 84px));
  margin: 0;
  max-width: 17ch;
  font-family: var(--font-display);
  font-size: clamp(24px, 5.8vw, 46px);
  line-height: 1.25;
  color: #fff;
  text-shadow: 0 2px 24px rgba(24, 22, 18, 0.45);
}
html.motion .dive__caption { opacity: 0; }

/* без motion: слои — обычная вертикальная лента, подписи под кадрами не нужны */
html:not(.motion) .dive__stage { position: relative; height: auto; overflow: visible; }
html:not(.motion) .dive__layer { position: relative; height: calc(var(--svh) * 64); }
html:not(.motion) .dive__captions { display: none; }

/* ---------- 04 · Квартал ---------- */

.houses__head { max-width: 780px; margin-bottom: clamp(36px, 6vw, 64px); }
.houses__title { font-size: clamp(30px, 6.4vw, 52px); margin-bottom: 20px; }
.houses__lead { color: var(--ink-dim); margin-bottom: 16px; max-width: 58ch; }
.houses__hint { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brass); }

.houses__wrap { display: grid; gap: clamp(24px, 5vw, 56px); }

/* генплан с зумом: слой .houses__zoom масштабируется к выбранному дому.
   На мобиле фрейм вертикальный 3:4 (карта крупнее), зум-слой остаётся
   квадратным (координаты пинов в % от кадра) и центрируется по X. */
.houses__map {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 3 / 4;
}
@media (min-width: 900px) {
  .houses__map { aspect-ratio: 1 / 1; }
}
.houses__zoom {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  aspect-ratio: 1 / 1;
  translate: -50% 0;
  transform: scale(var(--z, 1)) translate(var(--tx, 0%), var(--ty, 0%));
  transition: transform 1.15s cubic-bezier(0.25, 0.7, 0.25, 1);
}
@media (prefers-reduced-motion: reduce) {
  .houses__zoom { transition: none; }
}
.houses__reset {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 3;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  padding: 9px 15px;
  border-radius: 999px;
  border: none;
  background: rgba(242, 239, 232, 0.94);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(33, 30, 25, 0.25);
  transition: opacity 0.3s ease;
}
.houses__reset:hover { opacity: 0.85; }

/* пины домов: почти невесомые — тонкое кольцо, лёгкая дымка под цифрой
   и нежная расходящаяся пульсация как приглашение к нажатию */
.houses__pin {
  position: absolute;
  left: var(--px);
  top: var(--py);
  transform: translate(-50%, -50%) scale(calc(1 / var(--z, 1)));
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: rgba(33, 30, 25, 0.34);
  color: #fff;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 5px rgba(33, 30, 25, 0.65);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(33, 30, 25, 0.22);
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, opacity 0.4s ease,
              transform 1.15s cubic-bezier(0.25, 0.7, 0.25, 1);
}
.houses__pin::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.85);
  animation: pin-pulse 2.8s ease-out infinite;
  pointer-events: none;
}
/* пульс вразнобой — пины дышат, а не мигают хором */
.houses__pin[data-house="1"]::after { animation-delay: 0.55s; }
.houses__pin[data-house="2"]::after { animation-delay: 1.1s; }
.houses__pin[data-house="3"]::after { animation-delay: 1.65s; }
.houses__pin[data-house="4"]::after { animation-delay: 2.2s; }
@keyframes pin-pulse {
  0%   { transform: scale(1); opacity: 0.75; }
  65%  { transform: scale(1.75); opacity: 0; }
  100% { transform: scale(1.75); opacity: 0; }
}
.houses__pin:hover { background: rgba(33, 30, 25, 0.45); }
.houses__pin.is-active {
  background: var(--mint);
  border-color: var(--mint);
  color: var(--ink);
  text-shadow: none;
}
.houses__pin.is-active::after { animation: none; opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .houses__pin::after { animation: none; opacity: 0; }
}
.houses__map.is-zoomed .houses__pin:not(.is-active) { opacity: 0; pointer-events: none; }

/* мобильный bottom-sheet карточки дома: поверх нижнего края экрана */
.houses__sheet {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  z-index: 60;
  background: rgb(244, 241, 234);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(33, 30, 25, 0.4);
  transform: translateY(calc(100% + 32px));
  transition: transform 0.65s cubic-bezier(0.25, 0.7, 0.25, 1);
}
.houses__sheet.is-open { transform: none; }
/* фото дома в плашке — как в десктопной карточке */
.houses__sheet-media { height: clamp(110px, calc(var(--svh) * 15), 150px); }
.houses__sheet-body { padding: 13px 48px 15px 20px; }
.houses__sheet-name { font-size: 21px; margin: 2px 0 8px; }
.houses__sheet-text { font-size: 12.5px; line-height: 1.6; color: var(--ink-dim); }
.houses__sheet-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: color-mix(in srgb, var(--stone) 80%, transparent);
  color: var(--ink-dim);
  font-size: 13px;
  cursor: pointer;
}
@media (min-width: 900px) {
  .houses__sheet { display: none; }
}
@media (max-width: 899px) {
  /* на мобиле дом описывает bottom-sheet — статичную карточку прячем */
  .houses__side .houses__card { display: none; }
}

.chip {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 400;
  letter-spacing: 0.05em;
  padding: 10px 17px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--brass) 50%, transparent);
  background: transparent;
  color: var(--ink-dim);
  cursor: pointer;
  transition: all 0.3s ease;
}
.chip:hover { border-color: var(--brass); color: var(--ink); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--ivory); }
.houses__chips, .rez__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }

.houses__card {
  border-radius: 6px;
  overflow: hidden;
  background: var(--stone);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.houses__card.is-swapping { opacity: 0; transform: translateY(10px); }
.houses__card-media { aspect-ratio: 4 / 3; }
.houses__card-body { padding: clamp(20px, 3vw, 30px); }
.houses__role {
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 8px;
}
.houses__name { font-size: clamp(22px, 5vw, 30px); margin-bottom: 10px; }
.houses__text { font-size: 14.5px; color: var(--ink-dim); }

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

.houses__plaza { margin-top: clamp(28px, 5vw, 56px); }
.houses__plaza .plx { aspect-ratio: 4 / 3; }
@media (min-width: 900px) {
  .houses__plaza .plx { aspect-ratio: 21 / 9; }
}
.houses__plaza figcaption {
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
  padding-top: 10px;
}

/* ---------- 05 · Внутренний мир ---------- */

.inner { padding: 0 0 clamp(88px, calc(var(--vh) * 14), 160px); background: linear-gradient(var(--ivory), var(--ivory)); }

.inner__hero { position: relative; height: calc(var(--svh) * 92); }
.inner__hero .plx { border-radius: 0; height: 100%; }
.inner__hero-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(24, 22, 18, 0.72) 0%, rgba(24, 22, 18, 0.18) 45%, rgba(24, 22, 18, 0.12) 100%);
  pointer-events: none;
}
.inner__hero-text {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: clamp(28px, calc(var(--vh) * 6), 64px) var(--pad-x);
  color: #fff;
}
.inner__title { font-size: clamp(32px, 7vw, 58px); margin-bottom: 16px; color: #fff; }
.inner__lead { color: rgba(255, 255, 255, 0.85); max-width: 52ch; }

/* озеро — полноэкранный брейкер, от кромки до кромки */
.inner__lake {
  position: relative;
  margin: clamp(14px, 2vw, 24px) 0 0;
}
.inner__lake .plx { aspect-ratio: auto; height: min(calc(var(--svh) * 92), 900px); border-radius: 0; }
.inner__lake figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: clamp(20px, 5vw, 40px) clamp(20px, 4vw, 44px);
  background: linear-gradient(to top, rgba(24, 22, 18, 0.68), transparent);
  color: #fff;
  border-radius: 0 0 4px 4px;
}
.inner__lake em {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(19px, 4.6vw, 32px);
  line-height: 1.3;
}
.inner__lake figcaption { padding-left: var(--pad-x); padding-right: var(--pad-x); border-radius: 0; }

.inner__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: clamp(28px, 5vw, 56px) var(--pad-x) 0;
}
.inner__item img { aspect-ratio: 4 / 5; border-radius: 4px; height: auto; }
@media (min-width: 900px) {
  .inner__grid { grid-template-columns: repeat(3, 1fr); gap: clamp(14px, 2vw, 24px); }
}

/* ---------- 06 · Резиденции ---------- */

.rez__head { max-width: 760px; margin-bottom: clamp(28px, 5vw, 52px); }
.rez__title { font-size: clamp(34px, 7vw, 56px); margin-bottom: 20px; }
.rez__lead { color: var(--ink-dim); max-width: 56ch; }

.rez__stage {
  display: grid;
  gap: 20px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--stone);
  /* кроссфейд ведёт GSAP (main.js); will-change для плавности зума кадра */
  will-change: opacity, transform;
}
.rez__media img { will-change: transform; }
.rez__media { aspect-ratio: 4 / 5; }
.rez__info { padding: 0 clamp(20px, 3vw, 32px) clamp(24px, 3vw, 32px); }
.rez__name { font-size: clamp(22px, 5.4vw, 32px); margin-bottom: 12px; }
.rez__text { font-size: 14.5px; color: var(--ink-dim); margin-bottom: 14px; max-width: 52ch; }
.rez__specs { list-style: none; margin-bottom: 16px; }
.rez__specs li {
  position: relative;
  padding: 11px 0 11px 24px;
  border-bottom: 1px solid color-mix(in srgb, var(--brass) 28%, transparent);
  font-size: 13.5px;
  color: var(--ink-dim);
}
.rez__specs li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 12px;
  height: 1px;
  background: var(--mint);
}
.rez__example {
  font-size: 13px;
  color: var(--brass);
  letter-spacing: 0.04em;
  border-left: 2px solid var(--mint);
  padding-left: 12px;
}
.rez__example:empty { display: none; }

.rez__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: clamp(28px, 5vw, 56px);
}
.rez__detail img { aspect-ratio: 4 / 5; border-radius: 4px; height: auto; }

@media (min-width: 900px) {
  .rez__stage { grid-template-columns: minmax(0, 460px) 1fr; align-items: stretch; }
  .rez__media { aspect-ratio: 3 / 4; height: auto; }
  .rez__info { padding: 36px; align-self: center; }
  .rez__row { grid-template-columns: repeat(4, minmax(0, 320px)); justify-content: center; gap: clamp(14px, 2vw, 24px); }
}

/* ---------- 07 · Пентхаусы (тёмная) ---------- */

.pent { background: var(--green-deep); color: var(--cream); }
.pent__head { max-width: 740px; margin-bottom: clamp(28px, 5vw, 52px); }
.pent__title { font-size: clamp(30px, 6.6vw, 52px); margin-bottom: 18px; }
.pent__lead { color: var(--cream-dim); max-width: 50ch; }
/* крыша — на весь экран, от кромки до кромки */
.pent__media { margin: 0 calc(-1 * var(--pad-x)); }
.pent__media .plx { aspect-ratio: auto; height: min(calc(var(--svh) * 88), 860px); border-radius: 0; }
.pent__pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: clamp(20px, 4vw, 44px);
}
.pent__half img { aspect-ratio: 3 / 4; border-radius: 4px; height: auto; }

@media (min-width: 900px) {
  .pent__pair { gap: clamp(14px, 2vw, 24px); }
}

/* ---------- 08 · Клуб (тёмная) ---------- */

.club { background: var(--green-soft); color: var(--cream); }
.club__head { max-width: 720px; margin-bottom: clamp(28px, 5vw, 48px); }
.club__title { font-size: clamp(30px, 6.6vw, 52px); }

/* карусель: лента карточек, листается скроллом (пин на десктопе и мобиле) */
.club__track { display: flex; gap: clamp(14px, 2vw, 24px); will-change: transform; }
.club__card { flex: none; width: clamp(230px, 62vw, 380px); }
.club__card img { aspect-ratio: 3 / 4; border-radius: 4px; height: auto; }
.club__card--wide { width: clamp(300px, 80vw, 600px); }
.club__card--wide img { aspect-ratio: 4 / 3; }
.club__card figcaption {
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--cream);
  padding-top: 12px;
}
.club__line {
  margin-top: clamp(24px, calc(var(--vh) * 4), 44px);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream-dim);
  line-height: 2.1;
  max-width: 640px;
}
@media (min-width: 900px) {
  .club__card { width: clamp(240px, 22vw, 380px); }
  .club__card--wide { width: clamp(320px, 34vw, 600px); }
}
html.motion .club { height: calc(var(--svh) * 320); padding: 0; }
html.motion .club__pin {
  position: sticky;
  top: 0;
  height: calc(var(--svh) * 100);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: calc(env(safe-area-inset-top, 0px) + 70px) var(--pad-x) clamp(24px, calc(var(--vh) * 4), 44px);
}
html:not(.motion) .club__track {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
}
html:not(.motion) .club__card { scroll-snap-align: start; }

/* ---------- 09 · Технологии ---------- */

.tech { display: grid; gap: clamp(36px, 6vw, 80px); align-items: center; }
.tech__title { font-size: clamp(28px, 6vw, 48px); margin-bottom: clamp(24px, 5vw, 44px); max-width: 16ch; }
.tech__list { list-style: none; max-width: 560px; }
.tech__list li {
  position: relative;
  padding: 16px 0 16px 28px;
  border-bottom: 1px solid color-mix(in srgb, var(--brass) 30%, transparent);
  color: var(--ink-dim);
  font-size: clamp(14px, 3.8vw, 16.5px);
}
.tech__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 12px;
  height: 1px;
  background: var(--mint);
}
.tech__media { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(14px, 2vw, 24px); align-items: start; }
.tech__shot .plx { aspect-ratio: 3 / 4; }
.tech__shot figcaption {
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
  padding-top: 10px;
  line-height: 1.7;
}
@media (min-width: 900px) {
  .tech { grid-template-columns: 1.1fr 0.9fr; }
  .tech__media { order: -1; }
}

/* ---------- 10 · Окружение: пролёт карточек ---------- */

.city { position: relative; padding: 0; background: var(--green-deep); }

.city__stage {
  position: relative;
  height: calc(var(--svh) * 100);
  overflow: hidden;
}

.city__stage-title {
  position: absolute;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%);
  width: min(92vw, 17ch);
  text-align: center;
  font-size: clamp(30px, 6vw, 58px);
  line-height: 1.22;
  color: var(--cream);
  z-index: 1;
}

/* карточки «реки»: вертикальный anchor по центру экрана,
   подъём и глубину задаёт таймлайн (main.js) */
.city__card {
  position: absolute;
  top: 50%;
  overflow: hidden;
  border-radius: 5px;
  will-change: transform, opacity;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}
.city__card img { will-change: transform; }
.city__card figcaption {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 1;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff;
  /* без блюра: подписи живут поверх скрабящихся карточек, блюр репейнтил каждый кадр */
  background: rgba(24, 22, 18, 0.66);
  padding: 6px 10px;
  border-radius: 3px;
}

/* «мир» пролётки: горизонтальные полосы + развороты; вертикаль ведёт таймлайн.
   Соседние по порядку карточки — в разных полосах, чтобы не наезжать при подъёме */
.cc-1 { width: 26vw; aspect-ratio: 4/3;  left: 6vw;  rotate: -2deg; }
.cc-2 { width: 25vw; aspect-ratio: 4/5;  left: 60vw; rotate: 1.5deg; }
.cc-3 { width: 22vw; aspect-ratio: 4/3;  left: 34vw; rotate: -1deg; }
.cc-4 { width: 18vw; aspect-ratio: 4/5;  left: 72vw; rotate: 2deg; }
.cc-5 { width: 17vw; aspect-ratio: 3/4;  left: 8vw;  rotate: 1.5deg; }
.cc-6 { width: 24vw; aspect-ratio: 9/10; left: 40vw; rotate: -2deg; }
.cc-7 { width: 19vw; aspect-ratio: 4/5;  left: 66vw; rotate: 1deg; }
.cc-8 { width: 16vw; aspect-ratio: 3/4;  left: 20vw; rotate: -1.5deg; }
.cc-9 { width: 21vw; aspect-ratio: 3/4;  left: 48vw; rotate: 1.5deg; }
.cc-10 { width: 23vw; aspect-ratio: 16/10; left: 70vw; rotate: -1deg; }
.cc-11 { width: 25vw; aspect-ratio: 16/10; left: 30vw; rotate: 2deg; }

@media (max-width: 700px) {
  .city__card { box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4); }
  .cc-1 { width: 46vw; left: 6vw; }
  .cc-2 { width: 50vw; left: 48vw; }
  .cc-3 { width: 44vw; left: 26vw; }
  .cc-4 { width: 38vw; left: 58vw; }
  .cc-5 { width: 36vw; left: 6vw; }
  .cc-6 { width: 48vw; left: 34vw; }
  .cc-7 { width: 40vw; left: 56vw; }
  .cc-8 { width: 34vw; left: 12vw; }
  .cc-9 { width: 44vw; left: 48vw; }
  .cc-10 { width: 48vw; left: 8vw; }
  .cc-11 { width: 50vw; left: 42vw; }
}

/* финал: квартал раскрывается на весь экран — всегда верхним слоем;
   траектории хвостовых карточек разведены так, чтобы под него не попадать */
.city__final {
  left: 0;
  top: 0;
  width: 100vw;
  height: calc(var(--svh) * 100);
  border-radius: 0;
  box-shadow: none;
  z-index: 2;
  transform-origin: center center;
  rotate: 0deg;
}
.city__final-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(24, 22, 18, 0.72) 0%, rgba(24, 22, 18, 0.1) 50%);
}
.city__final-text {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: clamp(28px, calc(var(--vh) * 6), 64px) var(--pad-x);
  color: #fff;
}
.city__final-line {
  font-family: var(--font-display);
  font-size: clamp(24px, 5.6vw, 44px);
  line-height: 1.25;
}

/* без motion: пролёт становится вертикальной лентой */
html:not(.motion) .city { padding: clamp(88px, calc(var(--vh) * 14), 160px) var(--pad-x); }
html:not(.motion) .city__stage { height: auto; overflow: visible; }
html:not(.motion) .city__stage-title { position: relative; left: auto; top: auto; transform: none; margin: 0 auto clamp(28px, 5vw, 48px); }
html:not(.motion) .city__card { position: relative; left: auto !important; top: auto !important; width: 100%; margin-bottom: 20px; rotate: 0deg; }
html:not(.motion) .city__final { height: auto; aspect-ratio: 4 / 3; }

/* ---------- 11 · Цифры ---------- */

.facts { background: var(--stone); }
.facts__list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 64px) clamp(20px, 4vw, 48px);
  max-width: 1080px;
  margin: 0 auto;
}
.facts__item { border-top: 1px solid color-mix(in srgb, var(--brass) 40%, transparent); padding-top: 18px; }
.facts__num {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(32px, 7.4vw, 58px);
  color: var(--ink);
  margin-bottom: 6px;
}
.facts__label { font-size: clamp(12px, 3.2vw, 14px); color: var(--ink-dim); letter-spacing: 0.04em; }
@media (min-width: 900px) {
  .facts__list { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- 12 · Девелопер ---------- */

.dev__head { max-width: 800px; margin-bottom: clamp(36px, 6vw, 64px); }
.dev__title { font-size: clamp(32px, 7vw, 54px); margin-bottom: 20px; }
.dev__lead { color: var(--ink-dim); margin-bottom: clamp(28px, 5vw, 44px); max-width: 56ch; }
.dev__stats { list-style: none; display: grid; gap: 18px; }
.dev__stats li { font-size: 14px; color: var(--ink-dim); border-top: 1px solid color-mix(in srgb, var(--brass) 40%, transparent); padding-top: 14px; }
.dev__stats span {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(28px, 6vw, 44px);
  color: var(--brass);
}
@media (min-width: 700px) {
  .dev__stats { grid-template-columns: repeat(3, 1fr); gap: clamp(18px, 3vw, 40px); }
}

.dev__photos { margin-top: clamp(32px, 6vw, 64px); }
.dev__photos-kicker {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 18px;
}
.dev__photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dev__photo img { aspect-ratio: 4 / 3; border-radius: 4px; height: auto; }
@media (min-width: 900px) {
  .dev__photo-grid { grid-template-columns: repeat(4, 1fr); gap: clamp(14px, 2vw, 24px); }
}

/* реальное фото построенного — от кромки до кромки */
.dev__built { margin: clamp(28px, 5vw, 56px) calc(-1 * var(--pad-x)) 0; }
.dev__built .plx { aspect-ratio: 4 / 3; border-radius: 0; }
.dev__built figcaption {
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
  padding: 10px var(--pad-x) 0;
}
@media (min-width: 900px) {
  .dev__built .plx { aspect-ratio: 21 / 9; max-height: calc(var(--svh) * 80); }
}

.dev__deadline {
  margin-top: clamp(36px, 7vw, 64px);
  font-family: var(--font-display);
  font-size: clamp(24px, 5.4vw, 38px);
  text-align: center;
}

/* ---------- 13 · Контакт ---------- */

.outro { position: relative; color: var(--cream); text-align: center; overflow: hidden; padding-top: clamp(110px, calc(var(--vh) * 18), 190px); padding-bottom: clamp(110px, calc(var(--vh) * 18), 190px); }
.outro__bg { position: absolute; inset: 0; }
.outro__veil { position: absolute; inset: 0; background: rgba(24, 22, 18, 0.72); }
.outro__inner { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; }
.outro__inner .kicker { justify-content: center; }
.outro__title { font-size: clamp(28px, 6.4vw, 46px); margin-bottom: 16px; color: #fff; }
.outro__text { color: rgba(239, 236, 227, 0.75); margin-bottom: 30px; }
.outro__phone {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(30px, 7.4vw, 54px);
  line-height: 1.2;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--mint) 55%, transparent);
  padding-bottom: 8px;
  margin-bottom: clamp(24px, calc(var(--vh) * 4), 36px);
  transition: color 0.3s ease, border-color 0.3s ease;
}
.outro__phone:hover { color: var(--mint); border-color: var(--mint); }
.outro__links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}
.outro__link {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--cream);
  text-decoration: none;
  border: 1px solid rgba(239, 236, 227, 0.35);
  border-radius: 999px;
  padding: 13px 24px;
  transition: color 0.3s ease, border-color 0.3s ease;
}
.outro__link:hover { color: var(--mint); border-color: var(--mint); }

/* ---------- Ховеры карточек (точный указатель) ---------- */

@media (hover: hover) and (pointer: fine) {
  .inner__item img, .club__card img, .dev__photo img, .rez__detail img, .pent__half img {
    transition: transform 0.5s ease;
  }
  .inner__item:hover img, .club__card:hover img, .dev__photo:hover img,
  .rez__detail:hover img, .pent__half:hover img { transform: translateY(-6px); }
}

/* ---------- Reveal: до инициализации GSAP элементы видимы ---------- */

html.motion [data-reveal] { opacity: 0; }
html.motion [data-reveal-group] > * { opacity: 0; }

/* prefers-reduced-motion обрабатывается в JS: класс .motion не ставится,
   страница остаётся обычной вертикальной лентой */
