/* ── Global Loader ─────────────────────────────────────────────────── */
#global-loader {
    position: fixed;
    inset: 0;
    background: #1a1f2e;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

#global-loader.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* Keep body background matching the loader color so any gap between loader
   fade-out and first meaningful DOM paint is invisible to the user. */
html, body {
    background-color: #1a1f2e !important;
}

html:not(.loader-active),
body:not(.loader-active) {
    background-color: #ffffff !important;
}

/* ── Loader brand text ─────────────────────────────────────────────── */
.loader-logo {
    font-family: 'Inter', 'Roboto', Arial, sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #3699ff;
    letter-spacing: 3px;
    margin-bottom: 2rem;
}

/* ── Loading typewriter text ───────────────────────────────────────── */
.gl-text {
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 16px;
    color: #9aa5b8;
    margin-top: 16px;
    letter-spacing: 1px;
    min-height: 24px;
}

/* ── Folding-cube spinner ──────────────────────────────────────────── */
.sk-folding-cube {
    width: 56px;
    height: 56px;
    position: relative;
    transform: rotateZ(45deg);
}

.sk-folding-cube .sk-cube {
    float: left;
    width: 50%;
    height: 50%;
    position: relative;
    transform: scale(1.1);
}

.sk-folding-cube .sk-cube:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #3699ff;
    animation: sk-foldCubeAngle 4s infinite linear both;
    transform-origin: 100% 100%;
}

.sk-folding-cube .sk-cube2 { transform: scale(1.1) rotateZ(90deg); }
.sk-folding-cube .sk-cube3 { transform: scale(1.1) rotateZ(180deg); }
.sk-folding-cube .sk-cube4 { transform: scale(1.1) rotateZ(270deg); }

.sk-folding-cube .sk-cube2:before { animation-delay: 0.3s; }
.sk-folding-cube .sk-cube3:before { animation-delay: 0.6s; }
.sk-folding-cube .sk-cube4:before { animation-delay: 0.9s; }

@keyframes sk-foldCubeAngle {
    0%, 10% {
        transform: perspective(140px) rotateX(-180deg);
        opacity: 0;
    }
    25%, 75% {
        transform: perspective(140px) rotateX(0deg);
        opacity: 1;
    }
    90%, 100% {
        transform: perspective(140px) rotateY(180deg);
        opacity: 0;
    }
}

