/* --- RESET & BASE --- */
:root {
    --glass-surface: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.15);
    --physics-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --primary-font: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: var(--primary-font); }

body {
    background-color: #050505;
    color: #fff;
    overflow-x: hidden;
    height: 100vh;
    /* Update 1: Dynamic Height for Mobile Browsers */
    height: 100dvh; 
}

.bg-noise {
    position: fixed; inset: 0;
    background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMDAiIGhlaWdodD0iMjAwIj48ZmlsdGVyIGlkPSJnoiPjxmZVR1cmJ1bGVuY2UgdHlwZT0iZnJhY3RhbE5vaXNlIiBiYXNlRnJlcXVlbmN5PSIwLjY1IiBudW1PY3RhdmVzPSIzIiBzdGl0Y2hUaWxlcz0ic3RpdGNoIi8+PC9maWx0ZXI+PHJlY3Qgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsdGVyPSJ1cmwoI2cpIiBvcGFjaXR5PSIwLjAzIi8+PC9zdmc+');
    pointer-events: none; z-index: 0;
}

/* --- NEW INTRO ANIMATION (Sad/Wide Text) --- */
#intro-layer {
    position: fixed; inset: 0; background-color: #ffffff; z-index: 9999;
    display: flex; justify-content: center; align-items: center;
    overflow: hidden; transition: opacity 0.8s ease;
}
.intro-text {
    color: #1a1a1a;
    font-size: clamp(1.5rem, 5vw, 3rem); /* Responsive font */
    font-weight: 300; text-transform: uppercase; letter-spacing: 2px;
    opacity: 0; white-space: nowrap;
    animation: sadExpandSequence 5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
@keyframes sadExpandSequence {
    0% { opacity: 0; transform: scale(0.9); filter: blur(10px); }
    25% { opacity: 1; transform: scale(1); filter: blur(0px); letter-spacing: 4px; }
    50% { opacity: 1; transform: scale(1.1); letter-spacing: 6px; }
    100% { opacity: 0; transform: scale(8); letter-spacing: 50px; filter: blur(20px); }
}
.fade-out-layer { opacity: 0; pointer-events: none; }

/* --- TEAM LAYOUT --- */
.team-section {
    opacity: 0; transition: opacity 1.2s ease;
    padding: 40px; max-width: 1400px; margin: 0 auto;
    height: 100vh; height: 100dvh;
    display: flex; flex-direction: column;
    position: relative; z-index: 1;
}
.team-section.visible { opacity: 1; }

.header-area { text-align: center; margin-bottom: 30px; flex-shrink: 0; }
.header-area h2 { 
    font-size: clamp(2.5rem, 5vw, 3.5rem); 
    font-weight: 700; letter-spacing: -1px; 
    background: linear-gradient(to bottom, #fff, #888);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.header-area p { color: #666; font-size: 1.1rem; letter-spacing: 2px; text-transform: uppercase; }

.cards-wrapper {
    position: relative; width: 100%; height: 600px;
    perspective: 1000px; flex-grow: 1;
}

/* CARD STYLES */
.t-card {
    position: absolute;
    background: var(--glass-surface);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,255,255,0.05);
    border-radius: 24px; padding: 20px;
    display: flex; cursor: pointer; overflow: hidden;
    transition: all 0.8s var(--physics-bounce); 
    will-change: top, left, width, height, transform;
}
.card-sheen {
    position: absolute; inset: 0;
    background: linear-gradient(120deg, transparent 30%, var(--glass-highlight) 50%, transparent 70%);
    opacity: 0.3; pointer-events: none;
}
.t-card:hover { border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.05); }

.img-box {
    border-radius: 16px; overflow: hidden; flex-shrink: 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3); transition: 0.5s ease;
    background: #222;
}
.img-box img {
    width: 100%; height: 100%; object-fit: cover;
    filter: grayscale(100%) contrast(1.1); transition: 0.5s;
}
.pos-main .img-box img { filter: grayscale(0%); transform: scale(1.05); }

.text-content {
    display: flex; flex-direction: column; justify-content: center;
    margin-left: 30px;
}
.text-content h3 { font-size: 1.4rem; color: #fff; font-weight: 600; }
.text-content .role { color: #888; font-size: 0.9rem; letter-spacing: 1px; margin-bottom: 10px; display: block; text-transform: uppercase;}

.details {
    max-height: 0; opacity: 0;
    transform: translateY(20px); transition: 0.5s ease;
}
.view-btn {
    margin-top: 20px; padding: 12px 30px;
    background: #fff; color: #000;
    border: none; border-radius: 30px;
    cursor: pointer; font-weight: 700; transition: 0.3s;
}

/* --- DESKTOP POSITIONS (GLOBAL DEFAULTS) --- */
/* This is exactly how you had it. */
.pos-main {
    top: 0; left: 0; width: 58%; height: 100%; z-index: 10;
    background: rgba(15, 15, 15, 0.6); border-color: rgba(255,255,255,0.15);
}
.pos-main .img-box { width: 45%; height: 100%; }
.pos-main .text-content { width: 50%; margin-left: 50px; }
.pos-main h3 { font-size: 3rem; margin-bottom: 5px; letter-spacing: -1px;}
.pos-main .role { font-size: 1rem; color: #aaa; }
/* IMPORTANT: This makes details visible globally for the main card */
.pos-main .details { max-height: 1000px; opacity: 1; transform: translateY(0); transition-delay: 0.2s; }

/* --- SMALL CARD STYLING (DESKTOP) --- */
.pos-1, .pos-2, .pos-3, .pos-4 {
    left: 60%; width: 40%; height: 23%; z-index: 5; align-items: center; padding: 15px 25px;
}
.pos-1 .img-box, .pos-2 .img-box, .pos-3 .img-box, .pos-4 .img-box {
    width: 60px; height: 60px; border-radius: 50%;
}
.pos-1 .role, .pos-2 .role, .pos-3 .role, .pos-4 .role {
    display: none;
}
.pos-1 { top: 0%; } .pos-2 { top: 25.6%; } .pos-3 { top: 51.2%; } .pos-4 { top: 76.8%; }


/* ===================== MOBILE & TABLET (Adjusted to 1024px) ===================== */
@media (max-width: 1024px) {
    
    .team-section { padding: 20px 15px; height: 100dvh; overflow: hidden; }
    .header-area { margin-bottom: 15px; }
    .header-area h2 { font-size: 2rem; }
    
    .cards-wrapper { 
        height: auto; flex-grow: 1; 
        display: flex; flex-direction: column;
        padding-bottom: env(safe-area-inset-bottom);
    }

    /* --- 1. THE STAGE (Main Card) --- */
    .pos-main { 
        top: 0 !important; left: 0 !important;
        width: 100% !important; 
        height: 82% !important; 
        
        z-index: 20;
        flex-direction: column; 
        padding: 15px;
        border-radius: 24px; 
        background: rgba(20,20,20,0.95); 
    }

    /* IMAGE */
    .pos-main .img-box { 
        width: 100%; 
        height: 75%; 
        border-radius: 20px; 
        box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    }

    /* TEXT CONTENT */
    .pos-main .text-content { 
        width: 100%; 
        height: 25%; 
        margin: 0; 
        padding: 15px 5px 0 5px;
        display: grid;
        grid-template-columns: 1fr auto; 
        grid-template-rows: auto 1fr; 
        align-items: center;
        column-gap: 15px;
    }

    .pos-main h3 { 
        grid-column: 1;
        text-align: left;
        font-size: 1.5rem; 
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .pos-main .role { 
        grid-column: 2;
        text-align: right;
        font-size: 0.85rem; 
        margin: 0;
        white-space: nowrap;
    }

    .pos-main .text-content p { display: none; } 
    
    /* Update 6: Fixed Alignment - Button aligns left under name */
    .pos-main .view-btn {
        grid-column: 1;     /* Changed from '1 / span 2' to just '1' to sit under name */
        justify-self: start; /* Changed from 'center' to 'start' (left align) */
        align-self: start; 
        margin-top: 15px;
        padding: 10px 30px;
        font-size: 0.9rem;
        border-radius: 25px;
        display: block; 
    }

    /* --- 2. THE DOCK (Other Cards) --- */
    .pos-1, .pos-2, .pos-3, .pos-4 {
        top: auto !important; bottom: 0 !important;
        height: 14% !important; 
        width: 23% !important; 
        padding: 0;
        display: flex; justify-content: center; align-items: center;
        border-radius: 16px;
        background: rgba(255,255,255,0.08);
        border: 1px solid rgba(255,255,255,0.05);
        z-index: 10;
        margin-bottom: 10px;
    }

    .pos-1 .text-content, .pos-2 .text-content, 
    .pos-3 .text-content, .pos-4 .text-content { display: none; }

    .pos-1 .img-box, .pos-2 .img-box, 
    .pos-3 .img-box, .pos-4 .img-box {
        width: 45px; height: 45px;
        border-radius: 50%;
        border: 2px solid rgba(255,255,255,0.2);
    }

    .pos-1 { left: 0% !important; }
    .pos-2 { left: 25.6% !important; }
    .pos-3 { left: 51.2% !important; }
    .pos-4 { left: 76.8% !important; }
}

/* Update 5: Support for iPhone SE / Tiny Screens */
@media (max-width: 380px) {
    .pos-main .img-box { height: 65%; }
    .pos-main h3 { font-size: 1.2rem; }
    .pos-main .view-btn { padding: 8px 20px; font-size: 0.8rem; }
    .pos-1 .img-box, .pos-2 .img-box, .pos-3 .img-box, .pos-4 .img-box {
        width: 35px; height: 35px;
    }
}