/* 8/16-bit Hacker Retro Theme */
@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

:root {
    --bg: #050505;
    --bg-grid: #0a0a0f;
    --fg: #00ff41;
    --fg-dim: #008f11;
    --fg-bright: #39ff14;
    --accent: #ff00ff;
    --accent2: #00ffff;
    --danger: #ff0040;
    --warning: #ffaa00;
    --terminal: #33ff33;
    --crt-scan: rgba(0, 255, 65, 0.03);
    --shadow: 0 0 10px var(--fg-dim), 0 0 20px var(--fg-dim);
}

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

body {
    background: var(--bg);
    color: var(--fg);
    font-family: 'VT323', monospace;
    font-size: 20px;
    line-height: 1.4;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* CRT Scanline Effect */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        var(--crt-scan) 2px,
        var(--crt-scan) 4px
    );
    pointer-events: none;
    z-index: 9999;
    animation: scanline 8s linear infinite;
}

@keyframes scanline {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

/* CRT Flicker */
body::after {
    content: "";
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 255, 65, 0.01);
    opacity: 0;
    pointer-events: none;
    z-index: 9998;
    animation: flicker 0.15s infinite;
}

@keyframes flicker {
    0% { opacity: 0.02; }
    50% { opacity: 0.05; }
    100% { opacity: 0.02; }
}

/* Grid Background */
.grid-bg {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image:
        linear-gradient(rgba(0, 255, 65, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 65, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: -1;
}

/* Container */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

/* Header / Boot Sequence */
.boot-sequence {
    margin-bottom: 40px;
    border: 2px solid var(--fg-dim);
    padding: 20px;
    background: rgba(0, 20, 0, 0.8);
    box-shadow: var(--shadow);
}

.boot-line {
    opacity: 0;
    animation: bootFade 0.5s forwards;
    margin: 4px 0;
}

@keyframes bootFade {
    to { opacity: 1; }
}

.boot-line:nth-child(1) { animation-delay: 0.1s; }
.boot-line:nth-child(2) { animation-delay: 0.3s; }
.boot-line:nth-child(3) { animation-delay: 0.5s; }
.boot-line:nth-child(4) { animation-delay: 0.7s; }
.boot-line:nth-child(5) { animation-delay: 0.9s; }
.boot-line:nth-child(6) { animation-delay: 1.1s; }
.boot-line:nth-child(7) { animation-delay: 1.3s; }

.cursor-blink::after {
    content: "█";
    animation: blink 1s step-end infinite;
    color: var(--fg);
}

@keyframes blink {
    50% { opacity: 0; }
}

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

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

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

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

@keyframes glitch-anim-1 {
    0% { clip: rect(20px, 9999px, 50px, 0); }
    20% { clip: rect(80px, 9999px, 120px, 0); }
    40% { clip: rect(10px, 9999px, 90px, 0); }
    60% { clip: rect(60px, 9999px, 100px, 0); }
    80% { clip: rect(30px, 9999px, 70px, 0); }
    100% { clip: rect(90px, 9999px, 130px, 0); }
}

@keyframes glitch-anim-2 {
    0% { clip: rect(60px, 9999px, 100px, 0); }
    20% { clip: rect(10px, 9999px, 50px, 0); }
    40% { clip: rect(90px, 9999px, 130px, 0); }
    60% { clip: rect(30px, 9999px, 70px, 0); }
    80% { clip: rect(80px, 9999px, 120px, 0); }
    100% { clip: rect(20px, 9999px, 90px, 0); }
}

/* Title */
.main-title {
    font-size: 48px;
    text-align: center;
    margin: 30px 0;
    text-shadow: 0 0 20px var(--fg), 0 0 40px var(--fg-dim);
    letter-spacing: 4px;
}

.subtitle {
    text-align: center;
    color: var(--fg-dim);
    font-size: 24px;
    margin-bottom: 40px;
}

/* Tool Cards */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.tool-card {
    border: 2px solid var(--fg-dim);
    padding: 20px;
    background: rgba(0, 10, 0, 0.9);
    transition: all 0.3s;
    cursor: pointer;
    text-decoration: none;
    color: var(--fg);
    display: block;
    position: relative;
    overflow: hidden;
}

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

.tool-card:hover::before {
    left: 100%;
}

.tool-card:hover {
    border-color: var(--fg-bright);
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.2), inset 0 0 20px rgba(0, 255, 65, 0.05);
    transform: translateY(-2px);
}

.tool-card .icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.tool-card h3 {
    color: var(--fg-bright);
    font-size: 24px;
    margin-bottom: 8px;
}

.tool-card .desc {
    color: var(--fg-dim);
    font-size: 18px;
}

.tool-card .status {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 14px;
    padding: 2px 8px;
    border: 1px solid;
}

.status.online { color: var(--terminal); border-color: var(--terminal); }
.status.beta { color: var(--warning); border-color: var(--warning); }
.status.dev { color: var(--accent); border-color: var(--accent); }

/* Terminal Box */
.terminal {
    border: 2px solid var(--fg-dim);
    padding: 20px;
    margin: 30px 0;
    background: rgba(0, 5, 0, 0.95);
    font-size: 18px;
}

.terminal-header {
    border-bottom: 1px solid var(--fg-dim);
    padding-bottom: 10px;
    margin-bottom: 15px;
    color: var(--fg-dim);
}

.terminal-line {
    margin: 6px 0;
    opacity: 0;
    animation: typeLine 0.1s forwards;
}

@keyframes typeLine {
    to { opacity: 1; }
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid var(--fg-dim);
    color: var(--fg-dim);
    font-size: 16px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg);
}
::-webkit-scrollbar-thumb {
    background: var(--fg-dim);
    border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--fg);
}

/* Responsive */
@media (max-width: 600px) {
    .main-title { font-size: 32px; }
    body { font-size: 16px; }
    .tools-grid { grid-template-columns: 1fr; }
}
