/* Главная в новом исполнении: первый экран с домом и туманом (по макету Lumen Roof) и все блоки под ним.
   День = светлая тема, ночь = тёмная (data-theme="blue"). Переключатель один. */

:root { --hk: 0; }
:root[data-theme="blue"] { --hk: 1; }

/* ---------- Палитра главной ---------- */
body.home {
  --h-bg: #f3f5f9; --h-card: #ffffff; --h-ink: #14202f; --h-muted: #5d6a7c; --h-line: #e2e7ef;
  --h-navy: #14307a; --h-red: #d4202e; --h-soft: #eef2f8;
}
:root[data-theme="blue"] body.home {
  --h-bg: #0b1426; --h-card: #121f3b; --h-ink: #f2f5fa; --h-muted: #a9b5c9; --h-line: #223257;
  --h-navy: #9db8ff; --h-red: #ff5a66; --h-soft: #17274a;
}
:root[data-variant] body.home,
:root body.home { background: var(--h-bg) !important; background-image: none !important; color: var(--h-ink); font-family: "Inter", "Segoe UI", system-ui, sans-serif; }
:root[data-variant] body.home::before, :root[data-variant] body.home::after { display: none !important; }

/* Обычная шапка на главной: пока виден первый экран, её заменяет прозрачная строка макета */
@media (min-width: 821px) {
  :root[data-variant] body.home header.site { position: fixed; left: 0; right: 0; top: 12px; margin: 0 auto; transition: opacity .25s, transform .25s; }
  :root[data-variant] html.at-hero body.home header.site,
  html.at-hero body.home header.site { opacity: 0; pointer-events: none; transform: translateY(-14px); visibility: hidden; }
}

/* ---------- Первый экран ---------- */
.hh { position: relative; height: 100svh; min-height: 560px; overflow: hidden; isolation: isolate; background: #0b1426; --sink: 0px; --dip: 0; --k: var(--hk);
  --ink: #14202f; --nav: #1b2736; }
@supports (color: color-mix(in srgb, #000 50%, #fff)) {
  .hh { --ink: color-mix(in srgb, #14202f calc((1 - var(--k)) * 100%), #fff); --nav: color-mix(in srgb, #1b2736 calc((1 - var(--k)) * 100%), #eef1f6); }
}
:root[data-theme="blue"] .hh { --ink: #fff; --nav: #eef1f6; }
@supports (color: color-mix(in srgb, #000 50%, #fff)) {
  :root[data-theme="blue"] .hh { --ink: color-mix(in srgb, #14202f calc((1 - var(--k)) * 100%), #fff); --nav: color-mix(in srgb, #1b2736 calc((1 - var(--k)) * 100%), #eef1f6); }
}
.hh-layer, .hh-layer img, .hh-cut { position: absolute; inset: 0; width: 100%; height: 100%; }
.hh-layer img, .hh-cut { display: block; object-fit: cover; object-position: 50% 62%; }
.hh-sky { z-index: 1; }
.hh-sky img { transform: scale(1.05); }
.hh-sky .n { opacity: var(--k); }
/* Заголовок стоит МЕЖДУ небом и домом: нижняя строка уходит за крышу */
.hh-title { position: absolute; z-index: 2; left: 0; right: 0; top: auto; bottom: calc(var(--hh) - var(--roof) - var(--bite)); margin: 0; padding: 0 16px; text-align: center; color: var(--ink);
  font-family: "Inter", "Segoe UI", system-ui, sans-serif; font-weight: 700; letter-spacing: -.03em; line-height: 1.04;
  font-size: max(26px, min(6.3vw, 11.4vh, calc((var(--roof) - 84px) / 2.2))); opacity: calc(1 - var(--dip) * .8); text-shadow: none; max-width: none; }
/* Положение крыши на экране: фото вписано по принципу cover (16:9, якорь 62% по вертикали), верх надстройки на 29,8% высоты кадра.
   Заголовок привязан низом к этой точке, поэтому на любом экране дом задевает только нижние края букв. */
.hh { --hh: max(100svh, 560px); --ih: max(var(--hh), 56.25vw); --roof: calc((var(--hh) - var(--ih)) * .62 + var(--ih) * .298); --bite: .3em; }
.hh-title span { display: block; }
.hh-home { z-index: 3; transform: translate3d(0, var(--sink), 0); will-change: transform; }
.hh-set { position: absolute; inset: 0; visibility: hidden; }
.hh-set.d { visibility: visible; }
.hh.is-night .hh-set.d { visibility: hidden; }
.hh.is-night .hh-set.n { visibility: visible; }
.hh-ground { -webkit-mask-image: linear-gradient(transparent 54%, #000 64%); mask-image: linear-gradient(transparent 54%, #000 64%); }
#heroFog { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; pointer-events: none; }
.hh-fogcss { position: absolute; left: 0; right: 0; bottom: 0; height: 60%; z-index: 4; pointer-events: none; opacity: 0; background: linear-gradient(0deg, rgba(240, 236, 222, .96), rgba(240, 236, 222, 0)); }
.hh.nogl .hh-fogcss { opacity: calc(.4 + var(--surge, 0) * .6); }
.hh.nogl.is-night .hh-fogcss { background: linear-gradient(0deg, rgba(52, 62, 92, .96), rgba(52, 62, 92, 0)); }
.hh-ui { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; pointer-events: none; }
.hh-ui a, .hh-ui button { pointer-events: auto; }
/* Строка сверху: логотип, разделы по центру, кнопка-таблетка */
.hh-bar { display: flex; align-items: center; padding: 20px 34px 0; color: var(--nav); }
.hh-logo { flex: 1 1 0; display: flex; }
.hh-logo img { height: 46px; width: auto; display: block; background: #fff; border-radius: 10px; padding: 4px 8px; box-shadow: 0 4px 14px rgba(0, 0, 0, .14); }
.hh-links { display: flex; gap: clamp(14px, 2.4vw, 34px); white-space: nowrap; font-size: 16px; font-weight: 600; opacity: calc(1 - var(--dip) * .82); }
.hh-links a { color: inherit; text-decoration: none; padding: 6px 0; }
.hh-links a:hover { text-decoration: underline; text-underline-offset: 6px; }
.hh-side { flex: 1 1 0; display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.hh-sw { width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid currentColor; background: transparent; color: var(--nav); display: grid; place-items: center; cursor: pointer; padding: 0; opacity: .9; }
.hh-sw svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.hh-sw .ico-sun { display: none; }
:root[data-theme="blue"] .hh-sw .ico-sun { display: block; }
:root[data-theme="blue"] .hh-sw .ico-moon { display: none; }
.hh-cta { display: inline-flex; align-items: center; white-space: nowrap; height: 44px; padding: 0 24px; border-radius: 99px; font-size: 15.5px; font-weight: 600; text-decoration: none;
  background: #0d1117; color: #fff; opacity: calc(1 - var(--dip) * .62); transition: transform .25s; }
:root[data-theme="blue"] .hh-cta { background: #fff; color: #0d1117; }
@supports (color: color-mix(in srgb, #000 50%, #fff)) {
  .hh-cta, :root[data-theme="blue"] .hh-cta { background: color-mix(in srgb, #0d1117 calc((1 - var(--k)) * 100%), #fff); color: color-mix(in srgb, #fff calc((1 - var(--k)) * 100%), #0d1117); }
}
.hh-cta:hover { transform: translateY(-1px); }
.hh-sw:focus-visible, .hh-cta:focus-visible, .hh-btn:focus-visible, .hh-links a:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
/* Низ экрана: две кнопки и подпись */
.hh-dock { margin-top: auto; padding: 0 16px 34px; display: flex; flex-direction: column; align-items: center; }
.hh-actions { display: flex; gap: 10px; padding: 6px; border-radius: 18px; background: rgba(120, 132, 140, .34); border: 1px solid rgba(255, 255, 255, .25); }
.hh-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 54px; padding: 0 30px; border-radius: 13px; font-size: 17px; font-weight: 600; color: #fff; text-decoration: none; }
.hh-btn.main { background: linear-gradient(160deg, #f7f8dc, #e2ee9f 90%); color: #1c2316; box-shadow: inset 0 0 18px rgba(255, 255, 255, .65); }
.hh-btn:hover { filter: brightness(1.05); }
.hh-cap { margin: 18px 0 0; text-align: center; font-size: 16px; line-height: 1.35; color: var(--nav); }
@media (max-width: 820px) {
  .hh { height: calc(100svh - 76px); min-height: 520px; --hh: max(calc(100svh - 76px), 520px); --bite: .16em; }
  .hh-bar { display: none; }
  .hh-layer img, .hh-cut { object-position: 72% 62%; }
  .hh-title { font-size: clamp(32px, 10.4vw, 58px); }
  .hh-dock { padding-bottom: 22px; }
  .hh-actions { width: 100%; max-width: 440px; }
  .hh-btn { flex: 1 1 0; padding: 0 8px; min-height: 52px; font-size: 15px; white-space: nowrap; }
  .hh-cap { font-size: 14px; max-width: 360px; }
  .hh-cap br { display: none; }
}
@media (prefers-reduced-motion: reduce) { .hh-home { transform: none; } }

/* ---------- Блоки под первым экраном ---------- */
:root[data-variant] body.home main .wrap, body.home main .wrap, :root[data-variant] body.home footer.site .wrap { width: min(1180px, calc(100% - 40px)) !important; max-width: none !important; margin-left: auto !important; margin-right: auto !important; padding-left: 0 !important; padding-right: 0 !important; }
:root[data-variant] body.home .stats, body.home .stats { margin: 0; padding: 56px 0 8px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; background: none; }
:root[data-variant] body.home .stat, body.home .stat { background: none !important; border: 0 !important; box-shadow: none !important; border-radius: 0; padding: 6px 22px; text-align: center; display: block !important; min-width: 0; border-left: 1px solid var(--h-line) !important; backdrop-filter: none !important; }
:root[data-variant] body.home .stat:first-child, body.home .stat:first-child { border-left: 0 !important; }
:root[data-variant] body.home .stat::before, :root[data-variant] body.home .stat::after { display: none !important; }
:root[data-variant] body.home .stat b, body.home .stat b { display: block; font-family: inherit; font-size: clamp(34px, 4.2vw, 58px); font-weight: 700; letter-spacing: -.035em; line-height: 1; color: var(--h-ink) !important; }
:root[data-variant] body.home .stat span span, body.home .stat span span { display: inline !important; margin: 0 !important; font-size: inherit; }
:root[data-variant] body.home .stat > span, body.home .stat > span { display: block; margin-top: 10px; font-size: 15px; color: var(--h-muted) !important; }

:root[data-variant] body.home section.block, body.home section.block { padding: 88px 0 !important; background: none !important; border: 0 !important; box-shadow: none !important; border-radius: 0 !important; backdrop-filter: none !important; margin: 0 !important; max-width: none !important; width: auto !important; }
:root[data-variant] body.home .head, body.home .head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; margin-bottom: 44px; }
:root[data-variant] body.home .kicker, body.home .kicker { display: inline-flex; margin: 0 0 12px; padding: 6px 14px; border-radius: 99px; background: var(--h-soft); color: var(--h-navy) !important; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
:root[data-variant] body.home .kicker::before { display: none; }
:root[data-variant] body.home section.block h2, :root[data-variant] body.home .head h2, body.home .head h2 { font-family: inherit; font-size: clamp(32px, 4.4vw, 56px); font-weight: 700; letter-spacing: -.035em; line-height: 1.05; color: var(--h-ink) !important; margin: 0; }
:root[data-variant] body.home .muted, body.home .muted { color: var(--h-muted) !important; }
:root[data-variant] body.home #about p.muted { margin-left: auto; margin-right: auto; text-align: center; }

:root[data-variant] body.home .services, body.home .services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
:root[data-variant] body.home .service, :root[data-variant] body.home .panel, :root[data-variant] body.home .office, :root[data-variant] body.home .promo,
body.home .service, body.home .panel, body.home .office, body.home .promo {
  background: var(--h-card) !important; border: 1px solid var(--h-line) !important; border-radius: 26px !important; box-shadow: 0 1px 2px rgba(16, 24, 40, .04) !important; padding: 30px 28px; backdrop-filter: none !important; color: var(--h-ink); transition: transform .2s, box-shadow .2s; }
:root[data-variant] body.home .service::before, :root[data-variant] body.home .service::after { display: none !important; }
:root[data-variant] body.home .service:hover, :root[data-variant] body.home .office:hover, :root[data-variant] body.home .promo:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(16, 24, 40, .1) !important; }
:root[data-variant] body.home .service h3, body.home .service h3 { font-family: inherit; font-size: 21px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 10px; color: var(--h-ink) !important; }
:root[data-variant] body.home .service p, body.home .service p { font-size: 15.5px; line-height: 1.6; color: var(--h-muted) !important; }
:root[data-variant] body.home .panel b, :root[data-variant] body.home .office b { color: var(--h-ink); }
:root[data-variant] body.home label, :root[data-variant] body.home .field label { color: var(--h-muted); }
:root[data-variant] body.home input, :root[data-variant] body.home select { background: var(--h-soft); border: 1px solid var(--h-line); color: var(--h-ink); border-radius: 14px; }

:root[data-variant] body.home .btn, body.home .btn { border-radius: 99px; font-weight: 600; background: var(--h-ink); color: var(--h-bg); border: 0; box-shadow: none; }
:root[data-variant] body.home .btn.ghost, body.home .btn.ghost { background: transparent; color: var(--h-ink); border: 1.5px solid var(--h-line); }
:root[data-variant] body.home .btn:hover { transform: translateY(-1px); }

:root[data-variant] body.home .promo-grid, body.home .promo-grid { gap: 18px; }
:root[data-variant] body.home .promo, body.home .promo { padding: 40px 36px; background: linear-gradient(150deg, #14307a, #0b1d4a) !important; border: 0 !important; color: #fff; }
:root[data-variant] body.home .promo.promo-sell { background: linear-gradient(150deg, #d4202e, #9c1420) !important; }
:root[data-variant] body.home section.block .promo h2, body.home section.block .promo h2 { color: #fff !important; font-size: clamp(24px, 2.6vw, 34px); }
:root[data-variant] body.home .promo p { color: rgba(255, 255, 255, .86) !important; font-size: 16px; }
:root[data-variant] body.home .promo .kicker { background: rgba(255, 255, 255, .16); color: #fff !important; }
:root[data-variant] body.home .promo-link { color: #fff !important; font-weight: 700; }

:root[data-variant] body.home .card, body.home .card { background: var(--h-card) !important; border: 1px solid var(--h-line) !important; border-radius: 24px !important; box-shadow: none !important; overflow: hidden; backdrop-filter: none !important; }
:root[data-variant] body.home .card .title, :root[data-variant] body.home .card .price { color: var(--h-ink) !important; }
:root[data-variant] body.home .card .meta { color: var(--h-muted) !important; }

:root[data-variant] body.home footer.site, body.home footer.site { background: #0b1426 !important; color: #dfe5ee; border: 0 !important; border-radius: 0 !important; margin: 40px 0 0 !important; max-width: none !important; width: 100% !important; box-shadow: none !important; backdrop-filter: none !important; padding: 48px 0 !important; }
:root[data-variant] body.home footer.site a { color: #dfe5ee; }

@media (max-width: 900px) {
  :root[data-variant] body.home .services, body.home .services { grid-template-columns: 1fr 1fr; }
  :root[data-variant] body.home .stats, body.home .stats { grid-template-columns: 1fr 1fr; row-gap: 28px; }
  :root[data-variant] body.home .stat:nth-child(3), body.home .stat:nth-child(3) { border-left: 0 !important; }
}
@media (max-width: 640px) {
  :root[data-variant] body.home .services, body.home .services, :root[data-variant] body.home .promo-grid, body.home .promo-grid { grid-template-columns: 1fr; }
  :root[data-variant] body.home section.block, body.home section.block { padding: 56px 0 !important; }
  :root[data-variant] body.home .guide { grid-template-columns: 1fr !important; }
}

/* ---------- Лента объектов под первым экраном (по спецификации) ---------- */
.mq-wrap { position: relative; margin: 0; padding: 0; background: var(--h-bg); }
.mq { position: relative; overflow: hidden; padding: 16px 0; user-select: none; touch-action: pan-y; }
.mq[hidden] { display: none; }
.mq-track { display: flex; width: max-content; gap: 12px; will-change: transform; cursor: grab; }
.mq.is-grabbing .mq-track { cursor: grabbing; }
.mq-slide { display: block; flex: none; width: 240px; height: 320px; border-radius: 16px; overflow: hidden; background: var(--h-soft); }
.mq-slide img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; display: block; }
.mq-mask { position: absolute; left: 0; right: 0; width: 100%; height: 80px; z-index: 2; pointer-events: none; }
.mq-mask path { fill: var(--h-bg); }
.mq-top { top: 0; }
.mq-bot { bottom: 0; }
@media (min-width: 640px) {
  .mq-track { gap: 16px; }
  .mq-slide { width: 320px; height: 512px; border-radius: 16px; }
  .mq-mask { height: 100px; }
}
.mq-text { text-align: center; max-width: 42rem; margin: 0 auto; padding: 8px 24px 56px; }
.mq-text p { font-size: 17px; line-height: 1.6; color: var(--h-ink); }
.mq-links { margin-top: 24px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
@media (min-width: 640px) { .mq-links { flex-direction: row; justify-content: center; gap: 32px; } }
.mq-links a { font-weight: 600; color: var(--h-ink); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--h-muted); transition: text-decoration-color .2s; }
.mq-links a:hover { text-decoration-color: var(--h-ink); }

/* «Смотреть объекты» — фирменный красный, заметный на тёмном фоне героя */
.hh-btn.main { background: linear-gradient(160deg, #e8333f, #d4202e 55%, #b71b27 100%); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22), 0 10px 26px rgba(212, 32, 46, .45); }
.hh-btn.main:hover { background: linear-gradient(160deg, #f0404b, #d4202e 55%, #b71b27 100%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3), 0 14px 32px rgba(212, 32, 46, .5); }

/* Ценники на главной («Новые объекты»): заметный красный вместо бледного */
:root[data-variant] body.home .card .price { color: #fff !important; font-size: 21px; }
:root[data-theme="blue"] body.home .card .price { color: #fff !important; }
