@import url('https://fonts.googleapis.com/css2?family=Anton&display=swap');

.outpost-loading-screen {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 24px;
    padding: 28px;
    background: #020303;
    color: var(--color-primary);
    opacity: 1;
    visibility: visible;
    transition: opacity 720ms ease, visibility 720ms ease;
}

.outpost-loading-screen.is-complete {
    opacity: 0;
    visibility: hidden;
}

.outpost-loading-scanlines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(255,255,255,0.018) 50%, transparent 50%),
        linear-gradient(90deg, rgba(255,0,0,0.012), rgba(0,255,255,0.008), rgba(0,0,255,0.012));
    background-size: 100% 4px, 6px 100%;
    animation: outpost-loading-scan 260ms steps(2, end) infinite;
}

.outpost-loading-glitch {
    position: relative;
    font-family: "Press Gothic", "Press Gothic Pro", "Anton", Impact, Haettenschweiler, var(--font-display);
    font-size: clamp(3rem, 9vw, 7rem);
    line-height: 0.9;
    letter-spacing: 12px;
    color: var(--color-accent);
    text-align: center;
    text-transform: uppercase;
    text-shadow: 0 4px 18px rgba(0,0,0,0.95);
}

.outpost-loading-message {
    margin-bottom: -12px;
    color: rgba(212,197,165,0.72);
    font-family: var(--font-display-light);
    font-size: clamp(0.9rem, 2vw, 1.25rem);
    letter-spacing: 4px;
    text-align: center;
    text-transform: uppercase;
}

.outpost-loading-message[hidden] {
    display: none;
}

.outpost-loading-glitch::before,
.outpost-loading-glitch::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    overflow: hidden;
    color: inherit;
    opacity: 0.55;
    pointer-events: none;
}

.outpost-loading-glitch::before {
    clip-path: inset(12% 0 62% 0);
    animation: outpost-glitch-top 1.3s steps(1, end) infinite;
}

.outpost-loading-glitch::after {
    clip-path: inset(64% 0 12% 0);
    animation: outpost-glitch-bottom 1.05s steps(1, end) infinite;
}

.outpost-loading-quote-block {
    width: min(760px, 84vw);
    min-height: 3.6em;
    text-align: center;
}

.outpost-loading-quote {
    color: rgba(212,197,165,0.62);
    font-family: var(--font-family);
    font-size: clamp(0.78rem, 1.5vw, 1rem);
    line-height: 1.6;
}

.outpost-loading-source {
    margin-top: 7px;
    color: rgba(212,197,165,0.42);
    font-family: var(--font-display-light);
    font-size: clamp(0.7rem, 1.3vw, 0.88rem);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.outpost-loading-source[hidden] {
    display: none;
}

.outpost-loading-progress {
    display: flex;
    align-items: center;
    gap: 18px;
}

.outpost-loading-ring {
    width: 44px;
    height: 44px;
    border: 1px solid rgba(212,197,165,0.13);
    border-top-color: var(--color-accent);
    border-right-color: rgba(212,197,165,0.52);
    border-radius: 50%;
    animation: outpost-loading-spin 850ms linear infinite;
}

.outpost-loading-percent {
    min-width: 58px;
    color: var(--color-accent);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    letter-spacing: 2px;
}

@keyframes outpost-loading-spin {
    to { transform: rotate(360deg); }
}

@keyframes outpost-loading-scan {
    0%, 82%, 100% { transform: translateY(0); opacity: 0.55; }
    83% { transform: translateY(3px); opacity: 0.82; }
}

@keyframes outpost-glitch-top {
    0%, 86%, 100% { transform: translate(0); }
    87% { transform: translate(7px, -2px); }
    90% { transform: translate(-4px, 1px); }
    93% { transform: translate(2px, 0); }
}

@keyframes outpost-glitch-bottom {
    0%, 74%, 100% { transform: translate(0); }
    75% { transform: translate(-6px, 2px); }
    79% { transform: translate(4px, -1px); }
    82% { transform: translate(-2px, 0); }
}

@media (max-width: 600px) {
    .outpost-loading-glitch {
        letter-spacing: 7px;
    }
    .outpost-loading-quote-block {
        width: 90vw;
    }
}

@media (prefers-reduced-motion: reduce) {
    .outpost-loading-scanlines,
    .outpost-loading-glitch::before,
    .outpost-loading-glitch::after,
    .outpost-loading-ring {
        animation: none;
    }
}
