:root {
    --bg-color: #050505;
    --text-main: #e0e0e0;
    --text-dim: #666;
    --accent: #ffffff;
    --terminal-green: #0f0;
    --terminal-red: #f00;
    /* Used sparingly for debug feel */
    --font-head: 'Share Tech Mono', monospace;
    --font-body: 'Space Mono', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    cursor: crosshair;
    /* Ominous cursor */
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-body);
    overflow-x: hidden;
    font-size: 14px;
    line-height: 1.6;
}

/* --- VISUAL FX LAYERS --- */

/* Scanlines */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0) 50%, rgba(0, 0, 0, 0.2) 50%, rgba(0, 0, 0, 0.2));
    background-size: 100% 4px;
    z-index: 999;
    pointer-events: none;
    opacity: 0.6;
}

/* Noise / Dither Simulation */
.noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 998;
    opacity: 0.05;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Vignette */
.vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: 0 0 150px rgba(0, 0, 0, 0.9) inset;
    pointer-events: none;
    z-index: 900;
}

/* --- LAYOUT --- */

canvas#world-engine {
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
    opacity: 0.4;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 10;
}

/* --- NAVIGATION --- */

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    padding-bottom: 20px;
    margin-bottom: 100px;
}

.logo {
    font-family: var(--font-head);
    font-size: 1.5rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    border: 1px solid var(--text-main);
    padding: 5px 15px;
    background: black;
}

.nav-links a {
    color: var(--text-dim);
    text-decoration: none;
    margin-left: 30px;
    text-transform: uppercase;
    font-size: 0.8rem;
    transition: color 0.2s, text-shadow 0.2s;
}

.nav-links a:hover {
    color: var(--accent);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* --- HERO --- */

.hero {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-left: 1px solid #333;
    padding-left: 40px;
}

h1 {
    font-family: var(--font-head);
    font-size: clamp(3rem, 8vw, 7rem);
    line-height: 0.9;
    text-transform: uppercase;
    margin-bottom: 20px;
    letter-spacing: -2px;
}

.hero p {
    max-width: 600px;
    color: var(--text-dim);
    font-size: 1.1rem;
    margin-bottom: 40px;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    color: var(--terminal-green);
    border: 1px solid #333;
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.8);
    width: fit-content;
}

.blink {
    width: 8px;
    height: 8px;
    background-color: var(--terminal-green);
    margin-right: 10px;
    animation: blinking 1s infinite;
}

@keyframes blinking {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

/* --- SECTIONS --- */

.section-header {
    font-family: var(--font-head);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
    margin: 100px 0 40px 0;
    display: flex;
    justify-content: space-between;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2px;
    /* Gap for grid lines */
    background-color: #333;
    /* Color of grid lines */
    border: 1px solid #333;
}

.card {
    background-color: var(--bg-color);
    padding: 30px;
    transition: background-color 0.3s;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card:hover {
    background-color: #0a0a0a;
}

.card h3 {
    font-family: var(--font-head);
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--accent);
}

.card p {
    color: var(--text-dim);
    font-size: 0.9rem;
}

.card .meta {
    font-size: 0.7rem;
    color: #444;
    margin-top: 20px;
    font-family: var(--font-head);
    text-transform: uppercase;
}

/* --- FOOTER --- */

footer {
    margin-top: 150px;
    border-top: 1px solid #333;
    padding: 50px 0;
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #444;
}

.glitch-hover:hover {
    animation: glitch 0.3s cubic-bezier(.25, .46, .45, .94) both infinite;
    color: var(--terminal-green);
}

@keyframes glitch {
    0% {
        transform: translate(0)
    }

    20% {
        transform: translate(-2px, 2px)
    }

    40% {
        transform: translate(-2px, -2px)
    }

    60% {
        transform: translate(2px, 2px)
    }

    80% {
        transform: translate(2px, -2px)
    }

    100% {
        transform: translate(0)
    }
}

/* Util */
.mono-box {
    border: 1px solid #333;
    padding: 20px;
    margin-top: 50px;
    background: #000;
}

/* --- GLITCH FX --- */

.glitch-active {
    animation: color-shift 0.2s infinite;
    overflow: hidden;
}

.shake-hard {
    animation: shake 0.1s cubic-bezier(.36, .07, .19, .97) both infinite;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-5px, 0, 0) rotate(1deg);
    }

    20%,
    80% {
        transform: translate3d(5px, 0, 0) rotate(-1deg);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-10px, 0, 0) rotate(2deg);
    }

    40%,
    60% {
        transform: translate3d(10px, 0, 0) rotate(-2deg);
    }
}

@keyframes color-shift {
    0% {
        filter: hue-rotate(0deg) saturate(1);
    }

    50% {
        filter: hue-rotate(180deg) saturate(1.5);
    }

    100% {
        filter: hue-rotate(360deg) saturate(1);
    }
}

.access-denied-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--font-head);
    color: red;
    text-align: center;
}

.error-box {
    border: 2px solid red;
    padding: 40px;
    background: #100000;
    box-shadow: 0 0 50px red;
    animation: pulse-red 0.5s infinite alternate;
}

.error-box h1 {
    font-size: 4rem;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 5px;
}

.loading-bar {
    width: 100%;
    height: 10px;
    background: #300;
    margin-top: 20px;
    position: relative;
}

.loading-bar .fill {
    height: 100%;
    background: red;
    width: 0%;
    animation: fill-bar 5s linear forwards;
}

@keyframes pulse-red {
    from {
        box-shadow: 0 0 20px red;
    }

    to {
        box-shadow: 0 0 60px red;
    }
}

@keyframes fill-bar {
    0% {
        width: 0%;
    }

    100% {
        width: 100%;
    }
}

/* --- ALERT BANNER --- */
.alert-banner {
    background-color: rgba(50, 0, 0, 0.8);
    border: 1px solid #500;
    color: #f88;
    text-align: center;
    padding: 10px;
    font-family: var(--font-head);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
    animation: pulse-alert 2s infinite;
}

.alert-banner a {
    color: #fff;
    text-decoration: underline;
    font-weight: bold;
}

.alert-banner a:hover {
    color: var(--terminal-red);
    text-shadow: 0 0 5px red;
}

@keyframes pulse-alert {
    0% {
        box-shadow: 0 0 5px rgba(255, 0, 0, 0.1) inset;
    }

    50% {
        box-shadow: 0 0 15px rgba(255, 0, 0, 0.3) inset;
    }

    100% {
        box-shadow: 0 0 5px rgba(255, 0, 0, 0.1) inset;
    }
}