/* --- CORE RESETS & FONTS --- */
body {
    margin: 0;
    height: 100vh;
    overflow: hidden; /* Prevent scroll on desktop */
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-color: #f0f0f5; 
    color: #1d1d1f;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- LOADER OVERLAY --- */
#loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f0f0f5;
    z-index: 9999;
    transition: opacity 0.8s ease-out;
    pointer-events: none;
}

#loader-overlay.hidden {
    opacity: 0;
}

/* --- 3D BACKGROUND CANVAS --- */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; 
    outline: none;
    opacity: 0;
    transition: opacity 1s ease-in;
}

#bg-canvas.loaded {
    opacity: 1;
}

/* --- LAYOUT CONTAINERS --- */
.scene-container {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
}

.float-wrapper {
    animation: float 6s ease-in-out infinite;
    margin-bottom: 40px; 
    position: relative; 
    z-index: 5;
}

/* --- MONITOR COMPONENT --- */
.monitor-outline {
    width: 50vw; 
    max-width: 600px;
    aspect-ratio: 16/10;
    background: rgba(255, 255, 255, 0.65);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.8); 
    box-shadow: 
        0 30px 80px rgba(0, 0, 0, 0.15),
        inset 0 0 0 2px rgba(255, 255, 255, 1),
        inset 0 0 0 4px rgba(200, 200, 200, 0.2),
        inset 0 0 20px rgba(255,255,255,0.5);
    position: relative;
    backdrop-filter: blur(20px);
    display: flex;
    justify-content: center;
    align-items: center;
    will-change: transform;
}

.screen-inner {
    width: 96%;
    height: 94%;
    background: linear-gradient(135deg, #ffffff 0%, #f2f2f7 100%);
    border-radius: 16px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05); 
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
}

.screen-reflection {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 45%,
        rgba(255, 255, 255, 0.9) 50%,
        transparent 55%
    );
    transform: rotate(30deg);
    opacity: 0.4;
    pointer-events: none;
    z-index: 10;
}

/* --- TYPOGRAPHY --- */
.content-stack {
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 80%;
}

.eyebrow {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #86868b;
    font-weight: 600;
    opacity: 0;
    animation: fadeUp 0.8s ease-out forwards 0.3s;
}

.headline {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin: 0;
    background: linear-gradient(180deg, #1d1d1f 0%, #434344 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0;
    line-height: 1.2;
    padding-bottom: 0.1em;
    animation: fadeUp 0.8s ease-out forwards 0.5s;
}

.subtext {
    font-size: 1.2rem;
    color: #6e6e73;
    font-weight: 400;
    margin-bottom: 0;
    opacity: 0;
    line-height: 1.4;
    animation: fadeUp 0.8s ease-out forwards 0.7s;
}

/* --- FORM COMPONENTS --- */
.waitlist-form {
    display: flex;
    gap: 12px;
    width: 100%;
    max-width: 420px;
    opacity: 0;
    animation: fadeUp 0.8s ease-out forwards 1.0s;
    position: relative;
    z-index: 30;
    pointer-events: auto;
}

.input-wrapper {
    position: relative;
    flex-grow: 1;
}

input[type="email"] {
    width: 100%;
    box-sizing: border-box;
    padding: 16px 20px;
    border-radius: 14px;
    border: 1px solid rgba(0,0,0,0.1);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    font-size: 1rem;
    color: #1d1d1f;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

input[type="email"]:focus {
    border-color: #1d1d1f;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

button.submit-btn {
    padding: 16px 28px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(180deg, #1d1d1f 0%, #434344 100%);
    color: white;
    font-size: 1rem;
    font-weight: 800; 
    letter-spacing: -0.02em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    white-space: nowrap;
    box-shadow: 0 10px 20px rgba(0,0,0,0.15), 0 2px 5px rgba(0,0,0,0.1);
}

button.submit-btn:hover {
    transform: translateY(-4px) scale(1.02);
    background: linear-gradient(180deg, #3a3a3c 0%, #5a5a5c 100%);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2), 0 5px 10px rgba(0,0,0,0.1);
}

button.submit-btn:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 5px 10px rgba(0,0,0,0.15);
}

.success-msg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    color: #1d1d1f;
    font-weight: 600;
    border-radius: 14px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.waitlist-form.submitted .success-msg {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.shadow-floor {
    position: absolute;
    top: 60%;
    width: 30vw;
    height: 20px;
    background: radial-gradient(ellipse at center, rgba(0,0,0,0.15) 0%, transparent 60%);
    border-radius: 50%;
    animation: shadow-scale 6s ease-in-out infinite;
    z-index: -1;
    filter: blur(5px);
    pointer-events: none;
}

/* --- ANIMATIONS --- */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shadow-scale {
    0% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(0.9); opacity: 0.4; }
    100% { transform: scale(1); opacity: 0.6; }
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
    /* Allow scrolling on very small screens to prevent cutoff */
    body {
        height: auto;
        min-height: 100vh;
        overflow-y: auto; 
    }

    .scene-container {
        padding: 40px 0; /* Vertical breathing room */
        height: auto;
        min-height: 100vh;
    }

    /* Adjust monitor to look good on portrait */
    .monitor-outline { 
        width: 85vw; 
        max-width: 400px; 
        height: auto;
        /* Change aspect ratio to 4/3 for mobile (iPad shape) so text fits vertically */
        aspect-ratio: 4/3; 
        max-height: 45vh; 
        margin-top: 20px;
    }

    .content-stack {
        width: 90%;
        gap: 12px;
    }

    .headline { 
        font-size: 2.25rem; /* Scaled down */
    }
    
    .subtext {
        font-size: 1rem;
        line-height: 1.3;
    }

    .float-wrapper {
        margin-bottom: 25px;
    }

    /* Stack form vertically */
    .waitlist-form { 
        flex-direction: column; 
        width: 85vw; 
        max-width: 400px;
        gap: 10px;
    }
    
    input[type="email"], button.submit-btn {
        width: 100%;
        padding: 14px; /* Compact padding */
    }
    
    .shadow-floor { 
        top: 45%; 
        width: 60vw;
    }
}