.home-page .home-carousel {
    position: relative;
    isolation: isolate;
    min-height: 510px;
    margin-top: var(--page-top-space);
    border-radius: 18px;
    background: #161b26;
    overflow: hidden;
}

.home-carousel-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity .45s ease, visibility .45s ease;
    background: #161b26;
}

/* Keep every slide layered inside the hero; inactive slides never add page height. */
.home-page .hero.home-carousel > .home-carousel-slide:not(.is-active) {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.home-page .hero.home-carousel > .home-carousel-slide.is-active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.home-carousel-slide.is-active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    z-index: 1;
}

.home-carousel-slide--violet { background: #1a1725; }
.home-carousel-slide--blue { background: #111b2c; }
.home-carousel-slide--animated { background: #21151d; }

.home-carousel-photo {
    position: absolute;
    inset: 0 0 0 auto;
    display: block;
    width: 68%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    max-width: none;
}

.home-carousel-slide:first-child .home-carousel-photo { object-position: center 42%; }
.home-carousel-slide--blue .home-carousel-photo { object-position: center 58%; }
.home-carousel-slide--animated .home-carousel-photo { object-position: center 55%; }

.home-carousel-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #161b26 0%, #161b26 31%, rgba(22, 27, 38, .9) 43%, rgba(22, 27, 38, .2) 70%, transparent 100%);
    pointer-events: none;
}

.home-carousel-slide--violet::after {
    background: linear-gradient(90deg, #1a1725 0%, #1a1725 30%, rgba(26, 23, 37, .9) 43%, rgba(26, 23, 37, .16) 71%, transparent 100%);
}

.home-carousel-slide--blue::after {
    background: linear-gradient(90deg, #111b2c 0%, #111b2c 31%, rgba(17, 27, 44, .9) 43%, rgba(17, 27, 44, .14) 71%, transparent 100%);
}

.home-carousel-slide--animated::after {
    background: linear-gradient(90deg, #21151d 0%, #21151d 31%, rgba(33, 21, 29, .92) 43%, rgba(33, 21, 29, .18) 72%, transparent 100%);
}

.home-carousel-slide--animated::before {
    content: "";
    position: absolute;
    z-index: 1;
    inset: 0 0 0 42%;
    background: linear-gradient(105deg, transparent 20%, rgba(255, 118, 97, .18) 45%, rgba(175, 109, 255, .16) 55%, transparent 80%);
    transform: translateX(-110%);
    pointer-events: none;
}

.home-carousel-slide--animated.is-active::before {
    animation: carousel-light-sweep 5s ease-in-out infinite;
}

@keyframes carousel-light-sweep {
    0%, 15% { transform: translateX(-110%); opacity: 0; }
    35% { opacity: 1; }
    75%, 100% { transform: translateX(110%); opacity: 0; }
}

.home-page .home-carousel .home-carousel-copy {
    position: relative;
    z-index: 2;
    width: min(56%, 710px);
    padding: 64px clamp(28px, 5vw, 78px) 100px;
}

.home-carousel-copy .eyebrow {
    margin-bottom: 18px;
    color: #c8b5f6;
}

.home-carousel-copy h1,
.home-carousel-copy h2 {
    max-width: 17ch;
    margin: 0 0 20px;
    color: #fff;
    font-size: clamp(42px, 4.15vw, 66px);
    font-weight: 700;
    letter-spacing: -.048em;
    line-height: 1.05;
    text-wrap: balance;
}

.home-carousel-copy > p:not(.eyebrow) {
    max-width: 39ch;
    margin: 0 0 28px;
    color: #e0e2e8;
    font-size: clamp(16px, 1.25vw, 19px);
    line-height: 1.5;
    text-wrap: pretty;
}

.home-carousel-controls {
    position: absolute;
    z-index: 5;
    right: clamp(24px, 3vw, 48px);
    bottom: 26px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.home-carousel-arrow,
.home-carousel-dot {
    appearance: none;
    border: 0;
    cursor: pointer;
}

.home-carousel-arrow {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 50%;
    background: rgba(12, 15, 24, .4);
    color: #fff;
    backdrop-filter: blur(8px);
    transition: background .2s ease, transform .2s ease;
}

.home-carousel-arrow:hover { background: rgba(255, 255, 255, .2); transform: translateY(-2px); }
.home-carousel-arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.home-carousel-dots { display: flex; align-items: center; gap: 7px; }
.home-carousel-dot { width: 18px; height: 18px; padding: 5px; border-radius: 50%; background: transparent; }
.home-carousel-dot::after { content: ""; display: block; width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .5); transition: background .2s ease, transform .2s ease; }
.home-carousel-dot.is-active::after { background: #fff; transform: scale(1.25); }
.home-carousel-arrow:focus-visible,
.home-carousel-dot:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.home-carousel .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 760px) {
    .home-page .hero.home-carousel { min-height: 0; height: clamp(590px, 145vw, 720px); margin-top: 20px; }
    .home-page .hero.home-carousel > .home-carousel-slide { align-items: flex-start; }
    .home-page .hero.home-carousel > .home-carousel-slide:not(.is-active) { visibility: hidden; }
    .home-carousel-photo { inset: auto 0 0; width: 100%; height: 52%; object-fit: cover; object-position: center; }
    .home-carousel-slide:first-child .home-carousel-photo { object-position: center 36%; }
    .home-carousel-slide--blue .home-carousel-photo { object-position: center 52%; }
    .home-carousel-slide::after,
    .home-carousel-slide--violet::after,
    .home-carousel-slide--blue::after,
    .home-carousel-slide--animated::after {
        background: linear-gradient(180deg, var(--carousel-bg, #161b26) 0%, var(--carousel-bg, #161b26) 42%, rgba(17, 20, 30, .3) 68%, transparent 100%);
    }
    .home-carousel-slide--violet { --carousel-bg: #1a1725; }
    .home-carousel-slide--blue { --carousel-bg: #111b2c; }
    .home-carousel-slide--animated { --carousel-bg: #21151d; }
    .home-page .home-carousel .home-carousel-copy { width: 100%; max-width: 100%; padding: 38px 28px 100px; }
    .home-carousel-copy h1,
    .home-carousel-copy h2 { max-width: 14ch; font-size: clamp(38px, 8.4vw, 54px); }
    .home-carousel-copy > p:not(.eyebrow) { max-width: 37ch; font-size: 16px; }
    .home-carousel-controls { right: 20px; bottom: 18px; }
    .home-carousel-slide--animated::before { inset: 40% 0 0; }
}

@media (max-width: 440px) {
    .home-page .hero.home-carousel { height: clamp(570px, 155vw, 680px); }
    .home-page .home-carousel .home-carousel-copy { padding: 32px 23px 90px; }
    .home-carousel-copy h1,
    .home-carousel-copy h2 { font-size: clamp(36px, 9vw, 44px); }
    .home-carousel-controls { gap: 12px; }
    .home-carousel-arrow { width: 38px; height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
    .home-carousel-slide,
    .home-carousel-arrow,
    .home-carousel-dot::after { transition: none; }
    .home-carousel-slide--animated.is-active::before { animation: none; }
}
