.how {
    background: transparent;
}

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

.steps-row {
    --step-card-w: 420px;
    --step-card-h: 264px;
    --step-overlap: 0.46;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: flex-end;
    gap: 0;
    max-width: 1320px;
    width: 100%;
    margin: 0 auto;
    padding: 12px 0 8px;
    isolation: isolate;
    overflow: hidden;
}

.step-card {
    width: var(--step-card-w);
    height: var(--step-card-h);
    flex-shrink: 0;
    box-sizing: border-box;
    border-radius: 30px;
    padding: 0 20px 24px 20px;
    position: relative;
    z-index: var(--z, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: flex-start;
    cursor: default;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.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(calc(-1 * var(--step-card-w) * var(--step-overlap)));
}

.steps-row.is-expanded .step-card.is-after {
    transform: translateX(calc(var(--step-card-w) * var(--step-overlap)));
}

/* Активная карточка — сверху всех */
.steps-row.is-expanded .step-card.active {
    z-index: 100;
}

.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: 13px;
    color: var(--text-muted);
}

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

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

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

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

    .step-card,
    .step-card:not(:first-child) {
        width: 100%;
        height: auto;
        min-height: 0;
        flex: none;
        margin-left: 0;
        padding: 12px 14px;
        border-radius: 16px;
        box-shadow: none;
        transform: none !important;
        transition: none;
        cursor: default;
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        column-gap: 10px;
        row-gap: 4px;
        align-items: baseline;
        text-align: left;
    }

    .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: static;
        transform: none;
        grid-column: 1;
        grid-row: 1;
        font-size: 11px;
        font-weight: 500;
        letter-spacing: 0.05em;
        white-space: nowrap;
        color: rgba(255, 255, 255, 0.65);
    }

    .step-title {
        grid-column: 2;
        grid-row: 1;
        margin: 0;
        font-size: 15px;
        font-weight: 500;
        line-height: 1.35;
        color: #fff;
        transition: none;
    }

    .step-desc {
        grid-column: 1 / -1;
        grid-row: 2;
        margin: 0;
        padding-left: 0;
        font-size: 13px;
        line-height: 1.5;
        font-weight: 400;
        color: rgba(255, 255, 255, 0.8);
        overflow: visible;
        display: block;
        -webkit-line-clamp: unset;
        -webkit-box-orient: unset;
    }

    .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;
    }
}
