*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0a0a0f;
    --bg-card: #0d1117;
    --bg-card-hover: #111a14;
    --text: #c9d1d9;
    --text-muted: #6e7681;
    --accent: #00ff41;
    --accent-dim: rgba(0, 255, 65, 0.1);
    --accent-glow: rgba(0, 255, 65, 0.15);
    --border: #1a2a1a;
    --border-bright: #2a3a2a;
    --radius: 4px;
    --font-mono: 'Courier New', Consolas, 'Liberation Mono', monospace;
    --critical: #ff4444;
    --high: #ff9900;
    --emerging: #00ff41;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

/* Subtle grid overlay */
body::before {
    content: '';
    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: 0;
}

#matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.12;
    pointer-events: none;
}

/* Grid overlay */
body::before {
    z-index: 1;
}

main {
    position: relative;
    z-index: 2;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- NAV --- */

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

nav {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.accent {
    color: var(--accent);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
    list-style: none;
}

.nav-links a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    font-family: var(--font-mono);
    font-weight: 600;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--accent);
}

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    color: var(--accent);
    font-size: 1.4rem;
    padding: 4px 10px;
    border-radius: var(--radius);
    cursor: pointer;
}

/* --- BUTTONS --- */

.btn {
    display: inline-block;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.92rem;
    border-radius: var(--radius);
    transition: all 0.2s;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    letter-spacing: 0.01em;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg);
    padding: 12px 28px;
    border: 1px solid var(--accent);
}

.btn-primary:hover {
    background: transparent;
    color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

.btn-outline {
    border: 1px solid var(--border-bright);
    color: var(--text);
    padding: 12px 28px;
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}

.btn-nav {
    background: var(--accent);
    color: var(--bg) !important;
    padding: 8px 18px;
    border-radius: var(--radius);
    font-weight: 800;
}

.btn-nav:hover {
    box-shadow: 0 0 15px var(--accent-glow);
    color: var(--bg) !important;
}

.btn-sm {
    padding: 8px 20px;
    font-size: 0.85rem;
}

.btn-large {
    font-size: 1.05rem;
    padding: 16px 36px;
}

/* --- HERO --- */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 24px 80px;
    position: relative;
}

/* CRT scanlines on hero */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 65, 0.015) 2px,
        rgba(0, 255, 65, 0.015) 4px
    );
    pointer-events: none;
    z-index: 0;
}

.hero-content {
    max-width: 720px;
    position: relative;
    z-index: 1;
}

.terminal-line {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 0.95rem;
    margin-bottom: 24px;
    opacity: 0.8;
    min-height: 1.5em;
}

.cursor {
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 24px;
}

.hero-sub {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 560px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* --- STATS --- */

.stats {
    padding: 80px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    text-align: center;
}

.stat-card {
    padding: 20px;
}

.stat-number {
    font-family: var(--font-mono);
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -0.03em;
}

.stat-plus {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    display: block;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 0.92rem;
}

/* --- THREATS --- */

.threats {
    padding: 100px 0;
    border-bottom: 1px solid var(--border);
}

.threats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.threat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    transition: border-color 0.25s, box-shadow 0.25s;
    position: relative;
    padding-left: 32px;
}

.threat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    border-radius: var(--radius) 0 0 var(--radius);
    background: var(--border);
    transition: background 0.25s, box-shadow 0.25s;
}

.threat-card:hover {
    border-color: var(--border-bright);
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.05);
}

.threat-card:hover::before {
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}

.threat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 12px;
}

.threat-card h3 {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 700;
}

.threat-tag {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 2px;
    letter-spacing: 0.05em;
    white-space: nowrap;
    flex-shrink: 0;
}

.threat-tag.critical {
    background: rgba(255, 68, 68, 0.15);
    color: var(--critical);
    border: 1px solid rgba(255, 68, 68, 0.3);
}

.threat-tag.high {
    background: rgba(255, 153, 0, 0.12);
    color: var(--high);
    border: 1px solid rgba(255, 153, 0, 0.3);
}

.threat-tag.emerging {
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid rgba(0, 255, 65, 0.3);
}

.threat-card p {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.7;
}

.threats-sources {
    margin-top: 32px;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.8;
}

.threats-sources a {
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    transition: color 0.2s, border-color 0.2s;
}

.threats-sources a:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* --- SERVICES --- */

.services {
    padding: 100px 0;
    border-bottom: 1px solid var(--border);
}

h2 {
    font-size: 1.8rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.section-sub {
    text-align: center;
    color: var(--text-muted);
    max-width: 520px;
    margin: 0 auto 56px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 24px;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.service-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.05);
}

.service-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.service-card p {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.7;
    margin-bottom: 20px;
}

.service-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
}

.service-tags li {
    background: var(--accent-dim);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 2px;
    font-family: var(--font-mono);
}

/* --- PARTNERS --- */

.partners {
    padding: 100px 0;
    border-bottom: 1px solid var(--border);
}

.partners-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.partner-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 24px;
    transition: border-color 0.25s, box-shadow 0.25s;
    display: flex;
    flex-direction: column;
}

.partner-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.05);
}

.partner-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.partner-card p {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.7;
    margin-bottom: 20px;
    flex-grow: 1;
}

/* --- CTF --- */

.ctf {
    padding: 100px 0;
    border-bottom: 1px solid var(--border);
}

.ctf-content {
    max-width: 680px;
    margin: 0 auto;
    text-align: center;
}

.ctf-badge {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 16px;
    text-shadow: 0 0 20px var(--accent-glow);
}

.ctf-content p {
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 16px;
}

.ctf-content strong {
    color: var(--text);
}

.ctf-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 32px;
    flex-wrap: wrap;
}

/* --- ABOUT --- */

.about {
    padding: 100px 0;
    border-bottom: 1px solid var(--border);
}

.about-text {
    max-width: 680px;
    margin: 0 auto;
}

.about-text p {
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.8;
}

.about-text strong {
    color: var(--text);
}

.about-highlights {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 40px;
}

.highlight {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.highlight strong {
    color: var(--accent);
    font-size: 0.92rem;
    font-family: var(--font-mono);
}

.highlight span {
    color: var(--text-muted);
    font-size: 0.83rem;
}

/* --- CONTACT --- */

.contact {
    padding: 100px 0;
    text-align: center;
}

.contact-content {
    margin-top: 40px;
}

/* --- FOOTER --- */

footer {
    border-top: 1px solid var(--border);
    padding: 32px 0;
    position: relative;
    z-index: 2;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-brand {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1rem;
}

footer p {
    color: var(--text-muted);
    font-size: 0.83rem;
}

/* --- MOBILE --- */

@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: rgba(10, 10, 15, 0.97);
        backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--border);
        padding: 24px;
        gap: 20px;
    }

    .nav-links.open {
        display: flex;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .threats-grid {
        grid-template-columns: 1fr;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .partners-grid {
        grid-template-columns: 1fr;
    }

    .about-highlights {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .footer-content {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}
