.how {
    background: transparent;
    width: 100%;
    max-width: 100%;
}

.how-title-row {
    text-align: center;
    margin-bottom: 48px;
}

.steps-row {
    --step-overlap: 0.46;
    --step-card-w: calc(100% / (1 + 4 * (1 - var(--step-overlap))));
    --step-duration: 0.45s;
    --step-ease: cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: flex-end;
    gap: 0;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 12px 20px 8px;
    isolation: isolate;
    overflow: visible;
}

.step-card {
    width: var(--step-card-w);
    height: 264px;
    min-height: 264px;
    max-height: 264px;
    flex-shrink: 0;
    box-sizing: border-box;
    border-radius: 30px;
    padding: 0 20px 24px 20px;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: flex-start;
    cursor: default;
    transform-origin: center bottom;
    transition: transform var(--step-duration) var(--step-ease);
    overflow: hidden;
}

.step-card:not(:first-child) {
    margin-left: calc(-1 * var(--step-card-w) * var(--step-overlap));
}

/* Боковые карточки разъезжаются, активная — без увеличения */
.steps-row.is-expanded .step-card.is-before {
    transform: translateX(-44px);
}

.steps-row.is-expanded .step-card.is-after {
    transform: translateX(44px);
}

.step-card.active {
    z-index: 10;
    transform: none;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2);
}

.step-card:nth-child(1) {
    background: rgba(244, 122, 31, 1);
}

.step-card:nth-child(2) {
    background: rgba(255, 255, 255, 1);
}

.step-card:nth-child(3) {
    background: rgba(46, 46, 46, 1);
}

.step-card:nth-child(4) {
    background: rgba(135, 135, 135, 1);
}

.step-card:nth-child(5) {
    background: rgba(0, 0, 0, 1);
}

.step-card:nth-child(2) .step-num,
.step-card:nth-child(2) .step-title,
.step-card:nth-child(2) .step-desc,
.step-card:nth-child(4) .step-num,
.step-card:nth-child(4) .step-title,
.step-card:nth-child(4) .step-desc {
    color: #000;
}

.step-card .step-num {
    color: rgba(255, 255, 255, 0.65);
}

.step-card .step-title {
    color: #fff;
}

.step-card .step-desc {
    color: rgba(255, 255, 255, 0.8);
}

.step-num {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.step-title {
    margin: 75px 0 0 0;
    font-size: 32px;
    font-weight: 500;
    line-height: 1.3;
    flex-shrink: 0;
}

.step-desc {
    margin: 20px 0 0 0;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.65;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

.how-note {
    text-align: center;
    margin-top: 28px;
    font-size: 15px;
    color: black;
    font-weight: 500;
}

.how-note a {
    color: var(--orange);
    text-decoration: none;
    font-weight: 600;
}

@media (max-width: 900px) {
    .how-title-row {
        margin-bottom: 24px;
        padding: 0 2px;
    }

    .how-note {
        padding: 0 2px;
        margin-top: 20px;
    }

    .steps-row {
        --step-overlap-v: 0.22;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        width: 100%;
        max-width: 100%;
        padding: 12px 0 8px;
        overflow: visible;
        scroll-snap-type: none;
    }

    .step-card,
    .step-card:not(:first-child) {
        width: 100%;
        max-width: 390px;
        height: 217px;
        min-height: 217px;
        max-height: 217px;
        aspect-ratio: auto;
        flex: none;
        margin-left: auto;
        margin-right: auto;
        padding: 0 15px 20px;
        border-radius: 30px;
        box-shadow: none;
        transform: none !important;
        transition: none;
        cursor: default;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        justify-content: flex-start;
        box-sizing: border-box;
    }

    .step-card:not(:first-child) {
        margin-top: calc(-1 * var(--step-overlap-v) * 217px);
    }

    .step-card:nth-child(1) { z-index: 1; }
    .step-card:nth-child(2) { z-index: 2; }
    .step-card:nth-child(3) { z-index: 3; }
    .step-card:nth-child(4) { z-index: 4; }
    .step-card:nth-child(5) { z-index: 5; }

    .step-card:nth-child(1) {
        background: rgba(244, 122, 31, 1);
    }

    .step-card:nth-child(2) {
        background: rgba(255, 255, 255, 1);
    }

    .step-card:nth-child(3) {
        background: rgba(46, 46, 46, 1);
    }

    .step-card:nth-child(4) {
        background: rgba(135, 135, 135, 1);
    }

    .step-card:nth-child(5) {
        background: rgba(0, 0, 0, 1);
    }

    .step-card.active,
    .steps-row.is-expanded .step-card,
    .steps-row.is-expanded .step-card.is-before,
    .steps-row.is-expanded .step-card.is-after,
    .steps-row.is-expanded .step-card:not(.active) {
        transform: none !important;
    }

    .step-num {
        position: absolute;
        top: 15px;
        left: 15px;
        transform: none;
        margin: 0;
        font-size: 11px;
        font-weight: 500;
        letter-spacing: 0.05em;
        white-space: nowrap;
        color: rgba(255, 255, 255, 0.65);
    }

    .step-title {
        width: 100%;
        margin: 60px 0 0;
        font-size: clamp(22px, 5vw, 28px);
        font-weight: 500;
        line-height: 1.3;
        color: #fff;
        text-align: center;
        transition: none;
    }

    .steps-row.is-expanded .step-card:not(.active) .step-title {
        margin-top: 60px;
        font-size: clamp(22px, 5vw, 28px);
    }

    .step-desc {
        width: 100%;
        margin: 20px 0 0;
        padding-left: 0;
        font-size: clamp(14px, 3.5vw, 16px);
        line-height: 1.5;
        font-weight: 400;
        color: rgba(255, 255, 255, 0.8);
        text-align: center;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
    }

    .step-card:nth-child(2) .step-num,
    .step-card:nth-child(2) .step-title,
    .step-card:nth-child(2) .step-desc,
    .step-card:nth-child(4) .step-num,
    .step-card:nth-child(4) .step-title,
    .step-card:nth-child(4) .step-desc {
        color: #000;
    }
}

@media (prefers-reduced-motion: reduce) {
    .step-card,
    .step-title,
    .step-desc {
        transition-duration: 0.01ms;
    }
}
