/* Team carousel — geometry mapped from the 1310 × 340 reference container. */
.team-section {
    --tm-blue: #2563eb;
    --tm-indigo: #4f46e5;
    --tm-purple: #7c3aed;
    --tm-text: #f8fafc;
    --tm-muted: #8b93a7;
    --tm-duration: 700ms;
    --tm-easing: cubic-bezier(0.22, 1, 0.36, 1);

    container-type: inline-size;
    direction: ltr;
    position: relative;
    width: min(96%, 1310px);
    max-width: 1310px;
    aspect-ratio: 1310 / 370;
    margin: 48px auto;
    overflow: hidden;
    color: var(--tm-text);
    border: 1px solid rgba(148, 163, 184, 0.13);
    border-radius: clamp(16px, 1.85cqw, 24px);
    background:
        radial-gradient(72% 145% at 64% 8%, rgba(79, 70, 229, 0.17), transparent 58%),
        radial-gradient(60% 110% at 8% 90%, rgba(37, 99, 235, 0.11), transparent 56%),
        linear-gradient(155deg, #0b1020 0%, #070a14 48%, #04050b 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 35px 90px -42px rgba(2, 6, 23, 0.95);
}

.team-section__inner {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: 29.24% 70.76%;
    padding: 0;
}

/* Reference text zone: x≈48 inside the container, width≈300. */
.team-section__intro {
    direction: rtl;
    box-sizing: border-box;
    width: 22.9cqw;
    margin-left: 3.66cqw;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1.15cqw;
    text-align: right;
}

.team-section__eyebrow {
    color: #818cf8;
    font-size: clamp(9px, 0.84cqw, 11px);
    font-weight: 700;
    letter-spacing: 0.14em;
}

.team-section__title {
    margin: 0;
    color: #fff;
    font-size: clamp(20px, 2.32cqw, 30px);
    font-weight: 800;
    line-height: 1.3;
}

.team-section__title-accent {
    color: transparent;
    background: linear-gradient(90deg, #60a5fa, var(--tm-purple));
    background-clip: text;
    -webkit-background-clip: text;
}

.team-section__desc {
    max-width: 100%;
    margin: 0;
    color: var(--tm-muted);
    font-size: clamp(10px, 0.92cqw, 12px);
    line-height: 1.85;
}

.team-section__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.65cqw;
    margin-top: 0.35cqw;
    padding: 0.78cqw 1.42cqw;
    color: #fff;
    border-radius: 0.7cqw;
    background: linear-gradient(90deg, var(--tm-blue), var(--tm-purple));
    box-shadow: 0 14px 32px -14px rgba(79, 70, 229, 0.9);
    font-size: clamp(10px, 0.92cqw, 12px);
    font-weight: 700;
    text-decoration: none;
    transition:
        transform 250ms ease,
        filter 250ms ease,
        box-shadow 250ms ease;
}

.team-section__cta svg {
    width: 1.2cqw;
    height: 1.2cqw;
    min-width: 14px;
    min-height: 14px;
    transform: scaleX(-1);
}

.team-section__cta:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
    box-shadow: 0 18px 38px -14px rgba(79, 70, 229, 1);
}

/* Carousel zone begins at 29.24% (≈383px) of the reference container. */
.team-carousel {
    direction: ltr;
    position: relative;
    width: 100%;
    height: 100%;
    min-width: 0;
    outline: none;
}

.team-carousel:focus-visible {
    outline: 2px solid #818cf8;
    outline-offset: -4px;
}

.team-carousel__stage {
    position: absolute;
    inset: 0;
    perspective: 1600px;
    overflow: visible;
    touch-action: pan-y;
}

/*
 * Cards are anchored by their top edge. Reference normal top≈37px inside
 * the container; active top≈20px. Width/height are genuine per state.
 * The corrected raw dimensions compensate for each state's requested scale,
 * so the final painted geometry matches the measured reference dimensions.
 */
.tm-card {
    position: absolute;
    left: 48.11%;
    top: 3.97cqw;
    width: 15.81cqw;
    height: 21.98cqw;
    margin: 0;
    overflow: hidden;
    opacity: 0;
    z-index: 0;
    cursor: pointer;
    border: 1px solid rgba(111, 118, 255, 0.38);
    border-radius: 1.15cqw;
    background: linear-gradient(180deg, #11172a, #080c17);
    box-shadow: 0 15px 32px -22px rgba(0, 0, 0, 0.9);
    translate: -50% 0;
    transform: scale(0.7);
    transform-origin: top center;
    will-change: left, top, width, height, transform, opacity;
    transition:
        left var(--tm-duration) var(--tm-easing),
        top var(--tm-duration) var(--tm-easing),
        width var(--tm-duration) var(--tm-easing),
        height var(--tm-duration) var(--tm-easing),
        transform var(--tm-duration) var(--tm-easing),
        opacity var(--tm-duration) var(--tm-easing),
        box-shadow var(--tm-duration) var(--tm-easing),
        border-color var(--tm-duration) var(--tm-easing);
}

.team-carousel__stage:not(.is-ready) .tm-card {
    transition: none;
}

.tm-card__media,
.tm-card__overlay {
    position: absolute;
    inset: 0;
}

.tm-card__media {
    overflow: hidden;
}

.tm-card__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: transform 600ms var(--tm-easing);
}

.tm-card__overlay {
    background: linear-gradient(
        to top,
        rgba(4, 6, 13, 0.98) 0%,
        rgba(4, 6, 13, 0.78) 21%,
        rgba(4, 6, 13, 0.18) 48%,
        transparent 70%
    );
}

.tm-card__info {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    z-index: 3;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 6px;
    padding: 0.9cqw 0.9cqw 1cqw;
}

.tm-card__text {
    direction: rtl;
    min-width: 0;
    text-align: right;
}

.tm-card__name,
.tm-card__role {
    overflow: hidden;
    margin: 0;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.tm-card__name {
    color: #fff;
    font-size: clamp(10px, 0.91cqw, 12px);
    font-weight: 800;
    line-height: 1.35;
}

.tm-card__role {
    margin-top: 2px;
    color: #9fb0d0;
    font-size: clamp(8px, 0.7cqw, 10px);
    font-weight: 500;
}

.tm-card__cta {
    display: inline-block;
    margin-top: 6px;
    color: #0798e8;
    font-size: clamp(8px, 0.65cqw, 10px);
    font-weight: 700;
}

.tm-card__linkedin {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85cqw;
    height: 1.85cqw;
    min-width: 22px;
    min-height: 22px;
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 0.5cqw;
    background: rgba(148, 163, 184, 0.14);
    transition:
        color 250ms ease,
        background 250ms ease,
        transform 250ms ease;
}

.tm-card__linkedin svg {
    width: 52%;
    height: 52%;
}

.tm-card__linkedin:hover {
    color: #fff;
    background: #0a66c2;
    transform: translateY(-2px);
}

.tm-card__badge {
    position: absolute;
    top: 0.72cqw;
    right: 0.72cqw;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.15cqw;
    height: 2.15cqw;
    color: #fff;
    opacity: 0;
    border-radius: 0.65cqw;
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    box-shadow: 0 8px 18px -6px rgba(124, 58, 237, 0.9);
    transform: scale(0.5);
    transform-origin: top right;
    pointer-events: none;
    transition:
        opacity 450ms var(--tm-easing),
        transform 450ms var(--tm-easing),
        width var(--tm-duration) var(--tm-easing),
        height var(--tm-duration) var(--tm-easing);
}

.tm-card__badge svg {
    width: 54%;
    height: 54%;
}

.tm-card--featured .tm-card__badge {
    opacity: 0.85;
    transform: scale(0.88);
}

/* Painted geometry: -2 ≈157×257, -1 ≈158×258, active 207×288. */
.tm-card.is-p-neg2 {
    left: calc(48.11% - 25.19cqw);
    width: 15.36cqw;
    height: 25.15cqw;
    opacity: 0.9;
    z-index: 1;
    transform: translateZ(-80px) scale(0.78) rotateY(-15deg);
}

.tm-card.is-p-neg1 {
    left: calc(48.11% - 12.98cqw);
    width: 14.71cqw;
    height: 24.02cqw;
    opacity: 0.95;
    z-index: 2;
    transform: translateZ(-30px) scale(0.82) rotateY(-8deg);
}

.tm-card.is-p0 {
    left: 48.11%;
    top: calc(3.97cqw - 1.3cqw);
    width: 15.81cqw;
    height: 21.98cqw;
    opacity: 1;
    z-index: 10;
    border-color: transparent;
    transform: scale(1) rotate(0deg);
    box-shadow:
        0 0 0 1px rgba(129, 140, 248, 0.42),
        0 18px 38px -18px rgba(2, 6, 23, 0.9),
        0 0 20px rgba(99, 102, 241, 0.34),
        0 0 42px rgba(124, 58, 237, 0.28),
        0 0 65px rgba(79, 70, 229, 0.2);
}

.tm-card.is-p-pos1 {
    left: calc(48.11% + 12.98cqw);
    width: 16.1cqw;
    height: 23.92cqw;
    opacity: 0.95;
    z-index: 2;
    transform: translateZ(-30px) scale(0.82) rotateY(8deg);
}

.tm-card.is-p-pos2 {
    left: calc(48.11% + 25.19cqw);
    width: 16.15cqw;
    height: 25.15cqw;
    opacity: 0.9;
    z-index: 1;
    transform: translateZ(-80px) scale(0.78) rotateY(15deg);
}

.tm-card.is-hidden-left {
    left: calc(48.11% - 42cqw);
    width: 15.36cqw;
    height: 25.15cqw;
    opacity: 0;
    z-index: 0;
    transform: translateZ(-120px) scale(0.68) rotateY(-18deg);
    pointer-events: none;
}

.tm-card.is-hidden-right {
    left: calc(48.11% + 42cqw);
    width: 16.15cqw;
    height: 25.15cqw;
    opacity: 0;
    z-index: 0;
    transform: translateZ(-120px) scale(0.68) rotateY(18deg);
    pointer-events: none;
}

.tm-card.is-p0::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 5;
    padding: 1.5px;
    border-radius: inherit;
    background: linear-gradient(150deg, #9aa9ff, #6366f1 48%, #7c3aed);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    pointer-events: none;
}

.tm-card.is-p0 .tm-card__badge {
    width: 2.55cqw;
    height: 2.55cqw;
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 9px 23px -5px rgba(124, 58, 237, 1);
}

.tm-card.is-p0:hover .tm-card__media img {
    transform: scale(1.045);
}

.team-carousel__nav {
    position: absolute;
    top: 50%;
    z-index: 20;
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.74);
    cursor: pointer;
    transform: translateY(-50%);
}

.team-carousel__nav.is-enabled {
    display: inline-flex;
}

.team-carousel__prev { left: 8px; }
.team-carousel__next { right: 8px; }
.team-carousel__nav svg { width: 19px; height: 19px; }

/* Pagination is centered relative to the carousel zone, not the page. */
.team-carousel__pagination {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 1.45cqw;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.46cqw;
}

.team-carousel__dot {
    width: 1.38cqw;
    height: 0.25cqw;
    min-height: 3px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.3);
    cursor: pointer;
    transition:
        width 350ms var(--tm-easing),
        background 350ms var(--tm-easing);
}

.team-carousel__dot.is-active {
    width: 2.15cqw;
    background: linear-gradient(90deg, var(--tm-blue), var(--tm-purple));
}

.team-carousel__dot:focus-visible,
.team-carousel__nav:focus-visible {
    outline: 2px solid #818cf8;
    outline-offset: 3px;
}

/* Tablet: preserve the visual language but expose three cards. */
@media (max-width: 1100px) {
    .team-section {
        width: min(96%, 900px);
        min-height: 500px;
        aspect-ratio: auto;
    }

    .team-section__inner {
        position: relative;
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: auto 340px;
        padding: 28px 20px 14px;
    }

    .team-section__intro {
        width: min(520px, 90%);
        margin: 0 auto;
        align-items: center;
        gap: 12px;
        text-align: center;
    }

    .team-section__title { font-size: 28px; }
    .team-section__desc { font-size: 13px; }
    .team-section__cta { padding: 10px 20px; font-size: 12px; }

    .team-carousel {
        width: 100%;
        max-width: 650px;
        margin: 0 auto;
    }

    .team-carousel__stage { inset: 0; }
    .tm-card { top: 34px; border-radius: 16px; }

    .tm-card.is-p-neg1 {
        left: calc(50% - 150px);
        width: 190px;
        height: 305px;
    }

    .tm-card.is-p0 {
        left: 50%;
        top: 16px;
        width: 205px;
        height: 310px;
    }

    .tm-card.is-p-pos1 {
        left: calc(50% + 150px);
        width: 190px;
        height: 305px;
    }

    .tm-card.is-p-neg2,
    .tm-card.is-hidden-left {
        left: calc(50% - 320px);
        opacity: 0;
    }

    .tm-card.is-p-pos2,
    .tm-card.is-hidden-right {
        left: calc(50% + 320px);
        opacity: 0;
    }

    .team-carousel__pagination { bottom: 2px; gap: 6px; }
    .team-carousel__dot { width: 18px; height: 3px; }
    .team-carousel__dot.is-active { width: 28px; }
}

/* Mobile: one active card, adjacent cards remain offstage for smooth swipes. */
@media (max-width: 640px) {
    .team-section {
        width: calc(100% - 24px);
        min-height: 610px;
        margin: 28px 12px;
    }

    .team-section__inner {
        grid-template-rows: auto 380px;
        padding-inline: 14px;
    }

    .team-section__title { font-size: 24px; }

    .tm-card.is-p0 {
        left: 50%;
        top: 20px;
        width: 230px;
        height: 320px;
    }

    .tm-card.is-p-neg1,
    .tm-card.is-p-neg2,
    .tm-card.is-hidden-left {
        left: calc(50% - 310px);
        opacity: 0;
    }

    .tm-card.is-p-pos1,
    .tm-card.is-p-pos2,
    .tm-card.is-hidden-right {
        left: calc(50% + 310px);
        opacity: 0;
    }

    .tm-card__info { padding: 14px; }
    .tm-card__name { font-size: 15px; }
    .tm-card__role { font-size: 11px; }
    .tm-card__linkedin { width: 28px; height: 28px; }
    .tm-card.is-p0 .tm-card__badge { width: 34px; height: 34px; }
}

@media (prefers-reduced-motion: reduce) {
    .tm-card,
    .tm-card__media img,
    .tm-card__badge,
    .team-section__cta,
    .team-carousel__dot {
        transition: none !important;
    }
}
