@import url('https://fonts.googleapis.com/css2?family=Creepster&family=Courier+Prime:wght@400;700&family=VT323&display=swap');

:root {
    --void-black: #0a0a0a;
    --deep-black: #1a1a1a;
    --dirty-gray: #2a2a2a;
    --blood-red: #8b0000;
    --bright-red: #ff0000;
    --terminal-green: #00ff00;
    --error-red: #ff4444;
    --corruption-purple: #800080;
    --glitch-blue: #0080ff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow-x: hidden;
}

body {
    background: linear-gradient(45deg, var(--void-black) 0%, var(--deep-black) 50%, var(--dirty-gray) 100%);
    font-family: 'VT323', 'Courier Prime', monospace;
    color: #ffffff;
    position: relative;
    cursor: none;
    font-size: 16px;
    line-height: 1.4;
    min-height: 100vh;
}

/* Static noise overlay */
#static-noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='1' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.05'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1;
    animation: static-flicker 0.1s infinite;
}

@keyframes static-flicker {
    0% { opacity: 0.03; }
    50% { opacity: 0.07; }
    100% { opacity: 0.03; }
}

/* CRT scan lines */
#scan-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(transparent 50%, rgba(0, 0, 0, 0.1) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 2;
    animation: scan-move 0.1s linear infinite;
}

@keyframes scan-move {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

/* Custom cursor */
.glitch-cursor {
    position: fixed;
    top: 0;
    left: 0;
    font-size: 24px;
    color: var(--blood-red);
    pointer-events: none;
    z-index: 9999;
    animation: cursor-flicker 1s infinite;
    mix-blend-mode: difference;
    text-shadow: 0 0 10px var(--blood-red);
}

@keyframes cursor-flicker {
    0%, 50%, 100% { opacity: 1; }
    25%, 75% { opacity: 0.3; }
}

/* Typography and glitch effects */
.glitch {
    position: relative;
    display: inline-block;
}

.glitch:before,
.glitch:after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch:before {
    animation: glitch-1 2s infinite;
    color: var(--glitch-blue);
    z-index: -1;
}

.glitch:after {
    animation: glitch-2 2s infinite;
    color: var(--blood-red);
    z-index: -2;
}

@keyframes glitch-1 {
    0%, 14%, 15%, 49%, 50%, 99%, 100% {
        transform: translate(0, 0) skew(0deg);
    }
    1%, 13% {
        transform: translate(-2px, 1px) skew(-1deg);
    }
    16%, 48% {
        transform: translate(1px, -1px) skew(1deg);
    }
    51%, 98% {
        transform: translate(-1px, 2px) skew(-2deg);
    }
}

@keyframes glitch-2 {
    0%, 20%, 21%, 62%, 63%, 100% {
        transform: translate(0, 0) skew(0deg);
    }
    1%, 19% {
        transform: translate(1px, -1px) skew(1deg);
    }
    22%, 61% {
        transform: translate(-2px, 1px) skew(-1deg);
    }
    64%, 99% {
        transform: translate(2px, -2px) skew(2deg);
    }
}

/* Header styles */
.main-header {
    text-align: center;
    padding: 40px 20px;
    background: radial-gradient(circle, var(--deep-black) 0%, var(--void-black) 100%);
    border-bottom: 2px solid var(--blood-red);
    position: relative;
}

.title {
    font-family: 'Creepster', cursive;
    font-size: clamp(3rem, 8vw, 8rem);
    color: var(--blood-red);
    text-shadow: 
        0 0 20px var(--blood-red),
        0 0 40px var(--blood-red),
        2px 2px 0px var(--void-black);
    margin-bottom: 20px;
    letter-spacing: 8px;
}

.subtitle {
    font-size: 1.5rem;
    color: var(--dirty-gray);
    letter-spacing: 4px;
    text-transform: uppercase;
}

.flicker {
    animation: flicker 3s infinite;
}

@keyframes flicker {
    0%, 18%, 22%, 25%, 53%, 57%, 100% {
        opacity: 1;
        text-shadow: 0 0 10px var(--terminal-green);
    }
    20%, 24%, 55% {
        opacity: 0.1;
        text-shadow: none;
    }
}

/* Navigation */
.main-nav {
    background: var(--deep-black);
    border-bottom: 1px solid var(--blood-red);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 40px;
}

.nav-link {
    color: #ffffff;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--blood-red);
    text-shadow: 0 0 10px var(--blood-red);
}

.phantom-link {
    opacity: 0.3;
    animation: phantom-pulse 4s infinite;
}

@keyframes phantom-pulse {
    0%, 100% { opacity: 0.1; }
    50% { opacity: 0.8; }
}

/* Main content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 10;
}

/* Terminal section */
.terminal-window {
    background: var(--void-black);
    border: 2px solid var(--terminal-green);
    border-radius: 8px;
    margin: 40px 0;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.3);
    overflow: hidden;
}

.terminal-header {
    background: var(--deep-black);
    padding: 15px 20px;
    border-bottom: 1px solid var(--terminal-green);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.terminal-title {
    color: var(--terminal-green);
    font-family: 'Courier Prime', monospace;
    font-weight: bold;
}

.terminal-status {
    color: var(--blood-red);
    font-size: 1.2rem;
}

.terminal-body {
    padding: 20px;
    font-family: 'Courier Prime', monospace;
    line-height: 1.6;
}

.terminal-line {
    margin-bottom: 10px;
    display: flex;
    gap: 10px;
}

.prompt {
    color: var(--terminal-green);
    font-weight: bold;
}

.prompt.error {
    color: var(--error-red);
    animation: error-pulse 1s infinite;
}

@keyframes error-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.command {
    color: #ffffff;
}

.error-text {
    color: var(--error-red);
}

.typing-effect {
    overflow: hidden;
    white-space: nowrap;
    animation: typing 3s steps(30, end), blink-cursor 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

.blink {
    animation: blink 1s infinite;
}

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

/* Content grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.content-box {
    background: linear-gradient(135deg, var(--deep-black) 0%, var(--dirty-gray) 100%);
    border: 1px solid var(--blood-red);
    border-radius: 8px;
    padding: 25px;
    position: relative;
    transition: all 0.3s ease;
}

.content-box:hover {
    box-shadow: 0 0 20px rgba(139, 0, 0, 0.5);
    transform: translateY(-5px);
}

.glitch-box {
    animation: box-glitch 15s infinite;
}

@keyframes box-glitch {
    0%, 90%, 100% { transform: translateY(0); }
    91%, 95% { 
        transform: translateY(-2px) skew(1deg);
        filter: hue-rotate(90deg);
    }
    93%, 97% { 
        transform: translateY(2px) skew(-1deg);
        filter: hue-rotate(180deg);
    }
}

.box-title {
    font-size: 1.5rem;
    color: var(--blood-red);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.distorted-text {
    font-family: 'VT323', monospace;
    font-size: 1.1rem;
    line-height: 1.5;
    color: #cccccc;
}

.corrupted-text {
    font-family: 'Courier Prime', monospace;
    color: var(--error-red);
    text-align: center;
    font-weight: bold;
    animation: data-corruption 2s infinite;
}

@keyframes data-corruption {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.5) contrast(2); }
}

.timestamp {
    position: absolute;
    bottom: 10px;
    right: 15px;
    font-size: 0.9rem;
    color: var(--terminal-green);
    font-family: 'Courier Prime', monospace;
}

.decrypt-btn {
    background: var(--blood-red);
    color: white;
    border: none;
    padding: 10px 20px;
    font-family: 'VT323', monospace;
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.decrypt-btn:hover {
    background: var(--bright-red);
    box-shadow: 0 0 15px var(--blood-red);
    transform: scale(1.05);
}

/* Hidden and phantom elements */
.phantom-box {
    background: linear-gradient(45deg, var(--void-black), var(--corruption-purple));
    border-color: var(--corruption-purple);
    animation: phantom-appear 10s infinite;
}

@keyframes phantom-appear {
    0%, 80%, 100% { opacity: 0; transform: scale(0.9); }
    85%, 95% { opacity: 1; transform: scale(1); }
}

.hidden-text {
    color: var(--blood-red);
    animation: reveal-text 0.1s infinite;
}

@keyframes reveal-text {
    0%, 99% { opacity: 0; }
    1%, 98% { opacity: 1; }
}

.red-text {
    color: var(--blood-red) !important;
    text-shadow: 0 0 10px var(--blood-red);
}

.whisper-text {
    font-style: italic;
    opacity: 0.7;
    animation: whisper 3s infinite;
}

@keyframes whisper {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.9; }
}

.base64-message {
    font-family: 'Courier Prime', monospace;
    font-size: 0.9rem;
    color: var(--terminal-green);
    background: var(--void-black);
    padding: 5px;
    border-radius: 3px;
    margin-top: 10px;
    display: inline-block;
}

/* Interactive zone */
.interactive-zone {
    text-align: center;
    margin: 60px 0;
    padding: 40px;
    background: radial-gradient(circle, var(--void-black) 0%, var(--deep-black) 70%);
    border: 2px dashed var(--blood-red);
    border-radius: 12px;
}

.warning-sign {
    font-size: 1.3rem;
    color: var(--error-red);
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 0 0 10px var(--error-red);
}

#noise-canvas {
    border: 1px solid var(--dirty-gray);
    background: var(--void-black);
    filter: contrast(200%) brightness(150%);
}

/* Footer */
.main-footer {
    background: var(--void-black);
    border-top: 2px solid var(--blood-red);
    padding: 30px 20px;
    text-align: center;
    margin-top: 60px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.copyright {
    font-size: 1rem;
    margin-bottom: 15px;
    opacity: 0.8;
}

.visitor-counter {
    font-family: 'Courier Prime', monospace;
    font-size: 1.1rem;
    color: var(--terminal-green);
}

#soul-counter {
    font-weight: bold;
    animation: counter-flicker 2s infinite;
}

@keyframes counter-flicker {
    0%, 90%, 100% { color: var(--terminal-green); }
    95% { color: var(--blood-red); }
}

/* Hidden line animation */
.hidden-line {
    opacity: 0;
    animation: reveal-hidden 8s infinite;
}

@keyframes reveal-hidden {
    0%, 70%, 100% { opacity: 0; }
    75%, 85% { opacity: 1; }
}

/* Responsive design */
@media (max-width: 768px) {
    .main-nav ul {
        flex-wrap: wrap;
        gap: 20px;
    }
    
    .nav-link {
        font-size: 1rem;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .title {
        font-size: 3rem;
        letter-spacing: 4px;
    }
    
    .terminal-body {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 20px 10px;
    }
    
    .content-box {
        padding: 15px;
    }
    
    .title {
        font-size: 2.5rem;
        letter-spacing: 2px;
    }
}

/* Special effects for different cursors */
body.skeletal-cursor .glitch-cursor::before {
    content: "☠";
    color: var(--blood-red);
}

body.cross-cursor .glitch-cursor::before {
    content: "✠";
    color: var(--corruption-purple);
}