/* =========================================
   1. HEADER & GHOST TEXT STYLES
   ========================================= */
.team-hero-section {
    position: relative;
    background-color: var(--bg-light);
    padding: 120px 0;
    text-align: center;
    overflow: hidden;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 42px;
}

.team-ghost-text {
    position: absolute;
    top: 59%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-heading);
    font-size: clamp(150px, 39vw, 400px); /* Responsive font size */
    font-weight: 800;
    color: rgba(0, 0, 0, 0.03);
    z-index: 1;
    pointer-events: none;
    user-select: none;
    line-height: 1;
    white-space: nowrap;
}

.team-hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1300px; /* Matches .container */
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: flex-end; /* Aligns content to the right on desktop */
}

.team-heading-group {
    display: flex;
    align-items: center;
    gap: 25px;
    text-align: left;
}

.line-container {
    width: 4px; /* Length of the line */
    height: 100px;
    background-color: transparent; /* Faint grey track (optional) */
    margin-bottom: 20px;
    overflow: hidden;
    border-radius: 2px;
}

.team-sub-heading {
    font-size: 1.2rem;
    font-family: var(--font-body);
    font-weight: 500;
    color: var(--color-dark);
    margin: 0;
}

.team-main-heading {
    font-family: var(--font-heading);
    font-size: 4rem;
    color: var(--color-text-black);
    line-height: 1.1;
    margin: 0;
}

/* Responsive adjustments for the header */
@media screen and (max-width: 768px) {
    .team-hero-content {
        justify-content: center; /* Center content on mobile */
    }
    .team-heading-group {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .line-container {
        width: 100px; /* Length of the line */
        height: 4px;
        background-color: transparent; /* Faint grey track (optional) */
        margin-bottom: 20px;
        overflow: hidden;
        border-radius: 2px;
    }

    .team-main-heading {
        font-size: 3rem;
    }
}

/* =========================================
   2. TEAM CARD CONTAINER & ANIMATIONS
   ========================================= */
.team-grid-section {
    background-color: var(--bg-light);
    padding: 80px 0 120px 0;
}

.team-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 40px;
}

/* -- User-Provided Animation Keyframes -- */
@keyframes slide-in {
    from {
        opacity: 0;
        scale: 0.9;
        rotate: calc((var(--side, 1) * (3deg * var(--amp, 1))));
    }
    to {
        opacity: 1;
        scale: 1;
        rotate: 0deg;
    }
}

.card-animation-layer {
    /* Apply animation if supported and not disabled by user */
    @media (prefers-reduced-motion: no-preference) {
        @supports (animation-timeline: view()) {
            animation: slide-in linear both;
            animation-timeline: view();
            /* Defines when the animation triggers while scrolling */
            animation-range: entry 0% cover 20%;
        }
    }
}

/* =========================================
   3. INDIVIDUAL TEAM CARD STYLES
   ========================================= */
.team-card {
    background-color: var(--color-white);
    border-radius: 12px;
    text-decoration: none;
    display: block;
    color: var(--color-dark);
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.team-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.team-card-image-wrapper {
    background-color: #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1 / 1; /* Makes it a perfect square */
    margin-bottom: 20px;
}

.team-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-card-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 20px 20px 20px;
}

.team-card-line {
    width: 2px;
    height: 60px;
    background-color: #e2e8f0;
    margin-right: 15px;
}

.team-card-info {
    flex-grow: 1;
}

.team-card-name {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-black);
    margin: 0 0 5px 0;
}

.team-card-role {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--color-dark);
    margin: 0;
}

.team-card-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: var(--color-primary);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: background-color 0.3s ease;
}

.team-card:hover .team-card-icon {
    background-color: #0077d9;
}
