#starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.3;
}

@keyframes twinkle {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

.star {
    animation: twinkle 3s infinite;
    animation-delay: calc(var(--delay) * 1s);
}

@keyframes scan-line {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100vh); }
}

.scan-line {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(to bottom, 
        transparent, 
        var(--terminal-highlight), 
        transparent);
    opacity: 0.1;
    animation: scan-line 8s linear infinite;
    pointer-events: none;
    z-index: 2;
}

@keyframes glitch {
    0%, 100% { 
        text-shadow: 
            2px 0 var(--terminal-dim),
            -2px 0 var(--terminal-highlight);
    }
    25% { 
        text-shadow: 
            -2px 0 var(--terminal-dim),
            2px 0 var(--terminal-highlight);
    }
    50% { 
        text-shadow: 
            2px 0 var(--terminal-highlight),
            -2px 0 var(--terminal-dim);
    }
}

.glitch {
    animation: glitch 3s infinite;
}

@keyframes matrix-rain {
    0% { 
        transform: translateY(-100vh);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% { 
        transform: translateY(120vh);
        opacity: 0;
    }
}

.matrix-char {
    position: fixed;
    color: var(--terminal-dim);
    animation: matrix-rain var(--duration) linear infinite;
    animation-delay: var(--delay);
    opacity: 0;
    font-size: 12px;
    pointer-events: none;
    text-shadow: 0 0 5px var(--terminal-dim);
    font-family: var(--terminal-font);
    transform: translateY(-100vh);
    animation-fill-mode: both;
}

@keyframes typewriter-lines {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes typewriter-text {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink-cursor {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.typewriter-container {
    overflow: hidden;
}

.typewriter-line {
    opacity: 0;
    animation: typewriter-lines 0.1s steps(1) forwards;
    animation-delay: calc(var(--line-index) * 0.05s);
}

#terminal-header {
    animation: typewriter-lines 0.1s steps(1);
}

#terminal-menu {
    opacity: 0;
    animation: typewriter-lines 0.1s steps(1) 0.1s forwards;
}

#terminal-content {
    opacity: 0;
    animation: typewriter-lines 0.1s steps(1) 0.2s forwards;
}

#terminal-footer {
    opacity: 0;
    animation: typewriter-lines 0.1s steps(1) 0.3s forwards;
}

.content-section {
    position: relative;
}

.content-loading {
    opacity: 0;
    animation: typewriter-lines 0.5s ease-out forwards;
}

@keyframes terminal-boot {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

body {
    animation: terminal-boot 0.3s steps(10);
}