/* =============================================
   ppuzzl.party -- Celestial Gathering
   ============================================= */

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

:root {
    --deep-cosmos: #0B0D17;
    --creamy-rose: #F8E4D9;
    --celestial-lavender: #C4B1D4;
    --star-gold: #E8D5A3;
    --nebula-blush: #D4A0B9;
    --frost-white: #F0ECF5;
    --void-blue: #161B2E;
    --dark-purple: #1A1525;

    --font-display: 'Poiret One', cursive;
    --font-body: 'Quicksand', sans-serif;
    --font-accent: 'Cormorant Garamond', serif;

    --cursor-x: 50vw;
    --cursor-y: 50vh;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--deep-cosmos);
    color: var(--frost-white);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(16px, 1.6vw, 19px);
    line-height: 1.8;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Cursor-Follow Glow --- */
#cursor-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 160, 185, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1000;
    transform: translate(calc(var(--cursor-x) - 150px), calc(var(--cursor-y) - 150px));
    transition: transform 0.15s ease-out;
    will-change: transform;
}

/* --- Star Layers --- */
.star-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    will-change: transform;
}

#star-layer-bg { z-index: 1; }
#star-layer-mid { z-index: 2; }
#star-layer-fg { z-index: 3; }

.star {
    position: absolute;
    border-radius: 50%;
    will-change: opacity, transform;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.star--gold {
    background-color: var(--star-gold);
}

.star--white {
    background-color: var(--frost-white);
}

/* Star twinkling animation */
@keyframes twinkle-1 {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1.0; }
}
@keyframes twinkle-2 {
    0%, 100% { opacity: 0.3; }
    40% { opacity: 0.9; }
    70% { opacity: 0.5; }
}
@keyframes twinkle-3 {
    0%, 100% { opacity: 0.15; }
    30% { opacity: 0.7; }
    60% { opacity: 1.0; }
    80% { opacity: 0.4; }
}

/* Star drift animations */
@keyframes drift-slow {
    0% { transform: translate(0, 0); }
    25% { transform: translate(8px, -12px); }
    50% { transform: translate(-5px, -20px); }
    75% { transform: translate(12px, -8px); }
    100% { transform: translate(0, 0); }
}
@keyframes drift-mid {
    0% { transform: translate(0, 0); }
    33% { transform: translate(-15px, 10px); }
    66% { transform: translate(10px, -15px); }
    100% { transform: translate(0, 0); }
}
@keyframes drift-fast {
    0% { transform: translate(0, 0); }
    20% { transform: translate(20px, -10px); }
    50% { transform: translate(-10px, -25px); }
    80% { transform: translate(15px, 5px); }
    100% { transform: translate(0, 0); }
}

/* --- Gradient Mesh Nebula --- */
#gradient-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 4;
    opacity: 0;
    transition: opacity 2s ease;
    background:
        radial-gradient(ellipse 60% 50% at 10% 20%, rgba(248, 228, 217, 0.10) 0%, transparent 70%),
        radial-gradient(ellipse 50% 60% at 85% 70%, rgba(196, 177, 212, 0.08) 0%, transparent 70%),
        radial-gradient(ellipse 45% 40% at 50% 90%, rgba(212, 160, 185, 0.07) 0%, transparent 70%),
        radial-gradient(ellipse 55% 45% at 30% 60%, rgba(232, 213, 163, 0.05) 0%, transparent 70%);
    animation: nebula-shift 25s ease-in-out infinite;
}

@keyframes nebula-shift {
    0% {
        background:
            radial-gradient(ellipse 60% 50% at 10% 20%, rgba(248, 228, 217, 0.10) 0%, transparent 70%),
            radial-gradient(ellipse 50% 60% at 85% 70%, rgba(196, 177, 212, 0.08) 0%, transparent 70%),
            radial-gradient(ellipse 45% 40% at 50% 90%, rgba(212, 160, 185, 0.07) 0%, transparent 70%),
            radial-gradient(ellipse 55% 45% at 30% 60%, rgba(232, 213, 163, 0.05) 0%, transparent 70%);
    }
    33% {
        background:
            radial-gradient(ellipse 55% 55% at 25% 40%, rgba(248, 228, 217, 0.12) 0%, transparent 70%),
            radial-gradient(ellipse 60% 50% at 70% 30%, rgba(196, 177, 212, 0.10) 0%, transparent 70%),
            radial-gradient(ellipse 50% 45% at 40% 80%, rgba(212, 160, 185, 0.06) 0%, transparent 70%),
            radial-gradient(ellipse 45% 50% at 60% 50%, rgba(232, 213, 163, 0.07) 0%, transparent 70%);
    }
    66% {
        background:
            radial-gradient(ellipse 50% 60% at 80% 15%, rgba(248, 228, 217, 0.08) 0%, transparent 70%),
            radial-gradient(ellipse 55% 45% at 20% 60%, rgba(196, 177, 212, 0.11) 0%, transparent 70%),
            radial-gradient(ellipse 60% 50% at 60% 85%, rgba(212, 160, 185, 0.09) 0%, transparent 70%),
            radial-gradient(ellipse 50% 55% at 45% 35%, rgba(232, 213, 163, 0.06) 0%, transparent 70%);
    }
    100% {
        background:
            radial-gradient(ellipse 60% 50% at 10% 20%, rgba(248, 228, 217, 0.10) 0%, transparent 70%),
            radial-gradient(ellipse 50% 60% at 85% 70%, rgba(196, 177, 212, 0.08) 0%, transparent 70%),
            radial-gradient(ellipse 45% 40% at 50% 90%, rgba(212, 160, 185, 0.07) 0%, transparent 70%),
            radial-gradient(ellipse 55% 45% at 30% 60%, rgba(232, 213, 163, 0.05) 0%, transparent 70%);
    }
}

/* --- Sections --- */
.section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background-color 0.8s ease;
}

.section-content {
    max-width: 600px;
    padding: 2rem;
    text-align: center;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease, transform 1s ease;
}

.section-content.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Observatory / Wordmark --- */
#observatory {
    background-color: var(--deep-cosmos);
}

.wordmark {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(42px, 8vw, 100px);
    letter-spacing: 0.15em;
    color: var(--frost-white);
    text-shadow:
        0 0 10px rgba(232, 213, 163, 0.4),
        0 0 30px rgba(232, 213, 163, 0.2),
        0 0 60px rgba(232, 213, 163, 0.1);
    opacity: 0;
    transition: opacity 1s ease, text-shadow 1s ease;
    margin-bottom: 1rem;
}

.wordmark.glow-active {
    opacity: 1;
    text-shadow:
        0 0 10px rgba(232, 213, 163, 0.6),
        0 0 30px rgba(232, 213, 163, 0.35),
        0 0 60px rgba(232, 213, 163, 0.15),
        0 0 100px rgba(232, 213, 163, 0.05);
}

.wordmark-ppuzzl {
    color: var(--frost-white);
}

.wordmark-dot {
    color: var(--star-gold);
}

.wordmark-party {
    color: var(--celestial-lavender);
}

.tagline {
    font-family: var(--font-accent);
    font-weight: 300;
    font-style: italic;
    font-size: clamp(16px, 2vw, 22px);
    color: var(--celestial-lavender);
    letter-spacing: 0.1em;
    opacity: 0;
    transition: opacity 1.5s ease 0.5s;
}

.tagline.visible {
    opacity: 0.8;
}

/* --- Section Backgrounds --- */
#section-nebula {
    background-color: var(--void-blue);
}

#section-aurora {
    background-color: var(--dark-purple);
}

#section-horizon {
    background-color: var(--deep-cosmos);
}

#section-deep {
    background-color: var(--void-blue);
}

/* --- Section Headings --- */
.section-heading {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(36px, 6vw, 80px);
    letter-spacing: 0.15em;
    color: var(--frost-white);
    margin-bottom: 2rem;
    text-shadow:
        0 0 10px rgba(232, 213, 163, 0.3),
        0 0 30px rgba(232, 213, 163, 0.15),
        0 0 60px rgba(232, 213, 163, 0.07);
}

/* --- Section Text --- */
.section-text {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--creamy-rose);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.accent-quote {
    font-family: var(--font-accent);
    font-weight: 300;
    font-style: italic;
    font-size: clamp(16px, 1.8vw, 18px);
    color: var(--celestial-lavender);
    margin-top: 2rem;
    opacity: 0.75;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .section-content {
        max-width: 90%;
        padding: 1.5rem;
    }

    .wordmark {
        letter-spacing: 0.08em;
    }

    .section-heading {
        letter-spacing: 0.08em;
    }
}

@media (max-width: 480px) {
    .section-content {
        max-width: 95%;
        padding: 1rem;
    }
}
