:root {
    --mouse-x: 50%;
    --mouse-y: 50%;
    --cursor-size: 300px;
    --primary-color: #00ff41;
    --bg-color: #030a05;
    --dim-color: #0a2612;
    --alert-color: #ff003c;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    overflow: hidden;
    /* Use a very blocky, digital monospace font */
    font-family: 'Courier New', Courier, monospace;
    user-select: none;
    -webkit-user-select: none;
}

/* Binary Text Layers */
.binary-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    word-break: break-all;
    line-height: 0.85; /* Tight vertical spacing for 'no spaces' look */
    font-size: 18px;
    letter-spacing: -1px; /* Tighter horizontal spacing */
    font-weight: bold;
}

#bg-layer {
    color: var(--dim-color);
    z-index: 1;
}

#fg-layer {
    color: var(--primary-color);
    text-shadow: 0 0 8px var(--primary-color), 0 0 2px #fff;
    z-index: 2;
    /* Circular spotlight that follows the mouse */
    clip-path: circle(var(--cursor-size) at var(--mouse-x) var(--mouse-y));
    -webkit-clip-path: circle(var(--cursor-size) at var(--mouse-x) var(--mouse-y));
    pointer-events: none;
    transition: clip-path 0.1s ease-out, -webkit-clip-path 0.1s ease-out;
}

/* CRT Scanline & Glitch Effect */
#glitch-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 3;
    pointer-events: none;
    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;
    opacity: 0.4;
}

/* User Interface Layer */
#ui-layer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transition: opacity 2s ease-in-out;
    pointer-events: none;
    background: rgba(3, 10, 5, 0.7);
    padding: 40px;
    border: 1px solid rgba(0, 255, 65, 0.2);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

#ui-layer.revealed {
    opacity: 1;
    pointer-events: auto;
    animation: ui-flicker 3s infinite;
}

@keyframes ui-flicker {
    0%, 19.999%, 22%, 62.999%, 64%, 64.999%, 70%, 100% {
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.8), inset 0 0 15px rgba(0, 255, 65, 0.1);
        border-color: rgba(0, 255, 65, 0.2);
    }
    20%, 21.999%, 63%, 63.999%, 65%, 69.999% {
        box-shadow: 0 0 40px rgba(0, 255, 65, 0.2), inset 0 0 25px rgba(0, 255, 65, 0.3);
        border-color: rgba(0, 255, 65, 0.6);
    }
}

h1.glitch {
    color: #fff;
    font-size: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 0.3rem;
    margin: 0 0 10px 0;
    position: relative;
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
    font-family: inherit;
}

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

h1.glitch::before {
    left: 2px;
    text-shadow: -2px 0 var(--alert-color);
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

h1.glitch::after {
    left: -2px;
    text-shadow: -2px 0 var(--primary-color);
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2.5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(10px, 9999px, 86px, 0); }
    10% { clip: rect(61px, 9999px, 83px, 0); }
    20% { clip: rect(51px, 9999px, 20px, 0); }
    30% { clip: rect(3px, 9999px, 80px, 0); }
    40% { clip: rect(80px, 9999px, 30px, 0); }
    50% { clip: rect(15px, 9999px, 90px, 0); }
    60% { clip: rect(40px, 9999px, 15px, 0); }
    70% { clip: rect(98px, 9999px, 60px, 0); }
    80% { clip: rect(31px, 9999px, 40px, 0); }
    90% { clip: rect(81px, 9999px, 10px, 0); }
    100% { clip: rect(12px, 9999px, 55px, 0); }
}

@keyframes glitch-anim-2 {
    0% { clip: rect(65px, 9999px, 100px, 0); }
    10% { clip: rect(10px, 9999px, 86px, 0); }
    20% { clip: rect(51px, 9999px, 5px, 0); }
    30% { clip: rect(80px, 9999px, 40px, 0); }
    40% { clip: rect(20px, 9999px, 90px, 0); }
    50% { clip: rect(3px, 9999px, 20px, 0); }
    60% { clip: rect(98px, 9999px, 60px, 0); }
    70% { clip: rect(40px, 9999px, 15px, 0); }
    80% { clip: rect(15px, 9999px, 80px, 0); }
    90% { clip: rect(61px, 9999px, 30px, 0); }
    100% { clip: rect(31px, 9999px, 10px, 0); }
}

.subtitle {
    color: var(--primary-color);
    font-size: 1rem;
    margin-bottom: 2rem;
    opacity: 0.8;
}

.enter-btn {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 12px 30px;
    font-size: 1.2rem;
    font-family: inherit;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.enter-btn:hover {
    background: rgba(0, 255, 65, 0.1);
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.4), inset 0 0 10px rgba(0, 255, 65, 0.4);
    text-shadow: 0 0 8px var(--primary-color);
}

.enter-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 65, 0.4), transparent);
    transition: left 0.5s;
}

.enter-btn:hover::before {
    left: 100%;
}

.enter-btn:active {
    transform: scale(0.95);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    :root {
        --cursor-size: 150px;
    }
    .binary-layer {
        font-size: 14px;
        line-height: 0.9;
        letter-spacing: 0;
    }
    h1.glitch {
        font-size: 1.8rem;
    }
    #ui-layer {
        padding: 20px;
        width: 80%;
    }
    .enter-btn {
        font-size: 1rem;
        padding: 10px 20px;
    }
}
