/* ROS2026 — Team detail page
   Shared layout for all team profile pages (team/<slug>.html).
   Only content changes per team: hero media, logo, captain banner,
   member images, team name/subtitle text, and --team-accent.
*/

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

    body.team-page {
        background: var(--bg-void);
        color: var(--fg-primary);
        font-family: var(--font-body);
        overflow-x: hidden;
    }

/* ============== BACK BUTTON ============== */
.team-back {
    position: fixed;
    top: 18px;
    left: 18px;
    z-index: 50;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px 9px 14px;
    border-radius: var(--r-pill);
    border: 1px solid var(--line-strong);
    background: rgba(7, 7, 12, 0.55);
    backdrop-filter: blur(8px);
    color: var(--fg-primary);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background 220ms ease, border-color 220ms ease, transform 220ms ease;
}

    .team-back svg {
        flex-shrink: 0;
    }

    .team-back:hover,
    .team-back:focus-visible {
        background: rgba(7, 7, 12, 0.85);
        border-color: var(--team-accent, var(--line-gold));
        transform: translateX(-2px);
    }

/* ============== HERO ============== */
.team-hero {
    position: relative;
    width: 100%;
    height: 64vh;
    min-height: 420px;
    max-height: 680px;
    overflow: hidden;
    background: var(--bg-void);
}

.team-hero-media {
    position: absolute;
    inset: 0;
}

.team-hero-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    display: block;
}

.team-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(7, 7, 12, 0.97) 0%, rgba(7, 7, 12, 0.88) 30%, rgba(7, 7, 12, 0.42) 58%, rgba(7, 7, 12, 0.08) 78%), linear-gradient(180deg, rgba(7, 7, 12, 0.05) 0%, rgba(7, 7, 12, 0) 45%, rgba(7, 7, 12, 0.65) 88%, var(--bg-void) 100%);
}

.team-hero-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 10px;
    max-width: min(600px, 62%);
    padding: 0 6vw;
}

.team-hero-logo {
    width: clamp(96px, 15vw, 190px);
    height: auto;
    margin-bottom: 4px;
    filter: drop-shadow(0 0 22px var(--team-accent, rgba(255, 184, 28, 0.35)));
}

.team-hero-label {
    margin: 0;
    font-family: 'Chonburi', var(--font-display);
    font-weight: 400;
    font-size: clamp(18px, 2.6vw, 30px);
    color: var(--fg-primary);
    letter-spacing: 0.02em;
}

.team-hero-name {
    margin: 0;
    font-family: 'Chonburi', var(--font-display);
    font-weight: 400;
    font-size: clamp(26px, 4.4vw, 54px);
    line-height: 1.15;
    color: #FFFFFF;
    text-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
    white-space: nowrap;
}

.team-hero-subtitle {
    margin: 4px 0 0;
    font-family: var(--font-body);
    font-size: clamp(12px, 1.4vw, 15px);
    font-weight: 500;
    color: #FFFFFF;
    letter-spacing: 0.03em;
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.9), 0 0 14px rgba(255, 255, 255, 0.55), 0 0 30px rgba(255, 255, 255, 0.35), 0 0 46px var(--team-accent, rgba(255, 184, 28, 0.45));
}

/* ============== MOTION ============== */
@keyframes teamFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes teamFadeUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

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

@keyframes teamFloat {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

@keyframes teamKenBurns {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.08);
    }
}

.team-hero-video {
    animation: teamKenBurns 24s ease-in-out infinite alternate;
    transform-origin: center;
}

.team-hero-logo {
    animation: teamFadeIn 700ms ease both, teamFloat 5s ease-in-out 700ms infinite;
}

.team-hero-label {
    animation: teamFadeUp 700ms ease 120ms both;
}

.team-hero-name {
    animation: teamFadeUp 700ms ease 220ms both;
}

.team-hero-subtitle {
    animation: teamFadeUp 700ms ease 340ms both;
}

/* ============== CAPTAIN ============== */
.team-captain-section {
    padding: 48px 20px 8px;
    display: flex;
    justify-content: center;
    background: var(--bg-void);
}

.team-captain-banner {
    width: 100%;
    max-width: 920px;
    height: auto;
    display: block;
    filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.5));
    opacity: 0;
    transform: translateY(28px) scale(0.98);
    transition: opacity 750ms cubic-bezier(.16,.84,.44,1), transform 750ms cubic-bezier(.16,.84,.44,1);
}

    .team-captain-banner.in-view {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

/* ============== TEAM MEMBERS ============== */
.team-members-section {
    position: relative;
    padding: 40px 20px 80px;
    overflow: hidden;
}

.team-members-bg {
    position: absolute;
    inset: 0;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.9) 22%, rgba(0, 0, 0, 0.9) 100%);
    mask-image: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.9) 22%, rgba(0, 0, 0, 0.9) 100%);
    opacity: 0.65;
}

.team-members-title {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    max-width: 520px;
    margin: 0 auto 34px;
    font-family: 'Chonburi', var(--font-display);
    font-weight: 400;
    font-size: 17px;
    letter-spacing: 0.06em;
    color: var(--fg-primary);
    text-transform: uppercase;
}

    .team-members-title::before,
    .team-members-title::after {
        content: '';
        flex: 1 1 auto;
        height: 2px;
        background: linear-gradient(90deg, transparent, var(--line-strong), var(--line-strong));
    }

    .team-members-title::after {
        background: linear-gradient(90deg, var(--line-strong), var(--line-strong), transparent);
    }

    .team-members-title span {
        flex-shrink: 0;
        position: relative;
        padding: 0 4px;
    }

.team-members-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    max-width: 920px;
    margin: 0 auto;
}

    .team-members-grid img {
        display: block;
        width: 100%;
        height: auto;
        border-radius: 4px;
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 650ms cubic-bezier(.16,.84,.44,1), transform 450ms cubic-bezier(.16,.84,.44,1), filter 260ms ease;
    }

        .team-members-grid img.in-view {
            opacity: 1;
            transform: translateY(0);
        }

        .team-members-grid img:nth-child(1) {
            transition-delay: 0ms;
        }

        .team-members-grid img:nth-child(2) {
            transition-delay: 70ms;
        }

        .team-members-grid img:nth-child(3) {
            transition-delay: 140ms;
        }

        .team-members-grid img:nth-child(4) {
            transition-delay: 210ms;
        }

        .team-members-grid img:nth-child(5) {
            transition-delay: 280ms;
        }

        .team-members-grid img:nth-child(6) {
            transition-delay: 350ms;
        }

        .team-members-grid img:nth-child(7) {
            transition-delay: 420ms;
        }

        .team-members-grid img:nth-child(8) {
            transition-delay: 490ms;
        }

        .team-members-grid img:hover {
            transform: translateY(-4px);
            filter: drop-shadow(0 10px 22px var(--team-accent, rgba(255, 184, 28, 0.3)));
            transition-delay: 0ms;
        }

@media (max-width: 860px) {
    .team-members-grid {
        max-width: 640px;
        gap: 12px;
    }
}

@media (max-width: 640px) {
    .team-hero {
        height: 58vh;
        min-height: 360px;
    }

    .team-hero-content {
        max-width: 84%;
        padding: 0 20px;
    }

    .team-captain-section {
        padding: 36px 16px 4px;
    }

    .team-members-section {
        padding: 32px 14px 56px;
    }

    .team-members-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: 420px;
        gap: 14px;
    }

    .team-members-title {
        font-size: 13px;
        margin-bottom: 24px;
    }
}

@media (max-width: 380px) {
    .team-back {
        top: 12px;
        left: 12px;
        padding: 7px 14px 7px 12px;
        font-size: 12px;
    }

    .team-hero-content {
        max-width: 90%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .team-hero-video,
    .team-hero-logo,
    .team-hero-label,
    .team-hero-name,
    .team-hero-subtitle {
        animation: none !important;
    }

    .team-captain-banner,
    .team-members-grid img {
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}


/* ============== HERO PLAY BUTTON (centered, opens video fullscreen) ============== */
.team-hero-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 3;
    transform: translate(-50%, -50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.75);
    background: rgba(7, 7, 12, 0.35);
    backdrop-filter: blur(4px);
    color: #fff;
    cursor: pointer;
    padding: 0;
    animation: teamFadeIn 700ms ease 300ms both, teamPlayPulse 2.6s ease-in-out 1s infinite;
    transition: transform 220ms ease, background 220ms ease, border-color 220ms ease, color 220ms ease;
}

    .team-hero-play-btn svg {
        margin-left: 4px; /* optical centering of the play triangle */
    }

    .team-hero-play-btn:hover,
    .team-hero-play-btn:focus-visible {
        background: var(--team-accent, rgba(255, 184, 28, 0.9));
        border-color: var(--team-accent, #fff);
        color: var(--bg-void);
        transform: translate(-50%, -50%) scale(1.08);
    }

@keyframes teamPlayPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.28);
    }

    50% {
        box-shadow: 0 0 0 16px rgba(255, 255, 255, 0);
    }
}

/* ============== VIDEO MODAL (fullscreen watch) ============== */
body.team-video-modal-active {
    overflow: hidden;
}

.team-video-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4vh 4vw;
    background: rgba(3, 3, 6, 0.92);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 220ms ease, visibility 0s linear 220ms;
}

    .team-video-modal.is-open {
        opacity: 1;
        visibility: visible;
        transition: opacity 220ms ease, visibility 0s linear 0s;
    }

.team-video-modal-inner {
    position: relative;
    width: 100%;
    max-width: 1120px;
    max-height: 88vh;
    aspect-ratio: 16 / 9;
    transform: scale(0.96);
    transition: transform 260ms cubic-bezier(.16,.84,.44,1);
}

.team-video-modal.is-open .team-video-modal-inner {
    transform: scale(1);
}

.team-video-modal video {
    width: 100%;
    height: 100%;
    max-height: 88vh;
    display: block;
    background: #000;
    border-radius: var(--r-md);
    box-shadow: var(--sh-modal);
}

.team-video-modal-close {
    position: absolute;
    top: -44px;
    right: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    background: rgba(7, 7, 12, 0.7);
    color: var(--fg-primary);
    cursor: pointer;
    transition: background 200ms ease, border-color 200ms ease, transform 200ms ease;
}

    .team-video-modal-close:hover,
    .team-video-modal-close:focus-visible {
        background: rgba(7, 7, 12, 0.95);
        border-color: var(--gold-500);
        transform: rotate(90deg);
    }

@media (max-width: 640px) {
    .team-hero-play-btn {
        width: 64px;
        height: 64px;
    }

        .team-hero-play-btn svg {
            width: 17px;
            height: 20px;
        }

    .team-video-modal {
        padding: 0;
    }

    .team-video-modal-inner {
        max-width: 100%;
        max-height: 100%;
        aspect-ratio: auto;
        height: 100%;
    }

    .team-video-modal video {
        max-height: 100%;
        border-radius: 0;
    }

    .team-video-modal-close {
        top: 12px;
        right: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .team-hero-play-btn {
        animation: none !important;
    }
}
