:root {
    --bg-color: #050101;
    --text-color: #f0f0f0;
    --accent-color: #e83331;

    /* Glitch Variables (Driven by JS) */
    --glitch-red-opacity: 0;
    --glitch-red-clip: inset(50% 0 50% 0);
    --glitch-red-unit: 0;
    /* -1 to 1 */

    --glitch-green-opacity: 0;
    --glitch-green-clip: inset(50% 0 50% 0);
    --glitch-green-unit: 0;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Space Mono', monospace;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: crosshair;
}

/* Container */
.container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
}

/* Logo */
.logo-wrapper {
    width: 100%;
    max-width: 600px;
    margin-bottom: 4rem;
    position: relative;
}

.logo-main {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 0 5px rgba(232, 51, 49, 0.2));
    position: relative;
    z-index: 10;
}

/* Logo Glitch Layers */
.logo-glitch-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    overflow: hidden;
    pointer-events: none;
    background-color: var(--bg-color);
    opacity: 0;
    /* Logic override */
    transition: opacity 0.05s;
    /* Slight fade or instant? keep fast */
}

.logo-glitch-layer img {
    width: 100%;
    height: 100%;
    display: block;
}

/* Red Layer (JS Driven) */
.logo-glitch-layer.red {
    opacity: var(--glitch-red-opacity);
    clip-path: var(--glitch-red-clip);
    transform: translateX(calc(var(--glitch-red-unit) * 15px));
    /* Large Shift for Logo */
}

.logo-glitch-layer.red img {
    filter: drop-shadow(2px 0 0 #f00);
}

/* Green Layer (JS Driven) */
.logo-glitch-layer.green {
    opacity: var(--glitch-green-opacity);
    clip-path: var(--glitch-green-clip);
    transform: translateX(calc(var(--glitch-green-unit) * 15px));
}

.logo-glitch-layer.green img {
    filter: drop-shadow(-2px 0 0 #0f0);
}

/* Links */
.links {
    display: flex;
    gap: 3rem;
}

.links a {
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
    letter-spacing: 2px;
    position: relative;
    transition: color 0.2s;
}

.links a:hover {
    color: var(--text-color);
}

/* Glitch Text Effect */
.glitch-text {
    position: relative;
    display: inline-block;
}

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

.glitch-text:hover::before,
.glitch-text:hover::after {
    display: block;
}

/* Text Glitch Syncs with Global Glitch */
.glitch-text::before {
    left: 0;
    text-shadow: 1px 0 #0f0;

    /* Always visible on hover (opacity 1), dynamic clip/pos */
    opacity: 1;
    clip-path: var(--glitch-green-clip);
    transform: translateX(calc(var(--glitch-green-unit) * 3px));
    /* Smaller Shift for Text */
}

.glitch-text::after {
    left: 0;
    text-shadow: -1px 0 #f00;

    opacity: 1;
    clip-path: var(--glitch-red-clip);
    transform: translateX(calc(var(--glitch-red-unit) * 3px));
}

/* Background Effects */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    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;
    pointer-events: none;
    z-index: 5;
    opacity: 0.3;
}

.noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 4;
    opacity: 0.03;
    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)' opacity='1'/%3E%3C/svg%3E");
}

#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
    .links {
        flex-direction: column;
        gap: 1.5rem;
        align-items: center;
    }

    .logo-wrapper {
        margin-bottom: 3rem;
    }
}