.services-section {
    overflow: clip;
}

.services-carousel__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.services-carousel__header .section-title {
    margin-bottom: 0;
}

.services-carousel__controls {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
}

.services-carousel__button {
    display: inline-grid;
    width: 48px;
    height: 48px;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(191, 219, 254, 0.2);
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.68);
    color: #ffffff;
    cursor: pointer;
    touch-action: manipulation;
    transition:
            background-color 180ms ease,
            border-color 180ms ease,
            color 180ms ease,
            opacity 180ms ease,
            transform 180ms ease;
}

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

.services-carousel__button:hover {
    border-color: rgba(251, 191, 36, 0.58);
    background: rgba(180, 83, 9, 0.9);
}

.services-carousel__button:active {
    transform: scale(0.96);
}

.services-carousel__button:focus-visible {
    outline: 3px solid #fbbf24;
    outline-offset: 3px;
}

.services-carousel__viewport {
    margin-top: 36px;
    padding: 4px 2px 18px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-padding-inline: 2px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    touch-action: pan-x pan-y;
}

.services-carousel__viewport::-webkit-scrollbar {
    display: none;
}

.services-carousel__viewport:focus-visible {
    outline: 2px solid rgba(251, 191, 36, 0.82);
    outline-offset: 6px;
    border-radius: 24px;
}

.services-carousel__viewport.is-reordering {
    scroll-behavior: auto;
    scroll-snap-type: none;
}

.services-carousel__track {
    display: grid;
    width: max-content;
    min-width: 100%;
    overflow-anchor: none;
    grid-auto-columns: min(84vw, 340px);
    grid-auto-flow: column;
    gap: 16px;
}

.service-carousel-card {
    position: relative;
    display: block;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border: 1px solid rgba(191, 219, 254, 0.18);
    border-radius: 24px;
    background: #0b1426;
    box-shadow: 0 24px 64px rgba(2, 8, 23, 0.32);
    color: #ffffff;
    cursor: pointer;
    isolation: isolate;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    touch-action: manipulation;
    transition:
            border-color 220ms ease,
            box-shadow 220ms ease,
            transform 220ms ease;
}

.service-carousel-card img {
    position: absolute;
    z-index: -3;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.002);
    transition:
            filter 260ms ease,
            opacity 260ms ease,
            transform 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

.service-carousel-card__scrim {
    position: absolute;
    z-index: -2;
    inset: 0;
    background:
            linear-gradient(180deg, rgba(2, 8, 23, 0.06) 20%, rgba(2, 8, 23, 0.42) 56%, rgba(2, 8, 23, 0.97) 100%),
            linear-gradient(90deg, rgba(2, 8, 23, 0.32), transparent 55%);
    transition: background-color 240ms ease;
}

.service-carousel-card__number {
    position: absolute;
    top: 20px;
    left: 20px;
    display: inline-flex;
    min-width: 48px;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    background: rgba(7, 17, 31, 0.68);
    backdrop-filter: blur(10px);
    color: #fbbf24;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.service-carousel-card__content {
    position: absolute;
    right: 22px;
    bottom: 22px;
    left: 22px;
    display: flex;
    flex-direction: column;
    transform: translateY(76px);
    transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.service-carousel-card__content > h3 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(22px, 2.2vw, 28px);
    font-weight: 850;
    letter-spacing: -0.025em;
    line-height: 1.08;
    text-wrap: balance;
}

.service-carousel-card__details {
    display: flex;
    min-height: 116px;
    flex-direction: column;
    justify-content: flex-end;
    gap: 14px;
    padding-top: 12px;
    color: rgba(226, 232, 240, 0.92);
    font-size: 15px;
    line-height: 1.46;
    opacity: 0;
    transform: translateY(10px);
    transition:
            opacity 190ms ease,
            transform 260ms ease;
}

.service-carousel-card__link {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    color: #fbbf24;
    font-size: 14px;
    font-weight: 850;
    letter-spacing: 0.01em;
}

.service-carousel-card:hover,
.service-carousel-card:focus-visible {
    border-color: rgba(251, 191, 36, 0.58);
    box-shadow: 0 30px 84px rgba(2, 8, 23, 0.48);
    transform: translateY(-3px);
}

.service-carousel-card:hover img,
.service-carousel-card:focus-visible img {
    transform: scale(1.045);
}

.service-carousel-card:hover .service-carousel-card__scrim,
.service-carousel-card:focus-visible .service-carousel-card__scrim {
    background-color: rgba(2, 8, 23, 0.18);
}

.service-carousel-card:hover .service-carousel-card__content,
.service-carousel-card:focus-visible .service-carousel-card__content {
    transform: translateY(0);
}

.service-carousel-card:hover .service-carousel-card__details,
.service-carousel-card:focus-visible .service-carousel-card__details {
    opacity: 1;
    transform: translateY(0);
}

.service-carousel-card:focus-visible {
    outline: 3px solid #fbbf24;
    outline-offset: -5px;
}

@media (min-width: 680px) {
    .services-carousel__track {
        grid-auto-columns: clamp(290px, 43vw, 420px);
        gap: 18px;
    }
}

@media (min-width: 1024px) {
    .services-carousel__track {
        grid-auto-columns: clamp(300px, 30.6vw, 360px);
        gap: 20px;
    }
}

@media (max-width: 679px) {
    .services-carousel__header {
        align-items: center;
        gap: 12px;
    }

    .services-carousel__controls {
        gap: 8px;
    }

    .services-carousel__button {
        width: 44px;
        height: 44px;
    }

    .services-carousel__viewport {
        margin-top: 28px;
    }

    .service-carousel-card__content {
        right: 20px;
        bottom: 20px;
        left: 20px;
        transform: translateY(0);
    }

    .service-carousel-card__content > h3 {
        font-size: clamp(22px, 7vw, 27px);
    }

    .service-carousel-card__details {
        min-height: 0;
        opacity: 1;
        transform: translateY(0);
    }
}

@media (hover: none) {
    .service-carousel-card__content {
        transform: translateY(0);
    }

    .service-carousel-card__details {
        min-height: 0;
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .services-carousel__button,
    .service-carousel-card,
    .service-carousel-card img,
    .service-carousel-card__content,
    .service-carousel-card__details {
        transition: none;
    }

    .service-carousel-card:hover,
    .service-carousel-card:focus-visible {
        transform: none;
    }
}
