body { 
    background-color: var(--bg-primary); 
    color: var(--text-primary); 
    overflow-x: hidden; 
}

.eng-grid {
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px), 
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

.blueprint-line {
    position: absolute;
    background: rgba(128, 189, 236, 0.1);
}
.blueprint-line-h { height: 1px; width: 100%; }
.blueprint-line-v { width: 1px; height: 100%; }


/* Modern scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #050816; }
::-webkit-scrollbar-thumb { background: #0F172A; border: 1px solid rgba(255,255,255,0.08); }
::-webkit-scrollbar-thumb:hover { background: #317BBD; }

/* --- PAGE WIPE LOADER --- */
#page-wipe {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-primary);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.5s cubic-bezier(0.8, 0, 0.2, 1);
}

.loader-container {
    width: 64px;
    height: 64px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    transition-delay: 0.3s;
}

.loader-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: #80BDEC;
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 0 15px rgba(128,189,236,1);
}

.loader-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    color: #317BBD;
    animation: spin 1s linear infinite;
}
.loader-ring circle { opacity: 0.25; }
.loader-ring path { opacity: 0.75; }

.loader-text {
    margin-top: 1rem;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #317BBD;
    opacity: 0;
    transition: opacity 0.3s ease;
    transition-delay: 0.3s;
}

/* Wiping DOWN (Entering new page) */
body {
    animation: none; /* Removed the old body fade animation */
}

/* On load, the wipe is covering the screen, then shrinks to bottom */
body:not(.is-leaving) #page-wipe {
    transform: scaleY(1);
    transform-origin: bottom;
    animation: wipeOut 0.6s cubic-bezier(0.8, 0, 0.2, 1) forwards;
    animation-delay: 0.1s;
}

/* Wiping DOWN (Leaving page) */
body.is-leaving #page-wipe {
    transform: scaleY(1);
    pointer-events: all;
}
body.is-leaving .loader-container,
body.is-leaving .loader-text {
    opacity: 1;
}

@keyframes wipeOut {
    to { transform: scaleY(0); }
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}


@keyframes fadeInCard {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
