/* =====================================================
   HOW IT WORKS
   ===================================================== */

.cp-hiw {
    overflow: clip;
    clip-path: inset(0); /* reliably clips sticky-child overflow that overflow:clip misses in some browsers */
}

.cp-hiw__inner {
    display: grid;
    grid-template-columns: 331px minmax(0, 1fr);
    align-items: center;
    gap: 133px;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 0; /* creates stacking context so ::before can paint above the cards */
}

/* Left-side mask: covers everything from the page edge to the viewport column start,
   blocking cards that have already scrolled past the intro panel and gap */
.cp-hiw__inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100vw;
    /* 484px = padding(20px) + intro-col(331px) + gap(133px) — viewport column start */
    width: calc(100vw + 484px);
    height: 100%;
    background-color: #0B0D0F;
    z-index: 2;
    pointer-events: none;
}

.cp-hiw__intro {
    align-self: stretch;
    max-width: 331px;
    height: 100%;
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    background-color: #0B0D0F;
    z-index: 3;
}

.cp-hiw__label {
    display: inline-block;
    margin-bottom: 10px;
    font-family: 'MonoBlack', sans-serif;
    font-size: 14px;
    line-height: 20px;
    font-weight: 400;
    letter-spacing: 0.1em;
    color: #FF9626;
}

.cp-hiw__heading {
    font-family: "SF UI Display", sans-serif;
    margin: 0;
    font-size: 54px;
    line-height: 62px;
    font-weight: 300;
    letter-spacing: -0.04em;
    color: #F7F7F7;
    text-transform: none;
}

.cp-hiw__viewport {
    overflow: visible;
}

.cp-hiw__track {
    display: flex;
    gap: 30px;
    width: max-content;
    will-change: transform;
}

.cp-hiw__card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 20px;
    width: 464px;
    min-height: 500px;
    padding: 40px 40px 50px 40px;
    background: #141517;
    border: 1px solid #1E1E1F;
    border-radius: 22px;
}

.cp-hiw__card-top {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.cp-hiw__phase {
    display: inline-block;
    margin-bottom: 10px;
    font-family: 'MonoBlack', sans-serif;
    font-size: 14px;
    line-height: 20px;
    font-weight: 400;
    letter-spacing: 0.1em;
    color: #F7F7F7;
}

.cp-hiw__card-title {
    font-family: "SF UI Display", sans-serif;
    font-size: 36px;
    line-height: 44px;
    font-weight: 300;
    letter-spacing: -0.04em;
    text-transform: none;
    background: linear-gradient(90deg, #FF9626 0%, #FFB15D 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.cp-hiw__list {
    margin: auto 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cp-hiw__list li {
    position: relative;
    padding-left: 19px;
    font-size: 18px;
    line-height: 24px;
    font-weight: 400;
    letter-spacing: 0.01em;
    color: #D2D2D2;
}

.cp-hiw__list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #FF9626;
}

@media (max-width: 1024px) {
    .cp-hiw__inner {
        grid-template-columns: 1fr;
        gap: 34px;
        position: static;
        height: auto;
        padding-top: 72px;
        padding-bottom: 72px;
    }

    .cp-hiw__inner::before {
        display: none;
    }

    .cp-hiw__intro {
        align-self: start;
        max-width: 540px;
    }

    .cp-hiw__heading {
        max-width: 560px;
    }

    .cp-hiw__viewport {
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .cp-hiw__viewport::-webkit-scrollbar {
        display: none;
    }
}

@media (max-width: 768px) {
    .cp-hiw__inner {
        gap: 26px;
        padding-top: 60px;
        padding-bottom: 60px;
    }

    .cp-hiw__viewport {
        overflow: hidden;
        position: relative;
        padding-bottom: 40px;
    }

    .cp-hiw__track {
        width: 100%;
        flex-direction: row;
        gap: 0;
        transform: none;
        transition: none;
    }

    .cp-hiw__card {
        flex: 0 0 100%;
        width: 100%;
        min-height: auto;
        padding: 18px 18px 22px;
        border-radius: 16px;
        opacity: 1 !important;
        transform: none !important;
    }

    .cp-hiw__card-title {
        margin-bottom: 34px;
        font-size: 22px;
    }

    .cp-hiw__list li {
        font-size: 13px;
    }

    .cp-hiw__swiper-pagination {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 6px;
        position: absolute;
        bottom: 12px;
        left: 0;
        right: 0;
        z-index: 10;
    }

    .cp-hiw__swiper-pagination .swiper-pagination-bullet {
        width: 6px;
        height: 6px;
        background: rgba(247, 247, 247, 0.3);
        border-radius: 50%;
        opacity: 1;
    }

    .cp-hiw__swiper-pagination .swiper-pagination-bullet-active {
        background: #FF9626;
        transform: scale(1.4);
    }
}

@media (min-width: 769px) {
    .cp-hiw__swiper-pagination {
        display: none;
    }

    /* Neutralise swiper-slide CSS (width:100%, flex-shrink:0) so the
       desktop horizontal-scroll layout is driven by our own card width. */
    .cp-hiw__card.swiper-slide {
        width: 464px;
        flex-shrink: 0;
    }
}
