/* ══════════════════════════════════════════════════════
   NITRO FOX DIGITALS — loader.css  (Terminal Boot r1)
   ══════════════════════════════════════════════════════ */

#nfLoader {
    position: fixed; inset: 0;
    z-index: 10000;
    background: #110E0B;
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    color: #FDF0E8;
}

/* Grid BG */
.ld-grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(232,80,10,0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(232,80,10,0.06) 1px, transparent 1px);
    background-size: 80px 80px;
    background-position: center;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 0%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 0%, transparent 80%);
    animation: ld-grid-move 20s linear infinite;
}
@keyframes ld-grid-move {
    from { background-position: 0 0; }
    to   { background-position: 80px 80px; }
}

/* Scanline overlay */
.ld-scan {
    position: absolute; inset: 0;
    background: repeating-linear-gradient(0deg,
        transparent 0px,
        transparent 3px,
        rgba(253,240,232,0.015) 3px,
        rgba(253,240,232,0.015) 4px);
    pointer-events: none;
    opacity: 0.8;
}

/* ── CORNER TAGS ── */
.ld-tag {
    position: absolute;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.14em;
    color: rgba(253,240,232,0.45);
    text-transform: uppercase;
    display: inline-flex; align-items: center; gap: 6px;
    opacity: 0;
    animation: ld-fade 0.6s ease 0.4s forwards;
}
.ld-tag--tl { top: 24px; left: 24px; }
.ld-tag--tr { top: 24px; right: 24px; color: #E8500A; }
.ld-tag--bl { bottom: 24px; left: 24px; }
.ld-tag--br { bottom: 24px; right: 24px; color: rgba(253,240,232,0.3); }

.ld-tag__bracket { color: #E8500A; font-size: 14px; }
.ld-tag__dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #E8500A;
    box-shadow: 0 0 8px #E8500A;
    animation: ld-blink 1.4s ease-in-out infinite;
}
@keyframes ld-blink { 50% { opacity: 0.3; } }
@keyframes ld-fade { to { opacity: 1; } }

/* ── CENTER ── */
.ld-center {
    position: relative;
    z-index: 2;
    display: flex; flex-direction: column; align-items: center;
    gap: 32px;
    width: min(640px, 88vw);
    text-align: center;
}

/* ── Giant number ── */
.ld-number-wrap {
    display: flex; align-items: baseline; gap: 8px;
    opacity: 0;
    animation: ld-fade 0.7s ease 0.2s forwards;
}
.ld-number-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(253,240,232,0.4);
    align-self: flex-start;
    padding-top: 20px;
}
.ld-number {
    font-family: 'Sixsound', sans-serif;
    font-weight: 400;
    font-size: 15rem; /* 240px base */
    line-height: 0.82;
    letter-spacing: -0.04em;
    color: #FFFFFF;
    display: inline-flex;
    filter: drop-shadow(0 0 30px rgba(232,80,10,0.3));
}
.ld-digit {
    display: inline-block;
    min-width: 0.55em;
    text-align: center;
    position: relative;
}
/* First digit dims when it's 0 */
.ld-number.is-tens .ld-digit:first-child { opacity: 0.15; }
.ld-number.is-single .ld-digit:nth-child(1),
.ld-number.is-single .ld-digit:nth-child(2) { opacity: 0.15; }

.ld-number-sign {
    font-family: 'Sixsound', sans-serif;
    font-weight: 400;
    font-size: 3.5rem; /* 56px */
    color: #E8500A;
    line-height: 1;
    align-self: flex-end;
    padding-bottom: 8px;
}

/* ── Wordmark with RGB glitch ── */
.ld-wordmark {
    display: flex; align-items: center; gap: 14px;
    font-family: 'Sixsound', sans-serif;
    font-weight: 400;
    font-size: 1rem; /* 16px */
    letter-spacing: 0.32em;
    color: #FDF0E8;
    opacity: 0;
    animation: ld-fade 0.6s ease 0.5s forwards;
}
.ld-word {
    position: relative;
    display: inline-block;
}
.ld-word::before,
.ld-word::after {
    content: attr(data-text);
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    color: #FDF0E8;
    mix-blend-mode: screen;
    pointer-events: none;
    opacity: 0;
}
.ld-word::before { color: #E8500A; animation: ld-glitch-r 3.6s ease-in-out infinite; }
.ld-word::after  { color: #0ae8c0; animation: ld-glitch-c 3.6s ease-in-out infinite; }
@keyframes ld-glitch-r {
    0%, 92%, 100%  { opacity: 0; transform: translate(0); }
    93%  { opacity: 0.8; transform: translate(-2px, 0); }
    94%  { opacity: 0.8; transform: translate(2px,  1px); }
    96%  { opacity: 0; }
}
@keyframes ld-glitch-c {
    0%, 92%, 100%  { opacity: 0; transform: translate(0); }
    93%  { opacity: 0.7; transform: translate(2px,  0); }
    94%  { opacity: 0.7; transform: translate(-2px, -1px); }
    96%  { opacity: 0; }
}
.ld-slash {
    color: #E8500A;
    font-weight: 400;
    transform: skewX(-12deg);
    opacity: 0.7;
}

/* ── ASCII progress bar ── */
.ld-ascii {
    display: flex; align-items: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    letter-spacing: -0.02em;
    line-height: 1;
    opacity: 0;
    animation: ld-fade 0.6s ease 0.55s forwards;
    width: 100%;
    max-width: 440px;
    gap: 4px;
}
.ld-ascii__brackets {
    color: #E8500A;
    font-size: 16px;
}
.ld-ascii__fill {
    color: #E8500A;
    white-space: nowrap;
    text-shadow: 0 0 4px rgba(232,80,10,0.6);
    transition: none;
}
.ld-ascii__empty {
    color: rgba(253,240,232,0.12);
    white-space: nowrap;
    transition: none;
}

/* ── Console log ── */
.ld-console {
    list-style: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    line-height: 1.7;
    letter-spacing: 0.02em;
    color: rgba(253,240,232,0.55);
    text-align: left;
    width: 100%;
    max-width: 440px;
    padding: 14px 18px;
    border: 1px solid rgba(253,240,232,0.08);
    border-radius: 6px;
    background: rgba(0,0,0,0.25);
    opacity: 0;
    animation: ld-fade 0.6s ease 0.6s forwards;
    min-height: 160px;
}
.ld-console li {
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.3s, transform 0.3s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ld-console li.is-shown {
    opacity: 1;
    transform: translateX(0);
}
.ld-console__arrow { color: #E8500A; margin-right: 6px; }
.ld-console__ok {
    display: inline-block;
    color: #22e17a;
    background: rgba(34,225,122,0.1);
    padding: 0 6px;
    border-radius: 3px;
    font-weight: 500;
    margin-right: 6px;
    font-size: 10px;
}
.ld-console li.ld-console__final .ld-console__ok {
    color: #E8500A;
    background: rgba(232,80,10,0.14);
}
.ld-console__dim { color: rgba(253,240,232,0.3); }
.ld-console__cursor {
    color: #E8500A;
    animation: ld-caret 0.9s steps(1) infinite;
}
@keyframes ld-caret { 50% { opacity: 0; } }

/* ── Exit slashes ── */
.ld-slash-exit {
    position: absolute;
    inset: 0;
    background: #110E0B;
    transform: translateY(100%) skewY(-8deg);
    z-index: 3;
    pointer-events: none;
}
.ld-slash-exit--a { background: #E8500A; }
.ld-slash-exit--b { background: #110E0B; }

#nfLoader.is-exit .ld-center,
#nfLoader.is-exit .ld-tag { animation: ld-exit-content 0.5s ease forwards; }
#nfLoader.is-exit .ld-slash-exit--a { animation: ld-slash-up 0.7s cubic-bezier(0.76,0,0.24,1) 0.1s forwards; }
#nfLoader.is-exit .ld-slash-exit--b { animation: ld-slash-up 0.7s cubic-bezier(0.76,0,0.24,1) 0.25s forwards; }

@keyframes ld-exit-content {
    to { opacity: 0; transform: translateY(-20px); }
}
@keyframes ld-slash-up {
    from { transform: translateY(100%) skewY(-8deg); }
    to   { transform: translateY(-100%) skewY(-8deg); }
}

#nfLoader.is-done {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0s 0.2s;
    pointer-events: none;
}

/* ── Mobile adjustments ── */
@media (max-width: 640px) {
    .ld-tag { font-size: 9px; letter-spacing: 0.1em; }
    .ld-tag--tl { top: 16px; left: 16px; }
    .ld-tag--tr { top: 16px; right: 16px; }
    .ld-tag--bl { bottom: 16px; left: 16px; }
    .ld-tag--br { bottom: 16px; right: 16px; }
    .ld-console { font-size: 10px; padding: 10px 14px; min-height: 140px; }
    .ld-wordmark { font-size: 12px; letter-spacing: 0.28em; gap: 10px; }
    .ld-number-wrap { gap: 4px; }
    .ld-center { gap: 22px; }
}
