/* Reset browser defaults */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden; /* Prevent page scroll */
    background-color: #000; /* Dark background for loading/gaps */
}

#container {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

#scene {
    width: 100%;
    height: 100%;
    position: relative;
}

/* Layer Styling */
.layer {
    position: absolute;
    /* Oversize the divs to 120% to create a 'bleed' area */
    width: 120% !important;
    height: 120% !important;
    /* Center the oversized div so there is 10% extra on all sides */
    left: -10% !important;
    top: -10% !important;
}

.layer img {
    width: 100%;
    height: 100%;
    /* 'cover' ensures the image fills the area without stretching */
    object-fit: cover;
    /* On mobile, this keeps the focus on the bottom/center of the image */
    object-position: bottom center;
    display: block;
}

/* Specific fix for the 'glitch' at the bottom */
/* We force the foreground layers to stay grounded */
.layer[data-depth="0.60"], 
.layer[data-depth="1.00"] {
    top: auto !important;
    bottom: -10% !important;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .layer {
        /* On mobile, we increase the width to 140% to allow for deeper vertical crops */
        width: 140% !important;
        left: -20% !important;
    }
    
    .layer img {
        /* Prioritize the bottom of the image for the log/text placement */
        object-position: bottom center;
    }
}


/* Darkening Overlay */
#dark-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7); /* Final darkness (70% dark / 30% visibility) */
    z-index: 10; /* Above the parallax layers */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s;
    pointer-events: none; /* Allows mouse to still hit parallax until active */
}

/* Modal/Button Container */
#scroll-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    z-index: 20;
    opacity: 0;
    visibility: hidden;
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* The Button itself */
.modal-btn {
    padding: 15px 40px;
    background: #fff;
    color: #000;
    text-decoration: none;
    font-family: sans-serif;
    font-weight: bold;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* State when active */
.is-active #dark-overlay {
    opacity: 0.8; 
    visibility: visible;
    pointer-events: auto; /* NOW IT CAN BE CLICKED */
    cursor: auto;
}

.is-active #scroll-modal {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}






#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0e0a; /* Deep forest black */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Highest priority */
    transition: opacity 1s ease, visibility 1s;
}

.loader-content {
    text-align: center;
    color: #ffffff;
    font-family: 'Georgia', serif;
    letter-spacing: 2px;
}

/* A simple pulsing organic loader */
.leaf-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 20px;
    border: 2px solid #ffffff;
    border-radius: 50% 0 50% 0; /* Leaf shape */
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
    0% { transform: rotate(0deg) scale(1); opacity: 1; }
    50% { transform: rotate(180deg) scale(1.2); opacity: 0.5; }
    100% { transform: rotate(360deg) scale(1); opacity: 1; }
}

/* Class to hide the loader */
.loader-hidden {
    opacity: 0;
    visibility: hidden;
}