/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden; /* Hide scrollbars for cinematic feel */
    background-color: #1a1c17; /* Muddy dark olive background */
    font-family: 'Orbitron', sans-serif;
    color: #e0e0d0;
    perspective: 1000px;
}

/* UI Overlay */
#ui-container {
    position: absolute;
    bottom: 5%;
    left: 0;
    width: 100%;
    text-align: center;
    z-index: 100;
    pointer-events: none;
    text-shadow: 0 0 10px #ffaa00, 0 0 20px #ff5500;
    animation: pulseText 2s infinite alternate;
}

.title {
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: 5px;
    margin-bottom: 5px;
    color: #ffcc00;
}

.subtitle {
    font-size: 1.2rem;
    letter-spacing: 3px;
    color: #d0d0b0;
    text-shadow: 0 0 10px #000;
    margin-bottom: 15px;
}

.ca-container {
    display: inline-flex;
    align-items: center;
    background: rgba(10, 10, 5, 0.8);
    border: 1px solid #4a4a35;
    padding: 8px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    pointer-events: auto; /* Make clickable */
    transition: all 0.3s ease;
}
.ca-container:hover {
    border-color: #ffaa00;
    box-shadow: 0 0 15px rgba(255, 170, 0, 0.4);
}

.ca-text {
    font-size: 0.9rem;
    letter-spacing: 1px;
    margin-right: 15px;
    color: #ffcc00;
    font-family: monospace;
}

.copy-btn {
    background: #ff5500;
    color: #fff;
    border: none;
    padding: 5px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}
.copy-btn:hover {
    background: #ffcc00;
    color: #000;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    pointer-events: auto; /* Make clickable */
}
.social-links a {
    display: inline-block;
    transition: transform 0.2s ease, filter 0.2s ease;
}
.social-links a:hover {
    transform: scale(1.1) translateY(-5px);
    filter: drop-shadow(0 0 15px rgba(255, 170, 0, 0.8));
}
.social-links img {
    width: 45px;
    height: 45px;
    object-fit: contain;
}

/* Parallax Container */
#parallax-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Removed transform-style: preserve-3d to prevent layers intersecting each other */
}

/* Layers Setup */
.layer {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    pointer-events: none; /* Let clicks pass through */
    will-change: transform;
}

/* Background Gradients & War Vibe */
.layer-1 {
    /* Muddy sky with distant orange fire */
    background: radial-gradient(circle at center bottom, #5a3a10 0%, #1a1c17 80%);
    z-index: 1;
    animation: pulseFire 6s infinite alternate;
}

.layer-2 {
    /* Silhouette of ruined city - olive/grey */
    background-image: repeating-linear-gradient(90deg, transparent, transparent 50px, #2a2c25 50px, #2a2c25 100px), repeating-linear-gradient(90deg, transparent, transparent 30px, #20221c 30px, #20221c 70px);
    background-size: 200px 100%, 150px 80%;
    background-position: bottom;
    background-repeat: repeat-x;
    opacity: 0.9;
    z-index: 2;
    transform: translateZ(-100px) scale(1.5);
    filter: drop-shadow(0 -10px 20px rgba(0, 0, 0, 0.5));
}

.layer-3 {
    /* Fog / Smoke base - olive tinted */
    background: linear-gradient(to top, rgba(30,32,25,0.9), transparent);
    z-index: 3;
    transform: translateZ(-50px) scale(1.2);
}

/* 3D Earth Container */
.three-layer {
    z-index: 4; /* Behind effects, in front of deep background */
    display: flex;
    justify-content: center;
    align-items: center;
    transform: scale(1.1); /* Removed translateZ to keep it strictly 2D layered */
}

#three-container canvas {
    display: block;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 50px rgba(0, 150, 255, 0.2));
}

/* Character Styling */
.character-layer {
    z-index: 999; /* Forced to the absolute front of all objects */
    display: flex;
    justify-content: center;
    align-items: center;
}

#main-character {
    max-width: 80vw;
    max-height: 80vh;
    object-fit: contain;
    filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.8));
    animation: floatCharacter 4s ease-in-out infinite;
    position: relative;
    z-index: 2;
}

.glow-effect {
    position: absolute;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(200, 150, 50, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 1;
    animation: pulseGlow 3s infinite alternate;
}

/* Dynamic Effects Container */
#effects-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 8; /* Between earth and character */
    pointer-events: none;
    overflow: hidden;
}

/* Foreground Smoke */
.layer-smoke {
    background-image: radial-gradient(circle, rgba(40, 42, 35, 0.5) 10%, transparent 40%);
    background-size: 200vw 200vh;
    z-index: 20;
    opacity: 0.7;
    mix-blend-mode: multiply; /* Darkens to create dirty war smoke */
    animation: panSmoke 25s linear infinite;
    transform: translateZ(50px) scale(1.1);
}

/* Screen Overlay / Vignette / CRT effects */
.layer-overlay {
    z-index: 30;
    box-shadow: inset 0 0 150px rgba(0,0,0,0.9);
    background: repeating-linear-gradient(
        0deg,
        rgba(0,0,0,0.15),
        rgba(0,0,0,0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
}

/* Dynamic Classes generated by JS */
.rocket {
    position: absolute;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, transparent, #ffcc00, #ff5500, #fff);
    border-radius: 2px;
    box-shadow: 0 0 15px #ff5500, 0 0 30px #ffaa00;
    will-change: transform;
}

.laser {
    position: absolute;
    width: 50px;
    height: 3px;
    background: #00ffff;
    box-shadow: 0 0 10px #00ffff, 0 0 20px #0055ff;
    border-radius: 1px;
    will-change: transform;
}

.explosion {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 30px #ffaa00, 0 0 60px #ff5500, 0 0 90px #220000;
    animation: explodeAnim 0.8s ease-out forwards;
}

.drone {
    position: absolute;
    width: 40px;
    height: 20px;
    background: #222;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.8);
    animation: hoverDrone 3s infinite ease-in-out alternate;
    will-change: transform;
    border: 1px solid #444;
}
.drone::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: #00ffff;
    border-radius: 50%;
    box-shadow: 0 0 10px #00ffff;
    animation: blinkLight 0.5s infinite alternate;
}

/* Animations */
@keyframes floatCharacter {
    0% { transform: translateY(0px) rotate(0deg) scale(1); }
    50% { transform: translateY(-15px) rotate(1deg) scale(1.02); }
    100% { transform: translateY(0px) rotate(0deg) scale(1); }
}

@keyframes pulseFire {
    0% { opacity: 0.7; background: radial-gradient(circle at center bottom, #4a2a0a 0%, #1a1c17 80%); }
    100% { opacity: 1; background: radial-gradient(circle at center bottom, #6a3a10 0%, #1a1c17 90%); }
}

@keyframes pulseGlow {
    0% { opacity: 0.3; transform: scale(0.9); }
    100% { opacity: 0.7; transform: scale(1.1); }
}

@keyframes panSmoke {
    0% { background-position: 0% 0%; }
    100% { background-position: 100% 100%; }
}

@keyframes explodeAnim {
    0% { transform: scale(1); opacity: 1; }
    30% { transform: scale(10); opacity: 1; background: #ffaa00; }
    60% { transform: scale(18); opacity: 0.8; background: #ff5500; }
    100% { transform: scale(25); opacity: 0; background: #222; }
}

@keyframes pulseText {
    0% { opacity: 0.8; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.05); text-shadow: 0 0 20px #ffcc00, 0 0 40px #ff5500; }
}

@keyframes blinkLight {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* Media Queries for Mobile */
@media (max-width: 768px) {
    #main-character {
        max-width: 95vw;
    }
    .title {
        font-size: 2rem;
    }
    .subtitle {
        font-size: 1rem;
    }
    .glow-effect {
        width: 80vw;
        height: 80vw;
    }
}
