/* ═══════════════════════════════════════════════════
   TERMINAL EFFECTS — CRT / Scanlines / Glow
   ═══════════════════════════════════════════════════ */

/* ── CRT Scanlines Overlay ── */
.crt-overlay {
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, var(--scanline-opacity)) 2px,
            rgba(0, 0, 0, var(--scanline-opacity)) 4px);
}

/* ── Typewriter Animation ── */
.typewriter {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--accent);
    animation: typewriter-reveal 2s steps(40, end),
        typewriter-cursor 0.75s step-end infinite;
}

@keyframes typewriter-reveal {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

@keyframes typewriter-cursor {

    0%,
    100% {
        border-color: var(--accent);
    }

    50% {
        border-color: transparent;
    }
}

/* ── Glow Pulse ── */
.glow-pulse {
    animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {

    0%,
    100% {
        text-shadow: 0 0 5px var(--accent-dim);
    }

    50% {
        text-shadow: 0 0 20px var(--accent-glow),
            0 0 40px var(--accent-dim);
    }
}

/* ── Flicker ── */
.flicker {
    animation: flicker 4s linear infinite;
}

@keyframes flicker {

    0%,
    19.999%,
    22%,
    62.999%,
    64%,
    64.999%,
    70%,
    100% {
        opacity: 1;
    }

    20%,
    21.999%,
    63%,
    63.999%,
    65%,
    69.999% {
        opacity: 0.4;
    }
}

/* ── Fade In Up ── */
.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fade-in-up 0.5s ease forwards;
}

@keyframes fade-in-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Staggered Animation Delays ── */
.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

.delay-4 {
    animation-delay: 0.4s;
}

.delay-5 {
    animation-delay: 0.5s;
}

/* ── ASCII Progress Animation ── */
@keyframes progress-fill {
    from {
        width: 0%;
    }
}

/* ── Border Glow Animation ── */
.border-glow {
    position: relative;
}

.border-glow::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(45deg,
            var(--accent),
            transparent,
            var(--accent));
    z-index: -1;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.border-glow:hover::before {
    opacity: 0.3;
}

/* ── Slide-in Animation for File Cards ── */
.slide-in {
    opacity: 0;
    transform: translateX(-20px);
    animation: slide-in 0.3s ease forwards;
}

@keyframes slide-in {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ── Matrix Rain Background (subtle, for hero section) ── */
.matrix-bg {
    position: relative;
    overflow: hidden;
}

.matrix-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 0%,
            var(--accent-dim) 0%,
            transparent 70%);
    opacity: 0.3;
    pointer-events: none;
}

/* ── Hover Lift ── */
.hover-lift {
    transition: transform var(--transition-fast),
        box-shadow var(--transition-fast);
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(var(--accent-rgb), 0.15);
}

/* ── Status Indicator ── */
.status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent);
    animation: status-pulse 2s ease-in-out infinite;
}

@keyframes status-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}