/*
 * Marden Property 2026 — главная страница.
 * Значения (высоты, clamp, отступы, тени) взяты из макета
 * design/Главная страница Marden.kz/Marden Homepage.dc.html.
 */

/* ================= Блок 1 — Hero ================= */

.m-hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: clamp(404px, 60vh, 595px);
    overflow: hidden;
    background: var(--color-ui-secondary);
}

.m-hero__media {
    position: absolute;
    inset: 0;
    will-change: transform;
}

.m-hero__media picture,
.m-hero__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.m-hero__img {
    object-fit: cover;
    object-position: center;
    filter: contrast(1.09) saturate(1.06) brightness(.99);
}

.m-hero__shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
            rgba(16, 25, 42, .84) 0%,
            rgba(16, 25, 42, .6) 30%,
            rgba(16, 25, 42, .22) 56%,
            rgba(16, 25, 42, 0) 80%);
}

.m-hero__inner {
    position: relative;
    z-index: 2;
    padding-top: clamp(36px, 6vh, 72px);
    padding-bottom: clamp(36px, 6vh, 72px);
}

.m-hero__content {
    max-width: 600px;
}

.m-hero__title {
    color: var(--c-white);
    margin-bottom: var(--space-400);
}

.m-hero__lead {
    max-width: 500px;
    margin-bottom: var(--space-600);
    font-size: clamp(17px, 2vw, 20px);
    line-height: var(--lh-body);
    color: rgba(255, 255, 255, .85);
}

.m-hero__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

/* Ссылка или кнопка — в зависимости от того, встраивается ролик или нет.
   Для кнопки сбрасываем её собственные рамку, фон и шрифт. */
.m-hero__video {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin-top: 42px;
    padding: 0;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--c-white);
    text-decoration: none;
    cursor: pointer;
}

.m-hero__video:hover {
    color: var(--color-accent);
}

.m-hero__play {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--control-h);
    height: var(--control-h);
    flex: none;
    border: 1.5px solid rgba(255, 255, 255, .5);
    border-radius: 50%;
    background: rgba(255, 255, 255, .04);
    color: var(--c-white);
    transition: background var(--t-hover), border-color var(--t-hover);
}

.m-hero__video:hover .m-hero__play {
    background: rgba(255, 255, 255, .18);
    border-color: var(--c-white);
}

@media (max-width: 767px) {
    .m-hero__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .m-hero__actions .m-btn {
        width: 100%;
    }
}

/* ================= Блок 2 — Выбор аудитории ================= */

.m-audience {
    padding: clamp(28px, 3.4vw, 44px) 0;
}

.m-audience__head {
    max-width: 720px;
    margin-bottom: clamp(18px, 2.4vw, 26px);
}

.m-audience__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(232px, 1fr));
    gap: var(--space-250);
}

.m-audience__card {
    display: flex;
    flex-direction: column;
    gap: var(--space-150);
    min-height: 156px;
    padding: 22px 36px 18px;
    border: 1px solid var(--color-divider);
    border-radius: 10px;
    background: var(--c-white);
    box-shadow: 0 1px 2px rgba(16, 25, 42, .04);
    color: inherit;
    text-decoration: none;
    transition: transform var(--t-slide), box-shadow var(--t-slide), border-color var(--t-slide);
}

.m-audience__card:hover {
    border-color: var(--color-brand-primary);
    box-shadow: 0 12px 26px rgba(16, 25, 42, .10);
    transform: translateY(-5px);
    color: inherit;
}

.m-audience__card:hover .m-icon-box {
    background: var(--c-brand-blue-tint-2);
}

.m-audience__card:hover .m-icon-box svg {
    stroke: var(--color-brand-hover);
}

.m-audience__text {
    flex: 1;
    font-size: 15px;
    line-height: 1.65;
    color: var(--color-text-secondary);
}

.m-audience__arrow {
    font-size: var(--fs-h3);
    font-weight: 700;
    line-height: 1;
    color: var(--color-brand-primary);
    transition: transform var(--t-slide), color var(--t-slide);
}

.m-audience__card:hover .m-audience__arrow {
    transform: translateX(6px);
    color: var(--color-brand-hover);
}

@media (max-width: 767px) {
    .m-audience__grid {
        grid-template-columns: 1fr;
    }

    .m-audience__card {
        padding: var(--space-250);
    }
}

/* ================= Блок 3 — Цифры ================= */

.m-stats {
    padding: clamp(38px, 6vw, 75px) 0;
}

.m-stats__row {
    /* Сетка, а не flex: цифр может быть и четыре (как в макете), и шесть
       (как в брифе) — колонки подстраиваются, ряд не разрывается 4+2. */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    justify-items: center;
    gap: clamp(32px, 4vw, 48px) clamp(20px, 2.4vw, 36px);
    max-width: 1160px;
    margin: 0 auto;
}

/* Пять и больше цифр: крупный кегль перестаёт помещаться в ряд, поэтому
   уменьшаем его — иначе «700 000+» выталкивает соседние колонки. */
.m-stats__row:has(> :nth-child(5)) .m-stats__value {
    font-size: clamp(32px, 3.2vw, 44px);
}

.m-stats__item {
    flex: 0 0 auto;
    text-align: center;
}

.m-stats__value {
    font-size: clamp(40px, 4.6vw, 60px);
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.05;
    white-space: nowrap;
    color: var(--c-white);
}

.m-stats__label {
    margin-top: 10px;
    font-size: var(--fs-caption);
    font-weight: 500;
    color: var(--color-on-dark-soft);
}

@media (max-width: 767px) {
    .m-stats__row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--space-500) var(--space-250);
    }

    .m-stats__item {
        min-width: 0;
    }

    /* Мобильный размер цифры по дизайн-системе — 32px. Без этого
       «700 000+» с nowrap не сжимается и растягивает всю страницу. */
    .m-stats__value {
        font-size: 32px;
    }
}

/* ================= Блок 4 — Услуги ================= */

.m-services {
    padding: clamp(72px, 10vw, 128px) 0 clamp(56px, 9vw, 104px);
}

.m-services__title {
    font-size: clamp(23px, 3.1vw, 32px);
    letter-spacing: -.01em;
}

.m-services .m-section__head {
    margin-bottom: clamp(24px, 3.5vw, 36px);
}

.m-services__card {
    width: min(285px, 78vw);
}

.m-services__media {
    height: 104px;
}

.m-services__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: sepia(.16) saturate(1.1) contrast(1.03) brightness(1.02) hue-rotate(-6deg);
    transition: transform 350ms ease;
}

.m-services__card:hover .m-services__img {
    transform: scale(1.05);
}

.m-services__tone {
    position: absolute;
    inset: 0;
    background: var(--color-accent);
    opacity: .12;
    mix-blend-mode: soft-light;
    pointer-events: none;
}

.m-services__icon {
    position: absolute;
    top: var(--space-150);
    left: var(--space-150);
    background: rgba(16, 25, 42, .42);
    backdrop-filter: blur(4px);
}

.m-services__icon svg {
    stroke: var(--c-white);
}

.m-services__body {
    gap: var(--space-100);
}

.m-services__text {
    font-size: var(--fs-body-sm);
    line-height: 1.5;
    color: var(--color-text-secondary);
}

.m-services__more {
    display: inline-block;
    margin-top: var(--space-50);
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-link);
    transition: transform var(--t-slide);
}

.m-services__card:hover .m-services__more {
    transform: translateX(5px);
}

/* ================= Блок 5 — Объекты на главной ================= */

.m-home-objects .m-section__head {
    margin-bottom: var(--space-400);
}

.m-home-objects__card {
    width: min(340px, 82vw);
}

.m-home-objects__body {
    padding: 28px;
}

.m-home-objects__meta {
    order: 1;
}

.m-home-objects__name {
    order: 2;
    font-size: 23px;
    font-weight: 700;
    line-height: var(--lh-heading);
    letter-spacing: -.01em;
}

.m-home-objects__area {
    order: 3;
    font-size: var(--fs-caption);
    color: var(--color-text-secondary);
}

.m-home-objects__foot {
    order: 4;
    display: flex;
    align-items: flex-end;
    flex: 1;
    margin-top: var(--space-250);
}

.m-home-objects__foot .m-link {
    font-size: 15px;
}

/* ================= Блок 6 — Доверие ================= */

.m-trust {
    padding: var(--space-1200) 0 clamp(56px, 9vw, 112px);
}

.m-trust__head {
    max-width: 760px;
    margin-bottom: clamp(36px, 5vw, 52px);
}

.m-trust__lead {
    margin-top: 14px;
}

.m-trust__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-400);
    padding: 36px 0;
    border-top: 1px solid var(--color-divider);
    border-bottom: 1px solid var(--color-divider);
}

.m-trust__item {
    display: flex;
    flex-direction: column;
    gap: var(--space-50);
    flex: none;
    color: var(--color-text-secondary);
}

.m-trust__name-row {
    display: flex;
    align-items: center;
    gap: var(--space-100);
}

.m-trust__name {
    font-size: clamp(18px, 2.4vw, 22px);
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--color-ui-primary);
    opacity: .78;
    transition: color var(--t-hover), opacity var(--t-hover);
}

.m-trust__item:hover .m-trust__name {
    color: var(--color-brand-primary);
    opacity: 1;
}

.m-trust__sub {
    font-size: var(--fs-overline);
    font-weight: 500;
    letter-spacing: .02em;
}

.m-trust__pop-text {
    display: block;
    margin-bottom: var(--space-150);
    font-size: var(--fs-body-sm);
    line-height: 1.5;
    font-weight: 500;
    color: var(--color-text-primary);
}

.m-trust__pop-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-100);
    font-size: var(--fs-caption);
    font-weight: 600;
    color: var(--color-text-link);
}

@media (max-width: 767px) {
    .m-trust__row {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-400) var(--space-250);
    }
}

/* ================= Блок 7 — Отзывы ================= */

.m-reviews__title {
    max-width: 620px;
}

.m-reviews .m-section__head {
    margin-bottom: clamp(28px, 4vw, 44px);
}

.m-reviews__viewport {
    overflow: hidden;
    border-radius: var(--radius-md);
}

.m-reviews__track {
    display: flex;
    transition: transform 500ms ease;
}

.m-reviews__slide {
    flex: none;
    width: 100%;
    padding: var(--space-50);
}

.m-reviews__card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 28px;
    margin: 0;
    padding: clamp(24px, 4vw, 40px);
    border: 1px solid var(--color-divider);
    border-radius: var(--radius-md);
    background: var(--c-white);
}

.m-reviews__avatar {
    position: relative;
    width: 96px;
    height: 96px;
    flex: none;
    overflow: hidden;
    border-radius: 50%;
    background: var(--color-ui-primary);
}

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

/* Кружок без фото: инициалы вместо глухой заливки, иначе он выглядит
   как картинка, которая не загрузилась. */
.m-reviews__avatar--initials {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-brand-tint);
    font-size: 30px;
    font-weight: 700;
    letter-spacing: .02em;
    color: var(--color-text-link);
}

.m-reviews__body {
    flex: 1;
    min-width: 240px;
}

.m-reviews__quote {
    margin: 0 0 var(--space-250);
    font-size: clamp(17px, 2.2vw, 20px);
    line-height: 1.55;
    font-weight: 500;
    color: var(--color-text-primary);
    text-wrap: pretty;
}

.m-reviews__name {
    font-size: var(--fs-body);
    font-weight: 700;
    color: var(--color-ui-primary);
}

.m-reviews__role {
    margin-top: 2px;
    font-size: var(--fs-body-sm);
    color: var(--color-text-secondary);
}

.m-reviews__controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--space-300);
}

.m-reviews__arrows {
    display: flex;
    gap: 10px;
}

@media (max-width: 767px) {
    .m-reviews__arrows {
        display: none;
    }

    .m-reviews__controls {
        justify-content: center;
    }

    /* Портрет над цитатой: с min-width 240px карточка не сжималась ниже
       414px и растягивала всю страницу шире вьюпорта. */
    .m-reviews__card {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-250);
    }

    .m-reviews__body {
        min-width: 0;
        width: 100%;
    }
}

/* ================= Блок 8 — Новости ================= */

.m-news__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: var(--space-300);
    margin-bottom: var(--space-500);
}

.m-news__card {
    transition: box-shadow 190ms ease-out, transform 190ms ease-out;
}

.m-news__card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.m-news__body {
    padding: 18px;
}

.m-news__cat {
    font-size: 11px;
}

.m-news__date {
    font-size: var(--fs-overline);
    font-weight: 500;
    color: var(--color-text-secondary);
}

.m-news__title {
    font-size: 18px;
    font-weight: 600;
    line-height: var(--lh-snug);
}

.m-news__text {
    font-size: var(--fs-body-sm);
    line-height: 1.5;
    color: var(--color-text-secondary);
}

.m-news__media {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-500) var(--space-600);
    padding-top: 36px;
    border-top: 1px solid var(--color-divider);
}

.m-news__media-label {
    font-size: var(--fs-caption);
    font-weight: 600;
    letter-spacing: .04em;
    color: var(--color-text-secondary);
}

.m-news__media-item {
    font-size: clamp(16px, 2vw, 19px);
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--color-ui-primary);
    opacity: .62;
    transition: opacity var(--t-hover), color var(--t-hover);
}

.m-news__media-item:hover {
    opacity: 1;
    color: var(--color-brand-hover);
}

@media (max-width: 767px) {
    .m-news__media {
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: var(--space-400);
        scrollbar-width: none;
    }

    .m-news__media::-webkit-scrollbar {
        display: none;
    }

    .m-news__media-item,
    .m-news__media-label {
        white-space: nowrap;
    }
}

/* ================= Блок 9 — Контакты и форма ================= */

.m-contact__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: clamp(32px, 5vw, 64px);
    align-items: start;
}

.m-contact__title {
    max-width: 440px;
    margin-bottom: var(--space-200);
}

.m-contact__lead {
    max-width: 420px;
    margin-bottom: var(--space-500);
    font-size: var(--fs-body-lg);
    line-height: var(--lh-body);
    color: var(--color-on-dark-muted);
}

.m-contact__channel {
    padding-top: var(--space-400);
    border-top: 1px solid var(--color-on-dark-faint);
}

.m-contact__overline {
    margin-bottom: var(--space-150);
    font-size: var(--fs-caption);
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--color-accent);
}

.m-contact__phone {
    display: inline-block;
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--c-white);
}

.m-contact__phone:hover {
    color: var(--color-accent);
}

.m-contact__schedule {
    margin-top: 10px;
    font-size: 15px;
    color: rgba(255, 255, 255, .6);
}

.m-contact__email {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-top: var(--space-200);
    font-size: 15px;
    color: var(--color-on-dark-strong);
}

.m-contact__email:hover {
    color: var(--c-white);
}

.m-contact__card {
    padding: var(--space-500);
    border-radius: var(--radius-md);
    background: var(--c-white);
    color: var(--color-text-primary);
}

.m-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.m-form-success__check {
    stroke: var(--c-success);
}

@media (max-width: 767px) {
    .m-contact__card {
        padding: var(--space-300);
    }
}
