/* Celestial Scroll Experience - Night to Day */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Theme Colors */
:root {
    /* Night/Dark Mode (starts here) */
    --theme-bg-1: #2a2a2a;
    --theme-bg-2: #1a1a1a;
    --theme-text: #e0e0e0;
    --theme-hero-text: #e0e0e0;
    --theme-surface: rgba(26, 26, 26, 0.9);
}

[data-theme='clearskies'] {
    --theme-bg-1: #0a0a0a;
    --theme-bg-2: #050505;
    --theme-text: #e0e0e0;
    --theme-hero-text: #e0e0e0;
    --theme-surface: rgba(5, 5, 5, 0.95);
    --theme-secondary: #ffffff;
}

[data-theme="sunny"] {
    /* Day/Light Mode */
    --theme-bg-1: #f5f5f5;
    --theme-bg-2: #ffffff;
    --theme-text: #2c3e50;
    --theme-hero-text: #2c3e50;
    --theme-surface: rgba(255, 255, 255, 0.95);
    --theme-secondary: #2c3e50;
}

/* Sky background with scroll-driven gradient */
#sky {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: linear-gradient(to bottom, var(--theme-bg-1), var(--theme-bg-2));
    transition: background 0.1s linear;
}

/* Stars */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: 
        radial-gradient(1px 1px at 10% 20%, white, transparent),
        radial-gradient(1px 1px at 25% 35%, white, transparent),
        radial-gradient(1px 1px at 40% 15%, white, transparent),
        radial-gradient(1px 1px at 55% 45%, white, transparent),
        radial-gradient(1px 1px at 70% 25%, white, transparent),
        radial-gradient(1px 1px at 85% 55%, white, transparent),
        radial-gradient(1px 1px at 15% 65%, white, transparent),
        radial-gradient(1px 1px at 30% 80%, white, transparent),
        radial-gradient(1px 1px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 75% 90%, white, transparent),
        radial-gradient(1px 1px at 90% 10%, white, transparent),
        radial-gradient(1px 1px at 95% 50%, white, transparent);
    background-size: 100% 100%;
    opacity: calc(1 - var(--progress, 0));
}

/* Celestial Progression Container */
#celestial {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: calc(1 - var(--progress, 0));
    transition: opacity 0.1s linear;
}

/* Moon */
.moon {
    position: absolute;
    top: 15%;
    left: 15%;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle at 30% 30%, #ffffff 0%, #d0d0d0 30%, #a0a0a0 60%, #707070 100%);
    border-radius: 50%;
    box-shadow: 0 0 40px rgba(240, 240, 240, 0.3);
    opacity: calc(1 - var(--progress, 0) * 0.8);
}

.moon::after {
    content: '';
    position: absolute;
    top: 20%;
    left: 25%;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 50%;
}

.moon::before {
    content: '';
    position: absolute;
    top: 40%;
    left: 50%;
    width: 25px;
    height: 25px;
    background: rgba(0, 0, 0, 0.12);
    border-radius: 50%;
}

/* Cloud layers */
.cloud-layer {
    position: absolute;
    width: 200%;
    height: 100%;
    opacity: calc(1 - var(--progress, 0));
    z-index: 0;
    pointer-events: none;
    animation: drift 30s linear infinite;
}

.cloud-layer.layer-1 {
    top: 10%;
    background: radial-gradient(ellipse at center, #ffffff 0%, #555555 70%, transparent 100%);
}

.cloud-layer.layer-2 {
    top: 30%;
    background: radial-gradient(ellipse at center, #ffffff 10%, #444444 70%, transparent 100%);
    animation: drift 40s linear infinite reverse;
}

.cloud-layer.layer-3 {
    top: 50%;
    background: radial-gradient(ellipse at center, #ffffff 5%, #333333 70%, transparent 100%);
    animation: drift 35s linear infinite;
}

/* Celestial bodies - fade out at 50% scroll */
.jupiter {
    position: absolute;
    top: 35%;
    left: 55%;
    width: 4px;
    height: 4px;
    background: #d2b48c;
    border-radius: 50%;
    opacity: calc(max(0, 1 - var(--progress, 0) * 2));
}

.jupiter::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: #8b4513;
    transform: translateY(-50%);
}

.saturn {
    position: absolute;
    top: 25%;
    left: 70%;
    width: 3px;
    height: 3px;
    background: #daa520;
    border-radius: 50%;
    opacity: calc(max(0, 1 - var(--progress, 0) * 2));
}

.venus {
    position: absolute;
    top: 45%;
    left: 75%;
    width: 5px;
    height: 5px;
    background: #ffffe0;
    border-radius: 50%;
    box-shadow: 0 0 8px #ffffe0;
    opacity: calc(max(0, 1 - var(--progress, 0) * 2));
}

.venus::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    transform: translate(-50%, -50%);
}

.spica {
    position: absolute;
    top: 48%;
    left: 80%;
    width: 3px;
    height: 3px;
    background: #a0cfff;
    border-radius: 50%;
    opacity: calc(max(0, 1 - var(--progress, 0) * 2));
}

.crescent-moon {
    position: absolute;
    top: 40%;
    left: 82%;
    width: 40px;
    height: 40px;
    background: #ffffff;
    border-radius: 50%;
    clip-path: circle(50% at 75% 50%);
    opacity: calc(max(0, 1 - var(--progress, 0) * 2));
}

.crescent-moon::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1a1a1a;
    border-radius: 50%;
    clip-path: circle(45% at 80% 50%);
}

/* Header */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    padding: 1.5rem 2rem;
    background: var(--theme-surface);
    backdrop-filter: blur(5px);
    transition: background 0.1s linear;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--theme-text);
}

.theme-toggle {
    background: none;
    border: 1px solid var(--theme-text);
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: var(--theme-text);
    color: #000;
    transform: scale(1.1);
}

[data-theme="clearskies"] .theme-toggle::before {
    content: '☀️';
}

[data-theme="sunny"] .theme-toggle::before {
    content: '🌙';
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-content {
    text-align: center;
    padding: 2rem;
    position: relative;
    z-index: 10;
}

.hero-content h2 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: var(--theme-hero-text);
}

.hero-content p {
    font-size: 1.3rem;
    opacity: 0.9;
}

/* Main content sections */
main {
    position: relative;
    z-index: 5;
}

.features, .mission, .cta {
    padding: 6rem 2rem;
    transition: background 0.1s linear;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.features h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--theme-text);
}

.mission {
    text-align: center;
}

.mission h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--theme-text);
}

.mission p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 1rem;
    color: var(--theme-text);
}

.cta h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--theme-text);
}

.cta p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.waitlist-form {
    display: flex;
    gap: 1rem;
    max-width: 400px;
    margin: 0 auto;
    flex-wrap: wrap;
    justify-content: center;
}

.waitlist-form input {
    flex: 1;
    min-width: 250px;
    padding: 0.75rem;
    border: 2px solid var(--theme-text);
    border-radius: 0.5rem;
    background: transparent;
    color: var(--theme-text);
    font-size: 1rem;
}

.waitlist-form button {
    padding: 0.75rem 2rem;
    background: var(--theme-text);
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: transform 0.3s ease;
}

.waitlist-form button:hover {
    transform: scale(1.05);
}

.footer {
    padding: 2rem;
    text-align: center;
}

/* Animations */
@keyframes drift {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Transition layer */
.transition-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--theme-bg-1);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.transition-layer.active {
    opacity: 1;
}

body:not(.scrolling) .cloud-layer {
    animation-play-state: paused;
}

@media (max-width: 768px) {
    .hero-content h2 {
        font-size: 2rem;
    }
    
    .moon {
        width: 80px;
        height: 80px;
        top: 10%;
        left: 10%;
    }
    
    .features h2, .mission h2, .cta h2 {
        font-size: 2rem;
    }
    
    .waitlist-form {
        flex-direction: column;
    }
    
    .header {
        padding: 1rem;
    }
    
    .cloud-layer {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero-content h2 {
        font-size: 1.5rem;
    }
}
