/* css/scientist.css */

/* --- LAYOUT --- */
.scientist-section {
    position: relative;
    height: 400vh; 
    z-index: 50;
    background-color: #000;
    margin-bottom: 0; 
}

/* Ensure the wrapper doesn't allow 3D items to overflow visually into the next section */
.scientist-sticky-wrapper {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden; /* Keeps the stars and 3D items contained */
    background-color: #000;
    perspective: 1000px;
}

/* --- HUD / TITLE --- */
.scientist-hud {
    position: absolute;
    top: 10%;
    left: 5%;
    width: 90%; 
    height: auto;
    z-index: 100;
    pointer-events: none; /* Allows clicks to pass through */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.scientist-title {
    font-family: 'Syncopate', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 5rem);
    color: transparent;
    -webkit-text-stroke: 1px rgba(0, 229, 255, 0.5);
    text-transform: uppercase;
    text-shadow: 0 0 20px rgba(0, 229, 255, 0.2);
    margin: 0; 
    opacity: 0;
    transform: translateY(20px); 
    transition: all 0.8s ease-out;
    pointer-events: auto; /* Allow selecting text if desired */
}

.scientist-subtitle {
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent-teal);
    font-size: 0.9rem;
    letter-spacing: 0.1em; 
    margin-top: 0.5rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out 0.2s, transform 0.8s ease-out 0.2s;
}

/* Active State */
.scientist-section.active .scientist-title,
.scientist-section.active .scientist-subtitle {
    opacity: 1;
    transform: translateY(0);
}

.scroll-indicator {
    position: fixed; 
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    opacity: 0; 
    animation: blink 2s infinite;
    transition: opacity 0.5s;
    pointer-events: none;
}

.scientist-section.active .scroll-indicator {
    opacity: 0.5;
}

/* --- WORMHOLE BACKGROUND --- */
.wormhole-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: radial-gradient(circle at center, #051015 0%, #000000 80%);
    overflow: hidden;
    pointer-events: none; /* CRITICAL: Allows clicks to pass through background */
}

/* Common Star Styles */
.stars, .stars-2, .stars-3 {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 2px;
    background: transparent;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none;
}

/* LAYER 1 */
.stars {
    box-shadow: 
        -300px -200px 1px #fff, 
        200px 100px 1px var(--accent-teal),
        -150px 300px 2px #fff,
        400px -50px 1px var(--accent-teal),
        -400px 400px 2px #fff,
        350px -350px 1px var(--accent-teal),
        -100px -450px 2px #fff,
        250px 250px 1px var(--accent-teal),
        -500px 100px 2px #fff,
        100px -500px 1px var(--accent-teal),
        0px 350px 2px #fff,
        -250px 0px 1px var(--accent-teal);
}

/* LAYER 2 */
.stars-2 {
    box-shadow: 
        150px -150px 2px #fff, 
        -250px 250px 1px var(--accent-teal),
        350px 50px 2px #fff,
        -100px -300px 1px #fff,
        450px 450px 2px #fff,
        -400px -100px 1px var(--accent-teal),
        200px 400px 2px #fff,
        -350px -350px 1px #fff,
        500px -200px 2px #fff,
        -50px 500px 1px var(--accent-teal),
        300px -400px 2px #fff,
        -200px 200px 1px var(--accent-teal);
}

/* LAYER 3 */
.stars-3 {
    box-shadow: 
        -450px -150px 2px var(--accent-teal), 
        300px 300px 1px #fff,
        -50px -400px 2px #fff,
        400px 150px 1px var(--accent-teal),
        -250px 450px 2px #fff,
        150px -350px 1px #fff,
        -350px 50px 2px var(--accent-teal),
        250px -250px 1px #fff,
        500px 500px 2px #fff,
        -500px -500px 1px var(--accent-teal);
}

.scientist-section.active .stars { animation: warpSpeed 3s linear infinite; }
.scientist-section.active .stars-2 { animation: warpSpeed 2s linear infinite; animation-delay: 1s; }
.scientist-section.active .stars-3 { animation: warpSpeed 1.5s linear infinite; animation-delay: 0.5s; }

@keyframes warpSpeed {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    10% { opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(8); opacity: 0; }
}

/* --- 3D WORLD --- */
.scene-3d-container {
    position: absolute;
    top: 5vh;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    transform-style: preserve-3d;
    pointer-events: none; /* CRITICAL: Pass clicks through container */
}

.scene-world {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transform-origin: 50% 50%;
    pointer-events: none; /* CRITICAL */
}

/* --- 3D ITEMS (Common) --- */
.sci-item {
    position: absolute;
    top: 50%;
    left: 50%;
    transform-style: preserve-3d;
    backface-visibility: hidden; /* Helps performance */
    will-change: transform, opacity, filter;
    
    background: rgba(10, 20, 25, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 229, 255, 0.2);
    padding: 1.5rem;
    color: var(--text-primary);
    width: 350px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.05);
    
    /* INTERACTION FIXES */
    pointer-events: auto; /* Re-enable clicks on the item itself */
    cursor: default;
    z-index: 10; 
}

.sci-item:hover {
    border-color: var(--accent-teal);
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.2);
    background: rgba(10, 20, 25, 0.95);
    z-index: 1000 !important; /* Pop to front on hover */
}

.sci-item.type-project {
    border-top: 3px solid var(--accent-teal);
}
.sci-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: var(--accent-teal);
    text-transform: uppercase;
    border: 1px solid var(--accent-teal);
    width: fit-content;
    padding: 2px 6px;
    border-radius: 4px;
}

.sci-item.type-paper {
    width: 300px;
    height: 400px;
    background: #e0e0e0;
    color: #111;
    border: none;
    align-items: center;
    text-align: center;
}

.type-paper > .sci-label {
    position: absolute;
    left: 1rem;
    top: 1rem;
    color: var(--bg-body);
    border-color: var(--accent-lime);
    background-color: var(--accent-lime);
}

.sci-item.type-paper .sci-title {
    color: #000;
    font-family: 'Times New Roman', serif;
    font-size: 1.5rem;
    margin-top: 1rem;
}
.sci-item.type-paper .sci-desc { color: #444; }

.type-award > .sci-label {
    color: #FFD700;
    border-color: #FFD700;
}

.sci-item.type-award {
    width: 300px;
    height: auto;            
    min-height: 180px;       
    border-radius: 12px;     
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    border: 0px;
    box-shadow: none;
    background: rgba(10, 20, 25, 0.9);
}

.sci-item.type-award:hover {
    z-index: 1000 !important;
}

/* FontAwesome Icons (Gold) */
.sci-item.type-award .sci-icon {
    font-size: 3rem;
    color: #FFD700;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Image Icons/Logos */
.sci-item.type-award .sci-icon-img {
    width: 10em;
    height: 10em;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.5));
}


.sci-item.type-award .sci-title { font-size: 1rem; color: #fff; }
.sci-item.type-award .sci-desc { font-size: 0.75rem; color: #aaa; }

/* Typography inside cards */
.sci-title {
    font-family: 'Syncopate', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    margin: 0;
}

.sci-desc {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.4;
    color: #bbb;
}

.sci-meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: #666;
    margin-top: auto;
    padding-top: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.sci-btn {
    text-decoration: none;
    color: var(--bg-body);
    background: var(--accent-teal);
    padding: 0.4rem 0.8rem;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    font-family: 'JetBrains Mono', monospace;
    transition: all 0.2s;
    position: relative;
    z-index: 20;
    cursor: pointer;
    pointer-events: auto;
}

.type-paper > .sci-meta > .sci-btn { background: var(--accent-lime); }

.sci-btn:hover {
    background: #fff;
    box-shadow: 0 0 10px #fff;
}

/* --- PROJECT MEDIA STYLES --- */
.sci-media-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 0.5rem 0;
    border-radius: 4px;
    overflow: hidden;
    background: #000;
    border: 1px solid rgba(0, 229, 255, 0.1);
    filter: grayscale(0.2) brightness(0.8);
    transition: filter 0.3s ease;
}

.sci-media-container iframe, 
.sci-project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sci-media-container iframe { pointer-events: auto; }

.sci-item:hover .sci-media-container {
    filter: grayscale(0) brightness(1);
}

@keyframes blink {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 768px) {
    .scientist-hud {
        top: 15%; /* Push title down slightly */
    }

    .scientist-title {
        font-size: 1.8rem; /* Smaller title on mobile */
    }

    .sci-item {
        /* On mobile, cards shouldn't exceed screen width minus padding */
        width: 85vw; 
        max-width: 320px;
        padding: 1.2rem;
    }

    .sci-item.type-paper {
        width: 80vw;
        max-width: 300px;
        height: auto;
        min-height: 350px;
    }

    .sci-item.type-award {
        width: 80vw;
        max-width: 300px;
    }
    
    .sci-title {
        font-size: 1rem;
    }
    
    .sci-desc {
        font-size: 0.75rem;
    }
}