/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #0a0a0a;
    --text-color: #f5f5f5;
    --glitch-color-1: #8b0000;
    --glitch-color-2: #2a4a4a;
    --accent: #333;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

/* Matrix Canvas Background */
#matrix {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.08;
}

/* Container */
.container {
    text-align: center;
    max-width: 800px;
    width: 100%;
    position: relative;
    z-index: 1;
}

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

.glitch {
    font-family: 'Space Mono', monospace;
    font-size: clamp(2rem, 8vw, 4.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
    animation: glitch-skew 4s infinite linear alternate-reverse;
}

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

.glitch::before {
    color: var(--glitch-color-1);
    animation: glitch-effect 3s infinite linear alternate-reverse;
    clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
    transform: translate(-2px, -1px);
}

.glitch::after {
    color: var(--glitch-color-2);
    animation: glitch-effect 2s infinite linear alternate-reverse reverse;
    clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
    transform: translate(2px, 1px);
}

@keyframes glitch-effect {
    0% { transform: translate(0); }
    20% { transform: translate(-3px, 3px); }
    40% { transform: translate(-3px, -3px); }
    60% { transform: translate(3px, 3px); }
    80% { transform: translate(3px, -3px); }
    100% { transform: translate(0); }
}

@keyframes glitch-skew {
    0% { transform: skew(0deg); }
    20% { transform: skew(-0.5deg); }
    40% { transform: skew(0.5deg); }
    60% { transform: skew(-0.3deg); }
    80% { transform: skew(0.2deg); }
    100% { transform: skew(0deg); }
}

/* Sub Text */
.sub-text {
    font-size: clamp(1rem, 4vw, 1.5rem);
    font-weight: 300;
    color: #666;
    animation: fadeIn 2s ease-out 0.5s both;
    margin-bottom: 2rem;
}

/* Secret Text */
.secret-text {
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    color: var(--glitch-color-2);
    opacity: 0;
    transition: opacity 0.8s ease;
    cursor: pointer;
    margin-bottom: 3rem;
}

.secret-text.visible {
    opacity: 1;
    animation: flicker 0.15s infinite;
}

@keyframes flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Interact Zone */
.interact-zone {
    width: 100%;
    height: 30vh;
    position: relative;
    cursor: crosshair;
    z-index: 2;
    border: 1px solid transparent;
    transition: border-color 0.3s;
}

.interact-zone:hover {
    border-color: var(--glitch-color-1);
}

.interact-zone:active {
    background: rgba(255, 0, 60, 0.05);
}

/* Scanline */
.scanline {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(0, 255, 249, 0.1);
    animation: scanline 4s linear infinite;
}

@keyframes scanline {
    0% { top: 0%; }
    100% { top: 100%; }
}

/* Footer */
.footer {
    padding-top: 2rem;
    border-top: 1px solid var(--accent);
    animation: fadeIn 2s ease-out 1s both;
    font-family: 'Space Mono', monospace;
}

.copyright {
    font-size: 0.9rem;
    color: #444;
    font-weight: 400;
}

.blink {
    animation: blink 1s step-end infinite;
    color: var(--glitch-color-2);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

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

/* Click ripple */
.ripple {
    position: absolute;
    border-radius: 50%;
    border: 1px solid var(--glitch-color-1);
    animation: rippleOut 1s ease-out forwards;
    pointer-events: none;
}

@keyframes rippleOut {
    0% { width: 0; height: 0; opacity: 1; }
    100% { width: 100px; height: 100px; opacity: 0; }
}

/* Responsive */
@media (max-width: 600px) {
    .interact-zone {
        height: 25vh;
    }
}
