.cw-stack-section {
    padding: 0;
    background: #0a0b0d;
}

.cw-stack-list {
    list-style: none;
}

.cw-stack-list::after {
    content: '';
    display: block;
    height: 80vh;
}

.cw-stack-item {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 22vh;
}

.cw-stack-item:nth-child(1) { z-index: 1; top: 0; }
.cw-stack-item:nth-child(2) { z-index: 2; top: 80px; }
.cw-stack-item:nth-child(3) { z-index: 3; top: 160px; }

.cw-stack-card {
    width: min(88vw, 860px);
    height: min(54vh, 480px);
    background: var(--color-surface);
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 40px 90px -20px rgba(0, 0, 0, 0.75);
    padding: 20px clamp(24px, 5vw, 48px) 32px;
    display: flex;
    flex-direction: column;
    position: relative;
    transform-origin: top center;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.cw-stack-card__shade {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: #000;
    opacity: 0;
    pointer-events: none;
    will-change: opacity;
}

.cw-stack-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--color-secondary);
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.cw-stack-card__label {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-secondary-light);
}

.cw-stack-card__num {
    font-family: var(--font-body);
    font-size: 1.2rem;
    color: var(--color-secondary-light);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.cw-stack-card__num::before {
    content: '';
    width: 22px;
    height: 1px;
    background: var(--color-secondary);
}

.cw-stack-card h3 {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 4.5vw, 3.8rem);
    font-weight: 800;
    line-height: 1.04;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    margin-bottom: 0.6rem;
    color: #fff;
}

.cw-stack-card__subtitle {
    font-family: var(--font-display);
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    color: var(--color-text-muted);
    margin-bottom: 1.2rem;
}

.cw-stack-card__subtitle b {
    color: #fff;
    font-weight: 500;
}

.cw-stack-card p,
.cw-stack-card__body {
    font-family: var(--font-display);
    color: rgba(242, 240, 234, 0.82);
    font-size: 0.95rem;
    line-height: 1.75;
    max-width: 52ch;
    flex: 1;
}

.cw-stack-card__image {
    position: absolute;
    top: 0;
    right: 0;
    width: 45%;
    height: 100%;
    background-size: cover;
    background-position: center;
    border-radius: 0 22px 22px 0;
    opacity: 0.16;
    mask-image: linear-gradient(to right, transparent, black 45%);
    -webkit-mask-image: linear-gradient(to right, transparent, black 45%);
    transition: opacity 0.4s ease;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.cw-stack-card--has-image:hover .cw-stack-card__image {
    opacity: 0.24;
}

.cw-stack-card--has-image h3,
.cw-stack-card--has-image .cw-stack-card__subtitle,
.cw-stack-card--has-image p,
.cw-stack-card--has-image .cw-stack-card__body {
    position: relative;
    z-index: 1;
    max-width: 55%;
}

@media (max-width: 820px) {
    .cw-stack-item {
        padding-top: 20vh;
    }
    .cw-stack-item:nth-child(1) { top: 0; }
    .cw-stack-item:nth-child(2) { top: 60px; }
    .cw-stack-item:nth-child(3) { top: 120px; }
    .cw-stack-list::after {
        height: 30vh;
    }
    .cw-stack-card {
        width: 92vw;
        height: min(50vh, 420px);
        padding: 16px 20px 24px;
    }
    .cw-stack-card h3 {
        font-size: clamp(1.9rem, 6vw, 2.8rem);
    }
    .cw-stack-card__image {
        width: 100%;
        height: 40%;
        top: auto;
        bottom: 0;
        border-radius: 0 0 22px 22px;
        mask-image: linear-gradient(to bottom, transparent, black 40%);
        -webkit-mask-image: linear-gradient(to bottom, transparent, black 40%);
        opacity: 0.2;
    }
    .cw-stack-card--has-image h3,
    .cw-stack-card--has-image .cw-stack-card__subtitle,
    .cw-stack-card--has-image p,
    .cw-stack-card--has-image .cw-stack-card__body {
        max-width: 100%;
    }
}
