/* ═══════════════════════════════════════════════════════════════
   KWIKO GLOBAL LOADER
   "Scanline Terminal" Aesthetic
   ═══════════════════════════════════════════════════════════════ */

.loader {
    position: fixed;
    inset: 0;
    z-index: 100000;
    /* Must be highest layer */
    background: #050505;
    /* Hidden by default (JS opts in) */
    display: none;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono, 'Courier New', monospace);

    /* Hardware acceleration for smooth exit */
    will-change: transform;
    transition: transform 0.8s cubic-bezier(0.7, 0, 0.2, 1);
}

.loader.is-visible {
    display: flex;
}

/* Exit State (Slide Up Curtain) */
.loader.exiting {
    transform: translateY(-100%);
}

/* ═══════════════════════════════════════════════════════════════
   VISUAL EFFECTS
   ═══════════════════════════════════════════════════════════════ */

.loader-scanline {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.1;
    z-index: 1;
    background: repeating-linear-gradient(to bottom,
            transparent 0px,
            transparent 2px,
            rgba(255, 255, 255, 0.05) 2px,
            rgba(255, 255, 255, 0.05) 4px);
    background-size: 100% 4px;
    animation: scanline 8s linear infinite;
}

@keyframes scanline {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 0 100px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   CONTENT LAYOUT
   ═══════════════════════════════════════════════════════════════ */

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    position: relative;
    z-index: 10;
}

/* 1. Top Label ("SYSTEM INIT") */
.loader-kicker {
    font-size: 10px;
    letter-spacing: 0.2em;
    color: var(--k-grey-mid, #737373);
    text-transform: uppercase;
    font-weight: 500;
}

/* 2. Scramble Text (Main Brand Name) */
.loader-scramble {
    font-size: clamp(2rem, 6vw, 3.5rem);
    letter-spacing: 0.15em;
    font-weight: 700;
    color: var(--k-white, #ffffff);
    min-width: 200px;
    /* Prevent jitter during scramble */
    text-align: center;
    /* Optional: Create a "cutout" look */
    mix-blend-mode: difference;
}

/* 3. Progress Bar Container */
.loader-bar-container {
    width: 256px;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

/* The actual filling bar */
.loader-bar {
    position: absolute;
    inset: 0;
    background: var(--k-orange, #F37021);
    width: 100%;
    /* Start hidden to left */
    transform: translateX(-100%);
    /* Smooth transition handled by JS updates */
    transition: none;
}

/* 4. Meta Data (EST Year & %) */
.loader-meta {
    display: flex;
    justify-content: space-between;
    width: 256px;
    /* Match bar width */
    font-size: 10px;
    color: var(--k-grey-mid, #737373);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.loader-percent {
    font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
    .loader-scanline {
        animation: none;
    }

    .loader {
        transition: opacity 0.5s ease;
        /* Fade instead of slide */
    }

    .loader.exiting {
        transform: none;
        opacity: 0;
    }
}