@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap');

:root {
    --bg-color: #0a0a0a;
    --neon-green: #39ff14;
    --cyber-purple: #bc13fe;
    --retro-orange: #ff5f1f;
    --text-color: #f0f0f0;
    --pixel-size: 4px;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
.pixel-font {
    font-family: 'Press Start 2P', cursive;
    text-transform: uppercase;
    line-height: 1.2;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    overflow-wrap: break-word;
}

/* CRT Scanline Effect */
body::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 9999;
    background-size: 100% 4px, 3px 100%;
    pointer-events: none;
}

/* Flicker Animation */
@keyframes flicker {
    0% {
        opacity: 0.97;
    }

    5% {
        opacity: 0.95;
    }

    10% {
        opacity: 0.9;
    }

    15% {
        opacity: 0.95;
    }

    20% {
        opacity: 0.98;
    }

    25% {
        opacity: 0.95;
    }

    30% {
        opacity: 0.9;
    }

    100% {
        opacity: 1;
    }
}

.crt-flicker {
    animation: flicker 0.15s infinite;
}

/* Container */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

/* Navigation */
nav {
    border-bottom: 4px solid var(--neon-green);
    padding: 1rem 0;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav a {
    color: var(--neon-green);
    text-decoration: none;
    margin-left: 2rem;
    font-size: 1rem;
    transition: all 0.3s;
}

nav a:hover {
    color: var(--bg-color);
    background-color: var(--neon-green);
    box-shadow: 0 0 10px var(--neon-green);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 0;
    border: 4px solid var(--cyber-purple);
    position: relative;
    margin-bottom: 3rem;
    background: rgba(188, 19, 254, 0.05);
}

.hero h1 {
    font-size: 2.5rem;
    color: var(--neon-green);
    text-shadow: 3px 3px var(--cyber-purple);
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.5rem;
    color: var(--retro-orange);
}

/* Sections */
.section {
    margin-bottom: 4rem;
}

.section h2 {
    color: var(--cyber-purple);
    border-bottom: 2px solid var(--cyber-purple);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    border: 4px solid var(--neon-green);
    padding: 1.5rem;
    background: rgba(57, 255, 20, 0.05);
    transition: transform 0.2s;
}

.card:hover {
    transform: translate(-4px, -4px);
    box-shadow: 4px 4px 0 var(--neon-green);
}

.card h3 {
    color: var(--neon-green);
    margin-bottom: 1rem;
    font-size: 1rem;
}

/* Pixel Art Image Placeholder */
.pixel-img {
    width: 100%;
    height: 200px;
    background: #222;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--text-color);
    image-rendering: pixelated;
    object-fit: cover;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0;
    border-top: 4px solid var(--retro-orange);
    color: var(--retro-orange);
    margin-top: 4rem;
}

/* Glitch Effect for 404 */
.glitch {
    position: relative;
    color: white;
    font-size: 4rem;
}

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

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 #00fff9, 2px 2px #ff00c1;
    animation: glitch-anim2 1s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% {
        clip: rect(31px, 9999px, 94px, 0);
    }

    20% {
        clip: rect(62px, 9999px, 42px, 0);
    }

    40% {
        clip: rect(16px, 9999px, 78px, 0);
    }

    60% {
        clip: rect(43px, 9999px, 11px, 0);
    }

    80% {
        clip: rect(54px, 9999px, 7px, 0);
    }

    100% {
        clip: rect(85px, 9999px, 33px, 0);
    }
}

@keyframes glitch-anim2 {
    0% {
        clip: rect(65px, 9999px, 100px, 0);
    }

    20% {
        clip: rect(30px, 9999px, 20px, 0);
    }

    40% {
        clip: rect(10px, 9999px, 40px, 0);
    }

    60% {
        clip: rect(50px, 9999px, 80px, 0);
    }

    80% {
        clip: rect(90px, 9999px, 10px, 0);
    }

    100% {
        clip: rect(20px, 9999px, 60px, 0);
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    nav {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    nav a {
        margin: 0 0.5rem;
        font-size: 0.9rem;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .hero img {
        height: 200px !important;
    }

    .glitch {
        font-size: 3rem;
    }

    .section h2 {
        font-size: 1.2rem;
    }

    .section {
        margin-bottom: 2rem;
    }

    h1 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .card h3 {
        font-size: 0.9rem;
    }

    body {
        font-size: 1.1rem;
    }
}