/* Услуги: 3×420px + 2×29px = 1318px — ниже этого одна колонка */
@media (max-width: 1318px) {
    .services-layout {
        grid-template-columns: 1fr;
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .service-card--t1,
    .service-card--t2 {
        height: auto;
        min-height: 240px;
    }
}

@media (max-width: 900px) {
    .container {
        max-width: none;
        width: 100%;
        padding-left: var(--page-gutter);
        padding-right: var(--page-gutter);
        box-sizing: border-box;
    }

    nav,
    .site-nav {
        position: relative;
        z-index: 200;
        flex-wrap: nowrap;
        align-items: center;
        overflow: visible;
        padding: 10px 14px;
        margin-top: 8px;
        margin-bottom: 16px;
        border-radius: 24px;
        width: 100%;
        box-sizing: border-box;
    }

    .nav-logo {
        flex: 1 1 auto;
        min-width: 0;
    }

    .nav-toggle {
        display: flex;
        flex-shrink: 0;
        margin-left: 4px;
    }

    .nav-cta {
        flex-shrink: 0;
    }

    .nav-links {
        position: absolute;
        top: calc(100% + 6px);
        left: 0;
        right: 0;
        z-index: 201;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 6px;
        margin: 0;
        padding: 0 10px;
        box-sizing: border-box;
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        visibility: hidden;
        pointer-events: none;
        background: rgba(0, 0, 0, 0.5);
        border: 1px solid rgba(0, 0, 0, 0.2);
        border-radius: 24px;
        box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
        transition:
            max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
            opacity 0.28s ease,
            padding 0.35s cubic-bezier(0.4, 0, 0.2, 1),
            visibility 0s linear 0.35s;
    }

    .site-nav.is-menu-open .nav-links {
        max-height: min(80vh, 360px);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        padding: 10px;
        transition:
            max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
            opacity 0.28s ease,
            padding 0.35s cubic-bezier(0.4, 0, 0.2, 1),
            visibility 0s;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        width: 100%;
        box-sizing: border-box;
        text-align: center;
        padding: 12px 16px;
        border-radius: 16px;
    }

    @media (prefers-reduced-motion: reduce) {
        .nav-links,
        .site-nav.is-menu-open .nav-links {
            transition-duration: 0.01ms;
        }
    }

    section {
        padding: 48px 0;
        width: 100%;
        box-sizing: border-box;
    }

    section.hero {
        padding: 0;
    }

    .hero-group {
        display: flex;
        flex-direction: column;
        width: 100%;
        margin-bottom: 24px;
    }

    .hero {
        position: relative; /* обязательно для абсолютного позиционирования фото */
        display: flex;
        flex-direction: column;
        width: 100%;
        height: auto;
        min-height: 0;
        border-radius: 24px;
        margin-bottom: 0;
        overflow: visible; /* чтобы тени/масштаб не обрезались */
    }

    /* Фото делаем абсолютным фоном */
    .hero-photo {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: min(56vw, 300px); /* такая же высота, как у контента */
        min-height: 200px;
        z-index: 0;
        border-radius: 24px 24px 0 0;
    }

    /* Контент – относительный, занимает ту же высоту, что и фото */
    .hero-content {
        position: relative; /* было absolute – меняем */
        z-index: 2;
        width: 100%;
        min-height: min(56vw, 300px); /* растягиваем, чтобы занять место */
        padding: 20px 16px 0;
        border-radius: 24px;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        justify-content: flex-end; /* текст внизу */
        background: rgba(0, 0, 0, 0.5); /* затемнение, чтобы текст читался */
    }

    .hero-title {
        font-size: clamp(22px, 5.5vw, 30px);
    }

    .hero-subtitle {
        font-size: 13px;
        padding-top: 12px;
    }

    .hero-subtitle br {
        display: none;
    }

    .hero-btns {
        padding-top: 12px;
        margin-bottom: 0;
        gap: 6px;
    }

    /* Статистика – теперь в нормальном потоке, строго под контентом */
    .stats-row {
        position: relative; /* уже было, но подстрахуем */
        bottom: auto;
        right: auto;
        left: auto;
        order: 0; /* сбрасываем */
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 15px 0;
        border-top: none;
        z-index: 3;
        box-sizing: border-box;
    }

    .stats-row__inner {
        flex-direction: column;
        gap: 4px;
        width: 100%;
    }

    .stat-item {
        --stat-overlap: 0;
        flex: 0 0 52px;
        width: 100%;
        min-height: 52px;
        height: 52px;
        margin-left: 0 !important;
        padding: 0 48px 0 16px;
        align-items: center;
        justify-content: flex-start;
        flex-direction: row;
        gap: 12px;
        border-radius: 14px;
    }

    .stat-item:not(:first-child) {
        margin-left: 0;
    }

    .stat-item--highlight {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
    }

    .stat-item--highlight .stat-label {
        letter-spacing: normal;
    }

    .stat-num {
        font-size: 24px;
        line-height: 1;
        flex-shrink: 0;
    }

    .stat-label,
    .stat-caption {
        font-size: 12px;
        line-height: 1.2;
        text-align: left;
    }

    .stat-item--arrow::after {
        top: 50%;
        right: 12px;
        transform: translateY(-50%);
        width: 32px;
        height: 32px;
        background-size: 16px 16px;
    }

    .services,
    .how,
    .projects,
    .clients,
    .faq {
        width: 100%;
    }

    .services-layout,
    .projects-layout,
    .faq-layout,
    .how-title-row,
    .how-note,
    .clients-header,
    .clients-subtitle {
        width: 100%;
        max-width: 100%;
    }

    .section-title {
        max-width: 100%;
    }

    .projects-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .projects-heading {
        width: 100%;
    }

    .projects-grid {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 16px;
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .project-card {
        width: 100%;
        max-width: 100%;
        height: 264px;
    }

    .project-card.large {
        grid-row: auto;
        height: 400px;
    }

    .project-card.large .project-info {
        padding-top: 300px;
    }
    .stat-item:nth-child(1),
    .stat-item:nth-child(3) {
        background: rgba(15, 15, 15, 0.5);   /* увеличь прозрачность по вкусу (0.6, 0.7, 0.8) */
        backdrop-filter: blur(10px);         /* сохрани размытие */
    }
    .project-card:nth-child(2) .project-info,
    .project-card:nth-child(3) .project-info {
        padding-top: 120px;
    }

    .faq-layout {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .faq-list,
    .faq-answer {
        width: 100%;
        max-width: 100%;
    }

    .faq-item {
        font-size: 14px;
        border-radius: 20px;
    }

    .clients-grid {
        width: 100%;
        max-width: 100%;
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .client-card.large {
        width: 100%;
        max-width: 100%;
        aspect-ratio: 645 / 420;
        height: auto;
        min-height: 0;
        grid-column: 1;
        grid-row: auto;
    }

    .client-card.large .client-card-epigraph {
        font-size: min(var(--client-epigraph-font-size, 108px), 22vw);
    }

    .clients-subtitle {
        max-width: 100%;
        padding: 0 4px;
    }

    .site-footer {
        width: 100%;
        max-width: 100%;
        height: auto;
        min-height: 280px;
        margin: 12px 0 0;
        border-radius: 24px;
    }

    /* Типографика: уменьшенные размеры на мобильных */
    .nav-logo {
        font-size: 18px;
    }

    .section-title {
        font-size: clamp(28px, 6vw, 36px);
    }

    .section-subtitle {
        font-size: 16px;
    }

    .btn-primary {
        font-size: 15px;
        height: 44px;
        min-height: 44px;
        padding: 10px 22px;
    }

    .btn-secondary {
        font-size: 15px;
        height: 44px;
        min-height: 44px;
        padding: 10px 8px 10px 22px;
    }

    .btn-more {
        font-size: 15px;
        width: auto;
        min-width: 0;
        height: 44px;
        min-height: 44px;
        padding: 10px 8px 10px 22px;
    }

    .nav-cta {
        font-size: 14px;
        padding: 8px 16px;
    }

    .service-card-tag {
        font-size: 11px;
    }

    .service-card-title {
        font-size: 26px;
    }

    .service-card-desc {
        font-size: 15px;
    }

    .how-note {
        font-size: 12px;
    }

    .project-tag {
        font-size: 11px;
    }

    .project-title {
        font-size: 26px;
    }

    .project-subtitle {
        font-size: 15px;
    }

    .clients-subtitle {
        font-size: 13px;
    }

    .client-card {
        font-size: 17px;
    }

    .faq-answer-brand {
        font-size: clamp(64px, 20vw, 96px);
    }

    .faq-answer p {
        font-size: 13px;
    }
    .mark {
        position: relative;
        /*padding-bottom: 20px;*/
    }

    .mark::after {
        content: '';
        position: absolute;
        right: -15px;
        bottom: -5px;
        width: 50px;
        max-width: 100%;
        height: 12px;
        background: url('../../img/header-stroke.svg') no-repeat left center / contain;
    }
}

@media (max-width: 480px) {
    .hero-photo {
        height: min(60vw, 260px);
        min-height: 180px;
    }

    .hero-content {
        min-height: min(60vw, 260px); /* было height – заменяем на min-height */
    }

    .stat-item {
        flex: 0 0 48px;
        height: 48px;
        min-height: 48px;
        padding: 0 44px 0 14px;
    }

    .hero-title {
        font-size: clamp(20px, 5vw, 26px);
    }

    .hero-subtitle {
        font-size: 12px;
    }

    .section-title {
        font-size: clamp(24px, 5.5vw, 30px);
    }

    .section-subtitle {
        font-size: 14px;
    }

    .stat-num {
        font-size: 20px;
    }

    .stat-label,
    .stat-caption {
        font-size: 11px;
    }

    .service-card-title {
        font-size: 22px;
    }

    .service-card-desc {
        font-size: 14px;
    }

    .project-title {
        font-size: 22px;
    }

    .project-subtitle {
        font-size: 14px;
    }

    .step-title {
        font-size: 14px;
    }

    .step-desc {
        font-size: 12px;
    }

    .step-num {
        font-size: 10px;
    }

    .client-card {
        font-size: 15px;
    }

    .faq-item {
        font-size: 13px;
    }

    .faq-answer p {
        font-size: 12px;
    }

    .hero-content {
        padding-bottom: 25px;
    }

    .hero-btns {
        padding-top: 10px;
        gap: 5px;
    }

    .btn-primary {
        font-size: 14px;
        height: 40px;
        min-height: 40px;
        padding: 8px 18px;
    }

    .btn-secondary {
        font-size: 14px;
        height: 40px;
        min-height: 40px;
        padding: 8px 6px 8px 18px;
    }

    .btn-more {
        font-size: 14px;
        height: 40px;
        min-height: 40px;
        padding: 8px 6px 8px 18px;
    }

    .nav-cta {
        padding: 7px 12px;
        font-size: 13px;
    }

    .nav-logo {
        font-size: 16px;
    }
    .mark {
        position: relative;
        /*padding-bottom: 20px;*/
    }

    .mark::after {
        content: '';
        position: absolute;
        right: -15px;
        bottom: -5px;
        width: 50px;
        max-width: 100%;
        height: 12px;
        background: url('../../img/header-stroke.svg') no-repeat left center / contain;
    }
}