/* =========================================================================
   «Баланс Тауэрс» — мини-лендинг «Семейные квартиры бизнес-класса»
   Визуальный язык боевых лендингов sm-balancetowers.ru, /exc и /family:
   Muller, заголовки прописными, лайм #CEDC00, светлые секции, серые
   плашки-метки «● Раздел», скругления, «стеклянная» плашка на фото.
   Движение сдержанное: мягкое появление при прокрутке, без пинов и наслоений.
   ========================================================================= */

@font-face { font-family: "Muller"; src: url("../fonts/muller-light.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Muller"; src: url("../fonts/muller-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Muller"; src: url("../fonts/muller-medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --lime: #CEDC00;
  --lime-hover: #DCE84A;
  --lime-ink: #8E9800;
  --ink: #0B0B0C;
  --ink-2: #555559;
  --ink-3: #8A8A8F;
  --bg: #FFFFFF;
  --bg-2: #F4F4F4;
  --bg-3: #E8E8E8;
  --dark: #0B0B0C;
  --line: rgba(11, 11, 12, .1);

  --r-xl: 28px;
  --r-lg: 20px;
  --r-btn: 10px;

  --gutter: 16px;
  --maxw: 1360px;
  --sec: 72px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}
@media (min-width: 768px)  { :root { --gutter: 32px; --sec: 96px; } }
@media (min-width: 1280px) { :root { --gutter: 48px; --sec: 112px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Muller", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 17px; line-height: 1.5; font-weight: 400;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
img, video { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--lime); color: var(--ink); }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--ink); color: #fff; border-radius: 8px; }
.skip:focus { top: 8px; }
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.lime { color: var(--lime); }

/* ---------- Типографика ---------- */
.h2 { font-weight: 400; text-transform: uppercase; font-size: clamp(28px, 3.6vw, 52px); line-height: 1.05; text-wrap: balance; }
.lead { font-size: clamp(17px, 1.3vw, 20px); line-height: 1.45; color: var(--ink-2); }
.head { display: grid; gap: 20px; margin-bottom: clamp(36px, 4.5vw, 64px); }
.head--center { justify-items: center; text-align: center; }
.head--center .lead { max-width: 620px; }
/* подзаголовок «Для семьи»: на десктопе ровно две строки, вторая — со слов «В «Баланс Тауэрс»…» */
@media (min-width: 900px) { .head--center .lead--2 { max-width: 780px; } .lead--2 span { display: block; } }

.tag {
  display: inline-flex; align-items: center; gap: 10px; justify-self: start; align-self: flex-start;
  padding: 7px 14px; border-radius: 8px; background: var(--bg-3); font-size: 14px; line-height: 1.2;
}
.head--center .tag { justify-self: center; align-self: center; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag--dark { background: rgba(255, 255, 255, .1); color: #fff; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 28px; border: 0; border-radius: var(--r-btn); cursor: pointer;
  font-size: 16px; line-height: 1.15; text-align: center; text-decoration: none; white-space: nowrap;
  transition: background-color .25s, color .25s, box-shadow .25s;
  -webkit-tap-highlight-color: transparent;
}
.btn--sm { min-height: 44px; padding: 0 20px; font-size: 15px; }
.btn--block { display: flex; width: 100%; }
.btn--lime { background: var(--lime); color: var(--ink); }
.btn--white { background: #fff; color: var(--ink); }
.btn--line { background: transparent; color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45); }
.btn--line-dark { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
@media (hover: hover) {
  .btn--lime:hover { background: var(--lime-hover); }
  .btn--white:hover { background: var(--lime); }
  .btn--line:hover { box-shadow: inset 0 0 0 1px #fff; }
  .btn--line-dark:hover { box-shadow: inset 0 0 0 1px var(--ink); }
}
.btn[aria-busy="true"] { pointer-events: none; opacity: .7; }

.glass {
  background: rgba(255, 255, 255, .18);
  -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); color: #fff;
}

/* =========================================================================
   Шапка (после первого экрана)
   ========================================================================= */
.bar {
  position: fixed; inset: 0 0 auto; z-index: 40; color: #fff;
  background: rgba(11, 11, 12, .78);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  transform: translateY(-105%); transition: transform .5s var(--ease);
}
.bar.is-on { transform: none; }
.bar__in { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 64px; }
.bar__logo img { height: 36px; width: auto; }
.bar__nav { display: none; gap: 32px; font-size: 15px; }
.bar__nav a { text-decoration: none; opacity: .8; transition: opacity .2s; }
.bar__nav a:hover { opacity: 1; }
@media (min-width: 1024px) { .bar__nav { display: flex; } }
@media (max-width: 520px) { .bar .btn { display: none; } }

/* =========================================================================
   1. Первый экран — как на /family: башни справа, текст слева
   ========================================================================= */
.hero {
  position: relative; isolation: isolate; overflow: hidden; color: #fff; background: var(--dark);
  min-height: 100vh; min-height: 100svh; display: grid; grid-template-rows: auto 1fr auto;
}
.hero__bg { position: absolute; inset: 0; z-index: -2; }
.hero__bg img { width: 100%; height: 100%; object-fit: cover; object-position: 75% 50%; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  /* у картинки с главной уже есть размытие слева — затемняем мягко, только под текст */
  background:
    linear-gradient(90deg, rgba(11, 11, 12, .5) 0%, rgba(11, 11, 12, .25) 34%, rgba(11, 11, 12, 0) 55%),
    linear-gradient(180deg, rgba(11, 11, 12, .35) 0%, rgba(11, 11, 12, 0) 22%),
    linear-gradient(0deg, rgba(11, 11, 12, .35) 0%, rgba(11, 11, 12, 0) 26%);
}
.hero__top { padding-top: clamp(20px, 3vw, 40px); }
.hero__logo img { height: clamp(40px, 3.4vw, 54px); width: auto; }
.hero__body { align-self: center; padding-block: 32px; }
.hero__title { font-weight: 400; text-transform: uppercase; font-size: clamp(30px, 4.4vw, 68px); line-height: 1.04; }
.hero__price { margin-top: 16px; color: var(--lime); font-size: clamp(30px, 3.2vw, 50px); line-height: 1.1; }
.hero__price sup { font-size: .45em; vertical-align: .9em; }
.hero__sub { margin-top: 10px; font-size: clamp(17px, 1.3vw, 20px); color: rgba(255, 255, 255, .9); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(28px, 3vw, 40px); }
.hero__foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-bottom: clamp(20px, 3vw, 36px); }
.hero__badges { display: flex; align-items: center; gap: 16px; }
.hero__badges img { height: clamp(60px, 6vw, 96px); width: auto; }
.hero__status { padding: clamp(12px, 1.2vw, 18px) clamp(20px, 2vw, 32px); border-radius: 14px; font-size: clamp(18px, 1.8vw, 28px); line-height: 1.1; }

@media (max-width: 760px) {
  /* телефон: картинка с главной sm-balancetowers.ru — небо сверху под текст, башни внизу */
  .hero__bg img { object-position: 50% 100%; }
  .hero::after {
    background:
      linear-gradient(180deg, rgba(11, 11, 12, .55) 0%, rgba(11, 11, 12, .3) 40%, rgba(11, 11, 12, 0) 62%),
      linear-gradient(0deg, rgba(11, 11, 12, .45) 0%, rgba(11, 11, 12, 0) 18%);
  }
  .hero__top { padding-top: 28px; }
  /* отступ от логотипа растёт с высотой экрана, чтобы текст не прилипал к верху */
  .hero__body { align-self: start; padding-block: clamp(36px, 6.5svh, 64px) 20px; }
  .hero__title { font-size: clamp(24px, 7.2vw, 40px); }
  .hero__price { margin-top: 12px; font-size: clamp(28px, 8vw, 40px); }
  .hero__sub { font-size: 16px; }
  .hero__cta { margin-top: 22px; }
  .hero__cta .btn { flex: 1 1 100%; white-space: normal; }
  .hero__badges img { height: 48px; }
  .hero__status { font-size: 16px; padding: 10px 16px; }
}

/* Появление первого экрана при загрузке */
@media (prefers-reduced-motion: no-preference) {
  .hero__bg img { animation: heroImg 1.6s var(--ease) both; }
  .in-1, .in-2, .in-3, .in-4 { animation: rise 1s var(--ease) both; }
  .in-1 { animation-delay: .15s; } .in-2 { animation-delay: .3s; } .in-3 { animation-delay: .45s; } .in-4 { animation-delay: .6s; }
}
@keyframes heroImg { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* =========================================================================
   Баланс в цифрах
   ========================================================================= */
.facts { padding-block: clamp(32px, 4vw, 56px); border-bottom: 1px solid var(--line); }
.facts__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
.facts b { display: block; font-weight: 300; font-size: clamp(32px, 3.4vw, 52px); line-height: 1; }
.facts li span { display: block; margin-top: 8px; color: var(--ink-2); font-size: 15px; line-height: 1.3; }
@media (min-width: 900px) {
  .facts__list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .facts li + li { padding-left: 32px; border-left: 1px solid var(--line); }
}

/* =========================================================================
   2. УТП: карточки-фото, как блок «Ценности» на sm-balancetowers.ru
   ========================================================================= */
.why { padding-block: var(--sec); }
.cards { display: grid; gap: 16px; }
.card {
  position: relative; overflow: hidden; isolation: isolate; border-radius: var(--r-lg);
  aspect-ratio: 3 / 4; color: #fff; background: var(--bg-3);
}
.card picture, .card img { position: absolute; inset: 0; width: 100%; height: 100%; }
.card img { object-fit: cover; transition: transform 1.2s var(--ease); }
.card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(11, 11, 12, .82) 0%, rgba(11, 11, 12, .35) 45%, rgba(11, 11, 12, .1) 100%); }
.card__num { position: absolute; left: 22px; top: 18px; z-index: 1; font-size: 26px; font-weight: 300; }
.card__body { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 22px; display: grid; gap: 8px; }
.card h3 { font-weight: 400; font-size: clamp(22px, 1.8vw, 28px); line-height: 1.15; }
.card p { font-size: 15px; line-height: 1.4; color: rgba(255, 255, 255, .88); }
@media (hover: hover) { .card:hover img { transform: scale(1.05); } }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .card { aspect-ratio: 4 / 3; } }
@media (min-width: 1100px) { .card { aspect-ratio: 3 / 4; } }
@media (min-width: 1100px) { .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 639.98px) {
  /* телефон: листаются свайпом */
  .cards { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scrollbar-width: none; }
  .cards::-webkit-scrollbar { display: none; }
  .card { flex: 0 0 82%; scroll-snap-align: center; aspect-ratio: 4 / 5; }
}

/* =========================================================================
   3. Квиз
   ========================================================================= */
.quiz { padding-block: var(--sec); background: var(--bg-2); }
.quiz__grid { display: grid; gap: 40px; align-items: center; }
.quiz__text { display: grid; gap: 22px; }
.steps { display: grid; margin-top: 8px; border-top: 1px solid var(--line); }
.steps li { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 18px; }
.steps b { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--lime); font-weight: 500; font-size: 15px; flex: none; }
.quiz__frame { position: relative; overflow: hidden; border-radius: var(--r-lg); background: #F4F4F4; min-height: 600px; box-shadow: 0 30px 70px -40px rgba(11, 11, 12, .35); }
.quiz__frame [data-marquiz-id] { min-height: 600px; }
.quiz__frame.is-ready, .quiz__frame.is-ready [data-marquiz-id] { min-height: 0; }
.quiz__wait { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: #fff; color: var(--ink-2); transition: opacity .4s; text-align: center; padding: 24px; }
.quiz__frame.is-ready .quiz__wait { opacity: 0; pointer-events: none; }
.quiz__direct { display: block; width: 100%; height: 640px; border: 0; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--bg-3); border-top-color: var(--lime-ink); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (min-width: 1024px) { .quiz__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 72px; } }

/* =========================================================================
   Переезд: трейд-ин
   ========================================================================= */
.move-sec { padding-block: var(--sec); }
.move { display: grid; overflow: hidden; border-radius: var(--r-xl); background: var(--dark); color: #fff; }
.move__text { display: flex; flex-direction: column; gap: 22px; padding: clamp(28px, 4vw, 64px); }
.move__title { font-weight: 400; text-transform: uppercase; font-size: clamp(26px, 3vw, 44px); line-height: 1.06; }
.move__text > p { color: rgba(255, 255, 255, .78); max-width: 32em; font-size: 18px; }
.ticks { display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 34px; color: rgba(255, 255, 255, .92); }
.ticks li::before { content: ""; position: absolute; left: 0; top: .1em; width: 22px; height: 22px; border-radius: 50%; background: var(--lime); }
.ticks li::after { content: ""; position: absolute; left: 7px; top: calc(.1em + 6px); width: 8px; height: 5px; border-left: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(-45deg); }
.move__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.move__img { position: relative; min-height: 320px; overflow: hidden; }
.move__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; }
@media (min-width: 900px) {
  .move { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .move__img { min-height: 560px; }
}
@media (max-width: 600px) { .move__cta .btn { flex: 1 1 100%; } }

/* =========================================================================
   4. Видео — без заголовка, слоган и кнопка сбоку
   ========================================================================= */
.film { background: #000; color: #fff; }
.player { position: relative; }
.player__media { position: relative; aspect-ratio: 16 / 9; background: #000; }
.player__media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* чёрная плашка со слоганом */
.player__plate { display: grid; justify-items: start; gap: clamp(28px, 3.4vw, 64px); background: #000; }
.player__title { font-size: clamp(32px, 3.3vw, 60px); line-height: 1.12; text-transform: uppercase; color: #fff; }
.player__btn { min-height: clamp(60px, 4vw, 76px); padding-inline: clamp(36px, 3.6vw, 56px); font-size: clamp(16px, 1.1vw, 20px); }
@media (min-width: 900px) {
  /* десктоп: видео во всю ширину, плашка в левом нижнем углу */
  .player__media { max-height: 100svh; min-height: 560px; width: 100%; }
  .player__wrap { position: absolute; inset: auto 0 clamp(32px, 2.6vw, 48px) 0; pointer-events: none; }
  /* плашка на 15% меньше: отступы, шрифт и кнопка ×0,85 */
  .player__plate { pointer-events: auto; width: max-content; max-width: 100%; padding: clamp(30px, 2.4vw, 46px); gap: clamp(24px, 2.9vw, 54px); border-radius: var(--r-btn); }
  .player__title { font-size: clamp(27px, 2.8vw, 51px); }
  .player__btn { min-height: clamp(51px, 3.4vw, 65px); padding-inline: clamp(30px, 3vw, 48px); font-size: clamp(15px, .95vw, 17px); }
}
@media (max-width: 899.98px) {
  /* телефон: видео сверху, под ним чёрный блок со слоганом */
  .film { padding-top: 64px; }
  .player__wrap { padding-block: 32px 48px; }
  .player__plate { gap: 22px; }
  .player__title { font-size: clamp(30px, 9.4vw, 44px); }
  .player__btn { min-width: 68%; min-height: 64px; font-size: 18px; }
}

/* =========================================================================
   Подвал
   ========================================================================= */
.foot { padding-block: 48px calc(40px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); font-size: 15px; }
.foot__grid { display: grid; gap: 24px; padding-bottom: 32px; border-bottom: 1px solid var(--line); }
.foot__logo { height: 44px; width: auto; filter: invert(1); }
.foot__lbl { display: block; margin-bottom: 4px; color: var(--ink-3); font-size: 14px; }
.foot__links { display: grid; gap: 8px; }
.foot__links a { text-underline-offset: 3px; }
.foot__legal { display: grid; gap: 10px; padding-top: 24px; color: var(--ink-3); font-size: 13px; line-height: 1.5; }
@media (min-width: 1024px) { .foot__grid { grid-template-columns: 1.2fr 1fr 1fr 1.2fr; gap: 40px; } }

/* ---------- Мобильная кнопка ---------- */
.dock { display: none; }
@media (max-width: 760px) {
  .dock { display: block; position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 45; transform: translateY(150%); transition: transform .5s var(--ease); }
  .dock.is-on { transform: none; }
  .dock .btn { width: 100%; box-shadow: 0 12px 30px rgba(0, 0, 0, .3); }
  .foot { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
}

/* =========================================================================
   Окно заявки «Получить каталог»
   ========================================================================= */
.modal {
  width: min(880px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 0;
  border-radius: var(--r-xl); background: #fff; color: var(--ink); overflow: auto;
}
.modal::backdrop { background: rgba(11, 11, 12, .6); }
.modal[open] { display: grid; }
@media (prefers-reduced-motion: no-preference) {
  .modal[open] { animation: rise .45s var(--ease); }
}
.modal__x { position: absolute; right: 14px; top: 14px; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); cursor: pointer; }
.modal__x svg { width: 20px; height: 20px; }
.modal__media { display: none; }
.modal__media img { width: 100%; height: 100%; object-fit: cover; }
.modal__body { padding: clamp(28px, 4vw, 48px); }
.modal__title { font-size: clamp(24px, 2.4vw, 32px); line-height: 1.1; text-transform: uppercase; padding-right: 40px; }
.modal__sub { margin-top: 10px; color: var(--ink-2); }
@media (min-width: 820px) {
  .modal[open] { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
  .modal__media { display: block; position: relative; }
  .modal__media img { position: absolute; inset: 0; object-position: 50% 30%; }
}
.form { display: grid; gap: 16px; }
.form .modal__sub { margin-bottom: 8px; }
.field { display: grid; gap: 6px; }
.field input {
  width: 100%; height: 56px; padding: 0 18px; border: 1px solid transparent; border-radius: var(--r-btn);
  background: var(--bg-2); color: var(--ink); font: inherit; font-size: 17px; transition: border-color .2s, background .2s;
}
.field input:focus { outline: none; border-color: var(--ink); background: #fff; }
.field input[aria-invalid="true"] { border-color: #D2401E; }
.field__err { color: #C2381A; font-size: 14px; }
.field__err[hidden] { display: none; }
.check { position: relative; display: flex; gap: 12px; font-size: 13px; line-height: 1.4; color: var(--ink-2); cursor: pointer; }
.check input { position: absolute; opacity: 0; width: 22px; height: 22px; margin: 0; }
.check__box { flex: none; width: 22px; height: 22px; border-radius: 6px; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); position: relative; }
.check input:checked + .check__box { background: var(--lime); box-shadow: none; }
.check input:checked + .check__box::after { content: ""; position: absolute; left: 7px; top: 3px; width: 7px; height: 12px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg); }
.check input:focus-visible + .check__box { outline: 2px solid var(--ink); outline-offset: 2px; }
.check input[aria-invalid="true"] + .check__box { box-shadow: inset 0 0 0 2px #D2401E; }
.check a { color: var(--ink); text-underline-offset: 2px; }
.form .btn { margin-top: 6px; }
.form__status { font-size: 14px; color: var(--ink-2); }
.form__status:empty { display: none; }
.form[hidden], .success[hidden] { display: none; }
.success { display: grid; justify-items: start; gap: 6px; outline: none; }
.success__ico { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--lime); margin-bottom: 12px; }
.success__ico svg { width: 26px; height: 26px; }
.success .btn { margin-top: 18px; }

/* ---------- Мягкое появление при прокрутке ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-fade] { opacity: 0; transform: translateY(20px); transition: opacity .8s var(--ease), transform .9s var(--ease); transition-delay: calc(var(--d, 0) * 80ms); }
  .js [data-fade].is-in { opacity: 1; transform: none; }
}
