:root {
    --color-header: #163971;
    --color-text: #111111;
    --color-divider: #fc1216;
    --color-cta-start: #e02424;
    --color-cta-end: #f25a3a;
    --color-bg: #ffffff;
    --color-hero-stage: #d9d9d9;
    --font-sans: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    /* Ключевые акценты — не схлопываются на низких экранах */
    --brand-size: clamp(1.65rem, 3.4vw + 0.7rem, 2.85rem);
    --slogan-size: clamp(0.95rem, 1.6vw + 0.45rem, 1.35rem);
    --phone-size: clamp(1.85rem, 4.5vw + 0.75rem, 4.75rem);
    --cta-label-size: clamp(0.95rem, 1.2vw + 0.55rem, 1.75rem);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    font-family: var(--font-sans);
    color: var(--color-text);
    background: #1a1a1a;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* По умолчанию — можно скроллить; на высоких экранах — один кадр */
.landing {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: visible;
    background-color: #1a1a1a;
    background-image: url("images/bg.jpg");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    /* запас под фиксированную кнопку телефона */
    padding-bottom: calc(5.75rem + env(safe-area-inset-bottom, 0px));
}

/* —— Header —— */
.landing__header {
    flex: 0 0 auto;
    width: 100%;
    background: var(--color-header);
    color: #fff;
    text-align: center;
    padding: clamp(0.55rem, 1.3vh, 1.15rem) clamp(0.75rem, 3vw, 2rem);
}

.landing__header-inner {
    margin: 0 auto;
    max-width: 72rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.landing__brand {
    margin: 0;
    font-size: var(--brand-size);
    font-weight: 800;
    letter-spacing: 0.01em;
    line-height: 1.1;
    text-wrap: balance;
}

.landing__slogan {
    margin: 0;
    max-width: 42rem;
    font-size: var(--slogan-size);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.25;
    opacity: 0.92;
    text-wrap: balance;
}

.landing__brand:focus,
.landing__slogan:focus {
    outline: none;
}

/* —— Services —— */
.landing__services {
    flex: 0 0 auto;
    width: 100%;
    background: rgba(255, 255, 255, 0.92);
    padding: clamp(0.7rem, 1.8vh, 1.5rem) clamp(1rem, 4vw, 2.5rem);
}

.landing__services-inner {
    max-width: 72rem;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: clamp(0.75rem, 2vw, 2rem);
    align-items: center;
}

.landing__services-title {
    margin: 0 0 0.5rem;
    font-size: clamp(1.35rem, 2.4vw + 0.4rem, 2.15rem);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.landing__service-block {
    margin: 0 0 0.5rem;
}

.landing__service-heading {
    margin: 0 0 0.35rem;
    font-size: clamp(1.1rem, 1.6vw + 0.45rem, 1.45rem);
    font-weight: 800;
    line-height: 1.25;
}

.landing__service-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 0.35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.landing__service-tags li {
    margin: 0;
    padding: 0.24rem 0.6rem;
    border-radius: 999px;
    background: rgba(22, 57, 113, 0.08);
    color: var(--color-header);
    font-size: clamp(0.82rem, 1.1vw + 0.45rem, 1.05rem);
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
}

.landing__services-list {
    margin: 0 0 0.5rem;
    padding: 0;
    list-style: none;
    font-size: clamp(1rem, 1.4vw + 0.45rem, 1.28rem);
    line-height: 1.35;
    font-weight: 600;
}

.landing__services-list li {
    position: relative;
    padding-left: 1.05em;
    margin-bottom: 0.3rem;
}

.landing__services-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    top: 0;
}

.landing__services-list li:last-child {
    margin-bottom: 0;
}

.landing__services-offer {
    margin: 0;
    font-size: clamp(1.05rem, 1.5vw + 0.45rem, 1.35rem);
    font-weight: 800;
    color: var(--color-header);
    line-height: 1.3;
}

.landing__services-art {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 0;
}

.landing__services-art img {
    max-height: clamp(5.5rem, 14vh, 13.5rem);
    width: auto;
    object-fit: contain;
}

/* —— Гео и цены —— */
.landing__geo {
    flex: 0 0 auto;
    width: 100%;
    background: rgba(244, 246, 249, 0.92);
    border-top: 1px solid rgba(226, 230, 238, 0.9);
    padding: clamp(0.55rem, 1.2vh, 1rem) clamp(1rem, 4vw, 2.5rem);
}

.landing__geo-inner {
    max-width: 72rem;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(0.65rem, 2.5vw, 2.5rem);
}

.landing__geo-place,
.landing__geo-price {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.landing__geo-label {
    font-size: clamp(0.78rem, 0.9vw + 0.45rem, 0.95rem);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-header);
}

.landing__geo-text {
    font-size: clamp(0.98rem, 1.3vw + 0.45rem, 1.3rem);
    font-weight: 600;
    line-height: 1.35;
    color: var(--color-text);
}

/* —— Красная линия —— */
.landing__divider {
    width: 100%;
    height: 4px;
    background: var(--color-divider);
    flex-shrink: 0;
}

/* —— Hero —— */
.landing__hero {
    position: relative;
    flex: 1 1 auto;
    min-height: clamp(16rem, 42vh, 28rem);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: transparent;
    container-type: size;
    container-name: stage;
}

.landing__hero-frame {
    position: relative;
    aspect-ratio: 4 / 3;
    width: min(100cqi, calc(100cqh * 4 / 3));
    height: min(100cqh, calc(100cqi * 3 / 4));
    min-height: 14rem;
    container-type: size;
    container-name: hero;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--color-hero-stage);
    perspective: 1400px;
    perspective-origin: 50% 50%;
}

.landing__carousel {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
}

.landing__carousel-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center center;
    opacity: 0;
    transform: translate3d(72%, 0, -180px) rotateY(-42deg) scale(0.88);
    transform-origin: center center;
    transition:
        transform 0.95s cubic-bezier(0.22, 0.61, 0.36, 1),
        opacity 0.75s ease;
    z-index: 0;
    backface-visibility: hidden;
    will-change: transform, opacity;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.landing__carousel-slide.is-prep {
    transition: none;
    opacity: 0;
    transform: translate3d(72%, 0, -180px) rotateY(-42deg) scale(0.88);
    z-index: 2;
}

.landing__carousel-slide.is-active {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotateY(0deg) scale(1);
    z-index: 3;
}

.landing__carousel-slide.is-exit {
    opacity: 0.45;
    transform: translate3d(-72%, 0, -180px) rotateY(42deg) scale(0.88);
    z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
    .landing__carousel-slide {
        transition: opacity 0.35s ease;
        transform: none;
        box-shadow: none;
    }

    .landing__carousel-slide.is-prep,
    .landing__carousel-slide.is-exit {
        transform: none;
        opacity: 0;
    }

    .landing__carousel-slide.is-active {
        transform: none;
        opacity: 1;
    }
}

/* Телефон всегда у нижнего края окна — не уезжает при скролле */
.landing__cta {
    position: fixed;
    left: 50%;
    bottom: max(0.55rem, env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    z-index: 1000;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    width: min(40rem, calc(100% - 1.3rem));
    padding: 0.75rem clamp(1.1rem, 4vw, 2.5rem);
    border-radius: 999px;
    background: linear-gradient(90deg, var(--color-cta-start), var(--color-cta-end));
    color: #fff;
    text-decoration: none;
    text-align: center;
    box-shadow: 0 4px 22px rgba(0, 0, 0, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.landing__cta:hover,
.landing__cta:focus-visible {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
    outline: none;
}

.landing__cta:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.landing__cta-label {
    font-size: var(--cta-label-size);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.1;
}

.landing__cta-phone {
    font-size: var(--phone-size);
    font-weight: 800;
    letter-spacing: 0.01em;
    line-height: 1.05;
    white-space: nowrap;
}

/* —— Высокий экран: умещаем в один viewport —— */
@media (min-height: 820px) and (min-width: 721px) {
    html,
    body {
        height: 100%;
        overflow: hidden;
    }

    .landing {
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
        background-size: 100% 100%;
        /* кнопка поверх hero, как в исходном макете */
        padding-bottom: 0;
    }

    .landing__hero {
        min-height: 0;
    }

    .landing__hero-frame {
        min-height: 0;
    }
}

/* —— Низкий экран: скролл + сжатие второстепенного —— */
@media (max-height: 819px) {
    .landing {
        height: auto;
        overflow: visible;
    }

    .landing__header {
        padding: 0.55rem 0.75rem;
    }

    .landing__services {
        padding: 0.55rem 1rem 0.6rem;
    }

    .landing__services-art img {
        max-height: 5.25rem;
    }

    .landing__geo {
        padding: 0.45rem 1rem;
    }

    .landing__hero {
        flex: 0 0 auto;
        min-height: 18rem;
        height: clamp(18rem, 48vh, 26rem);
    }

    .landing__hero-frame {
        width: 100%;
        height: 100%;
        min-height: 18rem;
        aspect-ratio: auto;
        max-width: 100%;
    }

    .landing__cta {
        padding: 0.7rem 1.35rem;
    }
}

/* Очень низкий: прячем иллюстрацию, компактнее текст */
@media (max-height: 640px) {
    .landing__services-art {
        display: none;
    }

    .landing__services-inner {
        grid-template-columns: 1fr;
    }

    .landing__services-title {
        font-size: 1.25rem;
        margin-bottom: 0.35rem;
    }

    .landing__service-heading {
        font-size: 1.05rem;
    }

    .landing__services-list {
        font-size: 0.95rem;
    }

    .landing__services-offer {
        font-size: 1rem;
    }

    .landing__geo-inner {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }

    .landing__geo-text {
        font-size: 0.95rem;
    }

    .landing__hero {
        min-height: 16.5rem;
        height: clamp(16.5rem, 52vh, 22rem);
    }

    .landing__hero-frame {
        min-height: 16.5rem;
    }
}

/* —— Узкий экран —— */
@media (max-width: 720px) {
    :root {
        --brand-size: clamp(1.55rem, 7vw + 0.35rem, 2.35rem);
        --slogan-size: clamp(0.85rem, 2.8vw + 0.25rem, 1.1rem);
        --phone-size: clamp(1.7rem, 7.2vw + 0.35rem, 2.65rem);
        --cta-label-size: clamp(0.9rem, 2.8vw, 1.15rem);
    }

    html,
    body {
        height: auto;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .landing {
        height: auto;
        min-height: 100dvh;
        overflow: visible;
        background-size: cover;
    }

    .landing__header {
        padding: 0.55rem 0.55rem 0.5rem;
    }

    .landing__slogan {
        letter-spacing: 0.02em;
        text-transform: none;
        font-weight: 600;
    }

    .landing__services {
        padding: 0.65rem 0.85rem 0.7rem;
    }

    .landing__services-inner {
        grid-template-columns: 1fr;
        gap: 0.45rem;
    }

    .landing__services-title {
        font-size: 1.35rem;
    }

    .landing__service-heading {
        font-size: 1.1rem;
    }

    .landing__service-tags li {
        font-size: 0.85rem;
        padding: 0.2rem 0.5rem;
        white-space: normal;
    }

    .landing__services-list {
        font-size: 1rem;
    }

    .landing__services-offer {
        font-size: 1.05rem;
    }

    .landing__services-art img {
        max-height: 5.75rem;
    }

    .landing__geo {
        padding: 0.55rem 0.85rem;
    }

    .landing__geo-inner {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .landing__geo-text {
        font-size: 1rem;
    }

    .landing__hero {
        flex: 0 0 auto;
        min-height: 17rem;
        height: clamp(17rem, 46vh, 24rem);
    }

    .landing__hero-frame {
        width: 100%;
        height: 100%;
        min-height: 17rem;
        aspect-ratio: auto;
        max-width: 100%;
    }

    .landing__cta {
        width: calc(100% - 1.1rem);
        padding: 0.75rem 1rem;
        border-radius: 1.35rem;
    }

    .landing__cta-phone {
        letter-spacing: 0;
        white-space: nowrap;
    }
}

/* Узкий + низкий */
@media (max-width: 720px) and (max-height: 640px) {
    .landing__services-art {
        display: none;
    }

    .landing__hero {
        min-height: 15.5rem;
        height: 15.5rem;
    }

    .landing__hero-frame {
        min-height: 15.5rem;
    }
}

/* Очень узкий телефон: телефон всё ещё крупный, допускается лёгкий перенос */
@media (max-width: 380px) {
    .landing__cta-phone {
        white-space: normal;
        font-size: clamp(1.55rem, 9.5vw, 2rem);
        word-break: keep-all;
    }
}
