/* ========== ROOT TOKENS ========== */
:root {
    --bg-0: #050608;
    --bg-1: #0a0d12;
    --bg-2: #11151c;
    --bg-panel: rgba(12, 16, 22, 0.65);
    --border: rgba(0, 255, 157, 0.15);
    --border-strong: rgba(0, 255, 157, 0.4);

    --text: #e6edf3;
    --text-dim: #8b949e;
    --text-faint: #4a525c;

    --accent: #00ff9d;          /* matrix green */
    --accent-2: #00d4ff;        /* cyan */
    --accent-3: #ff3864;        /* red alert */
    --accent-glow: 0 0 24px rgba(0, 255, 157, 0.5);

    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;

    --max-w: 1400px;
    --pad-x: clamp(1rem, 4vw, 4rem);
}

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

html { scroll-behavior: smooth; }

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

img, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: none; background: none; border: none; color: inherit; }
ul { list-style: none; }

::selection { background: var(--accent); color: var(--bg-0); }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-1); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 4px; }

/* ========== CANVAS LAYERS ========== */
#bgCanvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#matrixCanvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    opacity: 0.18;
    pointer-events: none;
}

.scanlines {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 2px,
        rgba(0, 255, 157, 0.025) 3px,
        transparent 4px
    );
    mix-blend-mode: overlay;
}

.vignette {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.7) 100%);
}

/* ========== CUSTOM CURSOR ========== */
.cursor-dot,
.cursor-ring {
    position: fixed;
    top: 0; left: 0;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    will-change: transform;
}

.cursor-dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--accent);
    transition: width 0.2s, height 0.2s, background 0.2s;
}

.cursor-ring {
    width: 36px;
    height: 36px;
    border: 1px solid var(--accent);
    border-radius: 50%;
    transition: width 0.3s, height 0.3s, border-color 0.3s, transform 0.15s;
    transform: translate(-50%, -50%);
    opacity: 0.7;
}

.cursor-ring.hover {
    width: 60px;
    height: 60px;
    border-color: var(--accent-2);
    background: rgba(0, 212, 255, 0.05);
}

/* ========== NAVIGATION ========== */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 1.2rem var(--pad-x);
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    background: rgba(5, 6, 8, 0.6);
    border-bottom: 1px solid var(--border);
    transition: transform 0.3s ease, background 0.3s ease;
}

.navbar.hidden { transform: translateY(-100%); }

.nav-brand {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

.brand-bracket { color: var(--accent); }
.brand-name { color: var(--text); }
.brand-cursor { color: var(--accent); animation: blink 1s steps(2) infinite; }

.nav-menu {
    display: flex;
    gap: 2rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.nav-link {
    color: var(--text-dim);
    transition: color 0.3s;
    position: relative;
    padding: 0.4rem 0;
}

.nav-link .nav-num {
    color: var(--accent);
    margin-right: 0.4rem;
    font-size: 0.75rem;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width 0.3s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 0.5rem;
}

.nav-toggle span {
    width: 26px;
    height: 2px;
    background: var(--accent);
    transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ========== STATUS BAR ========== */
.status-bar {
    position: fixed;
    bottom: 1.2rem;
    left: var(--pad-x);
    z-index: 50;
    display: flex;
    gap: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

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

.status-label { color: var(--text-faint); }
.status-value { color: var(--accent); }

/* ========== SIDE SOCIALS ========== */
.side-socials {
    position: fixed;
    right: var(--pad-x);
    bottom: 1.2rem;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
}

.side-socials a {
    width: 22px;
    height: 22px;
    color: var(--text-dim);
    transition: color 0.3s, transform 0.3s;
}

.side-socials a:hover {
    color: var(--accent);
    transform: translateY(-3px);
}

.side-socials a svg { width: 100%; height: 100%; }

.socials-line {
    width: 1px;
    height: 80px;
    background: linear-gradient(to bottom, var(--accent), transparent);
}

/* ========== SECTIONS ========== */
.section {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    padding: 6rem var(--pad-x);
    max-width: var(--max-w);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.section-num {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--accent);
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700;
    text-transform: lowercase;
    letter-spacing: 2px;
    color: var(--text);
}

.section-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--accent), transparent);
    max-width: 300px;
}

.section-lead {
    color: var(--text-dim);
    font-size: 1.05rem;
    max-width: 720px;
    margin-bottom: 3rem;
}

/* ========== FOOTER ========== */
.footer {
    position: relative;
    z-index: 2;
    padding: 2rem var(--pad-x);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(10px);
    background: rgba(5, 6, 8, 0.6);
}

.footer-line {
    display: none;
}

.footer-content {
    max-width: var(--max-w);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-dim);
}

.footer-build { color: var(--text-faint); }

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