/* =====================================================
   Section Container
   ===================================================== */
.team-section {
    padding: 80px 0;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

/* ── Animated ambient orbs ── */
    [data-theme="dark"] .team-section::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: 
            radial-gradient(circle at 20% 30%, rgba(0, 242, 254, 0.08) 0%, transparent 50%),
            radial-gradient(circle at 80% 70%, rgba(255, 0, 127, 0.06) 0%, transparent 50%);
        pointer-events: none;
        z-index: 0;
    }

    [data-theme="light"] .team-section::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: 
            radial-gradient(circle at 20% 30%, rgb(114 137 72 / 7%) 0%, transparent 50%),
            radial-gradient(circle at 80% 70%, rgb(207 255 121 / 13%) 0%, transparent 50%);
        pointer-events: none;
        z-index: 0;
    }

/* =====================================================
   Section Header — scroll-animated entrance
   ===================================================== */
.team-header {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
    z-index: 1;
}

/* Gradient subheading pill */
.team-subheading {
    display: inline-block;
    background: var(--gradient-secondary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 14px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.team-subheading.anim-in {
    opacity: 1;
    transform: translateY(0);
}

.team-title {
    font-size: 48px;
    font-weight: 800;
    margin: 0 0 16px 0;
    color: var(--text-primary);
    letter-spacing: -1px;
    line-height: 1.2;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease 0.1s, transform 0.7s ease 0.1s;
}
.team-title.anim-in {
    opacity: 1;
    transform: translateY(0);
}

.team-subtitle {
    font-size: 17px;
    color: var(--text-secondary);
    margin: 0 auto;
    max-width: 560px;
    line-height: 1.7;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease 0.2s, transform 0.7s ease 0.2s;
}
.team-subtitle.anim-in {
    opacity: 1;
    transform: translateY(0);
}

/* =====================================================
   Team Slider
   ===================================================== */
.team-slider {
    position: relative;
    padding: 14px 0;
    z-index: 1;
}

.slider-container {
    overflow: hidden;
    margin-bottom: 20px;
}

.slider-track {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    gap: 30px;
}

/* =====================================================
   Team Member Card
   ===================================================== */
.team-member {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    overflow: hidden;
    position: relative;
    flex: 0 0 calc(25% - 22.5px);
    z-index: 1;
    cursor: pointer;
    perspective: 1200px;
    transform-style: preserve-3d;
    /* lift transition handled separately */
    transition: border-color 0.4s ease,
                box-shadow 0.4s ease,
                transform 0.5s cubic-bezier(0.25,1,0.5,1);
    animation: memberFloat 5s ease-in-out infinite, memberRotate 6s ease-in-out infinite;
    animation-delay: var(--member-delay, 0s), var(--rotate-delay, 0s);
    opacity: 0;
    transform: translateY(60px) scale(0.6);
    transition: opacity 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.team-member.reveal-active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

@keyframes memberFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes memberRotate {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(0.5deg); }
    75% { transform: rotate(-0.5deg); }
}

.team-member:nth-child(1) { --member-delay: 0s; --rotate-delay: 0s; }
.team-member:nth-child(2) { --member-delay: 0.5s; --rotate-delay: 0.5s; }
.team-member:nth-child(3) { --member-delay: 1s; --rotate-delay: 1s; }
.team-member:nth-child(4) { --member-delay: 1.5s; --rotate-delay: 1.5s; }
.team-member:nth-child(5) { --member-delay: 2s; --rotate-delay: 2s; }
.team-member:nth-child(6) { --member-delay: 2.5s; --rotate-delay: 2.5s; }
[data-theme="light"] .team-member {
    background: #ffffff;
    box-shadow: 0 6px 24px rgba(0,0,0,0.05);
}

.team-member:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 24px 60px var(--shadow-color);
    transform: translateY(-10px);
    animation: none;
}

/* ── Scroll reveal ── */
.team-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.75s cubic-bezier(0.25,1,0.5,1),
                transform 0.75s cubic-bezier(0.25,1,0.5,1);
}
.team-reveal.reveal-active {
    opacity: 1;
    transform: translateY(0);
}

/* ── Directional door overlay (same as wwd section) ── */
.team-card-door {
    position: absolute;
    inset: 0;
    border-radius: 17px;
    background: var(--gradient-primary);
    z-index: 3;
    pointer-events: none;
    transform-origin: left center;
    transform: rotateY(90deg);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.25,1,0.5,1), opacity 0.45s ease;
}
[data-theme="light"] .team-card-door {
    background: linear-gradient(135deg, rgba(114,137,72,0.85), rgba(171,211,115,0.85));
}

/* =====================================================
   Team Image
   ===================================================== */
.team-image-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1.25;
}

.team-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.65s cubic-bezier(0.25,1,0.5,1);
}
.team-member:hover .team-image {
    transform: scale(1.1);
}

/* =====================================================
   Info Overlay — glassmorphic slide-up
   ===================================================== */
.team-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 58%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding: 26px 20px 22px;
    text-align: center;
    background: linear-gradient(to top,
        rgba(7,5,20,0.97) 0%,
        rgba(7,5,20,0.68) 55%,
        transparent 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 2;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.45s cubic-bezier(0.25,1,0.5,1),
                transform 0.45s cubic-bezier(0.25,1,0.5,1);
}
[data-theme="light"] .team-info {
    background: linear-gradient(to top,
        rgba(255,255,255,0.98) 0%,
        rgba(255,255,255,0.78) 55%,
        transparent 100%);
}

.team-member:hover .team-info {
    opacity: 1;
    transform: translateY(0);
}

/* Name */
.team-name {
    font-size: 19px;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: #ffffff;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.4s cubic-bezier(0.25,1,0.5,1) 0.06s,
                transform 0.4s cubic-bezier(0.25,1,0.5,1) 0.06s;
}
[data-theme="light"] .team-name { color: var(--text-primary); }

.team-member:hover .team-name {
    opacity: 1;
    transform: translateY(0);
}

/* Role */
.team-role {
    font-size: 12.5px;
    color: var(--accent-primary);
    font-weight: 600;
    margin: 0 0 16px 0;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.4s cubic-bezier(0.25,1,0.5,1) 0.12s,
                transform 0.4s cubic-bezier(0.25,1,0.5,1) 0.12s;
}
.team-member:hover .team-role {
    opacity: 1;
    transform: translateY(0);
}

/* ── Social icons ── */
.team-social {
    display: flex;
    gap: 10px;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.4s cubic-bezier(0.25,1,0.5,1) 0.18s,
                transform 0.4s cubic-bezier(0.25,1,0.5,1) 0.18s;
}
.team-member:hover .team-social {
    opacity: 1;
    transform: translateY(0);
}

.team-social a {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 13px;
    text-decoration: none;
    transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}
[data-theme="light"] .team-social a {
    background: rgba(0,0,0,0.07);
    border-color: rgba(0,0,0,0.15);
    color: var(--text-primary);
}

.team-social a:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #ffffff;
    transform: scale(1.18) rotate(-6deg);
    box-shadow: 0 4px 14px var(--shadow-color);
}
[data-theme="light"] .team-social a:hover {
    color: #ffffff;
}

/* Stagger each social icon */
.team-social a:nth-child(1) { transition-delay: 0.18s; }
.team-social a:nth-child(2) { transition-delay: 0.23s; }
.team-social a:nth-child(3) { transition-delay: 0.28s; }

/* =====================================================
   Slider Controls & Pagination Dots
   ===================================================== */
.slider-controls-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 32px;
    position: relative;
    z-index: 1;
}

.slider-nav {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.slider-arrow {
    width: 46px;
    height: 46px;
    background: transparent;
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--accent-primary);
    position: relative;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.25,1,0.5,1),
                box-shadow 0.35s ease,
                color 0.3s ease;
}
.slider-arrow::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--accent-primary);
    transform: scale(0);
    transition: transform 0.35s cubic-bezier(0.25,1,0.5,1);
    z-index: 0;
}
.slider-arrow:hover::before { transform: scale(1); }
.slider-arrow:hover {
    color: #ffffff;
    transform: scale(1.12);
    box-shadow: 0 0 20px var(--shadow-color);
}
.slider-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}
.slider-arrow:focus {
    outline: none;
}
.slider-arrow svg {
    width: 20px;
    height: 20px;
    position: relative;
    z-index: 1;
}

/* Dots */
.slider-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.25,1,0.5,1);
}
[data-theme="light"] .slider-dot {
    background: rgba(0,0,0,0.15);
}
.slider-dot.active {
    width: 26px;
    border-radius: 4px;
    background: var(--accent-primary);
    box-shadow: 0 0 12px var(--accent-primary);
}

/* =====================================================
   Responsive
   ===================================================== */
@media (max-width: 1200px) {
    .team-member { flex: 0 0 calc(33.333% - 20px); }
}

@media (max-width: 768px) {
    .team-section { padding: 40px 0; }
    .team-header { margin-bottom: 40px; }
    .team-title { font-size: 36px; }
    .team-subtitle { font-size: 15px; }
    .team-member { flex: 0 0 calc(50% - 15px); }
    .team-name { font-size: 17px; }
    .slider-arrow { width: 40px; height: 40px; }
    .slider-arrow svg { width: 18px; height: 18px; }
}

@media (max-width: 576px) {
    .team-member { flex: 0 0 100%; }
    .team-title { font-size: 30px; }
}
