.team-section {
    padding: 110px 20px 130px;
    background: #F5F5F5;
    min-height: 70vh;
}

.team-header-text {
    text-align: center;
    max-width: 780px;
    margin: 0 auto 70px;
}

.team-main-title {
    font-family: 'TildaSans', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    color: #222;
    margin: 0 0 16px;
    line-height: 1.15;
    letter-spacing: -0.3px;
}

.team-header-text::after {
    content: '';
    display: block;
    width: 64px;
    height: 3px;
    background: #990823;
    margin: 22px auto 28px;
    border-radius: 2px;
}

.team-subtitle {
    font-family: 'TildaSans', sans-serif;
    font-size: 1.28rem;
    line-height: 1.6;
    color: #555;
    margin: 0;
    font-weight: 400;
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
}

.team-grid {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 36px;
    max-width: 1400px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.team-card {
    background: #fff;
    border-radius: 22px;
    overflow: hidden;
    width: 310px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.08);
    border: 1px solid #eee;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.team-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 22px 48px rgba(153, 8, 35, 0.16);
    border-color: #f0d0d5;
}

.card-photo-wrapper {
    position: relative;
    padding: 40px 32px 22px;
    display: flex;
    justify-content: center;
    background: #fff;
}

.card-photo {
    width: 172px;
    height: 172px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #f3f3f3;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
    transition: transform 0.4s ease;
}

.team-card:hover .card-photo {
    transform: scale(1.07);
}

.photo-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 22px 22px 0 0;
}

.team-card:hover .photo-overlay {
    opacity: 1;
}

.view-more {
    background: linear-gradient(90deg, #990823, #fa2a2a);
    color: #fff;
    padding: 12px 26px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    font-family: 'TildaSans', sans-serif;
    box-shadow: 0 8px 20px rgba(153, 8, 35, 0.35);
    transition: transform 0.25s ease;
}

.team-card:hover .view-more {
    transform: scale(1.06);
}

.card-info {
    padding: 10px 24px 34px;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-name {
    font-family: 'TildaSans', sans-serif;
    font-size: 1.35rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px;
    line-height: 1.3;
}

.card-position {
    font-family: 'TildaSans', sans-serif;
    color: #777;
    font-size: 1.05rem;
    font-weight: 400;
    margin: 0;
    line-height: 1.45;
}

.team-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(8px);
    padding: 16px;
    box-sizing: border-box;
}

.team-modal.active {
    display: flex;
}

.modal-content {
    background: white;
    max-width: 1000px;
    width: 100%;
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    position: relative;
}

.modal-image {
    flex: 0 0 42%;
    min-width: 0;
    background: #f5f5f5;
    display: flex;
    align-items: stretch;
}

.modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.modal-info {
    flex: 1;
    padding: 48px 42px;
    overflow-y: auto;
    min-width: 0;
}

.modal-info h3 {
    font-family: 'TildaSans', sans-serif;
    font-size: 2.1rem;
    margin: 0 0 8px;
    color: #1a1a1a;
    line-height: 1.25;
}

.modal-position {
    font-family: 'TildaSans', sans-serif;
    color: #990823;
    font-size: 1.2rem;
    margin: 0 0 28px;
    font-weight: 500;
    line-height: 1.4;
}

.modal-description {
    font-family: 'TildaSans', sans-serif;
    line-height: 1.7;
    color: #444;
    font-size: 1.05rem;
    margin-bottom: 32px;
}

.modal-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-badge {
    background: #f0f0f0;
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 0.92rem;
    color: #333;
    font-family: 'TildaSans', sans-serif;
}

.modal-close {
    position: absolute;
    top: 18px;
    right: 20px;
    font-size: 2rem;
    background: rgba(0, 0, 0, 0.55);
    border: none;
    color: #fff;
    cursor: pointer;
    z-index: 20;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    line-height: 1;
}

.modal-close:hover {
    background: #990823;
    transform: rotate(90deg);
}

@media (max-width: 1200px) {
    .team-grid {
        gap: 28px;
    }
    .team-card {
        width: 290px;
    }
    .card-photo {
        width: 160px;
        height: 160px;
    }
}

@media (max-width: 980px) {
    .team-section {
        padding: 90px 16px 110px;
    }
    .team-main-title {
        font-size: 2.5rem;
    }
    .team-subtitle {
        font-size: 1.18rem;
    }
    .team-grid {
        gap: 24px;
    }
    .team-card {
        width: 270px;
    }
}

@media (max-width: 900px) {
    .modal-content {
        flex-direction: column;
        max-height: 92vh;
        width: 94%;
    }

    .modal-image {
        flex: none;
        width: 100%;
        height: 280px;
        min-height: 280px;
        max-height: 280px;
    }

    .modal-image img {
        height: 100%;
        object-fit: cover;
        object-position: center top;
    }

    .modal-info {
        padding: 28px 28px 36px;
    }

    .modal-info h3 {
        font-size: 1.75rem;
    }

    .modal-position {
        font-size: 1.1rem;
        margin-bottom: 20px;
    }

    .modal-description {
        font-size: 1rem;
        margin-bottom: 24px;
    }

    .modal-close {
        top: 12px;
        right: 12px;
        background: rgba(0, 0, 0, 0.65);
    }
}

@media (max-width: 640px) {
    .team-main-title {
        font-size: 2.2rem;
    }
    .team-subtitle {
        font-size: 1.1rem;
    }
    .team-card {
        width: 100%;
        max-width: 340px;
    }
    .card-photo {
        width: 160px;
        height: 160px;
    }

    .modal-content {
        width: 96%;
        border-radius: 18px;
        max-height: 94vh;
    }

    .modal-image {
        height: 220px;
        min-height: 220px;
        max-height: 220px;
    }

    .modal-info {
        padding: 22px 20px 30px;
    }

    .modal-info h3 {
        font-size: 1.5rem;
    }

    .modal-position {
        font-size: 1.05rem;
        margin-bottom: 16px;
    }

    .modal-description {
        font-size: 0.98rem;
        line-height: 1.65;
    }

    .skill-badge {
        font-size: 0.88rem;
        padding: 7px 14px;
    }
}

@media (max-width: 400px) {
    .modal-image {
        height: 190px;
        min-height: 190px;
        max-height: 190px;
    }

    .modal-info {
        padding: 18px 16px 26px;
    }

    .modal-info h3 {
        font-size: 1.35rem;
    }

    .modal-position {
        font-size: 0.98rem;
    }
}