body { min-height: 100vh; padding: 40px 20px 80px; }
.wrap { max-width: 900px; margin: 0 auto; }
header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 48px; }
h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(2rem, 5vw, 2.8rem); margin: 32px 0 8px; }
.subtitle { color: var(--muted); font-size: 0.95rem; margin-bottom: 40px; max-width: 55ch; }

.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.member-card {
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px;
    padding: 32px 20px; border-radius: 16px;
    background: var(--surface); border: 1px solid var(--border);
    text-decoration: none; color: var(--text);
    position: relative;
    transition: background-color 0.4s var(--ease-in-out), transform 0.4s var(--ease-spring),
    border-color 0.3s var(--ease-out-expo);
}
/* La sombra vive en una capa fija y solo se anima su opacidad (GPU, sin repintar) */
.member-card::after {
    content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
    opacity: 0; transition: opacity 0.4s var(--ease-out-expo);
}
.member-card:hover { transform: translateY(-6px); border-color: var(--accent); }
.member-card:hover::after { opacity: 1; }
.member-card:hover .member-avatar { transform: scale(1.06); }
.member-card:active { transform: translateY(-2px) scale(0.98); transition-duration: 0.15s; }
.member-card.static { cursor: default; }
.member-card.static:hover { transform: none; border-color: var(--border); }
.member-card.static:hover::after { opacity: 0; }
.member-card.static:hover .member-avatar { transform: none; }

.member-avatar {
    width: 84px; height: 84px;
    font-family: var(--font-display); font-size: 1.6rem; color: var(--bg);
}
.member-name { font-weight: 600; font-size: 1.05rem; }
.member-role { color: var(--muted); font-size: 0.85rem; }

.profile-header { display: flex; align-items: center; gap: 24px; margin-bottom: 16px; flex-wrap: wrap; }
.profile-header .member-avatar { width: 96px; height: 96px; font-size: 1.8rem; flex-shrink: 0; }
.profile-name { font-family: var(--font-display); font-size: 2rem; font-weight: 400; margin: 0; }
.profile-role { color: var(--accent); font-size: 0.95rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }

.social-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 48px; }
.social-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: 20px;
    background: var(--surface); border: 1px solid var(--border);
    color: var(--muted); font-size: 0.85rem; text-decoration: none;
    transition: background-color 0.4s var(--ease-in-out), border-color 0.3s var(--ease-out-expo),
    color 0.3s var(--ease-out-expo), transform 0.3s var(--ease-spring);
}
.social-pill:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.social-pill:active { transform: scale(0.95); }
.social-pill.placeholder { opacity: 0.55; cursor: default; }
.social-pill.placeholder:hover { transform: none; }

.gallery { columns: 4 260px; column-gap: 16px; }
.gallery-item {
    break-inside: avoid; margin-bottom: 16px; border-radius: 14px; overflow: hidden;
    background: var(--surface); border: 1px solid var(--border);
    display: block; cursor: pointer;
    transform: translateZ(0);
    box-shadow: 0 0 0 rgba(0,0,0,0);
    transition: background-color 0.4s var(--ease-in-out), transform 0.5s var(--ease-spring),
    box-shadow 0.5s var(--ease-out-expo), border-color 0.35s var(--ease-out-expo);
}
.gallery-item:hover {
    transform: translateY(-6px) scale(1.015);
    box-shadow: 0 24px 48px rgba(0,0,0,0.28);
    border-color: var(--accent);
}
.gallery-item:active { transform: translateY(-2px) scale(0.99); transition-duration: 0.15s; }
.gallery-item img {
    width: 100%; height: auto; display: block;
    transition: transform 0.7s var(--ease-out-expo), filter 0.5s var(--ease-in-out);
    -webkit-user-select: none; user-select: none;
    -webkit-touch-callout: none;
    pointer-events: none;
}
.gallery-item:hover img { transform: scale(1.07); filter: brightness(1.05) saturate(1.05); }
.gallery-count { color: var(--muted); font-size: 0.85rem; margin-bottom: 20px; }
@media (max-width: 900px) { .gallery { columns: 3 200px; } }
@media (max-width: 600px) { .gallery { columns: 2 160px; column-gap: 10px; } .gallery-item { margin-bottom: 10px; } }

.lightbox-overlay {
    position: fixed; inset: 0; z-index: 999;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    display: flex; align-items: center; justify-content: center;
    padding: 40px 20px;
    opacity: 0; pointer-events: none;
    transition: opacity 0.4s var(--ease-out-expo), background-color 0.4s var(--ease-in-out), backdrop-filter 0.4s var(--ease-out-expo);
}
.lightbox-overlay.active { opacity: 1; pointer-events: auto; }
.lightbox-img {
    max-width: 90vw; max-height: 85vh; border-radius: 12px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.5);
    -webkit-user-select: none; user-select: none;
    -webkit-touch-callout: none; pointer-events: none;
    transform: scale(0.92) translateY(12px);
    transition: transform 0.45s var(--ease-spring);
}
.lightbox-overlay.active .lightbox-img { transform: scale(1) translateY(0); }
.lightbox-close {
    position: absolute; top: 24px; right: 28px;
    background: var(--surface); border: 1px solid var(--border); color: var(--text);
    width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
    transition: background-color 0.4s var(--ease-in-out), border-color 0.3s var(--ease-out-expo), transform 0.4s var(--ease-spring);
}
.lightbox-close:hover { border-color: var(--accent); transform: rotate(90deg) scale(1.05); }
.lightbox-close:active { transform: rotate(90deg) scale(0.92); }

.back-link { display: inline-block; margin-bottom: 8px; color: var(--muted); font-size: 0.9rem; text-decoration: none; transition: color 0.3s var(--ease-out-expo), transform 0.3s var(--ease-spring); }
.back-link:hover { color: var(--accent); transform: translateX(-3px); }

footer {
    padding: 32px 0;
    margin-top: 80px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.4s var(--ease-in-out);
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.legal-link, footer a {
    color: var(--muted);
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-color: var(--border);
    transition: color 0.3s var(--ease-out-expo), text-decoration-color 0.3s var(--ease-out-expo);
}

.legal-link:hover, footer a:hover {
    color: var(--accent);
    text-decoration-color: var(--accent);
}

/* Estilos específicos para portfolios de programación */
.dev-section {
    margin-top: 48px;
}

.dev-heading {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 400;
    margin-bottom: 20px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

/* Chips de tecnologías */
.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tech-tag {
    padding: 6px 14px;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 0.85rem;
    font-family: 'Fira Code', monospace, var(--font-body);
    color: var(--muted);
    transition: border-color 0.3s var(--ease-out-expo), color 0.3s var(--ease-out-expo);
}

.tech-tag.primary {
    color: var(--text);
    font-weight: 500;
}

.tech-tag.highlight {
    border-color: color-mix(in srgb, var(--accent) 30%, transparent);
    color: var(--accent);
}

.tech-tag:hover {
    border-color: var(--accent);
    color: var(--text);
}

/* Tarjetas de proyectos */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
    transition: border-color 0.35s var(--ease-out-expo), transform 0.4s var(--ease-spring);
}

.project-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.project-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 500;
}

.project-badge {
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--accent) 15%, transparent);
    color: var(--accent);
    font-weight: 500;
    white-space: nowrap;
}

.project-badge.muted {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
}

.project-desc {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.project-tech {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    font-family: 'Fira Code', monospace, var(--font-body);
    color: var(--accent);
    opacity: 0.85;
}

/* Responsivo para pantallas móviles */
@media (max-width: 600px) {
    footer {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}
/* Mientras llega la versión grande se ve la miniatura, algo suavizada */
.lightbox-img { transition: transform 0.45s var(--ease-spring), filter 0.35s ease; }
.lightbox-img.is-loading { filter: blur(3px); }

/* Galería accesible: foco visible y flechas del visor */
.gallery-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 14px; }
.lightbox-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--surface); border: 1px solid var(--border); color: var(--text);
    cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; line-height: 1;
    transition: border-color 0.3s var(--ease-out-expo), transform 0.4s var(--ease-spring);
}
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }
.lightbox-nav:hover { border-color: var(--accent); }
.lightbox-prev:hover { transform: translateY(-50%) translateX(-3px); }
.lightbox-next:hover { transform: translateY(-50%) translateX(3px); }
.lightbox-nav:active { transform: translateY(-50%) scale(0.92); }
@media (max-width: 768px) { .lightbox-nav { display: none; } } /* en móvil se desliza */

/* Galería: la imagen va en su propia capa, así el hover (sombra, borde) no obliga a repintarla.
   Solo en dispositivos con ratón: en móvil no hay hover y se ahorra memoria de GPU. */
@media (hover: hover) and (pointer: fine) {
    .gallery-item img { will-change: transform; }
}
