/* ============================================================
   ТОПДОМ — телефон, второй проход (26.10.2026): компактнее, ровный первый экран, аккуратные кнопки, окна по размеру экрана.
   Подключается ПОСЛЕДНИМ на каждой странице. Всё внутри max-width: 900px, компьютерная версия не меняется.
   ============================================================ */

@media (max-width: 900px) {

  /* ---------- общее: плотнее отступы и заголовки, длинные тексты короче ---------- */
  :root { --gutter: 16px; }
  .section { padding-top: 30px; padding-bottom: 30px; }
  .head { margin-bottom: 14px; gap: 8px; }
  .h2 { font-size: clamp(23px, 6.4vw, 29px); line-height: 1.08; }
  .lead { font-size: 13.5px; line-height: 1.42; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
  .fix .head .lead, .lm .lead { -webkit-line-clamp: 4; }
  .lead.m-keep { -webkit-line-clamp: unset; display: block; }

  /* блоки въезжают снизу, а не сбоку: ничего не вылетает за край экрана и не обрезается */
  .mo-on .mo[data-mv="left"], .mo-on .mo[data-mv="right"], .mo-on .mo[data-mv="pop"], .mo-on .mo[data-mv="rise"] { translate: 0 26px; rotate: 0deg; scale: 1; }
  .mo-on .mo { translate: 0 26px; }
  .mo-on .mo.mo-in { translate: 0 0; }
  html, body { overflow-x: clip; }
  main, section, .wrap { max-width: 100vw; }

  /* кнопки никогда не превращаются в овал: растут по высоте, текст переносится */
  .btn { height: auto; min-height: 48px; white-space: normal; text-align: left; line-height: 1.15; }
  .btn .btn__ic { flex: none; }

  /* ---------- первый экран ровно в размер экрана, фон темнее, заголовок крупнее и вверху ---------- */
  .hero { height: calc(100svh - var(--hdr)); min-height: 420px; max-height: none; }
  .hero::before { background: linear-gradient(180deg, rgba(0,0,0,.62) 0%, rgba(0,0,0,.34) 38%, rgba(0,0,0,.42) 62%, rgba(0,0,0,.72) 100%) !important; }
  .hero__in, .hero__in--v2 { inset: 0; display: flex; flex-direction: column; justify-content: space-between; align-items: stretch; gap: 14px; padding-top: 22px; padding-bottom: 16px; }
  .hero__col { max-width: 100%; }
  .hero h1 { font-size: clamp(38px, 11.4vw, 48px); line-height: 1.0; }
  .hero__tag { margin-top: 12px; font-size: 18px; }
  .hero__sub { margin-top: 8px; font-size: 13.5px; line-height: 1.4; max-width: 30em; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
  .hero__cta { gap: 10px; }
  .hero__cta .btn { min-height: 50px; }
  .hero__cap { margin-top: 8px; font-size: 12px; }
  :root { --adv-h: auto; }
  .adv { height: auto; }
  .adv__item, .adv__item + .adv__item { padding-top: 12px; padding-bottom: 12px; }
  .adv__item b { font-size: 13px; line-height: 1.25; }

  /* ---------- главная: блоки поменьше ---------- */
  .pcard { aspect-ratio: 16 / 10; }
  .pcard__info { padding: 12px 14px; }
  .pcard__info b { font-size: 19px; }
  .pcard__info span, .pcard__info small { font-size: 16px; }
  .plan__media { aspect-ratio: 16 / 10; }
  .plan .steps li, .plan__steps li { padding-top: 10px; padding-bottom: 10px; }
  .built__item { aspect-ratio: 4 / 3; }
  .level__num, .level--cta .level__num { font-size: 64px; }
  .level { padding: 14px 16px 12px; }
  .tc { height: min(50svh, 360px); }
  #tech { padding-top: 30px; padding-bottom: 26px; }
  .vill__map { height: 42svh; min-height: 280px; }
  .vill__side { padding: 18px var(--gutter) 22px; }
  .lm__lc, .lm__form { padding: 20px 16px; }
  .lm__list li { padding: 10px 0; font-size: 13.5px; }
  .act { min-height: 0; padding: 16px; }
  .act p, .act small { display: none; }
  .pay, .pay-grid > * { padding: 16px; }
  .meet__form { position: static; }
  .stats .stat, .num-grid > * { padding-top: 10px; padding-bottom: 10px; }
  .celeb__b > p { display: none; }
  .celeb__b .celeb__more, .celeb__more { height: auto; min-height: 40px; border-radius: 20px; white-space: normal; line-height: 1.15; padding: 6px 8px 6px 14px; width: 100%; justify-content: space-between; }

  /* ---------- шапка и раскрытое меню ---------- */
  .mobile-menu { padding: calc(var(--hdr) + 6px) var(--gutter) 14px; overflow-y: auto; }
  .mobile-menu a.m-link { font-size: 22px; padding: 9px 0; }
  .mobile-menu .m-foot { margin-top: 12px; gap: 10px; }
  .mobile-menu .m-foot > a:first-child { font-size: 19px !important; }
  .mobile-menu .header__soc--menu { display: flex; flex-wrap: wrap; gap: 8px; }
  .mobile-menu .soc { width: 38px; height: 38px; }
  .menu-open .mobile-menu .tswitch { position: fixed; top: calc((var(--hdr) - 34px) / 2); left: 84px; z-index: 101; margin: 0; }
  .menu-open .header .logo { position: relative; z-index: 101; }

  /* ---------- подвал: компактно, разделы в ряд, разделены линиями ---------- */
  .footer { padding-top: 22px; }
  .footer__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
  .footer__grid > div:first-child { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; padding-bottom: 16px; border-bottom: 1px solid rgba(255,255,255,.14); }
  .footer .logo img { height: 40px; }
  .footer__about { margin-top: 0; font-size: 12px; line-height: 1.35; max-width: none; }
  .footer__grid > div:nth-child(n+2):nth-child(-n+3) { padding: 14px 10px 14px 12px; border-bottom: 1px solid rgba(255,255,255,.14); }
  .footer__grid > div:nth-child(2) { padding-left: 0; }
  .footer__grid > div:nth-child(n+3):nth-child(-n+3) { border-left: 1px solid rgba(255,255,255,.14); }
  .footer__h { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 10px; }
  .footer li { margin-bottom: 7px; font-size: 12.5px; line-height: 1.25; }
  .footer__grid > div:last-child { grid-column: 1 / -1; padding: 14px 0 6px; display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: center; }
  .footer__grid > div:last-child > .footer__h { grid-column: 1 / -1; margin-bottom: 6px; }
  .footer__tel { font-size: 21px; white-space: nowrap; }
  .footer__grid > div:last-child > p:not(.footer__h) { grid-column: 1 / -1; margin-top: 4px !important; font-size: 12.5px !important; }
  .footer__soc { grid-column: 2; grid-row: 2; margin-top: 0; gap: 8px; }
  .footer__soc a { width: 34px; height: 34px; }
  .footer__bot { padding-top: 12px; gap: 8px 14px; font-size: 11.5px; flex-direction: column; align-items: flex-start; }
  .footer__mark { display: none; }

  /* ---------- «Проекты»: фильтры без плашки, идут от левого края по логотипу и уходят за правый край ---------- */
  body:not(.is-project) .pbar:not(.is-spec) { position: absolute; left: 0; right: 0; top: calc(var(--hdr) + 8px); }
  .pbar:not(.is-spec) .pbar__panel { background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; clip-path: none; padding: 0; min-height: 0; border-radius: 0; }
  .pbar:not(.is-spec) .pbar__filters { display: grid; gap: 8px; overflow: visible; flex-wrap: nowrap; padding: 0; }
  .pbar:not(.is-spec) .pbar__row { display: flex; align-items: center; gap: 16px; overflow-x: auto; scrollbar-width: none; padding: 0 28px 0 var(--gutter); margin: 0; flex-wrap: nowrap; }
  .pbar:not(.is-spec) .pbar__row::-webkit-scrollbar { display: none; }
  .pbar:not(.is-spec) .pbar__eye { display: none; }
  .pbar:not(.is-spec) .pf { flex: none; }
  .pbar .pills { background: var(--paper, #f5f5f2); }

  /* ---------- страница проекта ---------- */
  .pv-hero__in { justify-content: center; }
  .pv-dots { position: absolute; left: 0; right: 0; bottom: 12px; justify-content: center; margin: 0 auto; transform: none !important; opacity: 1; }
  .pv-specs__btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .pv-specs__btns .btn { height: 52px; min-height: 52px; padding: 0 6px 0 16px; font-size: 15px; font-weight: 500; justify-content: space-between; width: 100%; }
  .pv-specs__btns .btn .btn__ic { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; }
  .pv-specs__btns .btn .btn__ic .arrow { width: 16px; height: 16px; margin: 0; position: static; transform: none; }
  .pv-specs__btns .btn--outline { justify-content: center; padding: 0 12px; }
  .pv-specs__btns .btn--outline .btn__ic { display: none; }

  /* ---------- всплывающие окна: целиком в экране телефона ---------- */
  .modal { padding: 10px; align-items: end; }
  .modal__card { width: 100%; max-height: calc(100svh - 20px); overflow-y: auto; padding: 22px 18px 18px; border-radius: 22px; }
  .modal__card h3 { font-size: 22px; line-height: 1.1; padding-right: 40px; }
  .modal__card h3.modal__lead { font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .modal__kick { margin-bottom: 4px; }
  .modal__card > p, .modal__lead + p { font-size: 13px; margin-top: 6px; line-height: 1.4; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
  .modal form { margin-top: 12px; gap: 8px; }
  .modal .field, .modal select { height: 46px; }
  .modal .btn { min-height: 48px; }
  .modal__x { top: 10px; right: 10px; width: 36px; height: 36px; }
  .lmp__card { max-height: calc(100svh - 20px); }

  /* ---------- конструктор: без лишних подписей, после кнопок сразу подвал ---------- */
  .cfg-title .kicker { display: none; }
  .cfg-head { display: none; }
  .cfg ~ section { display: none; }
}

@media (max-width: 900px) {
  /* ---------- длинные колонки карточек → ленты, которые листают в сторону ---------- */
  #projects .proj-grid--2, .locs, .pay-grid { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter) 4px; scroll-padding: 0 var(--gutter); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  #projects .proj-grid--2::-webkit-scrollbar, .locs::-webkit-scrollbar, .pay-grid::-webkit-scrollbar { display: none; }
  #projects .proj-grid--2 > .pcard { flex: 0 0 84%; scroll-snap-align: start; }
  .locs > .loc, .locs > .loc:nth-child(n) { flex: 0 0 78%; grid-column: auto; aspect-ratio: 4 / 3; scroll-snap-align: start; }
  .pay-grid > .pay { flex: 0 0 82%; scroll-snap-align: start; padding: 16px; min-height: 0; }
  .pay-grid > .pay p, .pay-grid > .pay li { font-size: 13px; line-height: 1.4; }

  /* «Посмотреть вживую / Обсудить / Узнать стоимость»: низкие строки */
  .acts { display: grid; gap: 8px; }
  .act { display: grid !important; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px; min-height: 0; padding: 12px 12px 12px 16px; border-radius: 18px; text-align: left; }
  .act b { font-size: 17px; line-height: 1.15; }
  .act > span:not(.btn__ic) { font-size: 12.5px; opacity: .7; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden; }
  .act .btn__ic { grid-column: 2; grid-row: 1 / 3; width: 36px; height: 36px; }

  /* посёлки: карточки ниже, в списках по два пункта */
  .vf__img { aspect-ratio: 16 / 9; height: auto; min-height: 0; }
  .vf__b { padding: 12px 14px 14px; }
  .vf__b > p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
  .vf__b ul li:nth-child(n+3) { display: none; }
  .vill__info { display: none; }
  .vcard { padding-top: 12px; padding-bottom: 12px; }

  /* комплектации и калькулятор: плотнее */
  .level { padding: 12px 14px 10px; }
  .level__num, .level--cta .level__num { font-size: 52px; margin-bottom: 0; }
  .level h3 { font-size: 18px; }
  .level__list { margin-top: 6px; gap: 2px 12px; font-size: 12px; }
  .level__foot { padding-top: 8px; }
  .calc { padding: 16px; }

  /* документы и «С чего начать» */
  .lm__list li:nth-child(n+4) { display: none; }
  .lm__l .lead { display: none; }
  .meet__card, .meet__form, .meet .card { padding: 18px 16px; }

  /* цифры компании */
  .stat b, .num b, .stats b { font-size: 40px; }
}

@media (max-width: 900px) {
  .vf-grid { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter) 4px; scroll-padding: 0 var(--gutter); scrollbar-width: none; }
  .vf-grid::-webkit-scrollbar { display: none; }
  .vf-grid > .vf { flex: 0 0 82%; scroll-snap-align: start; }
  .vill__foot > p { display: none; }
  .vill__foot { padding-top: 8px; }
  .assoc__grid { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter) 4px; scrollbar-width: none; }
  .assoc__grid::-webkit-scrollbar { display: none; }
  .assoc__grid > .assoc__item { flex: 0 0 62%; scroll-snap-align: start; }
  .assoc__item small { display: none; }
  .steps3 li { padding-top: 8px; padding-bottom: 8px; }
  .steps3 li span { display: none; }
  .level__list li:nth-child(n+5) { display: none; }
}

@media (max-width: 900px) {
  .menu-open .header { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; border-color: transparent; }
  .pv-specs__btns .btn:not(.btn--outline) .btn__ic { background: #fff; color: #111; }
  .pv-specs__btns .btn:not(.btn--outline) .btn__ic svg { color: #111; stroke: #111; }
}

@media (max-width: 900px) {
  .assoc__grid { margin: 0; padding: 0; }
  .assoc__grid > .assoc__item { padding-left: var(--gutter); padding-right: 10px; }
}

body.at-footer .cfg-back { display: none !important; }

/* ленты листаются только вбок: вертикальной прокрутки внутри них нет */
@media (max-width: 900px) {
  .mcar, .built, #projects .proj-grid--2, .locs, .pay-grid, .vf-grid, .assoc__grid, #mtabs, .pbar__row { overflow-y: hidden !important; overscroll-behavior-x: contain; }
  .mcar, .built, #projects .proj-grid--2, .locs, .pay-grid, .vf-grid, .assoc__grid { touch-action: pan-x pan-y; }
}
