/* ═══════════════════════════════════════════════════════════════
   TERRAMATCH NEXUS — Main CSS
   Design system tokens, reset, global typography, scrollbars
   ═══════════════════════════════════════════════════════════════ */

/* ── Design Tokens ── */
:root {
    --bg:         #020b14;
    --bg2:        #030e1a;
    --bg3:        #041220;
    --teal:       #00f5d4;
    --teal-dim:   #00c4aa;
    --teal-dark:  #004d43;
    --cyan:       #00e5ff;
    --amber:      #ffb300;
    --red:        #ff3d3d;
    --green:      #00ff88;
    --text:       #c8f0ec;
    --text-dim:   #6a9e98;
    --border:     rgba(0,245,212,0.15);
    --border2:    rgba(0,229,255,0.20);
    --glass:      rgba(0,245,212,0.04);

    --font-body:    'Exo 2', sans-serif;
    --font-mono:    'Space Mono', monospace;
    --font-display: 'Rajdhani', sans-serif;

    --header-h:   56px;
    --footer-h:   28px;
    --z-header:   1000;
    --z-footer:   1000;
    --z-modal:    5000;
    --z-toast:    9998;
    --z-scanline: 9999;
    --z-splash:   10000;
}

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

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    background-image: radial-gradient(ellipse at center, #041a28 0%, #020b14 70%);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* ── Scanline Overlay (CRT texture) ── */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: var(--z-scanline);
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,245,212,0.015) 2px,
        rgba(0,245,212,0.015) 4px
    );
    mix-blend-mode: screen;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-body);
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
}

.mono {
    font-family: var(--font-mono);
}

.display {
    font-family: var(--font-display);
}

.label {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-dim);
}

.data-value {
    font-family: var(--font-mono);
    font-weight: 200;
    color: var(--teal);
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: var(--bg2);
}

::-webkit-scrollbar-thumb {
    background: var(--teal-dark);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--teal-dim);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--teal-dark) var(--bg2);
}

/* ── Selection ── */
::selection {
    background: var(--teal-dark);
    color: var(--teal);
}

/* ── Links ── */
a {
    color: var(--teal);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--cyan);
}

/* ── Lists ── */
ul, ol {
    list-style: none;
}

/* ── Images ── */
img {
    max-width: 100%;
    display: block;
}

/* ── Tables ── */
table {
    border-collapse: collapse;
    width: 100%;
}

/* ── Inputs ── */
input, select, textarea, button {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    outline: none;
    border: none;
    background: none;
}

button {
    cursor: pointer;
}

/* ── Hidden utility ── */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}
