/*
  Pixels design tokens.
  Palette: near-black indigo base, electric-violet primary accent,
  warm amber secondary accent (used sparingly for warnings/highlights).
  Display face: JetBrains Mono (grid-native, echoes the pixel identity
  without tipping into 8-bit pastiche). Body face: Inter.
*/
:root {
    --bg-0: #0a0b10;
    --bg-1: #101219;
    --bg-2: #161925;
    --bg-3: #1e2233;
    --grid-line: rgba(124, 92, 255, 0.07);
    --border: #262b3d;
    --border-soft: #1b1f2e;

    --text-0: #eef0f7;
    --text-1: #b7bcd1;
    --text-2: #7d8299;

    --accent: #7c5cff;
    --accent-hover: #9478ff;
    --accent-soft: rgba(124, 92, 255, 0.14);
    --amber: #ffb454;
    --green: #4ade80;
    --red: #ff6b6b;

    --font-display: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --radius-sm: 3px;
    --radius-md: 6px;
    --radius-lg: 10px;

    --px: 8px; /* base pixel unit — spacing derives from multiples of this */
}

* { box-sizing: border-box; }

html, body {
    height: 100%;
}

body {
    margin: 0;
    background: var(--bg-0);
    color: var(--text-0);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0 0 var(--px) 0;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    background: var(--accent);
    color: #0a0b10;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background 120ms ease, transform 80ms ease;
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text-0);
}
.btn-ghost:hover { background: var(--bg-2); }

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: var(--px);
}
.field label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-2);
    font-family: var(--font-display);
}
.field input {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    color: var(--text-0);
}
.field input:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.card {
    background: var(--bg-1);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: calc(var(--px) * 3);
}

.error-text { color: var(--red); font-size: 13px; }

/* Signature element: an ambient pixel grid that quietly lights individual
   cells at random, like activity on the platform. Used behind hero/auth
   surfaces only — never as generic decoration on every page. */
.pixel-field {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
    z-index: 0;
}
.pixel-field::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(124,92,255,0.10), transparent 70%);
}

@media (prefers-reduced-motion: no-preference) {
    .pixel-spark {
        animation: pixel-flicker 3.6s ease-in-out infinite;
    }
    @keyframes pixel-flicker {
        0%, 100% { opacity: 0.15; }
        50% { opacity: 0.55; }
    }
}
