/* ==========================================================================
   VIOR — Витальный дом. Главная страница.
   ========================================================================== */

/* ----- Design tokens ----- */
:root {
    /* Brand palette */
    --brand-white: #D9D9D9;          /* Брендовый/Белый */
    --brand-green: #2C4449;          /* Брендовый/Зеленый */
    --brand-bg-deep: #092C32;        /* Брендовый/Фон градиент */
    --neutral-light: #FAFBFC;        /* white */
    --neutral-400: #F1F2F5;          /* neutral/400 */
    --white-8: rgba(255, 255, 255, 0.08);
    --white-16: rgba(255, 255, 255, 0.08);
    --white-40: rgba(255, 255, 255, 0.4);

    /* Page gradient background (deep teal -> washed teal) */
    --page-bg:
        linear-gradient(93.9deg,
            rgb(2, 30, 33) 35.72%,
            rgb(16, 58, 65) 72.67%,
            rgb(20, 67, 74) 82.21%,
            rgb(43, 87, 93) 95.32%,
            rgb(105, 141, 144) 122.74%,
            rgb(183, 208, 208) 154.93%),
        linear-gradient(90deg, rgb(9, 44, 50) 0%, rgb(9, 44, 50) 100%);

    /* Typography */
    --font-heading: 'Cormorant Garamond', 'Times New Roman', serif;
    --font-body: 'Manrope', 'Helvetica Neue', Arial, sans-serif;

    /* Type scale */
    --h2: 36px;
    --h3: 32px;
    --h4: 28px;
    --h5: 22px;
    --h6: 20px;
    --text-xl: 20px;
    --text-l: 18px;
    --text-m: 16px;
    --text-s: 14px;
    --text-xs: 13px;

    /* Spacing tokens */
    --gap-xs: 8px;
    --gap-s: 12px;
    --gap-m: 16px;
    --gap-l: 24px;
    --gap-l-plus: 32px;
    --gap-xl: 40px;
    --gap-xxl: 64px;
    --grid-side: 32px;          /* контейнер */
    --grid-block: 96px;         /* отступы-блока */

    /* Shadows */
    --shadow-xs: 0px 1px 2px 0px rgba(16, 24, 40, 0.04);

    /* Container reference widths */
    --canvas-w: 1920px;
    --content-w: 1440px;
    --side-pad: 240px;

    /* Header logo — зазор подписи ~28% высоты марки, как на макете */
    --header-logo-h: 90px;
    --header-logo-tagline-gap: calc(var(--header-logo-h) * 0.28);
    --header-logo-ratio: 16810 / 5270; /* logo.svg viewBox width / height */
}

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

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    color: var(--neutral-light);
    background: var(--page-bg);
    background-attachment: fixed;
    line-height: 1.5;
    min-width: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img { display: block; max-width: 100%; }

/* `<picture>` не должен менять раскладку: фото ведёт себя как прямой потомок секции/карточки */
picture { display: contents; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
p { margin: 0; }

/* ----- Page frame ----- */
.page {
    width: 100%;
    max-width: var(--canvas-w);
    margin: 0 auto;
    overflow-x: clip;
    isolation: isolate;
}

.section {
    width: 100%;
    padding: 0 var(--side-pad);
    display: flex;
    justify-content: center;
    position: relative;
}

.section__inner {
    width: var(--content-w);
    max-width: 100%;
    padding: var(--grid-block) var(--grid-side);
    position: relative;
    z-index: 1;
}

.section--fixed-height {
    overflow: clip;
}

/* ----- Header ----- */
.header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    padding: 0 var(--side-pad);
    display: flex;
    justify-content: center;
}

.header__inner {
    width: var(--content-w);
    max-width: 100%;
    padding: var(--gap-l) var(--gap-l-plus);
    display: flex;
    align-items: center;
}

.header__row {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--gap-m);
    filter: drop-shadow(var(--shadow-xs));
}

.nav {
    display: flex;
    align-items: center;
}

.nav__item {
    padding: var(--gap-m);
    font-size: var(--text-s);
    font-weight: 500;
    line-height: 1.2;
    color: #fff;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: opacity .25s ease;
}
.nav__item:hover { opacity: .75; }

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--header-logo-tagline-gap);
    width: fit-content;
    flex-shrink: 0;
}

.logo__mark {
    height: var(--header-logo-h);
    width: auto;
    max-width: none;
    object-fit: contain;
    flex-shrink: 0;
}

.logo__tagline {
    margin: 0;
    padding: 0;
    padding-inline-end: 0.4em;
    width: 100%;
    box-sizing: border-box;
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 500;
    line-height: 1;
    color: #fff;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    text-align: center;
}

/* Шапка с nav: лого по центру строки (480+ — десктоп и планшет) */
@media (min-width: 480px) {
    .header__row {
        position: relative;
    }

    .header__row > nav.nav--desktop:first-of-type {
        flex: 1 1 0;
        justify-content: flex-start;
        min-width: 0;
    }

    .header__row > nav.nav--desktop:nth-of-type(2) {
        flex: 1 1 0;
        justify-content: flex-end;
        min-width: 0;
    }

    /* Верх марки — на вертикальном центре nav; подпись уходит вниз */
    .header__row .logo {
        position: absolute;
        left: 50%;
        top: 30%;
        transform: translateX(-50%);
    }
}

/* Mobile menu trigger — показ только на узкой ширине (см. media query ниже) */
.burger {
    display: none;
    flex-shrink: 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    width: 44px;
    height: 44px;
    padding: 0;
    color: var(--neutral-light);
    border-radius: 999px;
    border: 1px solid var(--white-16);
    background: var(--white-8);
    box-shadow: 0 1px 2px rgba(2, 30, 33, 0.15);
    transition: background-color .25s ease, border-color .25s ease, opacity .25s ease;
}

.burger:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.22);
}

.burger:focus-visible {
    outline: 2px solid var(--neutral-light);
    outline-offset: 3px;
}

.burger__line {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 1px;
    background: currentColor;
}

/* ----- Hero ----- */
.hero {
    height: 800px;
    position: relative;
    overflow: clip;
    z-index: 10;
}

.hero__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    z-index: 0;
}

.hero__inner {
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: var(--grid-side);
    padding-bottom: var(--grid-side);
    position: relative;
    z-index: 2;
}

/* ----- Buttons ----- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 0 var(--gap-xxl);
    font-family: var(--font-body);
    font-size: var(--text-m);
    font-weight: 400;
    line-height: 1.4;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}

.btn--outline {
    color: var(--brand-white);
    border: 1px solid var(--brand-white);
    background: transparent;
}
.btn--outline:hover {
    background: var(--brand-white);
    color: var(--brand-green);
}

.btn--filled {
    color: var(--brand-green);
    background: #fff;
    border: 1px solid var(--white-40);
    width: 328px;
    height: auto;
    padding: 10px 15px;
    align-items: flex-end;
}
.btn--filled:hover { background: var(--brand-white); }

.btn--link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0;
    color: var(--neutral-light);
    border-bottom: 1px solid var(--brand-white);
    font-size: var(--text-m);
    font-weight: 400;
    line-height: 1.4;
    background: transparent;
    cursor: pointer;
    transition: border-color .25s ease, opacity .25s ease;
}
.btn--link:hover { opacity: .8; }

.btn--link-blur { backdrop-filter: blur(2px); }

/* ----- Cookie notice ----- */
.cookie-notice {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    padding: var(--gap-m) var(--side-pad) var(--gap-l-plus);
    opacity: 0;
    visibility: hidden;
    transition: opacity .35s ease, visibility .35s ease;
}

.cookie-notice.is-visible {
    opacity: 1;
    visibility: visible;
}

.cookie-notice[hidden] {
    display: none !important;
}

.cookie-notice__inner {
    max-width: var(--content-w);
    margin: 0 auto;
    padding: var(--gap-l) var(--gap-l-plus);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--gap-l);
    background: linear-gradient(120deg,
            rgba(9, 44, 50, 0.95) 0%,
            rgba(20, 67, 74, 0.92) 45%,
            rgba(44, 68, 73, 0.9) 100%);
    border: 1px solid var(--white-16);
    box-shadow: 0 -12px 48px rgba(2, 30, 33, 0.5);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.cookie-notice__eyebrow {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: var(--text-s);
    letter-spacing: 0.28em;
    text-transform: uppercase;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.55);
    margin: 0 0 var(--gap-xs);
}

.cookie-notice__text {
    font-family: var(--font-body);
    font-size: var(--text-s);
    line-height: 1.6;
    color: rgba(250, 251, 252, 0.92);
    margin: 0;
    max-width: 54ch;
}

.cookie-notice__text a {
    text-decoration: underline;
    text-underline-offset: 0.18em;
    text-decoration-color: rgba(217, 217, 217, 0.4);
    transition: text-decoration-color .2s ease, color .2s ease;
}

.cookie-notice__text a:hover {
    text-decoration-color: var(--brand-white);
}

.cookie-notice__btn {
    flex-shrink: 0;
    min-height: 44px;
    height: auto;
    padding: 10px var(--gap-xl);
}

@media (max-width: 768px) {
    .cookie-notice {
        padding-left: var(--grid-side);
        padding-right: var(--grid-side);
    }

    .cookie-notice__inner {
        flex-direction: column;
        align-items: stretch;
        padding: var(--gap-m) var(--gap-l);
    }

    .cookie-notice__btn {
        width: 100%;
    }
}

/* ----- Promo section (Second screen) ----- */
.promo {
    height: 600px;
    overflow: clip;
    z-index: 9;
    align-items: center;
    justify-content: center;
}

.promo__inner {
    flex: 0 1 auto;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--gap-xxl) var(--grid-side);
}

.promo__content {
    width: 1267px;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--gap-xl);
    text-align: center;
    color: var(--neutral-light);
}

.promo__title {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: var(--h2);
    line-height: 1.4;
    text-transform: uppercase;
    width: 736px;
    max-width: 100%;
    margin-top: 0;
    margin-bottom: 0;
}

.promo__lead {
    font-family: var(--font-body);
    font-size: var(--text-l);
    font-weight: 400;
    line-height: 1.5;
    width: 900px;
    max-width: 100%;
}

/* ----- Slider 1 (Scenarios) ----- */
.slider1 {
    height: 800px;
    position: relative;
    overflow: clip;
    z-index: 8;
    cursor: pointer;
    /* горизонтальный жест отдаём скрипту, вертикаль — прокрутке страницы */
    touch-action: pan-y;
    -webkit-tap-highlight-color: transparent;
}

.slider1__slide {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    padding: 0 var(--side-pad);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .6s ease, visibility 0s linear .6s;
}

.slider1__slide.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: 1;
    transition: opacity .6s ease, visibility 0s linear 0s;
}

.slider1__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* PNG — экспорт макета: в картинке уже «вшита» левая стеклянная панель.
       Смещаем кадр вправо, чтобы остался только фото комнаты; текст — в HTML. */
    object-position: 52% center;
    z-index: 0;
}

/* Карусели: без нативного drag картинок — иначе ломается свайп по центральному фото */
.slider1__bg,
.houses__slide img,
.house-modal__pane-inner img {
    -webkit-user-drag: none;
    user-select: none;
}

.slider1__inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: var(--grid-side);
    position: relative;
    z-index: 1;
}

.slider1__card {
    width: 588px;
    height: 100%;
    padding: var(--grid-block) var(--gap-l) var(--gap-l);
    backdrop-filter: blur(7.5px);
    -webkit-backdrop-filter: blur(7.5px);
    background-color: rgba(12, 2, 1, 0.4);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    color: var(--neutral-light);
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.slider1__big-number {
    position: absolute;
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 360px;
    line-height: 1.5;
    letter-spacing: -18px;
    color: var(--white-16);
    top: -180px;
    left: 15px;
    z-index: 0;
    pointer-events: none;
    white-space: nowrap;
}

.slider1__content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: var(--gap-l-plus);
    align-items: flex-start;
    flex: 1;
    min-height: 0;
    width: 100%;
    overflow: hidden;
}

.slider1__eyebrow,
.slider1__title,
.slider1__text,
.slider1__cta {
    flex-shrink: 0;
}

.slider1__eyebrow {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: var(--text-m);
    letter-spacing: 4.8px;
    text-transform: uppercase;
    line-height: 1.2;
    margin: 0;
}

.slider1__title {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: var(--h2);
    line-height: 1.2;
    letter-spacing: 0.72px;
    text-transform: uppercase;
    margin: 0;
}

.slider1__text {
    font-family: var(--font-body);
    font-size: var(--text-m);
    font-weight: 400;
    line-height: 1.5;
    margin: 0;
}

/* Дополнительный текст сценария (раскрытие по кнопке) */
.slider1__expand {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s ease;
    width: 100%;
    flex: 0 1 auto;
    min-height: 0;
}

.slider1__expand.is-open {
    flex: 1 1 auto;
    min-height: 0;
    grid-template-rows: 1fr;
}

.slider1__expand-inner {
    overflow: hidden;
    min-height: 0;
}

.slider1__expand.is-open .slider1__expand-inner {
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
    padding-right: 2px;
}

.slider1__expand.is-open .slider1__expand-inner::-webkit-scrollbar {
    width: 4px;
}

.slider1__expand.is-open .slider1__expand-inner::-webkit-scrollbar-track {
    background: transparent;
}

.slider1__expand.is-open .slider1__expand-inner::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.35);
    border-radius: 100px;
}

.slider1__expand-inner > p {
    font-family: var(--font-body);
    font-size: var(--text-m);
    font-weight: 400;
    line-height: 1.5;
    margin: 0;
    padding-top: var(--gap-m);
}

.slider1__expand-inner > p:first-child {
    padding-top: var(--gap-s);
}

@media (prefers-reduced-motion: reduce) {
    .slider1__expand {
        transition: none;
    }
}

.slider1__cta--hidden {
    display: none;
}

/* Обёртка под «Показать больше» — на мобилке те же поля, что у .slider1__text */
.slider1__cta {
    margin: 0;
}

.slider1__arrows {
    display: flex;
    gap: var(--gap-xs);
    align-items: center;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    margin-top: auto;
    padding-top: var(--gap-l);
}

.slider1__card:has(.slider1__expand.is-open) .slider1__arrows {
    padding-top: var(--gap-xxl);
}

.arrow-btn {
    width: 72px;
    height: 72px;
    border-radius: 100px;
    border: 1px solid var(--neutral-400);
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color .25s ease, transform .25s ease;
}
.arrow-btn:hover { background: var(--white-8); }
.arrow-btn--active { background: var(--white-8); }

.arrow-btn img {
    width: 12px;
    height: 14px;
    pointer-events: none;
}

/* Без синей системной обводки при клике мышью; контур только для навигации с клавиатуры */
.arrow-btn:focus:not(:focus-visible) {
    outline: none;
}

.arrow-btn:focus-visible {
    outline: 2px solid var(--neutral-light);
    outline-offset: 3px;
}

/* Сценарии (свет / воздух / …): стрелки без заливки, кроме hover, фокуса и свайпа по блоку */
.slider1 .arrow-btn--active {
    background: transparent;
}
.slider1 .arrow-btn:hover {
    background: transparent;
}
@media (hover: hover) {
    .slider1 .arrow-btn:hover {
        background: var(--white-8);
    }
}
.slider1 .arrow-btn:focus-visible {
    background: var(--white-8);
}
.slider1 .arrow-btn:active {
    background: var(--white-8);
}
.slider1.slider1--swipe-active .arrow-btn {
    background: var(--white-8);
}

/* ----- Features (3-card sections) ----- */
.features {
    z-index: 7;
    overflow: clip;
}

.features__inner {
    padding: var(--grid-block) var(--grid-side);
    display: flex;
    justify-content: center;
}

.features__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--gap-xxl);
}

.features__header {
    width: 1267px;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--gap-xl);
    position: relative;
    isolation: isolate;
    padding-top: 64px;
}

.features__header--first { padding-top: 0; }

.features__decor {
    position: absolute;
    width: 370px;
    height: 272px;
    top: -69px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 0;
    pointer-events: none;
}

.features__header--inner-decor .features__decor { top: -13px; }

.features__title {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: var(--h3);
    line-height: 1.2;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    text-align: center;
    color: var(--neutral-light);
    width: 736px;
    max-width: 100%;
    margin: 0;
    position: relative;
    z-index: 2;
}

.features__title--big {
    font-size: var(--h2);
    line-height: 1.4;
}

.features__lead {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: var(--text-l);
    line-height: 1.5;
    text-align: center;
    color: var(--neutral-light);
    width: 900px;
    max-width: 100%;
    margin: 0;
    position: relative;
    z-index: 2;
}

.feature-row {
    display: flex;
    justify-content: center;
    align-items: stretch;
    width: 100%;
}

.feature {
    width: 457px;
    min-height: 0;
    border-top: 1px solid var(--brand-green);
    border-right: 1px solid var(--brand-green);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.feature:last-child { border-right: none; }

.feature__text {
    padding: var(--gap-xl);
    text-align: center;
    color: var(--neutral-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--gap-l-plus);
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    justify-content: flex-start;
}

.feature__title {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: var(--h4);
    line-height: 1.2;
    text-transform: uppercase;
    margin: 0;
}

.feature__desc {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: var(--text-m);
    line-height: 1.5;
    margin: 0;
}

@media (min-width: 1600px) {
    .feature__desc--trail-space-lg {
        padding-bottom: calc(2 * 1.5em);
    }
}

.feature__image {
    width: 100%;
    flex: 0 0 620px;
    height: 620px;
    overflow: hidden;
}

.feature__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.features__cta { margin-top: var(--gap-l); }

/* ----- Houses (full-width slider) ----- */
.section.houses {
    /* Carousel edge-to-edge inside .page; header uses .houses__top gutters */
    padding-left: 0;
    padding-right: 0;
}

.houses {
    padding: var(--grid-block) 0;
    display: block;
    z-index: 5;
    overflow: clip;
}

.houses__top {
    padding: 0 var(--side-pad);
    display: flex;
    justify-content: center;
    margin-bottom: var(--gap-xxl);
}

.houses__header {
    width: 1267px;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--gap-l-plus);
    text-align: center;
    color: var(--neutral-light);
}

.houses__intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--gap-l);
    width: 534px;
    max-width: 100%;
}

.houses__eyebrow {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: var(--text-m);
    line-height: 1.2;
    letter-spacing: 6.4px;
    text-transform: lowercase;
    white-space: nowrap;
    margin: 0;
}

.houses__title {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: var(--h2);
    line-height: 1.4;
    text-transform: uppercase;
    width: 494px;
    max-width: 100%;
    margin: 0;
}

.houses__lead {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: var(--text-xl);
    line-height: 1.5;
    width: 468px;
    max-width: 100%;
    margin: 0;
}

/* Full-width carousel: main slide centered, peeks of prev/next at edges. */
.houses__slider {
    position: relative;
    width: 100%;
    cursor: pointer;
    touch-action: pan-y;
    -webkit-tap-highlight-color: transparent;
}

/* Регион с tabindex не подсвечивается браузером при клике; заметное кольцо — только для Tab */
.houses__slider:focus:not(:focus-visible) {
    outline: none;
}

.houses__slider:focus-visible {
    outline: 2px solid var(--neutral-light);
    outline-offset: 4px;
}

.houses__viewport {
    position: relative;
    width: 100%;
    height: 640px;
}

.houses__slide {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition:
        opacity .6s ease,
        width .6s ease,
        height .6s ease,
        left .6s ease,
        visibility 0s linear .6s;
}

.houses__slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.houses__slide.is-prev,
.houses__slide.is-active,
.houses__slide.is-next {
    opacity: 1;
    visibility: visible;
    transition:
        opacity .6s ease,
        width .6s ease,
        height .6s ease,
        left .6s ease,
        visibility 0s linear 0s;
}

.houses__slide.is-active {
    width: 60%;
    height: 640px;
    left: 50%;
    z-index: 3;
    pointer-events: auto;
    cursor: pointer;
}

.houses__slide.is-active::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(1, 21, 23, 0.6) 0%, rgba(2, 30, 33, 0) 23.63%);
    pointer-events: none;
}

.houses__slide.is-prev {
    width: 15%;
    height: 540px;
    left: 7.5%;
    z-index: 2;
}

.houses__slide.is-next {
    width: 15%;
    height: 540px;
    left: 92.5%;
    z-index: 2;
}

.houses__caption-wrap {
    width: 100%;
    padding: var(--gap-xs) 20% 0;
}

.houses__caption {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 0 var(--gap-l);
    color: var(--neutral-light);
}

.houses__caption-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: var(--h3);
    line-height: 1.4;
    letter-spacing: 4.16px;
    text-transform: uppercase;
    margin: 0;
    transition: opacity .35s ease;
}

.houses__nav-prev,
.houses__nav-next {
    position: absolute;
    top: 320px;
    transform: translateY(-50%);
    z-index: 5;
}
.houses__nav-prev { left: 96px; }
.houses__nav-next { right: 96px; }

.houses__slider .houses__nav-prev,
.houses__slider .houses__nav-next {
    transition:
        background-color .25s ease,
        backdrop-filter .25s ease,
        border-color .25s ease,
        transform .25s ease;
}

.houses__slider .houses__nav-prev:hover,
.houses__slider .houses__nav-next:hover,
.houses__slider .houses__nav-prev:focus-visible,
.houses__slider .houses__nav-next:focus-visible {
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    background: var(--white-8);
    border-color: transparent;
}

/* ----- Technologies ----- */
.tech {
    z-index: 4;
    overflow: clip;
}

.tech__inner {
    padding: var(--grid-block) var(--grid-side);
    display: flex;
    justify-content: center;
}

.tech__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--gap-xxl);
}

.tech-grid {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--gap-l);
}

.tech-row {
    display: flex;
    gap: 0;
    width: 100%;
}

.tech-card {
    flex: 1;
    min-width: 0;
    min-height: 245px;
    padding: var(--gap-l-plus);
    border: 1px solid var(--brand-green);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: var(--gap-m);
    color: var(--neutral-light);
    background: transparent;
    cursor: pointer;
    text-align: left;
    transition: background-color .3s ease, color .3s ease;
}
.tech-card + .tech-card { margin-left: -1px; } /* collapse borders */

.tech-card:hover:not(.is-active),
.tech-card:focus-visible:not(.is-active) {
    background: rgba(255, 255, 255, 0.04);
    outline: none;
}

.tech-card.is-active {
    background: var(--brand-green);
    cursor: default;
}

.tech-card__body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.tech-card:not(.is-active) .tech-card__text {
    display: none;
}

.tech-card.is-active .tech-card__title {
    display: none;
}

.tech-card__num {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: var(--text-m);
    letter-spacing: 4.8px;
    line-height: 1.2;
    text-transform: uppercase;
    margin: 0;
}

.tech-card__title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: var(--h6);
    line-height: 1.2;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 0;
}

.tech-card__text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: var(--text-m);
    line-height: 1.5;
    margin: 0;
}

/* ----- Team ----- */
.team {
    z-index: 3;
    overflow: clip;
}

.team__inner {
    padding: var(--grid-block) var(--grid-side);
    display: flex;
    justify-content: center;
}

.team__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--gap-xxl);
}

.team__header {
    width: 1267px;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--gap-xl);
    text-align: center;
    color: var(--neutral-light);
}

.team__title {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: var(--h3);
    line-height: 1.2;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    width: 472px;
    max-width: 100%;
    margin: 0;
}

.team__lead {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: var(--text-l);
    line-height: 1.5;
    width: 592px;
    max-width: 100%;
    margin: 0;
}

.team__row {
    display: flex;
    gap: 96px;
    justify-content: center;
    width: 100%;
}

.team-member {
    width: 237.5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

.team-member__photo {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    overflow: hidden;
}
.team-member__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-member__info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--gap-xs);
    color: var(--brand-white);
    text-align: center;
}

.team-member__name {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: var(--h5);
    line-height: 1.5;
    margin: 0;
}

.team-member__role {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: var(--text-s);
    line-height: 1.5;
    margin: 0;
}

.team__about {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: var(--gap-xxl);
    color: #fff;
}

.team__about p {
    flex: 1;
    font-family: var(--font-body);
    font-weight: 400;
    font-size: var(--text-m);
    line-height: 1.5;
}

/* ----- Contact slider ----- */
.contact {
    height: 800px;
    position: relative;
    overflow: clip;
    z-index: 2;
}

.contact__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.contact__inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--grid-side);
    position: relative;
    z-index: 1;
}

.contact__card {
    width: 588px;
    height: 100%;
    padding: var(--grid-block) var(--gap-l) var(--gap-l);
    backdrop-filter: blur(7.5px);
    -webkit-backdrop-filter: blur(7.5px);
    background: rgba(65, 78, 80, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--gap-l-plus);
    color: var(--neutral-light);
}

.contact__eyebrow {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: var(--text-m);
    letter-spacing: 3.2px;
    text-transform: uppercase;
    line-height: 1.2;
    margin: 0;
}

.contact__title {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: var(--h2);
    line-height: 1;
    letter-spacing: 0.72px;
    text-transform: uppercase;
    margin: 0;
}

.contact__text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: var(--text-m);
    line-height: 1.5;
    margin: 0;
}

/* ----- Footer ----- */
.footer {
    z-index: 1;
    overflow: clip;
}

.footer__inner {
    padding: var(--gap-l) var(--gap-l-plus);
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer__row {
    flex: 1;
    display: flex;
    gap: var(--gap-m);
    align-items: flex-start;
    justify-content: center;
    filter: drop-shadow(var(--shadow-xs));
}

.footer__col {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer__col--left { width: 486px; }
.footer__col--right { width: 508px; }

.footer__item {
    padding: var(--gap-m);
    display: flex;
}

.footer__item--small p {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: var(--text-xs);
    line-height: 1.2;
    color: var(--brand-white);
    margin: 0;
    cursor: pointer;
    transition: opacity .25s ease;
}
.footer__item--small p:hover { opacity: .8; }

.footer__item--strong p {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: var(--text-l);
    line-height: 1.2;
    text-transform: uppercase;
    color: #fff;
    margin: 0;
}

/* ----- Misc / Accessibility ----- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Smooth scrolling for anchor navigation */
html { scroll-behavior: smooth; }

/* Reveal-on-scroll baseline */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .8s ease, transform .8s ease;
}
.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .reveal.is-visible {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ----- Modal ----- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal[hidden] { display: none; }

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 30, 33, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn .3s ease forwards;
}

.modal__dialog {
    position: relative;
    width: min(100%, 540px);
    max-width: 100%;
    background: var(--page-bg);
    border: none;
    padding: 60px clamp(24px, 6vw, 60px);
    color: var(--neutral-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    animation: scaleIn .35s cubic-bezier(.2,.6,.2,1) forwards;
}

.modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 24px;
    height: 24px;
    padding: 0;
    color: var(--neutral-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity .25s ease;
}
.modal__close:hover { opacity: .75; }

.modal__close-icon { display: block; }

.modal__title {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: var(--h2);
    line-height: 1.2;
    margin: 0;
    max-width: 419px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0;
}

.modal__form {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--gap-l);
    width: 100%;
    max-width: 340px;
}

.modal__fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal__input {
    box-sizing: border-box;
    width: 100%;
    height: 48px;
    background: transparent;
    border: 1px solid var(--white-40);
    color: var(--neutral-light);
    font-family: var(--font-body);
    font-size: var(--text-m);
    line-height: 1.4;
    letter-spacing: -0.01em;
    padding: 10px 16px;
    outline: none;
    transition: border-color .25s ease;
}
.modal__input::placeholder {
    color: var(--neutral-light);
    opacity: 0.4;
}
.modal__input:focus { border-color: var(--neutral-light); }

.modal__consent {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    margin: 0;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 400;
    font-size: var(--text-xs);
    line-height: 1.4;
    color: var(--neutral-light);
    opacity: 0.4;
}
.modal__consent:hover,
.modal__consent:focus-within { opacity: 0.85; }

.modal__consent-checkbox {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    margin: 2px 0 0;
    accent-color: var(--neutral-light);
    cursor: pointer;
}

.modal__consent-text a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.btn--modal-submit {
    width: 100%;
    height: 48px;
    padding: 10px 15px;
    font-weight: 600;
    color: var(--brand-green);
    background: var(--neutral-light);
    border: 1px solid var(--white-40);
}
.btn--modal-submit:hover {
    background: #fff;
}

/* ----- Nav modal (mobile) ----- */
.modal--nav .modal__dialog--nav {
    width: min(100%, 360px);
    padding: clamp(48px, 12vw, 56px) clamp(28px, 8vw, 40px) var(--gap-xl);
    align-items: stretch;
    gap: var(--gap-l-plus);
}

.modal__nav-eyebrow {
    margin: 0;
    font-family: var(--font-heading);
    font-size: clamp(22px, 5.5vw, 28px);
    font-weight: 500;
    line-height: 1.25;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--neutral-light);
}

.nav-modal__nav {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
}

.nav-modal__link {
    display: block;
    padding: var(--gap-l) var(--gap-m);
    font-size: var(--text-s);
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-align: center;
    color: var(--neutral-light);
    border-top: 1px solid var(--white-16);
    transition: background-color .22s ease, opacity .22s ease;
}

.nav-modal__link:last-child {
    border-bottom: 1px solid var(--white-16);
}

.nav-modal__link:hover {
    background: rgba(255, 255, 255, 0.06);
}

.nav-modal__link:focus-visible {
    outline: 2px solid var(--neutral-light);
    outline-offset: -2px;
}

/* ----- House detail modal ----- */
.modal.modal--house {
    z-index: 1002;
    padding: 0;
    align-items: center;
    justify-content: center;
    /* Как `.houses__slide`: opacity .6s ease (+ HOUSES_SLIDER_* в main.js) */
    --house-gallery-cross-ms: 0.6s;
}

.modal--house .modal__backdrop {
    background: rgba(2, 30, 33, 0.55);
}

.modal__dialog--house {
    box-sizing: border-box;
    width: 90vw;
    max-width: 90vw;
    height: 90vh;
    max-height: 90vh;
    min-height: 0;
    padding: clamp(var(--gap-l), 3.8vh, var(--gap-l-plus))
        clamp(var(--grid-side), 3.4vw, 28px);
    gap: clamp(var(--gap-l), 3vh, var(--gap-l-plus));
    background:
        linear-gradient(
            111.67deg,
            rgb(2, 30, 33) 35.72%,
            rgb(16, 58, 65) 72.67%,
            rgb(20, 67, 74) 82.21%,
            rgb(43, 87, 93) 95.32%,
            rgb(105, 141, 144) 122.74%,
            rgb(183, 208, 208) 154.93%
        ),
        linear-gradient(90deg, rgb(9, 44, 50) 0%, rgb(9, 44, 50) 100%);
    background-attachment: local;
    animation: fadeInHouse .42s ease forwards;
    overflow-x: clip;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@keyframes fadeInHouse {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal--house .house-modal__close {
    position: absolute;
    top: clamp(var(--gap-m), 4vw, var(--gap-l-plus));
    right: clamp(var(--gap-m), 4vw, var(--gap-l-plus));
    width: 40px;
    height: 40px;
    z-index: 3;
}

.house-modal__inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: clamp(var(--gap-l), 3vh, var(--gap-xl));
    width: min(1440px, 100%);
    margin: 0 auto;
}

.house-modal__header {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--gap-m);
    max-width: min(940px, 100%);
    padding-right: 48px;
}

.house-modal__caption {
    margin: 0;
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: var(--h2);
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--neutral-light);
    word-break: break-word;
}

.house-modal__title-accent {
    font-weight: 500;
    letter-spacing: 0.06em;
}

.house-modal__lead {
    margin: 0;
    font-size: var(--text-l);
    line-height: 1.5;
    color: var(--neutral-light);
    letter-spacing: -0.02em;
    max-width: min(940px, 100%);
}

.house-modal__gallery-zone {
    position: relative;
    /* С шапкой/футером — один левый край (.house-modal__inner без доп. inset) */
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

/* Как `.houses__viewport`: центральный кадр, по краям — превью; те же transition по left/width/height. */
.house-modal__gallery {
    position: relative;
    width: 100%;
    cursor: pointer;
    touch-action: pan-y;
    -webkit-tap-highlight-color: transparent;
}

.house-modal__pane {
    box-sizing: border-box;
}

.house-modal__pane-inner {
    position: relative;
    overflow: hidden;
    border-radius: 0;
    width: 100%;
    height: 100%;
    flex: 1 1 auto;
    min-height: 0;
    transition: opacity var(--house-gallery-cross-ms, 0.6s) ease;
}

.modal--house .house-modal__gallery.is-gallery-fading .house-modal__pane-inner {
    opacity: 0;
}

.house-modal__pane.is-active .house-modal__pane-inner::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(to top, rgba(1, 21, 23, 0.6) 0%, rgba(2, 30, 33, 0) 23.63%);
}

.house-modal__pane-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (min-width: 768px) {
    .house-modal__gallery {
        height: clamp(209px, 32.4vw, 468px);
        max-height: min(468px, 58vh);
        flex: 1 1 auto;
        min-height: clamp(209px, 32.4vw, 468px);
        align-self: stretch;
    }

    .house-modal__pane {
        position: absolute;
        top: 50%;
        left: 50%;
        display: flex;
        flex-direction: column;
        width: 0;
        height: 0;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translate(-50%, -50%);
        transition:
            opacity .6s ease,
            width .6s ease,
            height .6s ease,
            left .6s ease,
            visibility 0s linear .6s;
        z-index: 1;
    }

    .house-modal__pane.is-prev,
    .house-modal__pane.is-active,
    .house-modal__pane.is-next {
        opacity: 1;
        visibility: visible;
        transition:
            opacity .6s ease,
            width .6s ease,
            height .6s ease,
            left .6s ease,
            visibility 0s linear 0s;
    }

    .house-modal__pane.is-active {
        width: 60%;
        height: clamp(209px, 32.4vw, 468px);
        left: 50%;
        z-index: 3;
        pointer-events: auto;
    }

    .house-modal__pane.is-prev {
        width: 15%;
        height: clamp(180px, 27.45vw, 394px);
        left: 7.5%;
        z-index: 2;
    }

    .house-modal__pane.is-next {
        width: 15%;
        height: clamp(180px, 27.45vw, 394px);
        left: 92.5%;
        z-index: 2;
    }
}

@media (max-width: 1440px) and (min-width: 768px) {
    .house-modal__pane.is-active {
        width: 75%;
    }

    .house-modal__pane.is-prev,
    .house-modal__pane.is-next {
        width: 7.5%;
    }
}

@media (max-width: 767px) {
    .house-modal__gallery {
        display: flex;
        flex-direction: row;
        align-items: stretch;
        gap: 0;
        height: auto;
        min-height: min(133px, 19.8vh);
        max-height: none;
    }

    .house-modal__pane {
        position: relative;
        top: auto;
        left: auto;
        display: flex;
        flex-direction: column;
        flex-shrink: 0;
        width: auto;
        height: auto;
        overflow: visible;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: none;
        transition: none;
        align-self: stretch;
        min-height: 0;
        z-index: auto;
    }

    .house-modal__pane.is-prev,
    .house-modal__pane.is-next {
        display: none;
    }

    .house-modal__pane.is-active {
        flex: 1 1 auto;
        min-width: 0;
        width: 100%;
        max-width: 100%;
        height: auto;
        min-height: 0;
        max-height: none;
    }

    .house-modal__pane.is-active .house-modal__pane-inner {
        min-height: min(288px, 52.2vw);
    }
}

/* Как «Узнать больше»: те же arrow-btn и hover, что у .houses__nav-prev / next */
.modal--house .house-modal__gallery-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    transition:
        background-color .25s ease,
        backdrop-filter .25s ease,
        border-color .25s ease,
        transform .25s ease;
}

.modal--house .house-modal__gallery-btn img {
    width: 12px;
    height: 14px;
    pointer-events: none;
}

/* Специфичность выше глобального .arrow-btn: без синей обводки при клике внутри диалога */
.modal--house .house-modal__gallery-btn:focus:not(:focus-visible) {
    outline: none;
}

.modal--house .house-modal__gallery-btn:focus-visible {
    outline: 2px solid var(--neutral-light);
    outline-offset: 3px;
}

.modal--house .house-modal__gallery-btn:hover,
.modal--house .house-modal__gallery-btn:focus-visible {
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    background: var(--white-8);
    border-color: transparent;
}

.house-modal__gallery-btn--prev {
    left: clamp(8px, 2vw, 40px);
}

.house-modal__gallery-btn--next {
    right: clamp(8px, 2vw, 40px);
}

.house-modal__footer {
    max-width: min(940px, 100%);
}

.house-modal__long {
    margin: 0;
    font-size: var(--text-m);
    line-height: 1.55;
    color: var(--neutral-light);
}

/* От 480px: без вертикального скролла у диалога — flex + компактнее галерея/отступы */
@media (min-width: 480px) {
    .modal__dialog--house {
        display: flex;
        flex-direction: column;
        overflow-y: hidden;
        overflow-x: clip;
        gap: clamp(10px, 1.65vh, 22px);
        padding: clamp(18px, 2.45vh, 34px) clamp(14px, 2vw, 24px);
    }

    .modal--house .house-modal__close {
        position: absolute;
        top: clamp(6px, 1.35vh, 16px);
        right: clamp(6px, 1.65vw, 18px);
    }

    .house-modal__inner {
        flex: 1 1 auto;
        min-height: 0;
        gap: clamp(var(--gap-l), 2.35vh, var(--gap-xl));
    }

    .house-modal__header {
        flex-shrink: 0;
        padding-right: 40px;
    }

    .house-modal__caption {
        font-size: clamp(22px, 2.55vw, var(--h2));
        line-height: 1.25;
        letter-spacing: 0.04em;
    }

    .house-modal__lead {
        font-size: clamp(15px, 1rem, var(--text-l));
    }

    .house-modal__gallery-zone {
        flex: 1 1 auto;
        min-height: 0;
        align-self: stretch;
        padding: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .house-modal__footer {
        flex-shrink: 0;
    }

    .house-modal__long {
        font-size: clamp(14px, 0.9rem, var(--text-m));
        line-height: 1.48;
    }
}

/* Планшет «высота диалога»: галерея растягивается только когда боковые превью скрыты */
@media (min-width: 480px) and (max-width: 767px) {
    .house-modal__gallery {
        flex: 1 1 auto;
        max-height: 90%;
        min-height: min(133px, 19.8vh);
        width: 100%;
        align-items: stretch;
        align-self: stretch;
    }
}

@media (max-width: 767px) {
    .modal__dialog--house {
        padding-inline: clamp(12px, 4vw, 20px);
    }

    .house-modal__header {
        padding-right: 44px;
    }

    .house-modal__gallery-zone {
        padding-inline: 0;
    }

    .house-modal__gallery {
        gap: 0;
    }

    .house-modal__gallery-btn--prev {
        left: clamp(4px, 2vw, 12px);
    }

    .house-modal__gallery-btn--next {
        right: clamp(4px, 2vw, 12px);
    }
}

@media (max-width: 479px) {
    .modal--house .house-modal__close {
        width: 36px;
        height: 36px;
        top: calc(env(safe-area-inset-top, 0px) + var(--gap-m));
        right: calc(env(safe-area-inset-right, 0px) + var(--gap-m));
    }

    .modal__dialog--house {
        display: block;
        overflow-x: clip;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-left: calc(15px + env(safe-area-inset-left, 0px));
        padding-right: calc(15px + env(safe-area-inset-right, 0px));
        padding-bottom: calc(var(--gap-l) + env(safe-area-inset-bottom, 0px));
        gap: var(--gap-l-plus);
    }

    .house-modal__gallery-zone {
        padding-inline: 0;
    }

    .house-modal__pane.is-active .house-modal__pane-inner {
        min-height: min(288px, 52.2vw);
    }
}

@media (prefers-reduced-motion: reduce) {
    .modal__dialog--house {
        animation: none;
    }

    .modal--house .house-modal__pane {
        transition-duration: 0.01ms;
        transition-delay: 0ms;
    }

    .modal--house .house-modal__pane-inner {
        transition-duration: 0.01ms;
        transition-delay: 0ms;
    }

    .modal--house .house-modal__gallery.is-gallery-fading .house-modal__pane-inner {
        opacity: 1;
        transform: none;
    }
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field__label {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    color: var(--brand-white);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.field__input {
    height: 44px;
    background: transparent;
    border: 1px solid rgba(217, 217, 217, 0.4);
    color: var(--neutral-light);
    font-family: var(--font-body);
    font-size: var(--text-m);
    padding: 0 14px;
    outline: none;
    transition: border-color .25s ease;
}
.field__input:focus { border-color: var(--brand-white); }
.field__input::placeholder { color: rgba(217, 217, 217, 0.5); }

@keyframes fadeIn {
    from { opacity: 0; } to { opacity: 1; }
}
@keyframes scaleIn {
    from { opacity: 0; transform: translateY(20px) scale(.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}



/* ==========================================================================
   Responsive — 1440 / 768 / ~375
   Desktop (>1440): базовые стили без изменений.
   ========================================================================== */

@media (max-width: 1440px) {
    :root {
        --side-pad: clamp(24px, 5vw, 240px);
        --grid-side: clamp(16px, 3vw, 32px);
        --grid-block: clamp(48px, 6vw, 96px);
    }

    .houses__slide.is-active {
        width: 75%;
        height: 640px;
    }

    .houses__slide.is-prev,
    .houses__slide.is-next {
        width: 7.5%;
        height: 540px;
    }

    .houses__nav-prev { left: clamp(16px, 4vw, 96px); }
    .houses__nav-next { right: clamp(16px, 4vw, 96px); }
}

/* Технологии: ниже ширины ноутбука четыре колонки в ряд перегружают текст */
@media (max-width: 1024px) {
    .tech {
        overflow-x: visible;
    }

    .tech__inner {
        min-width: 0;
        width: 100%;
        max-width: 100%;
    }

    .tech__content {
        align-items: stretch;
        min-width: 0;
        width: 100%;
        max-width: 100%;
        gap: clamp(var(--gap-l-plus), 5vw, var(--gap-xxl));
    }

    .tech-grid {
        min-width: 0;
        width: 100%;
        max-width: 100%;
    }

    .tech-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1px;
        background: var(--brand-green);
        border: 1px solid var(--brand-green);
    }

    .tech-card {
        flex: none;
        min-width: 0;
        min-height: clamp(168px, 22vw, 220px);
        margin-left: 0 !important;
        padding: clamp(var(--gap-m), 3vw, var(--gap-l-plus))
            clamp(var(--gap-m), 3vw, var(--gap-l-plus));
        border: none;
        border-radius: 0;
        background: transparent;
    }

    .tech-card.is-active {
        background: var(--brand-green);
        min-height: auto;
    }

    .tech-card:not(.is-active):hover,
    .tech-card:not(.is-active):focus-visible {
        background: rgba(255, 255, 255, 0.04);
    }

    .tech-card__title,
    .tech-card__text {
        overflow-wrap: break-word;
        hyphens: auto;
    }

    .tech__content > .btn {
        align-self: center;
    }
}

/* Шапка: 480–1439 — как на планшете (~768), строка на всю ширину до полного десктопа (≥1440); ≤479 — бургер */
@media (min-width: 480px) and (max-width: 1439px) {
    .header__inner {
        width: 100%;
        max-width: 100%;
        padding-inline: clamp(8px, 2.2vw, 20px);
    }

    .header__row {
        gap: clamp(6px, 1.5vw, 14px);
    }

    .header__row .nav__item {
        flex-shrink: 0;
        padding: var(--gap-s) clamp(6px, 1.2vw, 12px);
        font-size: clamp(11px, 1.45vw, 13px);
        letter-spacing: 0.06em;
        white-space: nowrap;
    }

    :root {
        --header-logo-h: clamp(36px, 6.8vw, 48px);
    }
}

/* Технологии: до 1439 — статичные карточки как на ~375 (рамка, градиент, номер → заголовок → текст); ≥1440 — интерактивный ряд */
@media (max-width: 1439px) {
    .tech-row.js-tech-cards {
        display: grid;
        gap: 0;
        background: transparent !important;
        border: none !important;
        padding: 0;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tech-row.js-tech-cards .tech-card {
        cursor: default;
        pointer-events: none;
        min-height: 0;
        transition: none;

        align-items: flex-start;
        text-align: left;

        padding: clamp(var(--gap-l-plus), 5vw, 42px);
        gap: clamp(var(--gap-l-plus), 4vw, var(--gap-xl));

        /* Как на ~375: рамка через border-box — при схлопывании ячеек нет «толстой» двойной линии */
        border: 1px solid transparent;
        border-radius: 0;
        margin-left: 0 !important;

        /* background:
            linear-gradient(
                155deg,
                rgb(7, 38, 43) 0%,
                rgb(12, 52, 58) 38%,
                rgb(22, 68, 74) 100%
            ) padding-box,
            linear-gradient(
                to right,
                var(--white-40) 0%,
                #2c4449 100%
            ) border-box; */
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    }

    .tech-row.js-tech-cards .tech-card__num {
        align-self: flex-start;
        text-align: left;
        letter-spacing: 0.42em;
        font-weight: 600;
        font-size: var(--text-m);
        margin: 0;
        padding: 0;
    }

    .tech-row.js-tech-cards .tech-card__body {
        justify-content: flex-start;
        align-items: flex-start;
        align-self: stretch;
        gap: clamp(var(--gap-l-plus), 4vw, var(--gap-xl));
        width: 100%;
        text-align: left;
    }

    .tech-row.js-tech-cards .tech-card__title {
        text-align: left;
        letter-spacing: 0.08em;
        line-height: 1.28;
        margin: 0;
    }

    .tech-row.js-tech-cards .tech-card__text {
        text-align: left;
        margin: 0;
        line-height: 1.55;
        opacity: 0.94;
    }

    .tech-row.js-tech-cards .tech-card:not(.is-active) .tech-card__text,
    .tech-row.js-tech-cards .tech-card.is-active .tech-card__text {
        display: block !important;
    }

    .tech-row.js-tech-cards .tech-card:not(.is-active) .tech-card__title,
    .tech-row.js-tech-cards .tech-card.is-active .tech-card__title {
        display: block !important;
    }

    .tech-row.js-tech-cards .tech-card:hover,
    .tech-row.js-tech-cards .tech-card:focus-visible {
        outline: none;
    }
}

/* Технологии: сетка 2×2 — без двойных линий между соседними карточками */
@media (min-width: 480px) and (max-width: 1439px) {
    .tech-row.js-tech-cards .tech-card:nth-child(2n) {
        margin-left: -1px;
    }

    .tech-row.js-tech-cards .tech-card:nth-child(n + 3) {
        margin-top: -1px;
    }
}

/* Features: до 1439 — ряд карточек со скроллом, контейнер без обрезки (как на планшете, но до laptop) */
@media (max-width: 1439px) {
    .features__header {
        padding-top: clamp(32px, 8vw, 64px);
    }

    /* Иначе «overflow-x: visible» при базовом overflow-y: clip даёт вычисленный overflow-x: auto и ломает край карусели */
    .features {
        overflow: visible;
    }

    .features__inner {
        min-width: 0;
        width: 100%;
        max-width: 100%;
    }

    .features__content {
        align-items: stretch;
        min-width: 0;
        width: 100%;
        max-width: 100%;
    }

    .features__cta {
        align-self: center;
    }

    /* Горизонтальный скролл; одна сетка на ряд — выровненные строки текста и фото (без subgrid — стабильнее по колонкам) */
    .feature-row {
        display: grid;
        grid-template-columns: repeat(3, min(420px, calc(100% - 24px)));
        grid-template-rows: auto minmax(390px, 1fr);
        justify-content: start;
        justify-items: stretch;
        gap: 0;
        align-items: stretch;
        align-self: stretch;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin-inline: calc(-1 * var(--grid-side));
        padding-inline: var(--grid-side);
        overflow-x: auto;
        overflow-y: visible;
        overflow-anchor: none;
        overscroll-behavior-x: contain;
        touch-action: pan-x pan-y;
        scroll-snap-type: x proximity;
        scroll-padding-inline: var(--grid-side);
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .feature-row::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    .feature-row .feature {
        display: contents;
    }

    .feature-row .feature:nth-child(1) .feature__text {
        grid-column: 1;
        grid-row: 1;
    }

    .feature-row .feature:nth-child(1) .feature__image {
        grid-column: 1;
        grid-row: 2;
    }

    .feature-row .feature:nth-child(2) .feature__text {
        grid-column: 2;
        grid-row: 1;
    }

    .feature-row .feature:nth-child(2) .feature__image {
        grid-column: 2;
        grid-row: 2;
    }

    .feature-row .feature:nth-child(3) .feature__text {
        grid-column: 3;
        grid-row: 1;
    }

    .feature-row .feature:nth-child(3) .feature__image {
        grid-column: 3;
        grid-row: 2;
    }

    .feature-row .feature .feature__text {
        border-top: 1px solid var(--brand-green);
        scroll-snap-align: start;
        flex: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-width: 0;
        min-height: 0;
    }

    .feature-row .feature:not(:last-child) .feature__text,
    .feature-row .feature:not(:last-child) .feature__image {
        border-right: 1px solid var(--brand-green);
    }

    .feature-row .feature .feature__image {
        flex: none;
        width: 100%;
        min-width: 0;
        min-height: 390px;
        height: 100%;
        max-height: none;
        overflow: hidden;
    }

    .feature-row .feature .feature__image picture {
        display: block;
        width: 100%;
        height: 100%;
    }

    .feature-row .feature .feature__image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .bl720 .reveal.is-visible
    {

        max-height: 720px;
    }

    .bl720 .features__decor {

        top: -39px;

    }

}

@media (max-width: 768px) {
    body {
        background-attachment: scroll;
    }

    .hero {
        height: clamp(420px, 65vw, 800px);
    }

    .promo {
        height: auto;
        min-height: min(520px, 78vh);
        padding-block: 0;
        align-items: center;
        justify-content: center;
    }

    .promo__inner {
        flex: 0 1 auto;
        width: 100%;
        min-height: 0;
        padding-block: clamp(var(--gap-xl), 6vh, var(--gap-xxl));
        padding-inline: var(--grid-side);
    }

    .slider1 {
        height: clamp(520px, 85vw, 800px);
    }

    .houses__viewport {
        height: clamp(380px, 50vw, 640px);
    }

    .houses__slide.is-active {
        height: clamp(380px, 50vw, 640px);
    }

    .houses__slide.is-prev,
    .houses__slide.is-next {
        height: clamp(320px, 42vw, 540px);
    }

    .houses__nav-prev,
    .houses__nav-next {
        top: clamp(190px, 25vw, 320px);
    }

    .contact {
        height: clamp(520px, 90vw, 800px);
    }

    .footer__row {
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--gap-l);
    }

    .footer__col--left,
    .footer__col--right {
        width: auto;
        max-width: 100%;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* Features: 480–1439 — шапки «как на ~375»: без лишних полей секции, текст на всю ширину с 15px по краям */
@media (min-width: 480px) and (max-width: 1439px) {
    .section.features {
        padding-inline: 0;
    }

    .section.features .features__inner {
        padding-inline: 0;
    }

    /* Те же кегли, что при max-width: 479px (длинные заголовки помещаются) */
    .section.features .features__title {
        font-size: 26px;
        letter-spacing: 1.2px;
    }

    .section.features .features__lead {
        font-size: 15px;
    }

    .section.features .features__title,
    .section.features .features__lead {
        padding-left: calc(15px + env(safe-area-inset-left, 0px));
        padding-right: calc(15px + env(safe-area-inset-right, 0px));
        box-sizing: border-box;
    }

    .section.features .feature-row {
        margin-inline: 0;
        padding-inline: calc(15px + env(safe-area-inset-left, 0px))
            calc(15px + env(safe-area-inset-right, 0px));
        scroll-padding-inline: calc(15px + env(safe-area-inset-left, 0px))
            calc(15px + env(safe-area-inset-right, 0px));
    }

    /* Технологии: шапка (заголовок + лид) — те же кегли и поля, что у features на этом диапазоне */
    .section.tech {
        padding-inline: 0;
    }

    .section.tech .tech__inner {
        padding-inline: 0;
    }

    .section.tech .features__title {
        font-size: 26px;
        letter-spacing: 1.2px;
    }

    .section.tech .features__lead {
        font-size: 15px;
    }

    .section.tech .features__title,
    .section.tech .features__lead {
        padding-left: calc(15px + env(safe-area-inset-left, 0px));
        padding-right: calc(15px + env(safe-area-inset-right, 0px));
        box-sizing: border-box;
    }
}

/* Технологии: 768–1339 — 10px от краёв экрана (шапка без отдельных 15px, поля секции) */
@media (min-width: 768px) and (max-width: 1339px) {
    .section.tech {
        padding-inline: calc(10px + env(safe-area-inset-left, 0px))
            calc(10px + env(safe-area-inset-right, 0px));
    }

    .section.tech .features__title,
    .section.tech .features__lead {
        padding-left: 0;
        padding-right: 0;
    }
}

/* Команда: до 1339px (в т.ч. 768–1339) — как на ~375: скролл карточек, колонка «о команде», поля 15px, кегли; ≥1340 — десктопный ряд */
@media (max-width: 1339px) {
    .section.team {
        padding-inline: 0;
    }

    .team__inner {
        padding-inline: 0;
        min-width: 0;
        width: 100%;
        max-width: 100%;
    }

    .team {
        overflow-x: visible;
    }

    .team__content {
        align-items: center;
        min-width: 0;
        width: 100%;
        max-width: 100%;
    }

    .section.team .team__header {
        text-align: center;
        align-items: center;
    }

    .section.team .team__title {
        padding-left: calc(15px + env(safe-area-inset-left, 0px));
        padding-right: calc(15px + env(safe-area-inset-right, 0px));
        font-size: 26px;
        letter-spacing: 1.2px;
        text-align: center;
    }

    .section.team .team__lead {
        padding-left: calc(15px + env(safe-area-inset-left, 0px));
        padding-right: calc(15px + env(safe-area-inset-right, 0px));
        font-size: 15px;
        text-align: center;
    }

    .section.team .team__about p {
        padding-left: calc(15px + env(safe-area-inset-left, 0px));
        padding-right: calc(15px + env(safe-area-inset-right, 0px));
        font-size: 14px;
        text-align: center;
    }

    .team__row {
        justify-content: safe center;
        gap: var(--gap-xl);
        align-self: stretch;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        flex-shrink: 1;
        margin-inline: 0;
        padding-left: calc(15px + env(safe-area-inset-left, 0px));
        padding-right: calc(15px + env(safe-area-inset-right, 0px));
        overflow-x: auto;
        overflow-y: visible;
        overscroll-behavior-x: contain;
        touch-action: pan-x pan-y;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: calc(15px + env(safe-area-inset-left, 0px))
            calc(15px + env(safe-area-inset-right, 0px));
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .team__row::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    .team-member {
        flex: 0 0 auto;
        flex-shrink: 0;
        scroll-snap-align: start;
        width: 200px;
        max-width: min(200px, 72vw);
    }

    .team__about {
        flex-direction: column;
        gap: var(--gap-l-plus);
        align-items: center;
        padding-inline: 0;
        text-align: center;
    }

    .team__about p {
        flex: none;
        width: 100%;
        max-width: none;
    }
}

@media (max-width: 479px) {
    :root {
        --h2: 28px;
        --h3: 26px;
        --h4: 22px;
        --h5: 18px;
        --text-xl: 17px;
        --text-l: 15px;
        --text-m: 14px;
    }

    /* Promo, Features, Сценарии, шапка Houses: секция без полей страницы (~375). Команда — max-width: 1339px; Технологии — 10px от края */
    .section.promo,
    .section.features,
    .section.slider1 {
        padding-inline: 0;
    }

    .section.tech {
        padding-inline: calc(10px + env(safe-area-inset-left, 0px))
            calc(10px + env(safe-area-inset-right, 0px));
    }

    .promo__inner {
        padding-inline: 0;
    }

    .section.features .features__inner {
        padding-inline: 0;
    }

    .section.tech .tech__inner {
        padding-inline: 0;
    }

    .houses__top {
        padding-inline: 0;
    }

    /* Поля только у типографики шапок; карусели — на всю ширину (команда — в блоке max-width: 1339px). Технологии — поля секции 10px, шапка без доп. отступов */
    .section.promo .promo__title,
    .section.promo .promo__lead,
    .section.features .features__title,
    .section.features .features__lead,
    .houses__top .houses__eyebrow,
    .houses__top .houses__title,
    .houses__top .houses__lead {
        padding-left: calc(15px + env(safe-area-inset-left, 0px));
        padding-right: calc(15px + env(safe-area-inset-right, 0px));
    }

    .section.tech .features__title,
    .section.tech .features__lead {
        padding-left: 0;
        padding-right: 0;
        box-sizing: border-box;
    }

    /* Сценарии (slider1): поля у подписи, заголовка, текста и блока ссылки внутри карточки */
    .section.slider1 .slider1__eyebrow,
    .section.slider1 .slider1__title,
    .section.slider1 .slider1__text,
    .section.slider1 .slider1__expand,
    .section.slider1 .slider1__cta {
        padding-left: calc(15px + env(safe-area-inset-left, 0px));
        padding-right: calc(15px + env(safe-area-inset-right, 0px));
    }

    .section.slider1 .slider1__cta .btn--link {
        flex: 0 0 auto;
        width: fit-content;
        max-width: 100%;
        box-sizing: border-box;
    }

    .feature-row {
        grid-template-columns: repeat(3, 80vw);
        margin-inline: 0;
        padding-inline: 0;
        scroll-padding-inline: 0;
    }

    .header {
        padding-left: calc(15px + env(safe-area-inset-left, 0px));
        padding-right: calc(15px + env(safe-area-inset-right, 0px));
    }

    .header__inner {
        padding-top: calc(15px + env(safe-area-inset-top, 0px));
        padding-inline: 0;
    }

    .header__row {
        position: relative;
        display: flex;
        justify-content: center;
        align-items: flex-start;
        width: 100%;
        padding-inline: calc(44px + var(--gap-s));
    }

    .header__row .nav--desktop {
        display: none;
    }

    .burger {
        display: inline-flex;
        position: absolute;
        top: 0;
        right: 0;
    }

    .logo {
        margin-inline: auto;
        width: fit-content;
        max-width: 100%;
    }

    .logo__mark {
        max-width: min(100%, calc(var(--header-logo-h) * 229 / 52.2449));
        height: auto;
        max-height: 60px;
        margin-top: 30px;
    }

    /* Сценарии: фото на всю ширину, текст под ним */
    .slider1 {
        height: auto;
        overflow: visible;
        position: relative;
        cursor: pointer;
        touch-action: pan-y;
    }

    .slider1__slide {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        padding: 0;
        width: 100%;
    }

    .slider1__slide:not(.is-active) {
        position: absolute;
        inset: 0;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        z-index: 0;
        transition: opacity .45s ease, visibility 0s linear .45s;
    }

    .slider1__slide.is-active {
        position: relative;
        inset: auto;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        z-index: 1;
        transition: opacity .45s ease, visibility 0s linear 0s;
    }

    .slider1__bg {
        position: relative;
        inset: auto;
        width: 100%;
        height: min(72vw, 320px);
        min-height: 220px;
        object-fit: cover;
        object-position: center center;
        flex-shrink: 0;
        z-index: 0;
    }

    .slider1__inner {
        height: auto;
        align-items: stretch;
        justify-content: flex-start;
        /* как у .slider1__bg: полная ширина слайда; отступы текста — в .slider1__card */
        padding: 0 0 var(--gap-l);
        width: 100%;
    }

    .slider1__card {
        width: 100%;
        height: auto;
        min-height: 0;
        padding: var(--gap-xl) 0 var(--gap-l);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        background-color: rgba(9, 44, 50, 0.92);
        gap: var(--gap-l);
    }

    .slider1__big-number {
        font-size: clamp(270px, 81vw, 390px);
        letter-spacing: -0.06em;
        top: clamp(-190px, -132vw, -100px);
        left: calc(15px + env(safe-area-inset-left, 0px));
    }

    .slider1__content {
        gap: var(--gap-l);
        align-items: stretch;
        width: 100%;
        max-width: 100%;
    }

    /* Раскрытый текст: ограниченная высота + прокрутка внутри (иначе touch уходит в свайп слайдера) */
    .slider1__expand.is-open .slider1__expand-inner {
        max-height: min(42vh, 240px);
    }

    .slider1__arrows {
        margin-top: var(--gap-m);
        padding-left: calc(15px + env(safe-area-inset-left, 0px));
        padding-right: calc(15px + env(safe-area-inset-right, 0px));
    }

    .slider1__card:has(.slider1__expand.is-open) .slider1__arrows {
        margin-top: var(--gap-xl);
        padding-top: var(--gap-l);
    }

    .arrow-btn {
        width: 56px;
        height: 56px;
    }

    /* Технологии: одна колонка на ~375px, без зазоров между карточками */
    .tech-row.js-tech-cards {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    /* В одной колонке схлопываем только горизонтальные швы */
    .tech-row.js-tech-cards .tech-card + .tech-card {
        margin-top: -1px;
    }

    .tech-row.js-tech-cards .tech-card {
        padding: clamp(var(--gap-l-plus), 6vw, 38px);
    }

    /* ~375: колонки 80vw (правило на .feature-row — grid-template-columns); .feature — display:contents, ширина не задаётся */

    .features__cta,
    .tech__content > .btn {
        width: 100%;
        max-width: 320px;
    }

    .btn--filled {
        width: 100%;
        max-width: 328px;
    }

    .contact__card {
        width: 100%;
        max-width: 100%;
    }

    .houses__caption-wrap {
        padding-inline: var(--grid-side);
    }

    .houses__caption {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--gap-m);
    }
}

/* Экран ~375: ширина блока лого 172px, марка и подпись в том же масштабе (отношение к viewBox 229) */
@media (max-width: 375px) {
    .section.tech .section__inner.tech__inner {
        padding-inline: 0;
    }

    :root {
        --header-logo-h: calc(172px * 52.2449 / 229);
    }

    .logo {
        max-width: 172px;
    }

    .logo__tagline {
        font-size: calc(var(--text-xs) * 172 / 229);
    }
}

/* ==========================================================================
   Подстраницы (политики и др.) — тот же хедер/футер, текстовый блок
   ========================================================================== */

.page--sub .header.header--subpage {
    position: sticky;
    top: 0;
    z-index: 50;
    background: linear-gradient(to bottom, rgba(2, 30, 33, 0.98), rgba(9, 44, 50, 0.95));
    border-bottom: 1px solid var(--white-8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow-x: clip;
    --header-logo-h: 52px;
}

.page--sub .header.header--subpage .header__inner {
    align-items: center;
    min-height: calc(var(--header-logo-h) + var(--gap-l) * 2);
}

.page--sub .header.header--subpage .header__row {
    min-height: var(--header-logo-h);
}

.page--sub .header.header--subpage .header__row .logo {
    top: 50%;
    transform: translate(-50%, -50%);
}

.page--sub .header.header--subpage .logo__mark {
    height: var(--header-logo-h);
    width: auto;
    max-width: min(100%, calc(var(--header-logo-h) * var(--header-logo-ratio)));
    max-height: var(--header-logo-h);
}

@media (min-width: 480px) and (max-width: 1439px) {
    .page--sub .header.header--subpage {
        --header-logo-h: clamp(32px, 5.5vw, 44px);
    }
}

@media (max-width: 479px) {
    .page--sub .header.header--subpage {
        --header-logo-h: 38px;
    }

    .page--sub .header.header--subpage .header__inner {
        min-height: auto;
        padding-top: calc(12px + env(safe-area-inset-top, 0px));
        padding-bottom: 12px;
    }

    .page--sub .header.header--subpage .header__row .logo {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
    }

    .page--sub .header.header--subpage .logo__mark {
        height: auto;
        max-height: var(--header-logo-h);
        margin-top: 0;
        max-width: min(100%, calc(var(--header-logo-h) * var(--header-logo-ratio)));
    }
}

.legal {
    width: 100%;
    padding: var(--gap-xl) var(--side-pad) var(--grid-block);
    display: flex;
    justify-content: center;
}

.legal__inner {
    width: min(720px, 100%);
    max-width: 100%;
    padding: 0 var(--grid-side);
    color: var(--neutral-light);
}

.legal__eyebrow {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: var(--text-s);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.65);
    margin: 0 0 var(--gap-m);
}

.legal__title {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: clamp(28px, 4vw, var(--h2));
    line-height: 1.15;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin: 0 0 var(--gap-m);
    hyphens: auto;
}

.legal__updated {
    font-family: var(--font-body);
    font-size: var(--text-s);
    color: rgba(255, 255, 255, 0.55);
    margin: 0 0 var(--gap-xxl);
}

.legal__intro {
    font-family: var(--font-body);
    font-size: var(--text-m);
    line-height: 1.65;
    margin: 0 0 var(--gap-l-plus);
}

.legal__intro p + p {
    margin-top: var(--gap-m);
}

.legal__body {
    font-family: var(--font-body);
    font-size: var(--text-m);
    line-height: 1.65;
}

.legal__body h2 {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: var(--h6);
    line-height: 1.3;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--brand-white);
    margin: var(--gap-xl) 0 var(--gap-m);
}

.legal__body h2:first-child {
    margin-top: 0;
}

.legal__body p {
    margin: 0 0 var(--gap-m);
}

.legal__body ul {
    margin: 0 0 var(--gap-m);
    padding-left: 1.25em;
}

.legal__body li {
    margin-bottom: var(--gap-xs);
}

.legal__body li:last-child {
    margin-bottom: 0;
}

.legal__body a {
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: opacity 0.2s ease;
}

.legal__body a:hover {
    opacity: 0.85;
}

@media (max-width: 767px) {
    .legal {
        padding-top: var(--gap-l);
    }

    .legal__inner {
        padding-inline: var(--gap-l);
    }
}