/* ============================================
   GL1TCH.WTF — Main Stylesheet
   ============================================ */

/* --- Font Face --- */
@font-face {
    font-family: 'JetBrains Mono';
    src: url('../fonts/JetBrainsMono/JetBrainsMono-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'JetBrains Mono';
    src: url('../fonts/JetBrainsMono/JetBrainsMono-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'JetBrains Mono';
    src: url('../fonts/JetBrainsMono/JetBrainsMono-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* --- CSS Variables --- */
:root {
    --bg-primary: #0A0A0A;
    --accent-primary: #00FF88;
    --accent-secondary: #00CCFF;
    --accent-highlight: #FF00AA;
    --accent-warning: #FFFF00;
    --text-body: #CCCCCC;
    --text-muted: #555555;
    
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    
    --mx: 0.5;
    --my: 0.5;
}

/* --- Reset --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-mono);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-body);
    background-color: var(--bg-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

/* --- CRT Scanlines Overlay --- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15) 0px,
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
}

/* --- CRT Flicker Effect --- */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    background: radial-gradient(
        ellipse at center,
        transparent 0%,
        rgba(0, 0, 0, 0.3) 100%
    );
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 2rem;
}

/* --- Glitch Title --- */
.glitch-title {
    font-size: clamp(3rem, 10vw, 8rem);
    font-weight: 700;
    color: var(--accent-primary);
    text-transform: uppercase;
    position: relative;
    letter-spacing: 0.1em;
    text-shadow: 
        0 0 10px var(--accent-primary),
        0 0 20px var(--accent-primary),
        0 0 40px var(--accent-primary);
    animation: glitch-skew 4s infinite linear alternate-reverse;
    transform: translate(
        calc((var(--mx) - 0.5) * 10px),
        calc((var(--my) - 0.5) * 10px)
    );
    transition: transform 0.1s ease-out;
}

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

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

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

@keyframes glitch-1 {
    0%, 100% { transform: translate(-2px, -2px); }
    25% { transform: translate(2px, 0); }
    50% { transform: translate(-1px, 2px); }
    75% { transform: translate(1px, -1px); }
}

@keyframes glitch-2 {
    0%, 100% { transform: translate(2px, 2px); }
    25% { transform: translate(-2px, 1px); }
    50% { transform: translate(1px, -2px); }
    75% { transform: translate(-1px, 1px); }
}

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

/* --- Tagline with Typing Cursor --- */
.tagline {
    font-size: clamp(1rem, 3vw, 1.5rem);
    color: var(--accent-secondary);
    margin-top: 2rem;
    position: relative;
    opacity: 0;
}

.tagline::after {
    content: '_';
    animation: blink 1s step-end infinite;
    color: var(--accent-primary);
}

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

/* --- About Section --- */
.about {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.about-header {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(30px);
}

.about-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--text-muted),
        transparent
    );
    margin-bottom: 2rem;
    opacity: 0;
}

.about-text {
    opacity: 0;
    transform: translateY(30px);
}

.about-text p {
    margin-bottom: 0.5rem;
    color: var(--accent-primary);
}

.about-text p::before {
    content: '// ';
    color: var(--text-muted);
}

/* --- Footer --- */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    background: linear-gradient(
        to top,
        var(--bg-primary),
        transparent
    );
    z-index: 100;
}

.visitor-counter {
    cursor: pointer;
    transition: color 0.3s ease;
}

.visitor-counter:hover {
    color: var(--accent-primary);
}

.visitor-count {
    color: var(--accent-primary);
    font-weight: 500;
}

.no-tracking {
    transition: color 0.3s ease;
}

.no-tracking:hover {
    color: var(--accent-warning);
}

.copyright-easter {
    position: relative;
    cursor: default;
}

.copyright-easter .hidden-text {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    color: var(--accent-warning);
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.copyright-easter:hover .hidden-text {
    opacity: 1;
}

/* --- Chaos Mode (Konami Easter Egg) --- */
.chaos-mode {
    animation: chaos 0.1s infinite;
}

.chaos-mode .glitch-title {
    animation: chaos-glitch 0.05s infinite;
}

@keyframes chaos {
    0%, 100% { filter: hue-rotate(0deg); }
    25% { filter: hue-rotate(90deg); }
    50% { filter: hue-rotate(180deg); }
    75% { filter: hue-rotate(270deg); }
}

@keyframes chaos-glitch {
    0% { transform: translate(0, 0) skew(0deg); }
    20% { transform: translate(-10px, 5px) skew(5deg); }
    40% { transform: translate(10px, -5px) skew(-5deg); }
    60% { transform: translate(-5px, 10px) skew(3deg); }
    80% { transform: translate(5px, -10px) skew(-3deg); }
    100% { transform: translate(0, 0) skew(0deg); }
}

/* --- Terminal Message (Easter Egg) --- */
.terminal-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-primary);
    border: 1px solid var(--accent-primary);
    padding: 2rem;
    z-index: 10000;
    font-size: 0.9rem;
    max-width: 500px;
    box-shadow: 
        0 0 20px var(--accent-primary),
        inset 0 0 20px rgba(0, 255, 136, 0.1);
    animation: terminal-appear 0.3s ease-out;
}

.terminal-message::before {
    content: '> SYSTEM MESSAGE';
    display: block;
    color: var(--accent-warning);
    margin-bottom: 1rem;
    font-weight: 700;
}

.terminal-message p {
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.terminal-message .close-hint {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 1rem;
}

@keyframes terminal-appear {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* --- Noise Background --- */
.noise-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* --- Scroll Indicator --- */
.scroll-indicator {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-muted);
    font-size: 0.8rem;
    animation: bounce 2s infinite;
    opacity: 0;
}

.scroll-indicator::after {
    content: '↓';
    display: block;
    text-align: center;
    margin-top: 0.5rem;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(10px); }
}

/* --- Selection --- */
::selection {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

/* --- Links --- */
a {
    color: var(--accent-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-primary);
    text-shadow: 0 0 10px var(--accent-primary);
}
