.hero-carousel {
    padding: 12px 0 0;
}

.hero-carousel__viewport {
    position: relative;
}

.hero-carousel__viewport--has-dots::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    height: 48px;
    border-radius: 0 0 18px 18px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0), rgba(15, 23, 42, 0.38));
    pointer-events: none;
}

.hero-carousel__track {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    background: #0f172a;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-card);
}

.hero-carousel__slides {
    position: relative;
    width: 100%;
}

.hero-carousel__slide {
    width: 100%;
}

.hero-carousel__frame {
    display: block;
    width: 100%;
    line-height: 0;
    border-radius: inherit;
}

.hero-carousel__picture {
    display: block;
    width: 100%;
}

.hero-carousel__image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center;
}

/* Fade — show full banner, scale by width (recommended 3:1 assets). */
.hero-carousel--fade .hero-carousel__slides {
    min-height: 0;
}

.hero-carousel--fade .hero-carousel__slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.45s ease, visibility 0.45s ease;
}

.hero-carousel--fade .hero-carousel__slide.is-active {
    position: relative;
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

.hero-carousel--fade .hero-carousel__frame,
.hero-carousel--fade .hero-carousel__image {
    width: 100%;
    height: auto;
    max-height: none;
}

.hero-carousel--fade .hero-carousel__slide:not(.is-active) .hero-carousel__frame {
    height: 100%;
}

.hero-carousel--fade .hero-carousel__slide:not(.is-active) .hero-carousel__image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Slide — full image width, natural height. */
.hero-carousel--slide .hero-carousel__slides {
    display: flex;
    transition: transform 0.45s ease;
}

.hero-carousel--slide .hero-carousel__slide {
    flex: 0 0 100%;
}

.hero-carousel--slide .hero-carousel__image {
    width: 100%;
    height: auto;
}

.hero-carousel--split .hero-carousel__viewport {
    overflow: hidden;
}

.hero-carousel--split .hero-carousel__track {
    overflow: visible;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.hero-carousel--split .hero-carousel__slides {
    display: flex;
    align-items: center;
    gap: 14px;
    transition: transform 0.45s ease;
}

.hero-carousel--split .hero-carousel__slide {
    flex: 0 0 78%;
    opacity: 0.45;
    transform: scale(0.94);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.hero-carousel--split .hero-carousel__slide.is-active {
    opacity: 1;
    transform: scale(1);
}

.hero-carousel--split .hero-carousel__frame {
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-card);
    background: var(--color-surface);
}

.hero-carousel--split .hero-carousel__image {
    width: 100%;
    height: auto;
}

.hero-carousel__nav {
    position: absolute;
    top: 50%;
    z-index: 4;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.hero-carousel__nav--prev {
    left: 10px;
}

.hero-carousel__nav--next {
    right: 10px;
}

.hero-carousel__dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 10px;
    z-index: 3;
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 0 12px;
    pointer-events: none;
}

.hero-carousel__dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.28);
    cursor: pointer;
    pointer-events: auto;
    transition: transform 0.2s ease, background 0.2s ease, width 0.2s ease;
}

.hero-carousel__dot.is-active {
    width: 18px;
    transform: none;
    background: var(--color-primary);
    box-shadow: 0 1px 6px rgba(37, 99, 235, 0.45);
}

body.light-mode .hero-carousel__track {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.08);
}

body.light-mode .hero-carousel__nav {
    background: rgba(15, 23, 42, 0.72);
}

body.light-mode .hero-carousel__viewport--has-dots::after {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0), rgba(15, 23, 42, 0.18));
}

body.light-mode .hero-carousel__dot.is-active {
    box-shadow: 0 1px 6px rgba(34, 197, 94, 0.45);
}

body.atlas-mobile-first .hero-carousel,
body.atlas-mobile-first .hero-carousel.content-section {
    padding: 4px 0 0;
    margin: 0;
    position: relative;
    z-index: 1;
}

body.atlas-mobile-first .homepage-hero + .hero-carousel,
body.atlas-mobile-first .homepage-hero + .hero-carousel.content-section {
    padding-top: 0;
}

body.atlas-mobile-first .hero-carousel--split .hero-carousel__slide {
    flex-basis: 88%;
}

@media (max-width: 640px) {
    /* Landscape banner on phones — short wide rectangle (~2.4:1 / 720×300). */
    .hero-carousel__frame,
    .hero-carousel__frame--has-mobile,
    .hero-carousel--fade .hero-carousel__frame,
    .hero-carousel--fade .hero-carousel__frame--has-mobile,
    .hero-carousel--split .hero-carousel__frame,
    .hero-carousel--split .hero-carousel__frame--has-mobile {
        aspect-ratio: 12 / 5;
        height: auto;
        overflow: hidden;
    }

    .hero-carousel__picture,
    .hero-carousel__picture--has-mobile,
    .hero-carousel__frame .hero-carousel__picture,
    .hero-carousel__frame--has-mobile .hero-carousel__picture,
    .hero-carousel--fade .hero-carousel__frame .hero-carousel__picture {
        display: block;
        width: 100%;
        height: 100%;
    }

    .hero-carousel__image,
    .hero-carousel__frame--has-mobile .hero-carousel__image,
    .hero-carousel--fade .hero-carousel__frame .hero-carousel__image,
    .hero-carousel--fade .hero-carousel__frame--has-mobile .hero-carousel__image,
    .hero-carousel--fade .hero-carousel__image,
    .hero-carousel--slide .hero-carousel__image,
    .hero-carousel--split .hero-carousel__image {
        display: block;
        width: 100%;
        height: 100%;
        min-height: 0;
        max-height: none;
        object-fit: cover;
        object-position: center;
    }

    .hero-carousel__nav {
        width: 34px;
        height: 34px;
    }

    .hero-carousel__dots {
        bottom: 8px;
        gap: 6px;
    }

    .hero-carousel__dot {
        width: 7px;
        height: 7px;
    }

    .hero-carousel__dot.is-active {
        width: 16px;
    }

    .hero-carousel__viewport--has-dots::after {
        height: 40px;
    }
}
