/* ============================================================
   TEAM PAGE
   ============================================================ */

.team-page {
    padding-top: var(--header-h);
    background: #383838;
    min-height: 100vh;
    padding-bottom: 80px;
}

/* ── Header ── */
.team-header {
    padding: 56px 0 36px;
    text-align: center;
}

.team-header h2 {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 700;
    color: #fff;
    margin: 0;
    letter-spacing: -0.02em;
}

/* ── Grid — 3 per row ── */
.team-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 80%;
    margin-left: auto;
    margin-right: auto;
}

/* ── Card ── */
.team-card {
    position: relative;
    overflow: hidden;
    aspect-ratio: 3 / 4;
}

.team-card--clickable {
    cursor: pointer;
}

/* Photo */
.team-card__photo {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: #1a1a1a;
}

.team-card__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.75s cubic-bezier(0.4, 0, 0.2, 1);
}

.team-card__no-photo {
    width: 100%;
    height: 100%;
    background: #2a2a2a;
}

/* Overlay gradient */
.team-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0,0,0,0.78) 0%,
        rgba(0,0,0,0.15) 50%,
        rgba(0,0,0,0.04) 100%
    );
    transition: background 0.45s ease;
}

.team-card:hover::after {
    background: linear-gradient(
        to top,
        rgba(0,0,0,0.88) 0%,
        rgba(0,0,0,0.3) 55%,
        rgba(0,0,0,0.08) 100%
    );
}

.team-card:hover .team-card__photo img {
    transform: scale(1.05);
}

/* Info overlay */
.team-card__body {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.team-card__position {
    font-size: 0.65rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
    font-weight: 500;
    margin: 0;
}

.team-card__name {
    font-size: clamp(0.9rem, 1.4vw, 1.15rem);
    font-weight: 600;
    color: #fff;
    margin: 0;
    line-height: 1.25;
    letter-spacing: -0.01em;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.team-card:hover .team-card__name {
    transform: translateY(-3px);
}

.team-card__more {
    display: flex;
    align-items: center;
    color: rgba(255,255,255,0.4);
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.35s, transform 0.35s;
    margin-top: 2px;
}

.team-card--clickable:hover .team-card__more {
    opacity: 1;
    transform: translateX(0);
}

.team-card:not(.team-card--clickable) {
    cursor: default;
}

/* ── Popup ── */
.team-popup {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.team-popup.is-open {
    display: flex;
}

.team-popup__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    animation: popup-fade-in 0.3s ease;
}

.team-popup__box {
    position: relative;
    z-index: 1;
    background: #444;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    max-width: 720px;
    width: 100%;
    max-height: 88vh;
    animation: popup-slide-up 0.35s cubic-bezier(0.4,0,0.2,1);
}

@keyframes popup-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes popup-slide-up {
    from { opacity: 0; transform: translateY(30px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

.team-popup__close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    background: rgba(255,255,255,0.1);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    color: #fff;
}
.team-popup__close:hover { background: rgba(255,255,255,0.2); }

.team-popup__photo {
    width: 260px;
    flex-shrink: 0;
    overflow: hidden;
}

.team-popup__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.team-popup__content {
    padding: 40px 36px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.team-popup__position {
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.45);
    margin: 0 0 6px;
    font-weight: 500;
}

.team-popup__name {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 20px;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.team-popup__info {
    font-size: 0.93rem;
    line-height: 1.85;
    color: rgba(255,255,255,0.7);
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .team-grid { grid-template-columns: 1fr; }
    .team-popup__box    { flex-direction: column; }
    .team-popup__photo  { width: 100%; height: 220px; }
    .team-popup__content { padding: 24px 20px; }
}
