/* ============================================================
   WORKS CARDS INDEX VERSION
   ============================================================ */

/* Section heading and reusable lead-in */

.work-section>.section-label {
    margin-bottom: var(--space-3);
}

.section-lead {
    max-width: 65ch;
    margin: 0 0 var(--space-6);
    color: var(--color-text-muted);
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: 400;
    line-height: 1.65;
    text-wrap: pretty;
}

/* Grid */

.work-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-5);
}


/* Card */

.work-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;

    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);

    text-decoration: none;

    transition:
        background-color var(--transition),
        border-color var(--transition),
        box-shadow var(--transition),
        transform var(--transition);
}


/* Thumbnail
   "contain" preserves existing OG artwork without cropping.
   Change to "cover" later if your new thumbnails suit that.
*/

.work-card__media {
    position: relative;
    aspect-ratio: 1200 / 630;
    overflow: hidden;
    background: var(--color-surface-2);
    border-bottom: 1px solid var(--color-divider);
}

/* Lets <picture> wrappers sit transparently inside the media box */
.work-card__media picture {
    display: contents;
}

/* Sits behind the image; also serves as an intentional fallback. */

.work-card__fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: var(--space-6);

    color: var(--color-text-muted);
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 600;
    text-align: center;
    overflow-wrap: anywhere;
}

.work-card__image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;

    object-fit: contain;
    background: var(--color-surface-2);

    transition: transform var(--transition);
}


/* Content */

.work-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
    min-width: 0;
    padding: var(--space-6);
}


/* Professional domain: the single accented chip */

.work-card__tag {
    display: inline-flex;
    max-width: 100%;
    padding: var(--space-1) var(--space-3);

    border: 1px solid color-mix(in srgb, var(--color-primary) 22%, transparent);
    border-radius: var(--radius-full);

    color: var(--color-primary);
    background:
        color-mix(in srgb, var(--color-primary) 8%, transparent);

    font-size: var(--text-xs);
    font-weight: 700;
    line-height: 1.5;
}


/* Title and description */

.work-card__title {
    margin: 0;
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: var(--text-lg);
    font-weight: 700;
    line-height: 1.25;

    /* Protects narrow layouts from long venture names. */
    overflow-wrap: anywhere;
}

.work-card__desc {
    margin: 0;
    color: var(--color-text-muted);
    font-size: var(--text-base);
    font-weight: 400;
    line-height: 1.65;
}


/* Transferable capabilities: quieter than the domain chip */

.work-card__skills {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);

    margin: 0;
    padding: var(--space-1) 0 0;
    list-style: none;
}

.work-card__skills>li {
    max-width: 100%;
    padding: var(--space-1) var(--space-3);

    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);

    color: var(--color-text-muted);
    font-size: var(--text-xs);
    font-weight: 600;
    line-height: 1.5;
    overflow-wrap: anywhere;
}


/* CTA
   A visual signpost, not a second link.
   Auto margin keeps CTA rows aligned within each grid row.
*/

.work-card__cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    width: 100%;

    margin-top: auto;
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-divider);

    color: var(--color-primary);
    font-size: var(--text-sm);
    font-weight: 700;
    line-height: 1.5;
}

.work-card__cta>span:first-child {
    min-width: 0;
    overflow-wrap: anywhere;
}

.work-card__arrow {
    flex-shrink: 0;
    font-size: var(--text-lg);
    line-height: 1;

    transition: transform var(--transition);
}


/* Keyboard focus */

.work-card:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: var(--space-1);
    border-color: var(--color-primary);
}


/* Pointer interactions */

@media (hover: hover) and (pointer: fine) {
    .work-card:hover {
        background: var(--color-surface-2);
        border-color:
            color-mix(in srgb,
                var(--color-primary) 35%,
                var(--color-border));
        box-shadow: var(--shadow-md);
        transform: translateY(-2px);
    }

    .work-card:hover .work-card__image {
        transform: scale(1.025);
    }

    .work-card:hover .work-card__arrow {
        transform: translateX(3px);
    }
}

.work-card:active {
    transform: translateY(0);
    background: var(--color-surface-2);
    border-color: var(--color-primary);
}


/* Desktop / tablet:
   Featured card spans both columns and switches to image + text.
*/

@media (min-width: 46rem) {
    .work-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .work-card--featured {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns:
            minmax(0, 0.95fr) minmax(0, 1.05fr);
    }

    .work-card--featured .work-card__media {
        aspect-ratio: auto;
        min-height: calc(var(--space-16) * 4);
        border-bottom: 0;
        border-right: 1px solid var(--color-divider);
    }

    .work-card--featured .work-card__title {
        font-size: var(--text-xl);
    }

    .work-card--featured .work-card__image {
        object-fit: cover;
        object-position: center;
    }
}


/* Reduced motion */

@media (prefers-reduced-motion: reduce) {

    .work-card,
    .work-card__image,
    .work-card__arrow {
        transition: none;
    }

    .work-card:hover,
    .work-card:hover .work-card__image,
    .work-card:hover .work-card__arrow {
        transform: none;
    }
}
