/* Proyectos — Motion-Driven showcase (ui-ux-pro-max). Imágenes reales + animación GPU. */

.projects-showcase {
    padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(3rem, 6vw, 4.5rem);
    background: var(--color-background);
}

.work-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.35rem;
}

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

    .work-card--featured {
        grid-column: span 2;
    }
}

@media (min-width: 1140px) {
    .work-grid {
        grid-template-columns: repeat(12, minmax(0, 1fr));
    }

    .work-card {
        grid-column: span 6;
    }

    .work-card--featured {
        grid-column: span 12;
    }

    .work-card--compact {
        grid-column: span 4;
    }
}

.work-card {
    min-width: 0;
    content-visibility: auto;
    contain-intrinsic-size: 360px 320px;
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

.work-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.work-card article {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

@media (prefers-reduced-motion: no-preference) {
    .work-card.is-visible article:hover {
        border-color: rgba(3, 105, 161, 0.45);
        box-shadow: 0 14px 32px rgba(15, 23, 42, 0.1);
    }
}

.work-card__visual {
    position: relative;
    margin: 0;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #0f172a;
}

.work-card--featured .work-card__visual {
    aspect-ratio: 21 / 9;
}

.work-card__visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    transform: scale(1);
    transition: transform 0.6s ease;
}

.work-card.is-live .work-card__visual img {
    animation: work-kenburns 9s ease-in-out infinite alternate;
}

.work-card--featured.is-live .work-card__visual img {
    animation-duration: 11s;
}

@keyframes work-kenburns {
    0% { transform: scale(1) translateY(0); }
    100% { transform: scale(1.06) translateY(-1.5%); }
}

.work-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(15, 23, 42, 0.05) 0%,
        rgba(15, 23, 42, 0.15) 55%,
        rgba(15, 23, 42, 0.72) 100%
    );
    pointer-events: none;
}

.work-card__shine {
    position: absolute;
    inset: -40% -60%;
    background: linear-gradient(
        115deg,
        transparent 42%,
        rgba(255, 255, 255, 0.14) 50%,
        transparent 58%
    );
    transform: translateX(-120%);
    pointer-events: none;
}

.work-card.is-live .work-card__shine {
    animation: work-shine 4.5s ease-in-out infinite;
}

@keyframes work-shine {
    0%, 55% { transform: translateX(-120%); }
    100% { transform: translateX(120%); }
}

.work-card__tag {
    position: absolute;
    left: 14px;
    bottom: 14px;
    z-index: 2;
    padding: 0.35rem 0.75rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(3, 105, 161, 0.92);
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.work-card__scan {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #38bdf8, transparent);
    opacity: 0;
    pointer-events: none;
}

.work-card.is-live .work-card__scan {
    animation: work-scan 3.2s ease-in-out infinite;
}

@keyframes work-scan {
    0% { top: 8%; opacity: 0; }
    15% { opacity: 0.85; }
    85% { opacity: 0.85; }
    100% { top: 92%; opacity: 0; }
}

.work-card__body {
    padding: 1.1rem 1.2rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    flex: 1;
}

.work-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.work-card__index {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--color-accent);
}

.work-card__year {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.work-card__body h3 {
    margin: 0;
    font-size: clamp(1.05rem, 2.2vw, 1.2rem);
    line-height: 1.3;
    color: var(--color-primary);
}

.work-card__lead {
    margin: 0;
    font-size: 0.94rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.work-card__outcome {
    margin: 0.15rem 0 0;
    padding-top: 0.65rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--color-primary);
}

.work-card__outcome strong {
    color: var(--color-accent);
    font-weight: 600;
}

/* Hero: métricas animadas */
.projects-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    max-width: 520px;
    margin-top: 1.5rem;
}

.projects-metric {
    text-align: center;
    padding: 0.75rem 0.5rem;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 10px;
}

.projects-metric strong {
    display: block;
    font-size: 1.35rem;
    color: var(--color-accent);
    line-height: 1.1;
}

.projects-metric span {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

.projects-hero__title span.text-cyan {
    color: var(--cyan-accent);
}

@media (prefers-reduced-motion: reduce) {
    .work-card {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .work-card__visual img,
    .work-card__shine,
    .work-card__scan {
        animation: none !important;
    }
}
