/* =========================================
   1. VARIABLES & CINEMATIC PALETTE
   ========================================= */
:root {
    /* Palette: Restricted & Muted */
    --chem-green: #2f9e44;   
    --chem-void: #050805;    
    --cinema-white: #e6e6e6; 
    
    /* Physics: "Expo Out" Easing */
    --ease-cinematic: cubic-bezier(0.19, 1, 0.22, 1);
    
    /* Dimensions */
    --header-height: 80px;
    --menu-width: 400px; /* New variable for menu width */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--chem-void);
    color: var(--cinema-white);
    font-family: 'Oswald', sans-serif;
    overflow: hidden; 
    height: 100vh;
    width: 100vw;
    filter: saturate(0.95); 
}

/* =========================================
   2. ATMOSPHERE & GRAIN
   ========================================= */

.vignette {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at center, transparent 30%, #000 120%);
    pointer-events: none; z-index: 10;
}

.crt-lines {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 3px
    );
    pointer-events: none; z-index: 11; opacity: 0.4;
}

.smoke-bg {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(at 40% 60%, #0f1c13 0%, transparent 60%);
    z-index: -1;
    opacity: 0.6;
    animation: drift 20s infinite alternate ease-in-out;
}
@keyframes drift { from { transform: scale(1); } to { transform: scale(1.1); } }

/* =========================================
   3. NAVIGATION (INVISIBLE & VISIBLE)
   ========================================= */

.click-zone {
    position: absolute; top: 0; height: 100%; width: 35%;
    z-index: 50; cursor: pointer;
    transition: background 0.5s ease;
}
.click-zone:hover { background: linear-gradient(90deg, rgba(0,0,0,0.2), transparent); }
.click-zone.right { right: 0; transform: scaleX(-1); }

.top-nav {
    position: fixed; top: 30px; right: 40px;
    display: flex; gap: 30px; align-items: center; 
    z-index: 250; /* Higher than menu so hamburger stays clickable if needed */
}

.home-btn {
    text-decoration: none; color: var(--cinema-white); opacity: 0.6;
    font-size: 0.9rem; letter-spacing: 3px; font-weight: 300;
    transition: opacity 0.3s;
}
.home-btn:hover { opacity: 1; }

.hamburger { 
    cursor: pointer; width: 40px; height: 15px; 
    display: flex; flex-direction: column; justify-content: space-between; 
}
.hamburger span { 
    display: block; height: 1px; width: 100%; 
    background: var(--cinema-white); transition: 0.3s; 
}
.hamburger:hover span { background: var(--chem-green); width: 100%; }
.hamburger:hover span:nth-child(2) { width: 70%; }

/* =========================================
   4. CINEMATIC STAGE (3D ENVIRONMENT)
   ========================================= */

.cinematic-stage {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    perspective: 1200px; /* Determines the intensity of the 3D effect */
    display: flex;
    justify-content: center;
    align-items: center;
    /* Global scene lighting */
    background: radial-gradient(circle at 50% 30%, rgba(47, 158, 68, 0.05), transparent 70%);
}

.actor-card {
    position: absolute;
    width: 350px;
    height: 500px;
    top: 50%;
    left: 50%;
    /* Centering logic for absolute items */
    transform-origin: center center;
    transform: translate(-50%, -50%); 
    will-change: transform, filter, opacity;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
}

/* =========================================
   5. THE SUBJECT (IMAGE & TEXT)
   ========================================= */

.card-visual {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    /* Base cinematic look */
    filter: sepia(0.2) contrast(1.1) brightness(0.8);
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
}

/* The Periodic Element Box */
.periodic-element {
    position: absolute;
    top: -20px;
    left: -20px;
    width: 70px;
    height: 70px;
    background: rgba(10, 15, 10, 0.95);
    border: 2px solid var(--chem-green);
    color: var(--cinema-white);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    font-weight: 700;
    box-shadow: 0 0 30px rgba(47, 158, 68, 0.3);
    z-index: 10;
    /* It floats slightly off the image surface */
    transform: translateZ(30px); 
}

/* Typography embedded in the 3D card */
.card-info {
    position: absolute;
    bottom: -60px;
    left: 0;
    width: 100%;
    text-align: center;
    transform: translateZ(50px); /* Text floats closer to camera */
}

.platform-title {
    font-size: 4rem;
    line-height: 1;
    color: var(--cinema-white);
    text-transform: uppercase;
    text-shadow: 0 10px 20px rgba(0,0,0,0.5);
    margin-bottom: 5px;
}

.handle-text {
    font-family: 'Roboto Condensed', sans-serif;
    color: var(--chem-green);
    letter-spacing: 4px;
    text-transform: uppercase;
    font-size: 1rem;
    background: rgba(0,0,0,0.6);
    padding: 5px 10px;
    display: inline-block;
}

/* Overlay for non-active items to darken them */
.dimmer-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #000;
    opacity: 0; /* JS controls this */
    transition: opacity 0.5s;
    pointer-events: none;
    z-index: 5;
}

/* =========================================
   6. TYPOGRAPHY
   ========================================= */

.info { overflow: hidden; text-align: center; }

.platform {
    font-size: 5rem; line-height: 0.9;
    text-transform: uppercase; letter-spacing: -1px;
    color: var(--cinema-white);
    transform: translateY(100%); opacity: 0;
}

.username {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 1rem; letter-spacing: 6px; text-transform: uppercase;
    color: var(--chem-green); margin-top: 10px;
    opacity: 0; transform: translateY(20px);
}

/* =========================================
   7. ANIMATION
   ========================================= */

.slide.active .profile-img { animation: imageReveal 1.2s var(--ease-cinematic) forwards; }
.slide.active .platform { animation: textSlideUp 1s var(--ease-cinematic) 0.15s forwards; }
.slide.active .username { animation: fadeUp 1s var(--ease-cinematic) 0.3s forwards; }

@keyframes imageReveal {
    from { transform: scale(1.1) translateY(30px); opacity: 0; filter: blur(10px) grayscale(1); }
    to { transform: scale(1) translateY(0); opacity: 1; filter: blur(0) grayscale(0.8) sepia(0.2) contrast(1.2); }
}
@keyframes textSlideUp { to { transform: translateY(0); opacity: 1; } }
@keyframes fadeUp { to { transform: translateY(0); opacity: 0.8; } }

/* =========================================
   8. MENU & MODAL (FIXED)
   ========================================= */

.side-menu {
    position: fixed; 
    top: 0; 
    right: -450px; /* Hide completely off-screen */
    width: var(--menu-width); /* Fixed width for desktop */
    height: 100%;
    background: rgba(5, 8, 5, 0.98); 
    z-index: 200;
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center;
    gap: 2rem; 
    transition: right 0.6s var(--ease-cinematic);
    
    /* Adds a shadow so it pops off the background */
    box-shadow: -10px 0 50px rgba(0,0,0,0.8);
    border-left: 1px solid rgba(255,255,255,0.1);
}

.side-menu.active { 
    right: 0; 
}

.side-menu a { 
    color: var(--cinema-white); 
    font-size: 2rem; 
    text-decoration: none; 
    text-transform: uppercase; 
    transition: color 0.3s;
}
.side-menu a:hover { color: var(--chem-green); }

/* Modal Styles */
.modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.95); 
    z-index: 300; 
    justify-content: center; align-items: center;
    backdrop-filter: blur(5px);
}
.modal.active { display: flex; animation: fadeIn 0.3s ease; }

.modal-content { text-align: center; position: relative; width: 90%; max-width: 500px; }

.glow-text { 
    font-size: 3rem; color: var(--chem-green); margin-bottom: 2rem;
    text-shadow: 0 0 20px rgba(47, 158, 68, 0.4);
}

.download-grid { display: flex; flex-direction: column; gap: 1rem; }

.dl-btn {
    padding: 1rem 2rem; background: var(--cinema-white); color: #000;
    text-decoration: none; font-weight: bold; text-transform: uppercase;
    transition: all 0.3s ease;
}
.dl-btn:hover { transform: scale(1.02); box-shadow: 0 0 15px rgba(255,255,255,0.3); }

.dl-btn.outline { background: transparent; border: 2px solid var(--cinema-white); color: var(--cinema-white); }
.dl-btn.outline:hover { background: var(--cinema-white); color: #000; }

.close-modal { 
    position: absolute; top: -50px; right: 0; 
    color: #fff; font-size: 2.5rem; cursor: pointer; transition: color 0.3s;
}
.close-modal:hover { color: var(--chem-green); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* =========================================
   9. RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
    /* Mobile Menu: Return to Full Screen */
    .side-menu {
        width: 100%;
        right: -100%;
        border-left: none;
    }
    
    .profile-img { width: 85vw; height: 50vh; }
    .platform { font-size: 3.5rem; }
    .click-zone { width: 30%; } 
    .top-nav { top: 20px; right: 20px; }
    .periodic-box { font-size: 1.5rem; left: -15px; }
    
    .glow-text { font-size: 2rem; }
    .close-modal { top: -40px; right: 10px; }
}
/* --- FIX: Z-Index for Nav --- */
.top-nav {
    z-index: 1000; /* Ensure this is higher than the 3D cards (which go up to 100) */
}

/* --- NEW: Glowing Arrows --- */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px; height: 100px;
    display: flex; justify-content: center; align-items: center;
    z-index: 500; cursor: pointer;
    transition: all 0.3s ease; opacity: 0.4;
}
.nav-arrow:hover {
    opacity: 1; transform: translateY(-50%) scale(1.1);
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
}
.nav-arrow svg {
    fill: var(--cinema-white); width: 50px; height: 50px;
    filter: drop-shadow(0 0 10px rgba(47, 158, 68, 0.5));
}
.nav-arrow.left { left: 20px; }
.nav-arrow.right { right: 20px; }

/* --- NEW: Pagination Dots --- */
.pagination-dots {
    position: absolute; bottom: 40px; left: 50%;
    transform: translateX(-50%);
    display: flex; gap: 15px; z-index: 500;
}
.dot {
    width: 8px; height: 8px;
    background-color: var(--cinema-white);
    border-radius: 50%; opacity: 0.3;
    cursor: pointer; transition: all 0.3s ease;
}
.dot.active {
    opacity: 1; background-color: var(--chem-green);
    box-shadow: 0 0 10px var(--chem-green); transform: scale(1.5);
}