/* --- Site Intro / Loading Screen --- */
.is-loading {
    overflow: hidden;
}

.site-intro {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #1e1e28; /* The bland color matching site backgrounds */
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease-in-out, visibility 0.8s;
}

.site-intro.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* New logo exit animation */
.site-intro.fade-out .intro-logo,
.site-intro.fade-out .intro-subtitle {
    animation: logoExit 0.8s ease-in-out forwards;
}

@keyframes logoExit {
    0% {
        transform: scale(1);
        opacity: 1;
        filter: blur(0);
    }
    100% {
        transform: scale(1.5); /* Grows big */
        opacity: 0;
        filter: blur(20px);
    }
}

.intro-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("../images/backgrounds/pattern.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0; /* Start invisible for fade-in */
    z-index: -1;
    animation: backgroundFadeIn 3s ease-out 0.5s forwards; /* Fades in over 3 seconds after a short delay */
}

@keyframes backgroundFadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 0.4; /* Final opacity */
    }
}

.intro-content {
    text-align: center;
    z-index: 1;
}

.intro-logo {
    width: 500px;
    max-width: 90vw;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5));
    opacity: 0; /* Start invisible */
    animation: logoEntrance 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.25s forwards; /* Added 1s delay */
}

.intro-subtitle {
    margin-top: -0.5rem;
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
    opacity: 0;
    filter: blur(10px);
    animation: logoEntrance 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.35s forwards; /* Slightly more delay than logo */
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

@keyframes logoEntrance {
    0% { transform: scale(0.8); opacity: 0; filter: blur(10px); }
    100% { transform: scale(1); opacity: 1; filter: blur(0); }
}

.intro-content.fade-out {
    opacity: 0;
    filter: blur(10px);
    transform: scale(0.9);
    transition: all 0.5s ease-in-out;
    pointer-events: none;
}

/* Warning Section */
.intro-warning {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease-in-out;
    z-index: 2;
}

.intro-warning.show {
    opacity: 1;
    visibility: visible;
}

.warning-box {
    background: rgb(20, 20, 30);
    padding: 3rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.intro-warning.show .warning-box {
    transform: scale(1);
}

.warning-box h2 {
    font-size: 2.5rem;
    color: white;
    margin-bottom: 1.5rem;
    font-weight: 800;
}

.warning-box p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin-bottom: 2.5rem;
}

#intro-understand-btn {
    padding: 0 48px;
    height: 42px;
    line-height: 42px;
    font-size: 1.1rem;
    font-weight: 400;
}

/* Exit Zoom Animation */
.site-intro.exit-zoom .warning-box {
    animation: warningZoomExit 0.6s ease-in-out forwards;
}

@keyframes warningZoomExit {
    0% {
        transform: scale(1);
        opacity: 1;
        filter: blur(0);
    }
    100% {
        transform: scale(2);
        opacity: 0;
        filter: blur(20px);
    }
}

/* End Site Intro */
