/* ============================================================
   Page Load Transitions
   ============================================================ */

/* Main content initially hidden during loading */
body.loading header,
body.loading main,
body.loading footer {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

body.loaded header,
body.loaded main,
body.loaded footer {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    transition: opacity 1s ease-out 0.5s, transform 1s ease-out 0.5s;
}

/* Ensure content is visible by default (in case loading is skipped) */
body:not(.loading) header,
body:not(.loading) main,
body:not(.loading) footer {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* ============================================================
   Starry Night Background
   ============================================================ */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -2;
}

.stars::before,
.stars::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 2px;
    background: #fff;
    border-radius: 50%;
    box-shadow:
        25vw 18vh 0 0 #fff, 80vw 30vh 0 0 #fff, 40vw 70vh 0 0 #fff,
        90vw 40vh 0 0 #fff, 15vw 90vh 0 0 #fff, 70vw 60vh 0 0 #fff,
        5vw 50vh 0 0 #fff, 95vw 80vh 0 0 #fff, 35vw 25vh 0 0 #fff,
        60vw 95vh 0 0 #fff, 85vw 15vh 0 0 #fff, 10vw 75vh 0 0 #fff,
        50vw 45vh 0 0 #fff, 75vw 85vh 0 0 #fff, 20vw 65vh 0 0 #fff,
        65vw 35vh 0 0 #fff, 30vw 55vh 0 0 #fff, 45vw 20vh 0 0 #fff,
        55vw 75vh 0 0 #fff, 15vw 40vh 0 0 #fff, 85vw 60vh 0 0 #fff,
        25vw 80vh 0 0 #fff, 70vw 25vh 0 0 #fff, 40vw 90vh 0 0 #fff,
        80vw 50vh 0 0 #fff, 5vw 20vh 0 0 #fff, 60vw 70vh 0 0 #fff,
        90vw 85vh 0 0 #fff, 35vw 45vh 0 0 #fff, 75vw 10vh 0 0 #fff;
    animation: twinkle 3s infinite ease-in-out alternate;
}

.stars::after {
    width: 1px;
    height: 1px;
    box-shadow:
        12vw 33vh 0 0 #fff, 87vw 77vh 0 0 #fff, 23vw 12vh 0 0 #fff,
        78vw 45vh 0 0 #fff, 43vw 88vh 0 0 #fff, 67vw 23vh 0 0 #fff,
        18vw 67vh 0 0 #fff, 92vw 8vh 0 0 #fff, 48vw 52vh 0 0 #fff,
        73vw 93vh 0 0 #fff, 3vw 38vh 0 0 #fff, 58vw 18vh 0 0 #fff,
        28vw 73vh 0 0 #fff, 83vw 33vh 0 0 #fff, 38vw 58vh 0 0 #fff,
        13vw 83vh 0 0 #fff, 68vw 3vh 0 0 #fff, 93vw 68vh 0 0 #fff,
        8vw 28vh 0 0 #fff, 53vw 78vh 0 0 #fff, 88vw 13vh 0 0 #fff,
        33vw 48vh 0 0 #fff, 78vw 88vh 0 0 #fff, 23vw 8vh 0 0 #fff,
        63vw 63vh 0 0 #fff, 98vw 28vh 0 0 #fff, 18vw 98vh 0 0 #fff;
    animation: twinkle 2s infinite ease-in-out alternate-reverse;
}

@keyframes twinkle {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* ============================================================
   Shooting Stars
   ============================================================ */
.shooting-stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.shooting-stars::before,
.shooting-stars::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 2px;
    background: linear-gradient(45deg, #fff, transparent);
    border-radius: 50%;
    animation: shooting 3s linear infinite;
}

.shooting-stars::before {
    top: 10%;
    left: -10%;
    animation-delay: 0s;
}

.shooting-stars::after {
    top: 30%;
    left: -10%;
    animation-delay: 2s;
}

@keyframes shooting {
    0% {
        transform: translateX(0) translateY(0);
        opacity: 1;
    }
    70% {
        opacity: 1;
    }
    100% {
        transform: translateX(120vw) translateY(60vh);
        opacity: 0;
    }
}

/* ============================================================
   Animation Utilities
   ============================================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}
