﻿/* ============================================================
   GLOBAL RESET
   ------------------------------------------------------------ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: Georgia, serif;
}

/* ============================================================
   LOADING OVERLAY BACKGROUND
   ------------------------------------------------------------ */
/* This is the full-screen layer that fades out */
.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: linear-gradient( to bottom, rgba(0, 0, 0, 0.03), rgba(0, 0, 0, 0.2) ), url("../images/background.jpg") center/cover no-repeat;
    /* Victorian archival look */
    filter: grayscale(100%) contrast(130%);
    /* Smooth GPU-driven performance */
    will-change: opacity, filter, background;
    backface-visibility: hidden;
}

/* ============================================================
   PULSE ANIMATION (Spinner)
   ------------------------------------------------------------ */
.pulse-wrapper {
    width: 280px;
    height: 280px;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translateZ(0); /* smoother animation */
}

.pulse {
    width: 100%;
    height: 100%;
}

/* ============================================================
   LOADING TEXT
   ------------------------------------------------------------ */
.loading-title {
    margin-top: 1.8rem;
    color: #ffffff;
    font-size: 1.45rem;
    letter-spacing: 0.14em;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.55), 0 0 20px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 600px;
    padding: 0 20px;
    line-height: 1.35;
    text-align: center;
}

/* ============================================================
   CINEMATIC FADE-OUT ANIMATION
   ------------------------------------------------------------ */
/* Animates:
   - opacity
   - grayscale → natural
   - contrast → natural
   - background gradient softening
   */
/* ============================================================
   CINEMATIC FADE-OUT ANIMATION
   ------------------------------------------------------------ */

@keyframes loaderFadeOut {
    0% {
        opacity: 1;
        filter: grayscale(100%) contrast(130%);
    }

    40% {
        opacity: 0.55;
        filter: grayscale(60%) contrast(115%);
    }

    75% {
        opacity: 0.25;
        filter: grayscale(20%) contrast(105%);
    }

    100% {
        opacity: 0;
        filter: grayscale(0%) contrast(100%);
    }
}

/* Triggered when JS adds .hide-loader */
.hide-loader {
    animation: loaderFadeOut 0.65s ease forwards;
    pointer-events: none;
}

.loading-overlay {
    will-change: opacity, filter;
}
