.team {
    position: relative;
    margin-top: 160px;
}

.team h2 {
    text-align: left;
    margin-bottom: 40px;
    font-size: 3.5rem;
    font-weight: 200;
    letter-spacing: -0.04em;
    line-height: 0.9;
    background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleFadeIn 1s ease-out;
}

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

.team-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.team-member {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
    border: 1px solid var(--border-color);
    padding: 40px 30px 30px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px);
    animation: cardFadeIn 0.6s ease-out forwards;
}

/* staggered animation for each card */
.team-member:nth-child(1) { animation-delay: 0.1s; }
.team-member:nth-child(2) { animation-delay: 0.2s; }
.team-member:nth-child(3) { animation-delay: 0.3s; }
.team-member:nth-child(4) { animation-delay: 0.4s; }
.team-member:nth-child(5) { animation-delay: 0.5s; }
.team-member:nth-child(6) { animation-delay: 0.6s; }
.team-member:nth-child(7) { animation-delay: 0.7s; }
.team-member:nth-child(8) { animation-delay: 0.8s; }

@keyframes cardFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* animated gradient background on hover */
.team-member::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transition: left 0.5s ease;
    pointer-events: none;
}

.team-member:hover::before {
    left: 100%;
}

/* glowing border effect */
.team-member::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(45deg, transparent, transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.team-member:hover::after {
    background: linear-gradient(45deg, 
        #ff00ff 0%, 
        #00ffff 25%, 
        #ffff00 50%, 
        #00ffff 75%, 
        #ff00ff 100%);
    background-size: 300% 300%;
    animation: borderGlow 3s linear infinite;
    opacity: 0.3;
}

/* unique color gradients for team person */
/* dorsa - bright deep green */
.team-member:nth-child(1):hover::after {
    background: linear-gradient(45deg, 
        #00ff88 0%, 
        #00cc66 25%, 
        #00ff99 50%, 
        #00cc66 75%, 
        #00ff88 100%);
}

/* evan - pink & orange */
.team-member:nth-child(2):hover::after {
    background: linear-gradient(45deg, 
        #ec4899 0%, 
        #f97316 25%, 
        #fb923c 50%, 
        #f97316 75%, 
        #ec4899 100%);
}

/* richard - pink */
.team-member:nth-child(3):hover::after {
    background: linear-gradient(45deg, 
        #ec4899 0%, 
        #e372f4 25%, 
        #fb71f4 50%, 
        #f472f0 75%, 
        #ec4899 100%);
}

/* david - gold & amber */
.team-member:nth-child(4):hover::after {
    background: linear-gradient(45deg, 
        #eab308 0%, 
        #f59e0b 25%, 
        #fbbf24 50%, 
        #f59e0b 75%, 
        #eab308 100%);
}

/* haley - pink & rose */
.team-member:nth-child(5):hover::after {
    background: linear-gradient(45deg, 
        #ec4899 0%, 
        #f43f5e 25%, 
        #fb7185 50%, 
        #f43f5e 75%, 
        #ec4899 100%);
}

/* martendo - emerald & teal */
.team-member:nth-child(6):hover::after {
    background: linear-gradient(45deg, 
        #10b981 0%, 
        #14b8a6 25%, 
        #06b6d4 50%, 
        #14b8a6 75%, 
        #10b981 100%);
}

/* jimmy - indigo & violet */
.team-member:nth-child(7):hover::after {
    background: linear-gradient(45deg, 
        #6366f1 0%, 
        #8b5cf6 25%, 
        #a855f7 50%, 
        #8b5cf6 75%, 
        #6366f1 100%);
}

/* dylan - cyan & sky */
.team-member:nth-child(8):hover::after {
    background: linear-gradient(45deg, 
        #06b6d4 0%, 
        #0ea5e9 25%, 
        #3b82f6 50%, 
        #0ea5e9 75%, 
        #06b6d4 100%);
}

@keyframes borderGlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.team-member:hover {
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-12px) scale(1.02);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.7), 
        0 0 80px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, rgba(30, 30, 30, 1) 0%, rgba(20, 20, 20, 1) 100%);
}

.team-member h3 {
    margin: 0 0 12px 0;
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    transition: all 0.4s ease;
    position: relative;
    display: inline-block;
}

.team-member h3::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, #00ffff, #ff00ff);
    transition: width 0.4s ease;
}

.team-member:hover h3 {
    color: var(--text-primary);
    opacity: 1;
    transform: translateX(4px);
}

.team-member:hover h3::after {
    width: 100%;
}

/* unique name underline colors */
.team-member:nth-child(1) h3::after {
    background: linear-gradient(90deg, rgba(0, 255, 136, 0.4), rgba(0, 204, 102, 0.4), rgba(0, 255, 153, 0.4));
}

.team-member:nth-child(2) h3::after {
    background: linear-gradient(90deg, rgba(236, 72, 153, 0.4), rgba(249, 115, 22, 0.4), rgba(251, 146, 60, 0.4));
}

.team-member:nth-child(3) h3::after {
    background: linear-gradient(90deg, rgba(236, 72, 153, 0.4), rgba(244, 114, 182, 0.4), rgba(251, 113, 133, 0.4));
}

.team-member:nth-child(4) h3::after {
    background: linear-gradient(90deg, rgba(234, 179, 8, 0.4), rgba(245, 158, 11, 0.4), rgba(251, 191, 36, 0.4));
}

.team-member:nth-child(5) h3::after {
    background: linear-gradient(90deg, rgba(236, 72, 153, 0.4), rgba(244, 63, 94, 0.4), rgba(251, 113, 133, 0.4));
}

.team-member:nth-child(6) h3::after {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.4), rgba(20, 184, 166, 0.4), rgba(6, 182, 212, 0.4));
}

.team-member:nth-child(7) h3::after {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.4), rgba(139, 92, 246, 0.4), rgba(168, 85, 247, 0.4));
}

.team-member:nth-child(8) h3::after {
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.4), rgba(14, 165, 233, 0.4), rgba(59, 130, 246, 0.4));
}

.team-role {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin: 0 0 16px 0;
    line-height: 1.8;
    min-height: 22px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.8125rem;
    width: 100%;
    position: relative;
    transition: all 0.3s ease;
}

.team-member:hover .team-role {
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 
        0 0 10px rgba(0, 255, 255, 0.5),
        0 0 20px rgba(255, 0, 255, 0.3);
}

/* unique role text shadows */
.team-member:nth-child(1):hover .team-role {
    text-shadow: 
        0 0 10px rgba(0, 255, 136, 0.3),
        0 0 20px rgba(0, 204, 102, 0.2);
}

.team-member:nth-child(2):hover .team-role {
    text-shadow: 
        0 0 10px rgba(236, 72, 153, 0.3),
        0 0 20px rgba(249, 115, 22, 0.2);
}

.team-member:nth-child(3):hover .team-role {
    text-shadow: 
        0 0 10px rgba(236, 72, 153, 0.3),
        0 0 20px rgba(244, 114, 182, 0.2);
}

.team-member:nth-child(4):hover .team-role {
    text-shadow: 
        0 0 10px rgba(234, 179, 8, 0.3),
        0 0 20px rgba(245, 158, 11, 0.2);
}

.team-member:nth-child(5):hover .team-role {
    text-shadow: 
        0 0 10px rgba(236, 72, 153, 0.3),
        0 0 20px rgba(244, 63, 94, 0.2);
}

.team-member:nth-child(6):hover .team-role {
    text-shadow: 
        0 0 10px rgba(16, 185, 129, 0.3),
        0 0 20px rgba(20, 184, 166, 0.2);
}

.team-member:nth-child(7):hover .team-role {
    text-shadow: 
        0 0 10px rgba(99, 102, 241, 0.3),
        0 0 20px rgba(139, 92, 246, 0.2);
}

.team-member:nth-child(8):hover .team-role {
    text-shadow: 
        0 0 10px rgba(6, 182, 212, 0.3),
        0 0 20px rgba(14, 165, 233, 0.2);
}

@keyframes glitchText {
    0%, 90%, 100% {
        transform: translate(0);
    }
    92% {
        transform: translate(-2px, 0);
    }
    94% {
        transform: translate(2px, 0);
    }
    96% {
        transform: translate(-1px, 0);
    }
}

.team-description {
    font-size: 1.0625rem;
    color: rgba(160, 160, 160, 0.9);
    margin: 16px 0 0 0;
    line-height: 1.75;
    max-width: 100%;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.3s ease,
                margin 0.3s ease;
}

.team-description.active {
    max-height: 500px;
    opacity: 1;
    margin: 16px 0 24px 0;
}

.team-dropdown-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 100%;
    padding: 6px;
    margin-top: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-radius: 4px;
    font-size: 0.75rem;
    position: relative;
    overflow: hidden;
}

.team-dropdown-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(0, 255, 255, 0.2), transparent);
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
    border-radius: 50%;
}

.team-dropdown-btn:hover::before {
    width: 300px;
    height: 300px;
}

.team-dropdown-btn:hover {
    background: var(--bg-hover);
    border-color: var(--text-primary);
    color: var(--text-primary);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

/* unique dropdown button effects */
.team-member:nth-child(1) .team-dropdown-btn:hover {
    box-shadow: 0 0 2px rgba(0, 255, 136, 0.15);
}
.team-member:nth-child(1) .team-dropdown-btn::before {
    background: radial-gradient(circle, rgba(0, 255, 136, 0.05), transparent);
}

.team-member:nth-child(2) .team-dropdown-btn:hover {
    box-shadow: 0 0 2px rgba(236, 72, 153, 0.15);
}
.team-member:nth-child(2) .team-dropdown-btn::before {
    background: radial-gradient(circle, rgba(236, 72, 153, 0.05), transparent);
}

.team-member:nth-child(3) .team-dropdown-btn:hover {
    box-shadow: 0 0 2px rgba(236, 72, 153, 0.15);
}
.team-member:nth-child(3) .team-dropdown-btn::before {
    background: radial-gradient(circle, rgba(236, 72, 153, 0.05), transparent);
}

.team-member:nth-child(4) .team-dropdown-btn:hover {
    box-shadow: 0 0 2px rgba(234, 179, 8, 0.15);
}
.team-member:nth-child(4) .team-dropdown-btn::before {
    background: radial-gradient(circle, rgba(234, 179, 8, 0.05), transparent);
}

.team-member:nth-child(5) .team-dropdown-btn:hover {
    box-shadow: 0 0 2px rgba(236, 72, 153, 0.15);
}
.team-member:nth-child(5) .team-dropdown-btn::before {
    background: radial-gradient(circle, rgba(236, 72, 153, 0.05), transparent);
}

.team-member:nth-child(6) .team-dropdown-btn:hover {
    box-shadow: 0 0 2px rgba(16, 185, 129, 0.15);
}
.team-member:nth-child(6) .team-dropdown-btn::before {
    background: radial-gradient(circle, rgba(16, 185, 129, 0.05), transparent);
}

.team-member:nth-child(7) .team-dropdown-btn:hover {
    box-shadow: 0 0 2px rgba(99, 102, 241, 0.15);
}
.team-member:nth-child(7) .team-dropdown-btn::before {
    background: radial-gradient(circle, rgba(99, 102, 241, 0.05), transparent);
}

.team-member:nth-child(8) .team-dropdown-btn:hover {
    box-shadow: 0 0 2px rgba(6, 182, 212, 0.15);
}
.team-member:nth-child(8) .team-dropdown-btn::before {
    background: radial-gradient(circle, rgba(6, 182, 212, 0.05), transparent);
}

.team-dropdown-btn i {
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    z-index: 1;
}

.team-dropdown-btn:hover i {
    transform: translateY(2px);
}

.team-dropdown-btn.active i {
    transform: rotate(180deg);
}

.team-dropdown-btn.active:hover i {
    transform: rotate(180deg) translateY(-2px);
}

.team-social {
    display: flex;
    gap: 12px;
    margin-top: auto;
    padding-top: 0;
    width: 100%;
    justify-content: flex-start;
}

.team-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: var(--text-secondary);
    font-size: 1.25rem;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.team-social a::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 255, 255, 0.2), rgba(255, 0, 255, 0.2));
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.team-social a:hover::before {
    width: 100px;
    height: 100px;
}

.team-social a:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
    border-color: var(--text-primary);
    transform: translateY(-5px) scale(1.15);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(0, 255, 255, 0.3);
}

/* unique social icon effects */
.team-member:nth-child(1) .team-social a:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 255, 136, 0.3);
}
.team-member:nth-child(1) .team-social a::before {
    background: radial-gradient(circle, rgba(0, 255, 136, 0.15), rgba(0, 204, 102, 0.1));
}

.team-member:nth-child(2) .team-social a:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 20px rgba(236, 72, 153, 0.3);
}
.team-member:nth-child(2) .team-social a::before {
    background: radial-gradient(circle, rgba(236, 72, 153, 0.15), rgba(249, 115, 22, 0.1));
}

.team-member:nth-child(3) .team-social a:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 20px rgba(236, 72, 153, 0.3);
}
.team-member:nth-child(3) .team-social a::before {
    background: radial-gradient(circle, rgba(236, 72, 153, 0.15), rgba(244, 114, 182, 0.1));
}

.team-member:nth-child(4) .team-social a:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 20px rgba(234, 179, 8, 0.3);
}
.team-member:nth-child(4) .team-social a::before {
    background: radial-gradient(circle, rgba(234, 179, 8, 0.15), rgba(245, 158, 11, 0.1));
}

.team-member:nth-child(5) .team-social a:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 20px rgba(236, 72, 153, 0.3);
}
.team-member:nth-child(5) .team-social a::before {
    background: radial-gradient(circle, rgba(236, 72, 153, 0.15), rgba(244, 63, 94, 0.1));
}

.team-member:nth-child(6) .team-social a:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 20px rgba(16, 185, 129, 0.3);
}
.team-member:nth-child(6) .team-social a::before {
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15), rgba(20, 184, 166, 0.1));
}

.team-member:nth-child(7) .team-social a:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 20px rgba(99, 102, 241, 0.3);
}
.team-member:nth-child(7) .team-social a::before {
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1));
}

.team-member:nth-child(8) .team-social a:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 20px rgba(6, 182, 212, 0.3);
}
.team-member:nth-child(8) .team-social a::before {
    background: radial-gradient(circle, rgba(6, 182, 212, 0.15), rgba(14, 165, 233, 0.1));
}

.team-social a i {
    position: relative;
    z-index: 1;
}

/* responsive design for team */
@media (max-width: 1024px) {
    .team-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .team h2 {
        font-size: 2.5rem;
        margin-bottom: 30px;
    }
    
    .team-member {
        padding: 35px 25px 25px;
    }
}

@media (max-width: 768px) {
    .team {
        margin-top: 80px;
    }
    
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }
    
    .team h2 {
        font-size: 2rem;
        margin-bottom: 25px;
    }
    
    .team h2.pixelated-title {
        font-size: 1.5rem;
        line-height: 1.6;
    }
    
    .team-member {
        padding: 25px 20px 20px;
    }
    
    .team-member h3 {
        font-size: 1.3rem;
        margin-bottom: 10px;
    }
    
    .team-role {
        font-family: 'Press Start 2P', cursive;
        font-size: 0.75rem;
        min-height: 20px;
        margin-bottom: 14px;
    }
    
    .team-description {
        font-size: 1rem;
        margin-bottom: 20px;
        line-height: 1.7;
    }
    
    .team-social {
        padding-top: 0;
    }
    
    .team-social a {
        width: 40px;
        height: 40px;
        font-size: 1.125rem;
    }
    
    .team-dropdown-btn {
        padding: 5px;
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .team {
        margin-top: 60px;
    }
    
    .team-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .team h2 {
        font-size: 1.75rem;
        margin-bottom: 20px;
    }
    
    .team h2.pixelated-title {
        font-size: 1.25rem;
        line-height: 1.6;
    }
    
    .team-member {
        padding: 20px 18px 18px;
    }
    
    .team-member h3 {
        font-size: 1.25rem;
        margin-bottom: 10px;
    }
    
    .team-role {
        font-family: 'Press Start 2P', cursive;
        font-size: 0.75rem;
        min-height: 18px;
        margin-bottom: 12px;
    }
    
    .team-description {
        font-size: 0.9375rem;
        margin-bottom: 18px;
        line-height: 1.65;
    }
    
    .team-social {
        padding-top: 0;
    }
    
    .team-social a {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
    
    .team-dropdown-btn {
        padding: 5px;
        font-size: 0.65rem;
    }
}