/* Team / Speakers */
#team {
    --team-bg: #ffffff;
    --team-surface: #ffffff;
    --team-border: rgba(16, 24, 40, 0.09);
    --team-ring: rgba(36, 72, 255, 0.55);
    --team-text: #0f172a;
    --team-muted: #52607a;
    --team-space-1: 1rem;
    --team-space-2: 1.25rem;
    --team-space-3: 1.5rem;
    --team-space-4: 2rem;
    padding: 6.5rem 1.5rem;
    background: var(--team-bg);
}

.team-wrap {
    max-width: 1200px;
    margin: 0 auto;
}

/* Move-in horizontal (fluido y minimalista) */
#team .team-head,
#team .team-card {
    opacity: 0;
    transform: translateX(var(--team-shift, 36px));
    will-change: transform, opacity;
}

#team .team-head {
    --team-shift: -42px;
    transition: transform 2.15s cubic-bezier(.22, .61, .36, 1), opacity 2.05s ease;
    transition-delay: .04s;
}

#team .team-card {
    transition:
    transform 2.15s cubic-bezier(.22, .61, .36, 1),
    opacity 2.05s ease,
    flex-basis .42s ease,
    flex-grow .42s ease,
    box-shadow .4s ease,
    border-color .4s ease;
}

#team:not(.team-in) .team-card {
    transition-delay: var(--team-enter-delay, 0s);
}

#team.team-in .team-head,
#team.team-in .team-card {
    opacity: 1;
    transform: translateX(0);
}

/* Reverse state on scroll down */
#team.team-out {
    opacity: 0;
    pointer-events: none;
    transition: opacity 1.05s ease;
}

.team-head {
    max-width: 860px;
    margin: 0 auto 2.4rem;
    text-align: center;
}

.team-kicker {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-size: .74rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    font-weight: 700;
    color: #2448ff;
    margin-bottom: .85rem;
    background: rgba(36, 72, 255, 0.08);
    border: 1px solid rgba(36, 72, 255, 0.22);
    border-radius: 9999px;
    padding: .38rem 1.05rem;
}

.team-title {
    font-size: clamp(1.8rem, 4.7vw, 2.85rem);
    line-height: 1.08;
    font-weight: 800;
    color: var(--team-text);
    letter-spacing: -.025em;
    margin-bottom: .85rem;
}

.team-sub {
    color: var(--team-muted);
    font-size: 1rem;
    line-height: 1.78;
    margin: 0 auto;
    max-width: 760px;
}

.team-track {
    display: flex;
    gap: var(--team-space-1);
    min-height: 420px;
    align-items: stretch;
}

.team-card {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid var(--team-border);
    box-shadow: 0 20px 44px rgba(15, 23, 42, 0.10), 0 2px 8px rgba(15, 23, 42, 0.05);
    background: #d8e1ff;
    transition: flex-basis .42s ease, flex-grow .42s ease, transform .4s ease, box-shadow .4s ease, border-color .4s ease;
    outline: none;
    cursor: pointer;
}

.team-card:focus-visible {
    box-shadow: 0 0 0 3px var(--team-ring), 0 20px 44px rgba(15, 23, 42, 0.14);
}

.team-media-shell {
    position: absolute;
    inset: 0;
}

.team-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .55s ease, filter .35s ease;
}

.team-fallback {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.9rem, 4.8vw, 2.8rem);
    letter-spacing: .05em;
    font-weight: 700;
    color: rgba(255, 255, 255, .95);
    background: linear-gradient(145deg, #2448ff 0%, #7f9cff 100%);
}

.team-card.is-fallback .team-fallback {
    display: flex;
}

.team-card.is-fallback .team-media {
    display: none;
}

.team-sheen {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.03) 0%, rgba(7, 11, 26, 0.72) 100%);
    transition: opacity .35s ease;
}

.team-name-hint {
    position: absolute;
    left: var(--team-space-2);
    bottom: var(--team-space-2);
    color: rgba(255, 255, 255, .95);
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: .01em;
    transition: opacity .3s ease;
    z-index: 2;
}

.team-overlay {
    position: absolute;
    inset: auto 0 0 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .75rem;
    padding: 1.1rem 1.2rem 1.25rem;
    background: linear-gradient(180deg, rgba(8, 11, 20, 0) 0%, rgba(8, 11, 20, .68) 50%, rgba(8, 11, 20, .82) 100%);
    color: #f8fafc;
    transform: translateY(12px);
    opacity: 0;
    transition: transform .35s ease, opacity .35s ease;
    z-index: 3;
}

.team-overlay h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: .2rem;
    letter-spacing: -.01em;
}

.team-copy {
    max-width: min(100%, 44rem);
}

.team-role {
    margin: 0 0 .45rem;
    font-size: .77rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    font-weight: 700;
    color: rgba(255, 255, 255, .72);
}

.team-bio {
    margin: 0;
    font-size: .92rem;
    color: rgba(255, 255, 255, .86);
    line-height: 1.5;
}

.team-links {
    display: inline-flex;
    gap: .5rem;
}

.team-link {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .28);
    color: #fff;
    background: rgba(255, 255, 255, .07);
    transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.team-link-label {
    display: none;
}

.team-link:hover,
.team-link:focus-visible {
    background: rgba(255, 255, 255, .18);
    border-color: rgba(255, 255, 255, .48);
    transform: translateY(-1px);
}

.team-close {
    position: absolute;
    right: .9rem;
    top: .9rem;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .45);
    background: rgba(255, 255, 255, .12);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}

/* Desktop: hover/focus/active expande tarjeta, comprime el resto */
@media (min-width: 1024px) {
    .team-track.has-active .team-card {
        flex: 0.72 1 0;
    }

    .team-track.has-active .team-card.is-expanded {
        flex: 1.26 1 0;
        border-color: var(--team-border);
        box-shadow: 0 30px 66px rgba(15, 23, 42, .2);
    }

    .team-track.has-active .team-card:not(.is-expanded) .team-overlay {
        opacity: 0;
        transform: translateY(18px);
    }

    .team-track.has-active .team-card.is-expanded .team-overlay {
        opacity: 1;
        transform: translateY(0);
    }

    .team-track.has-active .team-card.is-expanded .team-name-hint {
        opacity: 0;
    }

    .team-track.has-active .team-card:not(.is-expanded) .team-sheen {
        opacity: .96;
    }

    .team-track.has-active .team-card.is-expanded .team-media {
        transform: scale(1.015);
        filter: saturate(1.02);
    }

    .team-track.has-active .team-card:not(.is-expanded) .team-media {
        transform: scale(1.002);
        filter: saturate(.94);
    }
}

/* Tablet/mobile: lista vertical sin scroll horizontal + estado expandido fijo */
@media (max-width: 1023px) {
    #team {
        padding: 5rem 1.1rem;
    }

    #team .team-head,
    #team .team-card {
        transform: translateX(24px);
    }

    .team-track {
        display: grid;
        grid-template-columns: 1fr;
        gap: .9rem;
        min-height: 0;
        overflow: visible;
        padding-bottom: 0;
    }

    .team-card {
        width: 100%;
        min-width: 0;
        min-height: auto;
        display: grid;
        grid-template-columns: 1fr;
        gap: 1rem;
        align-items: stretch;
        padding: 1rem;
        flex: none;
        box-shadow: 0 14px 34px rgba(15, 23, 42, 0.10), 0 2px 8px rgba(15, 23, 42, 0.06);
        cursor: default;
        background: #fff;
    }

    .team-card .team-media-shell {
        position: relative;
        inset: auto;
        width: 100%;
        min-height: 0;
        aspect-ratio: 16 / 9;
        border-radius: 20px;
        overflow: hidden;
    }

    .team-card .team-overlay {
        position: relative;
        inset: auto;
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
        align-items: center;
        justify-content: flex-start;
        min-height: 0;
        padding: .25rem 0 .05rem;
        background: none;
        color: var(--team-text);
        text-align: center;
    }

    .team-card .team-name-hint {
        display: none;
    }

    .team-card .team-close {
        display: none;
    }

    .team-card .team-media {
        transform: none;
        filter: saturate(1.02);
    }

    .team-card .team-sheen {
        opacity: 1;
        background: linear-gradient(180deg, rgba(10, 14, 28, 0.02) 0%, rgba(10, 14, 28, 0.2) 100%);
    }

    .team-card .team-copy {
        max-width: none;
        width: 100%;
        text-align: center;
    }

    .team-card .team-overlay h3 {
        font-size: 1.32rem;
        color: var(--team-text);
    }

    .team-card .team-role {
        color: #2448ff;
        margin-bottom: .55rem;
    }

    .team-card .team-bio {
        color: var(--team-muted);
        font-size: .96rem;
        line-height: 1.6;
    }

    .team-card .team-links {
        display: flex;
        flex-wrap: wrap;
        gap: .65rem;
        margin-top: .2rem;
        width: 100%;
        justify-content: center;
    }

    .team-card .team-link {
        width: auto;
        height: auto;
        min-height: 42px;
        gap: .55rem;
        padding: .72rem 1rem;
        border-radius: 999px;
        border: 1px solid rgba(36, 72, 255, .16);
        background: rgba(36, 72, 255, .06);
        color: #2448ff;
    }

    .team-card .team-link-label {
        display: inline;
        font-size: .86rem;
        font-weight: 700;
        line-height: 1;
    }

    .team-card .team-link:hover,
    .team-card .team-link:focus-visible {
        background: rgba(36, 72, 255, .12);
        border-color: rgba(36, 72, 255, .24);
    }
}

@media (max-width: 639px) {
    .team-card {
        border-radius: 22px;
        gap: .95rem;
        padding: .95rem;
    }

    .team-card .team-media-shell {
        width: 100%;
        aspect-ratio: 4 / 3;
    }

    .team-card .team-overlay {
        min-height: 0;
        gap: .7rem;
    }

    .team-card .team-overlay h3 {
        font-size: 1.2rem;
    }

    .team-card .team-role {
        font-size: .73rem;
    }

    .team-card .team-bio {
        font-size: .93rem;
    }

    .team-card .team-links {
        width: 100%;
    }

    .team-card .team-link {
        width: 100%;
        justify-content: center;
    }
}
