/* ============================================
   NEON PROTOCOL — Base Styles
   Reset, body, overlays, and shared elements
   ============================================ */

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

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

body {
  background: var(--surface);
  color: var(--on-surface);
  font-family: var(--font-mono);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
}

::selection {
  background: rgba(204, 151, 255, 0.2);
  color: var(--primary);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast), text-shadow var(--transition-fast);
}

a:hover {
  text-shadow: var(--glow-primary);
}

/* ── Background Layers ── */

.circuit-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.circuit-bg::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 40%;
  background:
    linear-gradient(90deg, transparent 49.5%, rgba(204, 151, 255, 0.04) 49.5%, rgba(204, 151, 255, 0.04) 50.5%, transparent 50.5%) 0 0 / 60px 60px,
    linear-gradient(0deg, transparent 49.5%, rgba(204, 151, 255, 0.04) 49.5%, rgba(204, 151, 255, 0.04) 50.5%, transparent 50.5%) 0 0 / 60px 60px;
  mask-image: linear-gradient(to top, rgba(0,0,0,0.4) 0%, transparent 100%);
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,0.4) 0%, transparent 100%);
}

.circuit-bg::after {
  content: '';
  position: absolute;
  bottom: 30px; right: 40px;
  width: 200px; height: 120px;
  background:
    linear-gradient(90deg, transparent 49%, rgba(204, 151, 255, 0.08) 49%, rgba(204, 151, 255, 0.08) 51%, transparent 51%) 0 0 / 20px 20px,
    linear-gradient(0deg, transparent 49%, rgba(204, 151, 255, 0.08) 49%, rgba(204, 151, 255, 0.08) 51%, transparent 51%) 0 0 / 20px 20px;
}

.gradient-accent {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(204, 151, 255, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(226, 224, 252, 0.04) 0%, transparent 50%);
}

/* ── Overlays ── */

.scanlines {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 100; opacity: 0.03;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(204, 151, 255, 0.04) 2px, rgba(204, 151, 255, 0.04) 4px);
}

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

.glitch-overlay {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 98;
  display: none;
}

/* ── Shared Animations ── */

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

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

@keyframes fadeReveal {
  from { opacity: 0; transform: translateY(10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

@keyframes scanMove {
  0% { top: 0; }
  100% { top: 100%; }
}

/* ── Utility Classes ── */

.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-tertiary { color: var(--tertiary); }
.text-muted { color: var(--on-surface-variant); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }

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