/* ===== FIX ДЛЯ ПЕРЕПОЛНЕНИЯ ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* ================= GRID ================= */

.team-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.2rem;

    padding: 1.5rem;

    max-width: calc(
        300px * 3 +
        1.2rem * 2 +
        1.5rem * 2
    );

    margin: 0 auto;
}

/* ================= CARD ================= */

.person-card {
    width: 300px;
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0,0,0,.06);
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
}

.person-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 26px rgba(0,0,0,.1);
}

.person-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

.person-info {
    padding: 0 12px 12px;
    text-align: center;
}

.person-info h3 {
    font-size: 15px;
    margin: 8px 0 4px;
}

.person-info .role {
    font-size: 13px;
    color: #777;
}

/* ================= MODAL ================= */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 80px 16px 40px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease;
    z-index: 9999;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

/* ================= POPUP ================= */

.modal-box {
    background: #fff;
    width: 100%;
    max-width: 820px;
    max-height: calc(100vh - 140px);
    border-radius: 16px;
    padding: 24px;
    position: relative;
    display: flex;
    flex-direction: column;
    animation: slideDown .25s ease;
}

/* ================= CLOSE ================= */

.close {
    position: absolute;
    top: 14px;
    right: 18px;
    font-size: 26px;
    cursor: pointer;
}

/* ================= HEADER ================= */

.modal-header {
    display: flex;
    gap: 18px;
    align-items: center;
    margin-bottom: 16px;
}

.modal-header img {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 10px;
}

/* ================= BODY ================= */

.modal-body p {
    margin: 6px 0;
    font-size: 14px;
    line-height: 1.5;
}

.modal-body {
    min-height: 0;
}

#modalDesc {
    max-height: 45vh;
    overflow-y: auto;
    padding-right: 10px;
}

.contacts a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
}

.contacts a:hover {
    text-decoration: underline;
}

/* ================= ANIMATION ================= */

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
