/* Register custom properties for aurora morph */
@property --aurora-hue {
  syntax: '<number>';
  initial-value: 250;
  inherits: false;
}

/* Root and Base Styles */
:root {
    --primary-purple: #8E44AD;
    --dark-brown: #3A3530;
    --slate-blue: #8A9AB0;
    --white: #FFFFFF;
    --cream: #F5F0E6;
    --light-purple: #D4B8E0;
    --black-night: #0E1420;
    --green-accent: #2ECC71;
    --aurora-rose: #E74C8C;
    --starlight: #D0C8BE;

    --font-cormorant: 'Cormorant Garamond', serif;
    --font-space-grotesk: 'Space Grotesk', sans-serif;
    --font-inter: 'Inter', sans-serif;
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    background: var(--black-night);
    color: var(--cream);
}

body {
    font-family: var(--font-inter);
    font-size: 1rem;
    line-height: 1.6;
}

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

/* ====== Section 1: Vestibule ====== */
.vestibule {
    background: linear-gradient(135deg, var(--black-night) 0%, var(--dark-brown) 100%);
    position: relative;
}

.aurora-gradient {
    position: absolute;
    top: 0;
    right: 0;
    width: 60%;
    height: 40%;
    background: radial-gradient(ellipse at 100% 0%, rgba(46, 204, 113, 0.2) 0%, rgba(142, 68, 173, 0.15) 40%, rgba(231, 76, 140, 0.1) 100%);
    pointer-events: none;
    /* Colors used: #2ECC71, #8E44AD, #E74C8C */
}

.vestibule-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.domain-name {
    font-family: var(--font-cormorant);
    font-weight: 300;
    font-size: clamp(3rem, 8vw, 6.5rem);
    letter-spacing: 0.06em;
    color: var(--cream);
    line-height: 1.1;
}

.domain-lower {
    display: block;
}

.domain-quest {
    display: block;
    font-family: var(--font-space-grotesk);
    font-weight: 500;
    letter-spacing: 0.02em;
}

.vestibule-subtitle {
    margin-top: 1rem;
    font-family: var(--font-space-grotesk);
    font-weight: 400;
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: var(--starlight);
    letter-spacing: 0.04em;
    /* Using #D0C8BE for starlight on dark backgrounds */
}

/* Constellation SVGs */
.constellation {
    position: absolute;
    pointer-events: none;
}

.stars-subtle {
    width: 200px;
    height: 200px;
    bottom: 10%;
    left: 5%;
}

.stars-scattered {
    width: 250px;
    height: 250px;
    top: 5%;
    right: 5%;
}

.stars-field {
    width: 300px;
    height: 300px;
    bottom: 5%;
    right: 3%;
}

.stars-aurora {
    width: 400px;
    height: 400px;
    bottom: -50px;
    left: 10%;
}

/* ====== Section 2: Reading Room ====== */
.reading-room {
    background: linear-gradient(135deg, var(--cream) 0%, #FAF8F3 100%);
    color: var(--dark-brown);
}

.reading-room-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    width: 90%;
    max-width: 1200px;
    position: relative;
    z-index: 2;
    padding: 4rem 2rem;
}

.reading-room-left h2 {
    font-family: var(--font-space-grotesk);
    font-weight: 600;
    font-size: clamp(1.5rem, 3.5vw, 2.5rem);
    color: var(--primary-purple);
    margin-bottom: 1.5rem;
    letter-spacing: 0.03em;
}

.reading-room-text {
    font-family: var(--font-cormorant);
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.8;
    color: var(--dark-brown);
    letter-spacing: 0.01em;
}

.telescope-diagram {
    width: 280px;
    height: 280px;
    margin: 0 auto;
    background: radial-gradient(circle at center, transparent 0%, var(--slate-blue) 2px, transparent 2px),
                radial-gradient(circle at center, transparent 10px, var(--slate-blue) 11px, transparent 11px),
                radial-gradient(circle at center, transparent 20px, var(--slate-blue) 21px, transparent 21px),
                radial-gradient(circle at center, transparent 30px, var(--slate-blue) 31px, transparent 31px);
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    border: 2px solid var(--slate-blue);
    border-radius: 50%;
    opacity: 0.7;
    position: relative;
}

.telescope-diagram::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 60%;
    background: var(--slate-blue);
}

.telescope-diagram::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(90deg);
    width: 2px;
    height: 60%;
    background: var(--slate-blue);
}

/* ====== Section 3: Observation Deck ====== */
.observation-deck {
    background: linear-gradient(135deg, #1a1820 0%, var(--black-night) 100%);
    color: var(--cream);
}

.observation-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 700px;
    width: 90%;
}

.observation-deck h2 {
    font-family: var(--font-space-grotesk);
    font-weight: 600;
    font-size: clamp(1.5rem, 3.5vw, 2.5rem);
    color: var(--primary-purple);
    margin-bottom: 2rem;
    letter-spacing: 0.03em;
}

.moon-phases {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 2.5rem 0;
    align-items: center;
}

.moon-phase {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--cream);
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.moon-phase:nth-child(1) {
    background: radial-gradient(circle at 30% 50%, var(--cream) 0%, var(--cream) 45%, var(--black-night) 45%, var(--black-night) 100%);
}

.moon-phase:nth-child(2) {
    background: radial-gradient(circle at 20% 50%, var(--cream) 0%, var(--cream) 30%, var(--black-night) 30%, var(--black-night) 100%);
}

.moon-phase:nth-child(3) {
    background: var(--black-night);
    border: 2px solid var(--cream);
}

.moon-phase:nth-child(4) {
    background: radial-gradient(circle at 80% 50%, var(--cream) 0%, var(--cream) 30%, var(--black-night) 30%, var(--black-night) 100%);
}

.moon-phase:nth-child(5) {
    background: radial-gradient(circle at 70% 50%, var(--cream) 0%, var(--cream) 45%, var(--black-night) 45%, var(--black-night) 100%);
}

.observation-text {
    font-family: var(--font-cormorant);
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.8;
    color: var(--cream);
    letter-spacing: 0.01em;
    margin-top: 2rem;
}

/* ====== Section 4: Aurora ====== */
.aurora {
    background: var(--black-night);
    color: var(--cream);
    position: relative;
}

.aurora-morph-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        hsl(var(--aurora-hue), 70%, 45%) 0%,
        hsl(calc(var(--aurora-hue) + 90), 60%, 40%) 35%,
        hsl(calc(var(--aurora-hue) + 180), 50%, 35%) 100%
    );
    opacity: 0.15;
    animation: aurora-morph 15s ease-in-out infinite;
}

@keyframes aurora-morph {
    0% {
        --aurora-hue: 250;
    }
    25% {
        --aurora-hue: 290;
    }
    50% {
        --aurora-hue: 340;
    }
    75% {
        --aurora-hue: 300;
    }
    100% {
        --aurora-hue: 250;
    }
}

.aurora-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 700px;
    width: 90%;
}

.aurora h2 {
    font-family: var(--font-space-grotesk);
    font-weight: 600;
    font-size: clamp(1.5rem, 3.5vw, 2.5rem);
    color: var(--light-purple);
    margin-bottom: 1.5rem;
    letter-spacing: 0.03em;
}

.aurora-text {
    font-family: var(--font-cormorant);
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.8;
    color: var(--cream);
    letter-spacing: 0.01em;
}

/* Responsive Design */
@media (max-width: 768px) {
    .reading-room-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 2rem 1rem;
    }

    .telescope-diagram {
        width: 200px;
        height: 200px;
    }

    .moon-phases {
        gap: 1rem;
    }

    .moon-phase {
        width: 50px;
        height: 50px;
    }

    .stars-subtle {
        width: 150px;
        height: 150px;
    }

    .stars-scattered {
        width: 180px;
        height: 180px;
    }

    .stars-field {
        width: 200px;
        height: 200px;
    }

    .stars-aurora {
        width: 250px;
        height: 250px;
    }
}
