:root {
    --bg: #0a0a0f;
    --bg2: #0d0d14;
    --surface: #12121c;
    --surface2: #1a1a2e;
    --accent: #00ff88;
    --accent2: #00cc6a;
    --accent-glow: rgba(0, 255, 136, 0.15);
    --danger: #ff2255;
    --warning: #ffaa00;
    --text: #e0e0e0;
    --text-dim: #6a6a8a;
    --border: rgba(0, 255, 136, 0.12);
    --font-mono: 'Share Tech Mono', monospace;
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    overflow-x: hidden;
    min-height: 100vh;
}

#scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 136, 0.015) 2px,
        rgba(0, 255, 136, 0.015) 4px
    );
}

#glitch-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    opacity: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(0, 255, 136, 0.03) 50%,
        transparent 100%
    );
    animation: glitchSweep 8s ease-in-out infinite;
}

@keyframes glitchSweep {
    0%, 90%, 100% { opacity: 0; transform: translateX(-100%); }
    92%, 98% { opacity: 1; transform: translateX(100%); }
}

.accent { color: var(--accent); }

/* NAVBAR */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(10, 10, 15, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    filter: drop-shadow(0 0 6px var(--accent));
}

.nav-brand {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--text);
    letter-spacing: 2px;
}

.nav-routes {
    display: flex;
    gap: 4px;
    overflow: hidden;
    max-width: 50vw;
}

.route-item {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    padding: 4px 10px;
    border-radius: 4px;
    background: var(--surface);
    color: var(--text-dim);
    border: 1px solid transparent;
    transition: all 0.1s;
    white-space: nowrap;
}

.route-item.active {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-glow);
    text-shadow: 0 0 8px var(--accent);
}

.route-item.danger {
    color: var(--danger);
    border-color: var(--danger);
    background: rgba(255, 34, 85, 0.1);
    text-shadow: 0 0 8px var(--danger);
}

.nav-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* HERO */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 80px 20px 40px;
    overflow: hidden;
}

.hero-bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 255, 136, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 136, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: gridScroll 20s linear infinite;
}

@keyframes gridScroll {
    0% { transform: translate(0, 0); }
    100% { transform: translate(40px, 40px); }
}

.hero-content {
    text-align: center;
    z-index: 2;
    position: relative;
}

.logo-container {
    position: relative;
    display: inline-block;
    margin-bottom: 30px;
}

.hero-logo {
    width: 120px;
    height: 120px;
    border-radius: 24px;
    border: 2px solid var(--accent);
    box-shadow: 0 0 40px var(--accent-glow), 0 0 80px rgba(0, 255, 136, 0.08);
    position: relative;
    z-index: 2;
    animation: logoFloat 4s ease-in-out infinite;
}

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

.logo-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 160px;
    height: 160px;
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: ringPulse 3s ease-out infinite;
}

.ring2 {
    width: 200px;
    height: 200px;
    animation-delay: 1s;
}

@keyframes ringPulse {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 5vw, 3.5rem);
    font-weight: 900;
    letter-spacing: 4px;
    margin-bottom: 12px;
}

.glitch {
    position: relative;
    display: inline-block;
    color: var(--text);
}

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

.glitch::before {
    color: var(--accent);
    animation: glitch1 3s infinite linear;
    clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
}

.glitch::after {
    color: var(--danger);
    animation: glitch2 3s infinite linear;
    clip-path: polygon(0 67%, 100% 67%, 100% 100%, 0 100%);
}

@keyframes glitch1 {
    0%, 94%, 100% { transform: translate(0); }
    95% { transform: translate(-3px, 1px); }
    96% { transform: translate(3px, -1px); }
    97% { transform: translate(-1px, 2px); }
}

@keyframes glitch2 {
    0%, 94%, 100% { transform: translate(0); }
    95% { transform: translate(3px, -1px); }
    96% { transform: translate(-3px, 1px); }
    97% { transform: translate(2px, -2px); }
}

.hero-subtitle {
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: var(--text-dim);
    font-weight: 300;
    margin-bottom: 28px;
    letter-spacing: 1px;
}

.device-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 22px;
    border-radius: 30px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent);
    margin-bottom: 28px;
    animation: fadeInUp 1s 0.5s both;
}

.badge-icon {
    font-size: 1.2rem;
}

.download-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px 48px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: var(--bg);
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 2px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    margin: 0 auto 40px;
    transition: all 0.3s;
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.25), 0 4px 20px rgba(0, 0, 0, 0.4);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 50px rgba(0, 255, 136, 0.35), 0 8px 30px rgba(0, 0, 0, 0.5);
}

.download-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: btnShine 3s infinite;
}

@keyframes btnShine {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.btn-icon {
    font-size: 0.8rem;
}

.btn-sub {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 400;
    letter-spacing: 1px;
    opacity: 0.7;
}

.stats-row {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 1s 1s both;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 28px;
    text-align: center;
    min-width: 140px;
}

.stat-num {
    display: block;
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent-glow);
}

.stat-label {
    font-size: 0.72rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

/* TERMINAL */
.terminal-section {
    max-width: 900px;
    margin: 0 auto 80px;
    padding: 0 20px;
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--surface2);
    border-radius: 12px 12px 0 0;
    border: 1px solid var(--border);
    border-bottom: none;
}

.terminal-dots {
    display: flex;
    gap: 6px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot.red { background: #ff5f57; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #28c840; }

.terminal-title {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-dim);
    flex: 1;
}

.terminal-minimize {
    color: var(--text-dim);
    cursor: pointer;
    font-size: 0.7rem;
}

.terminal-body {
    background: rgba(8, 8, 12, 0.95);
    border: 1px solid var(--border);
    border-radius: 0 0 12px 12px;
    padding: 16px 20px;
    min-height: 300px;
    max-height: 420px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    line-height: 1.6;
}

.terminal-body::-webkit-scrollbar {
    width: 4px;
}

.terminal-body::-webkit-scrollbar-track {
    background: transparent;
}

.terminal-body::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 2px;
}

.terminal-line {
    margin-bottom: 2px;
    animation: lineAppear 0.15s ease-out;
}

@keyframes lineAppear {
    from { opacity: 0; transform: translateX(-8px); }
    to { opacity: 1; transform: translateX(0); }
}

.terminal-line .prompt-text {
    color: var(--accent);
}

.terminal-line .cmd-text {
    color: #e0e0e0;
}

.terminal-line .info-text {
    color: #4a9eff;
}

.terminal-line .success-text {
    color: #28c840;
}

.terminal-line .warn-text {
    color: var(--warning);
}

.terminal-line .error-text {
    color: var(--danger);
}

.terminal-line .dim-text {
    color: var(--text-dim);
}

.terminal-cursor {
    display: flex;
    align-items: center;
    gap: 8px;
}

.prompt {
    color: var(--accent);
}

.cursor-blink {
    color: var(--accent);
    animation: blink 0.8s step-end infinite;
}

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

/* FEATURES */
.features-section {
    max-width: 1100px;
    margin: 0 auto 80px;
    padding: 0 20px;
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    text-align: center;
    margin-bottom: 40px;
    letter-spacing: 3px;
    color: var(--text);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px 24px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 255, 136, 0.3);
    box-shadow: 0 8px 30px rgba(0, 255, 136, 0.08);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 14px;
}

.feature-card h3 {
    font-family: var(--font-display);
    font-size: 0.95rem;
    letter-spacing: 1px;
    margin-bottom: 8px;
    color: var(--text);
}

.feature-card p {
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.5;
    margin-bottom: 16px;
}

.feature-bar {
    height: 3px;
    background: var(--surface2);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 6px;
}

.feature-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    border-radius: 2px;
    animation: barFill 2s ease-out;
}

@keyframes barFill {
    from { width: 0 !important; }
}

.feature-stat {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--accent);
}

/* THREAT MAP */
.threat-section {
    max-width: 1100px;
    margin: 0 auto 80px;
    padding: 0 20px;
}

.threat-monitor {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

#threatCanvas {
    width: 100%;
    height: 250px;
    display: block;
}

.threat-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1px;
    background: var(--border);
}

.threat-stat-item {
    background: var(--surface);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tsi-label {
    font-size: 0.72rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tsi-value {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent);
}

.threat-stat-item.warning .tsi-value {
    color: var(--danger);
    text-shadow: 0 0 10px rgba(255, 34, 85, 0.4);
}

/* FOOTER */
#footer {
    border-top: 1px solid var(--border);
    padding: 30px 20px;
    background: var(--bg2);
}

.footer-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 0.9rem;
    letter-spacing: 2px;
}

.footer-logo {
    width: 28px;
    height: 28px;
    border-radius: 6px;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.82rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-copy {
    font-size: 0.72rem;
    color: var(--text-dim);
}

/* HACKER MODE ACTIVE STYLES */
body.hacker-mode #navbar {
    border-bottom-color: var(--danger);
}

body.hacker-mode .status-dot {
    background: var(--danger);
    box-shadow: 0 0 10px var(--danger);
}

body.hacker-mode .route-item {
    animation: routeFlicker 0.033s infinite;
}

@keyframes routeFlicker {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.8; }
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .nav-routes {
        display: none;
    }

    .hero-title {
        font-size: 1.6rem;
    }

    .stats-row {
        flex-direction: column;
        align-items: center;
    }

    .stat-card {
        width: 100%;
        max-width: 280px;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .threat-stats {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    #navbar {
        padding: 0 12px;
    }

    .nav-brand {
        font-size: 1rem;
    }

    .hero-logo {
        width: 90px;
        height: 90px;
    }

    .download-btn {
        padding: 14px 32px;
        font-size: 0.85rem;
    }

    .terminal-body {
        font-size: 0.68rem;
        min-height: 220px;
    }
}
