/* === DARK TERMINAL STYLE === */
body {
    margin: 0;
    padding: 0;
    background: #000;
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Courier New', monospace;
    color: #8a2be2; /* Deep purple */
}

.dark-terminal {
    position: relative;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, #0a0a0a 0%, #000 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    overflow: hidden;
}

/* === GLITCH TEXT (Dark Glow) === */
.glitch {
    font-size: 5rem;
    font-weight: bold;
    text-transform: uppercase;
    position: relative;
    color: #8a2be2;
    text-shadow: 0 0 5px #8a2be2;
    animation: glitch 3s infinite alternate;
}

.glitch::before, .glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

.glitch::before {
    color: #ff0000; /* Blood red */
    z-index: -1;
    animation: glitch-effect 2s infinite reverse;
    text-shadow: 0 0 5px #ff0000;
}

.glitch::after {
    color: #0000ff; /* Deep blue */
    z-index: -2;
    animation: glitch-effect 1s infinite alternate;
    text-shadow: 0 0 5px #0000ff;
}

.subtext {
    font-size: 2rem;
    margin-top: 1rem;
    color: #ff0000;
    text-shadow: 0 0 5px #ff0000;
    animation: flicker 3s infinite;
}

/* === SCANLINE & NOISE (Darker) === */
.scanline {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(138, 43, 226, 0.03) 0%,
        rgba(138, 43, 226, 0.1) 50%,
        rgba(138, 43, 226, 0.03) 100%
    );
    background-size: 100% 6px;
    animation: scanline 6s linear infinite;
    z-index: 2;
    pointer-events: none;
}

.noise {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('assets/noise.png');
    opacity: 0.05;
    z-index: 3;
    pointer-events: none;
}

/* === OPTIONAL SCRATCH OVERLAY (Horror Effect) === */
.scratch-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('assets/scratch-overlay.png');
    opacity: 0.1;
    z-index: 4;
    pointer-events: none;
}

/* === TYPING EFFECT === */
.code-typing {
    margin-top: 2rem;
    font-size: 1.2rem;
    color: #8a2be2;
    text-shadow: 0 0 3px #8a2be2;
    white-space: nowrap;
    overflow: hidden;
    border-right: 2px solid #8a2be2;
    animation: typing 4s steps(40) forwards, blink-caret 0.75s step-end infinite;
}

.prompt {
    margin-top: 1rem;
    font-size: 1.2rem;
    color: #8a2be2;
    text-shadow: 0 0 3px #8a2be2;
}

.blinking-cursor {
    animation: blink 1s infinite;
}

/* === ANIMATIONS === */
@keyframes glitch {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-5px, 5px); }
    40% { transform: translate(-5px, -5px); }
    60% { transform: translate(5px, 5px); }
    80% { transform: translate(5px, -5px); }
}

@keyframes glitch-effect {
    0% { clip-path: inset(10% 0 90% 0); }
    20% { clip-path: inset(80% 0 5% 0); }
    40% { clip-path: inset(30% 0 60% 0); }
    60% { clip-path: inset(70% 0 10% 0); }
    80% { clip-path: inset(20% 0 50% 0); }
    100% { clip-path: inset(50% 0 30% 0); }
}

@keyframes scanline {
    0% { background-position: 0 0; }
    100% { background-position: 0 100vh; }
}

@keyframes flicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% { opacity: 1; }
    20%, 22%, 24%, 55% { opacity: 0.5; }
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: #8a2be2; }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}