.team-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}

.team-header {
    text-align: center;
    margin-bottom: 40px;
}

.team-header h1 {
    font-size: 3rem;
    color: var(--text-color, #333);
    margin-bottom: 15px;
}

.team-header p {
    font-size: 1.2rem;
    color: var(--text-muted, #666);
    max-width: 600px;
    margin: 0 auto;
}

.team-members {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    justify-items: center;
}

.team-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease;
    padding: 20px;
    border-radius: 12px;
}

.team-card:hover {
    transform: translateY(-5px);
    background: rgba(0, 0, 0, 0.02);
}

body.dark-mode .team-card:hover {
    background: rgba(255, 255, 255, 0.05);
}

.team-image-col {
    margin-bottom: 20px;
}

/* Wavy frame override for square */
.wavy-frame.square-frame {
    aspect-ratio: 1 / 1;
    width: 250px;
    max-width: 100%;
    margin: 0 auto;
    border-width: 15px;
    border-radius: 20px;
}

.team-card .founder-eyebrow {
    font-size: 0.9rem;
    color: var(--accent);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.team-card .team-name {
    font-size: 1.6rem;
    margin: 0;
    color: var(--text-color, #333);
}

body.dark-mode .team-card .team-name {
    color: #fff;
}

/* Hidden elements */
.founder-bio {
    display: none;
}
.team-member-link {
    display: none;
}

/* Modal Styles */
.team-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.team-modal-overlay.active {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.team-modal-content {
    background: var(--bg-color, #fff);
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: 20px;
    padding: 50px;
    position: relative;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 30px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
}

body.dark-mode .team-modal-content {
    background: var(--bg-color, #1a1a2e);
    color: #fff;
}

.team-modal-overlay.active .team-modal-content {
    transform: scale(1) translateY(0);
}

.team-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0,0,0,0.05);
    border: none;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color, #333);
    transition: background 0.3s ease;
    z-index: 10;
}

body.dark-mode .team-modal-close {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.team-modal-close:hover {
    background: rgba(0,0,0,0.1);
}

body.dark-mode .team-modal-close:hover {
    background: rgba(255,255,255,0.2);
}

.team-modal-body {
    display: flex;
    gap: 50px;
    align-items: flex-start;
}

.team-modal-image {
    flex-shrink: 0;
}

.modal-image-glare {
    width: 280px;
    height: 280px;
    object-fit: cover;
    border-radius: 16px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-image-glare:hover {
    transform: scale(1.02);
}

.modal-image-glare::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.5s ease;
    pointer-events: none;
}

.modal-image-glare:hover::after {
    left: 100%;
}

.team-modal-info {
    flex: 1;
}

.team-modal-info h2 {
    font-size: 2.4rem;
    margin-bottom: 8px;
    color: var(--text-color, #333);
    font-weight: 700;
}

body.dark-mode .team-modal-info h2 {
    color: #fff;
}

.team-modal-info .founder-eyebrow {
    color: var(--accent);
    font-size: 1.1rem;
    margin-bottom: 25px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

.team-modal-info .bio-content {
    line-height: 1.8;
    color: var(--text-color, #555);
    font-size: 1.1rem;
}

body.dark-mode .team-modal-info .bio-content {
    color: #ddd;
}

.team-modal-info .bio-content p {
    margin-bottom: 18px;
}

.team-modal-extra-link {
    margin-top: 20px;
    display: inline-block;
}

.team-modal-extra-link a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@media (max-width: 768px) {
    .team-modal-body {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 20px;
    }
    
    .team-modal-content {
        padding: 30px 20px;
    }
}
