.stacked-card-carousel {
    --stacked-card-gap: 62%;
    --stacked-card-radius: 2px;
    --stacked-card-shadow: 0 5px 10px rgba(28, 24, 51, .22);
    position: relative;
    width: 100%;
    overflow: hidden;
    isolation: isolate;
}

.stacked-card-carousel__viewport {
    position: relative;
    min-height: clamp(360px, 48vw, 610px);
    touch-action: pan-y;
    user-select: none;
    cursor: pointer;
}

.stacked-card-carousel__viewport:active {
    cursor: grabbing;
}

.stacked-card-carousel__track {
    position: absolute;
    inset: 0;
}

.stacked-card-carousel__card {
    --card-offset: 0%;
    --card-scale: 1;
    --card-opacity: 1;
    position: absolute;
    top: 50%;
    left: 50%;
    width: clamp(230px, 31vw, 480px);
    /* aspect-ratio: 4 / 5; */
    overflow: hidden;
    border: 0;
    border-radius: var(--stacked-card-radius);
    background: #fff;
    box-shadow: var(--stacked-card-shadow);
    /*opacity: var(--card-opacity);*/
    transform: translateX(calc(-50% + var(--card-offset))) translateY(-50%) scale(var(--card-scale));
    transform-origin: center;
    transition: transform 520ms cubic-bezier(.22, .8, .25, 1), opacity 360ms ease,
        filter 360ms ease, box-shadow 360ms ease;
    will-change: transform;
    box-shadow: 0 6px 8px rgba(30, 35, 70, 0.28),    
    			0 12px 18px rgba(30, 35, 70, 0.18)
}

.stacked-card-carousel__card:not([aria-current="true"]) {
    cursor: pointer;
    filter: saturate(.88) brightness(.98);
}

.stacked-card-carousel__card[aria-current="true"] {
    z-index: 10;
    filter: none;
}

.stacked-card-carousel__card[data-visible="false"] {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: transform 520ms cubic-bezier(.22, .8, .25, 1), opacity 260ms ease,
        visibility 0s linear 520ms;
}

.stacked-card-carousel__card:focus-visible {
    outline: 4px solid #17131f;
    outline-offset: 4px;
}

.stacked-card-carousel__card img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.stacked-card-carousel__button {
    position: absolute;
    z-index: 20;
    top: 50%;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid rgba(23, 19, 31, .16);
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: #17131f;
    box-shadow: 0 8px 30px rgba(23, 19, 31, .14);
    cursor: pointer;
    transform: translateY(-50%);
    transition: background-color 180ms ease, transform 180ms ease;
}

.stacked-card-carousel__button:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.06);
}

.stacked-card-carousel__button:focus-visible {
    outline: 3px solid #17131f;
    outline-offset: 3px;
}

.stacked-card-carousel__button--previous {
    left: max(12px, calc(50% - min(46vw, 680px)));
    border: 0;
    opacity: 1;
    background: none;
    z-index: 10;
}

.stacked-card-carousel__button--next {
    right: max(12px, calc(50% - min(46vw, 680px)));
    opacity: 1;
    border:0;
   background: none;
   z-index: 10;
}

.stacked-card-carousel__button svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.stacked-card-carousel__dots {
    display: flex;
    position: absolute;
    z-index: 20;
    right: 0;
    bottom: 8px;
    left: 0;
    justify-content: center;
    gap: 8px;
}

.stacked-card-carousel__dot {
    width: 9px;
    height: 9px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(23, 19, 31, .28);
    cursor: pointer;
    transition: background-color 180ms ease, transform 180ms ease;
}

.stacked-card-carousel__dot[aria-current="true"] {
    background: #17131f;
    transform: scale(1.35);
}

.stacked-card-carousel__counter {
    min-width: 64px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .9);
    color: #17131f;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 6px 20px rgba(23, 19, 31, .12);
}

.stacked-card-carousel__button[hidden],
.stacked-card-carousel__dots[hidden] {
    display: none;
}

.stacked-card-carousel__status {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

@media (max-width: 640px) {
    .stacked-card-carousel {
        --stacked-card-gap: 78%;
    }

    .stacked-card-carousel__viewport {
        min-height: clamp(400px, 132vw, 560px);
    }

    .stacked-card-carousel__card {
        width: min(76vw, 360px);
    }

    .stacked-card-carousel__button {
        top: auto;
        bottom: 18px;
        width: 42px;
        height: 42px;
        transform: none;
    }

    .stacked-card-carousel__button:hover {
        transform: scale(1.06);
    }

    .stacked-card-carousel__button--previous {
        left: 18px;
    }

    .stacked-card-carousel__button--next {
        right: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .stacked-card-carousel__card,
    .stacked-card-carousel__button,
    .stacked-card-carousel__dot {
        transition-duration: 1ms;
    }
}
