/* ==========================================================================
   CASE-STUDY DECK (home page)
   Cards stack as you scroll: each one pins under the header, and the next
   slides over it while the one beneath tips back. Motion drives the scroll
   and entrance animations from js/works-motion.js; without JS the cards
   still stack, just without the tilt.
   ========================================================================== */

.deck {
    display: block;
    counter-reset: deck;
}

.deck__slot {
    --stick: calc(var(--header-total-height) + 1.75rem);
    position: sticky;
    top: calc(var(--stick) + var(--i, 0) * 14px);
    margin-bottom: 2.5rem;
    perspective: 1600px;
}

.deck__slot:last-child {
    margin-bottom: 0;
}

.deck .proj-card {
    position: relative;
    flex-direction: row;
    min-height: 340px;
    border-color: var(--border-hover);
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 60px -40px rgba(20, 23, 28, 0.45), var(--shadow-sm);
    transform-origin: 50% 0;
    transition: border-color 0.25s ease;
}

.deck .proj-card:hover {
    transform: none;
    border-color: var(--accent-muted);
}

.deck .proj-card__visual {
    width: 46%;
    height: auto;
    border-bottom: 0;
    border-right: 1px solid var(--border);
}

.deck .proj-card__img {
    transition: none;
}

.deck .proj-card:hover .proj-card__img {
    transform: none;
}

.deck .proj-card__copy {
    flex: 1;
    padding: 2rem 2.25rem;
}

.deck .proj-card__copy::before {
    counter-increment: deck;
    content: counter(deck, decimal-leading-zero);
    display: block;
    margin-bottom: 1.1rem;
    font: 500 0.75rem/1 var(--font-mono);
    letter-spacing: 0.08em;
    color: var(--subtle);
}

.deck .proj-card__title {
    font-size: 1.45rem;
    letter-spacing: -0.01em;
    margin-bottom: 0.75rem;
}

.deck .proj-card__desc {
    font-size: 0.95rem;
    max-width: 34rem;
}

/* Dims the card as the next one slides over it (opacity set by Motion). */
.proj-card__shade {
    position: absolute;
    inset: 0;
    background: var(--bg);
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 900px) {
    .deck .proj-card {
        flex-direction: column;
        min-height: 0;
    }

    .deck .proj-card__visual {
        width: 100%;
        height: 180px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .deck .proj-card__copy {
        padding: 1.4rem 1.4rem 1.5rem;
    }

    .deck .proj-card__copy::before {
        margin-bottom: 0.75rem;
    }

    .deck .proj-card__title {
        font-size: 1.15rem;
    }

    .deck__slot {
        --stick: calc(var(--header-total-height) + 0.75rem);
        top: calc(var(--stick) + var(--i, 0) * 10px);
        margin-bottom: 1.5rem;
    }
}
