/* ── Loader ── */

#loader {
    position: fixed;
    inset: 0;
    background: var(--bg, #0a0a0a);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    transition: opacity 0.6s var(--ease-out, ease),
                visibility 0.6s;
}

#loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-ring {
    width: 48px;
    height: 48px;
    border: 2px solid var(--border, rgba(255,255,255,0.08));
    border-top-color: var(--accent, #6366f1);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loader-text {
    display: flex;
    gap: 3px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--text-secondary, #a1a1a1);
}

.loader-text span {
    animation: loaderChar 1.2s ease-in-out infinite;
}

.loader-text span:nth-child(1) { animation-delay: 0s; }
.loader-text span:nth-child(2) { animation-delay: 0.05s; }
.loader-text span:nth-child(3) { animation-delay: 0.1s; }
.loader-text span:nth-child(4) { animation-delay: 0.15s; }
.loader-text span:nth-child(5) { animation-delay: 0.2s; }
.loader-text span:nth-child(6) { animation-delay: 0.25s; }
.loader-text span:nth-child(7) { animation-delay: 0.3s; }
.loader-text span:nth-child(8) { animation-delay: 0.35s; }
.loader-text span:nth-child(9) { animation-delay: 0.4s; }
.loader-text span:nth-child(10) { animation-delay: 0.45s; }

/* ── Reveal Animations ── */

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--duration-slow) var(--ease-out),
                transform var(--duration-slow) var(--ease-out);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ── Keyframes ── */

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

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

@keyframes blink {
    50% { opacity: 0; }
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(30px, -40px); }
    50% { transform: translate(-20px, 20px); }
    75% { transform: translate(15px, 30px); }
}

@keyframes scrollDown {
    0% { top: -100%; }
    100% { top: 200%; }
}

@keyframes loaderChar {
    0%, 100% { opacity: 0.3; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-4px); }
}

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