/* ============================================
   Base — tokens, reset, background layers, cursor
   ============================================ */

:root {
  --bg: #0A0A0A;
  --bg-soft: #0E0E0F;
  --bg-elev: #111113;
  --ink: #F5F5F5;
  --ink-mute: #A1A1AA;
  --ink-faint: #6B6B72;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --accent: #6E8BFF;
  --accent-soft: rgba(110, 139, 255, 0.18);
  --accent-glow: rgba(110, 139, 255, 0.35);
  --serif: 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
  --tracking: -0.02em;
  --tracking-tight: -0.035em;
  --duration: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-feature-settings: 'ss01', 'cv11', 'cv02';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  line-height: 1.55;
  letter-spacing: -0.005em;
  cursor: none;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

::selection {
  background: rgba(110, 139, 255, 0.25);
  color: #fff;
}

/* ============================================
   Background layers
   ============================================ */

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

.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.9) 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.9) 0%, transparent 75%);
  animation: gridDrift 40s linear infinite;
}

@keyframes gridDrift {
  0% { background-position: 0 0; }
  100% { background-position: 80px 80px; }
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.cursor-glow {
  position: fixed;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(110, 139, 255, 0.07) 0%, rgba(110, 139, 255, 0) 60%);
  pointer-events: none;
  z-index: 2;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease;
  mix-blend-mode: screen;
}

.cursor-dot {
  position: fixed;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
  transition: width 0.25s var(--duration), height 0.25s var(--duration), opacity 0.2s ease;
}

.cursor-dot.hover {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(2px);
}

@media (hover: none) {
  body { cursor: auto; }
  .cursor-glow, .cursor-dot { display: none; }
}
