:root {
    --bg-color: #050505;
    --text-color: #e0e0e0;
    --accent-color: #00f3ff;
    /* Cyan accent */
    --secondary-color: #bd00ff;
    /* Purple secondary */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Enforce no selection globally */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;

    /* Disable mobile callouts (magnifying glass) */
    -webkit-touch-callout: none;

    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Outfit', sans-serif;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: crosshair;

    /* Native App Feel */
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    -webkit-touch-callout: none;
}

/* CRT Overlay */
.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    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));
    background-size: 100% 4px, 4px 100%;
    /* Scanlines */
    z-index: 999;
    pointer-events: none;
    animation: flicker 0.15s infinite;
}

@keyframes flicker {
    0% {
        opacity: 0.9;
    }

    50% {
        opacity: 0.95;
    }

    100% {
        opacity: 0.9;
    }
}

/* Vignette Overlay */
body::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 0%, #000000 90%);
    pointer-events: none;
    /* Let clicks pass through */
    z-index: 5;
}

#canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.container {
    position: relative;
    z-index: 10;
    text-align: center;
    opacity: 0;
    animation: fadeIn 2s ease-out forwards;
}

.hero-text {
    font-size: 15vw;
    font-weight: 700;
    letter-spacing: -0.05em;
    color: transparent;

    /* Liquid Fill Setup */
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0) 50%,
            var(--accent-color) 50%,
            rgba(189, 0, 255, 0.8) 100%);
    background-size: 100% 205%;
    background-position: 0% 5%;
    /* Start showing transparent part */
    background-clip: text;
    -webkit-background-clip: text;

    /* Stroke */
    -webkit-text-stroke: 2px rgba(255, 255, 255, 0.1);

    position: relative;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
    /* Nuclear option for selection */
    cursor: default;
    transition: background-position 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.1s ease-out;
    filter: drop-shadow(0 0 30px rgba(0, 243, 255, 0.1));
}

/* Remove old ::before fill */
.hero-text::before {
    display: none;
}

/* Hover: Fill the text (Triggered by container since text ignores pointer events) */
.container:hover .hero-text {
    background-position: 0% 100%;
    filter: drop-shadow(0 0 60px rgba(0, 243, 255, 0.5));
    -webkit-text-stroke: 2px rgba(255, 255, 255, 0.5);
    transform: scale(1.02);
}

/* Glitch Effect Classes */
.hero-text.glitch {
    position: relative;
    color: var(--text-color);
    /* Make text visible during glitch or keep transparent? stick to transparent */
}

/* Glitch layers need to grab the text */
.hero-text.glitch::after,
.hero-text.glitch::before {
    display: block;
    /* Override display:none from above */
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    /* Hide main text behind */
    color: var(--text-color);
    overflow: hidden;
    clip-path: inset(0 0 0 0);
    -webkit-text-stroke: 0;
    /* No stroke on glitch layers for cleaner look */
}

.hero-text.glitch::before {
    left: 2px;
    text-shadow: -2px 0 var(--secondary-color);
    animation: glitch-anim-1 0.3s infinite linear alternate-reverse;
}

.hero-text.glitch::after {
    left: -2px;
    text-shadow: -2px 0 var(--accent-color);
    animation: glitch-anim-2 0.3s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
    0% {
        clip-path: inset(20% 0 80% 0);
    }

    20% {
        clip-path: inset(60% 0 10% 0);
    }

    40% {
        clip-path: inset(40% 0 50% 0);
    }

    60% {
        clip-path: inset(80% 0 5% 0);
    }

    80% {
        clip-path: inset(10% 0 60% 0);
    }

    100% {
        clip-path: inset(50% 0 30% 0);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip-path: inset(10% 0 60% 0);
    }

    20% {
        clip-path: inset(80% 0 5% 0);
    }

    40% {
        clip-path: inset(40% 0 50% 0);
    }

    60% {
        clip-path: inset(20% 0 80% 0);
    }

    80% {
        clip-path: inset(50% 0 30% 0);
    }

    100% {
        clip-path: inset(60% 0 10% 0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .hero-text {
        font-size: 25vw;
        -webkit-text-stroke: 1px rgba(255, 255, 255, 0.2);
    }
}

/* Typing Text */
.typing-text {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    color: var(--accent-color);
    margin-top: 20px;
    letter-spacing: 0.1em;
    height: 1.5em;
    /* Prevent layout jump */
    text-shadow: 0 0 5px var(--accent-color);
    opacity: 0.8;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
}

.typing-text::after {
    content: '|';
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}