.how-to {
    padding: var(--section-padding);
    width: 100%;

    .container {
        align-items: flex-start;
    }

    .htm-layout {
        width: 100%;
        display: grid;
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.05fr);
        gap: clamp(2rem, 5vw, 5rem);
        align-items: center;
    }

    .htm-steps {
        display: flex;
        flex-direction: column;
        height: 100%;
        justify-content: center;
        gap: clamp(0.75rem, 1.4vw, 1.1rem);
    }

    .htm-step {
        --htm-fade: 1;
        display: flex;
        gap: clamp(14px, 1.4vw, 20px);
        padding: clamp(18px, 1.8vw, 26px);
        border-radius: var(--border-radius-small);
        background: transparent;
        cursor: pointer;
        text-align: start;
        transition:
            background-color 0.3s cubic-bezier(0.2, 0, 0, 1),
            border-color 0.3s cubic-bezier(0.2, 0, 0, 1),
            transform 0.3s cubic-bezier(0.2, 0, 0, 1);
    }

    .htm-step.is-active {
        background: var(--ncs-container-weak);
        border-color: var(--ncs-container-strong);
    }

    .htm-step.is-inactive {
        --htm-fade: 0.5;
    }

    .htm-step:hover {
        background: color-mix(in srgb, var(--ncs-container-weak) 65%, transparent);
    }

    .htm-step:focus-visible {
        outline: 2px solid var(--ncs-primary);
        outline-offset: 3px;
    }

    .htm-step-badge {
        flex: 0 0 auto;
        width: clamp(36px, 3vw, 44px);
        height: clamp(36px, 3vw, 44px);
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
        font-size: var(--font-sm);
        font-weight: var(--font-weight-bold);
        background: var(--ncs-container-strong);
        color: var(--text-faded);
        transition: background-color 0.3s ease, color 0.3s ease;
    }

    .htm-step.is-active .htm-step-badge {
        background: var(--ncs-primary);
        color: var(--ncs-on-primary, #fff);
    }

    .htm-step-body {
        display: flex;
        flex-direction: column;
        gap: 6px;
        min-width: 0;
        opacity: var(--htm-fade);
        transition: opacity 0.35s ease;
    }

    .htm-step-title {
        margin: 0;
        font-size: var(--font-md);
        font-weight: var(--font-weight-bold);
        line-height: 1.25;
        color: var(--text);
    }

    .htm-step-description {
        font-size: var(--font-sm);
        line-height: 1.6;
        color: var(--text-faded);

        p {
            margin: 0 0 8px;

            &:last-child {
                margin-bottom: 0;
            }
        }
    }

    .htm-media {
        position: relative;
        width: 100%;
    }

    .htm-media-frame {
        position: relative;
        width: 100%;
        aspect-ratio: 1 / 1;
        border-radius: var(--border-radius-large);
        overflow: hidden;
        background: color-mix(in srgb, var(--text) 4%, var(--background));
        border: 1px solid var(--ncs-container-strong);
    }

    .htm-media-layer {
        position: absolute;
        inset: 0;
        opacity: 0;
        visibility: hidden;
        transform: scale(1.02);
        transition: opacity 0.45s ease, visibility 0.45s ease, transform 0.6s cubic-bezier(0.2, 0, 0, 1);
    }

    .htm-media-layer.is-active {
        opacity: 1;
        visibility: visible;
        transform: scale(1);
    }

    .htm-media-el {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        display: block;
    }
}

@media (max-width: 991px) {
    .how-to .htm-layout {
        grid-template-columns: 1fr;
        gap: clamp(1.5rem, 4vw, 2.5rem);
    }

    .how-to .htm-media {
        order: -1;
    }

    .how-to .htm-media-frame {
        aspect-ratio: 1 / 1;
        max-width: 640px;
        margin-inline: auto;
    }
}

@media (max-width: 767px) {
    .how-to {
        padding: clamp(32px, 6vw, 56px) 0;
    }

    .how-to .htm-step {
        padding: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .how-to .htm-step,
    .how-to .htm-step *,
    .how-to .htm-media-layer {
        transition: none !important;
    }
}
