/* ═══════════════════════════════════════════════════════ */
/* BASE / RESET / LAYOUT                                  */
/* ═══════════════════════════════════════════════════════ */

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

:root {
  --radius: 0.75rem;
  --background: #030508;
  --foreground: #e8eaed;
  --card: #0a0e14;
  --card-foreground: #e8eaed;
  --primary: #4da6db;
  --primary-foreground: #030508;
  --secondary: #151b23;
  --secondary-foreground: #e8eaed;
  --muted: #0f1318;
  --muted-foreground: #7d8590;
  --accent: #2d7fb8;
  --accent-foreground: #030508;
  --border: rgba(77, 166, 219, 0.1);
  --input: rgba(77, 166, 219, 0.08);
  --ring: #4da6db;
  --neon-pink: #ff00ff;
  --neon-blue: #6bb5e8;
  --glow-rgb: 77, 166, 219;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
  overscroll-behavior: none;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--background);
  color: var(--foreground);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  overscroll-behavior: none;
  touch-action: pan-y;
  -webkit-text-size-adjust: 100%;
}

/* Noise overlay - below nav so glass blur works */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px;
}

/* HUD Scanline overlay - below nav so glass blur works */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    var(--scanline-color, rgba(77, 166, 219, 0.008)) 2px,
    var(--scanline-color, rgba(77, 166, 219, 0.008)) 4px
  );
}

/* Neural network canvas */
#neuralCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100vh !important;
  z-index: 0;
  pointer-events: none;
}

/* Grid pattern - now with perspective */
.grid-pattern {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(77, 166, 219, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(77, 166, 219, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 20%, transparent 70%);
}

/* Animated glow blobs - contained to viewport */
.glow-blob {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.glow-blob-1 {
  top: -10%;
  left: 50%;
  transform: translateX(-50%);
  width: min(1000px, 100vw);
  height: min(1000px, 100vw);
  background: radial-gradient(circle, rgba(0,212,170,0.1) 0%, rgba(0,180,216,0.05) 30%, transparent 70%);
  animation: blobPulse 8s ease-in-out infinite;
}

.glow-blob-2 {
  bottom: -10%;
  right: 0;
  width: min(800px, 80vw);
  height: min(800px, 80vw);
  background: radial-gradient(circle, rgba(168,85,247,0.06) 0%, rgba(0,180,216,0.03) 40%, transparent 70%);
  animation: blobPulse2 10s ease-in-out infinite reverse;
}

.glow-blob-3 {
  top: 40%;
  left: 0;
  width: min(600px, 60vw);
  height: min(600px, 60vw);
  background: radial-gradient(circle, rgba(0,240,255,0.04) 0%, transparent 70%);
  animation: blobPulse2 12s ease-in-out infinite 2s;
}

@keyframes blobPulse {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.5; }
  50% { transform: translateX(-50%) scale(1.3); opacity: 1; }
}

@keyframes blobPulse2 {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.2); opacity: 1; }
}

/* Data stream effect */
.data-stream {
  position: fixed;
  top: 0;
  width: 1px;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.data-stream::before {
  content: '';
  position: absolute;
  top: -100%;
  width: 100%;
  height: 30%;
  background: linear-gradient(to bottom, transparent, var(--primary), transparent);
  opacity: 0.15;
  animation: dataFlow var(--duration) linear infinite;
  animation-delay: var(--delay);
}

@keyframes dataFlow {
  0% { top: -30%; }
  100% { top: 100%; }
}

/* Glass effect */
.glass {
  background: rgba(10, 14, 20, 0.8);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
}

/* Container */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 10; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #0a0e14; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #4da6db, #2d7fb8); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #5db8e8, #3d94cc); }

/* Selection */
::selection { background: rgba(77, 166, 219, 0.3); color: #fff; }

/* Focus */
*:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

@keyframes spin { to { transform: rotate(360deg); } }
