/* Base & Reset */
.stacking-cards {
    background: #0a0a0a;
    position: relative;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    height: var(--stack-height, 400vh);
    /* Fallback 400vh */

    /* Force Full Width Breakout */
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    max-width: 100vw;
    overflow-x: hidden;
}

.stacking-cards * {
    box-sizing: border-box;
}

/* Sticky Setup */
.buffer-top {
    height: 35vh;
    background: #f5c400;
    transition: background 0.7s ease;
}

.buffer-bottom {
    height: 20vh
}

.sticky-wrapper {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    width: 100%;
}

.card {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: var(--sc-image-width, 50%) 1fr;
    width: 100%;
    height: 100%;
    background: #0a0a0a;
}

/* Image Section */
.card-image {
    position: relative;
    overflow: hidden;
    height: 100%;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: var(--sc-image-fit, cover);
    transform-origin: center;
}

/* Transform handled by JS */

/* Gradient Overlay - React: from-transparent via-black/20 to-black/80 */
.overlay-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.8));
    /* Default mobile-first fallback */
}

@media (min-width: 769px) {
    .overlay-gradient {
        background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.2) 50%, rgba(0, 0, 0, 0.4));
    }
}

/* Content Section */
.card-content {
    padding: 80px;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 10;
    background: #0a0a0a;
    border-left: 1px solid rgba(245, 196, 0, 0.2);
    /* border-brand-yellow/20 */
}

/* Typography */
.counter {
    position: absolute;
    top: 48px;
    right: 48px;
    color: rgba(245, 196, 0, .4);
    font-family: monospace;
    font-size: 1rem;
    font-weight: bold;
    letter-spacing: 0.3em;
}

h2.card-title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    /* Responsive typography */
    font-weight: 900;
    text-transform: uppercase;
    line-height: 0.9;
    letter-spacing: -0.05em;
    margin: 0 0 1.5rem 0;
    color: #fff;
}

/* Highlight Text */
.text-highlight {
    color: #f5c400;
}

.card-subtitle {
    font-size: 1.5rem;
    font-weight: 300;
    opacity: 0.8;
    margin: 0 0 1.5rem 0;
    letter-spacing: 1px;
}

.divider {
    width: 5rem;
    height: 2px;
    background: #f5c400;
    margin: 0 0 2rem 0;
}

.card-description {
    max-height: 40vh;
    overflow-y: auto;
    padding-right: 1rem;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

.card-description p {
    color: #9ca3af;
    max-width: 600px;
    line-height: 1.6;
    font-size: 1.125rem;
}

.card-description::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari/Opera */
}

/* Scroll Indicator */
.scroll-indicator {
    margin-top: 3rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #f5c400;
    font-family: monospace;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    animation: bounce 2s infinite;
}

.scroll-icon {
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid rgba(245, 196, 0, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(5px);
    }
}

/* Mobile Responsive */
@media screen and (max-width: 768px) {
    .stacking-cards {
        height: auto !important;
        /* Override desktop fixed height */
    }

    .sticky-wrapper {
        position: relative;
        height: auto;
        overflow: visible;
    }

    .card {
        position: relative;
        inset: auto;
        display: flex !important;
        flex-direction: column;
        /* Stack naturally */
        height: auto;
        min-height: 90vh;
        /* Full screen feel */
        padding-bottom: 0;
        background: transparent;
    }

    .card-image {
        position: relative;
        width: 100%;
        height: 50vh;
        z-index: 0;
    }

    .overlay-gradient {
        background: linear-gradient(to top, #0a0a0a 10%, transparent);
    }

    .card-content {
        padding: 30px 24px 60px;
        justify-content: flex-start;
        background: #0a0a0a;
        z-index: 1;
        min-height: 50vh;
        border-left: none;
        border-top: 1px solid rgba(245, 196, 0, 0.2);
    }

    h2.card-title {
        font-size: 2.5rem;
    }

    .card-subtitle {
        font-size: 1.25rem;
    }

    .counter {
        top: 20px;
        right: 20px;
        font-size: 0.85rem;
    }

    .card-description p {
        font-size: 1rem;
    }
}