/* ── Theme variables & Design tokens ── */
:root {
  --canvas: 250 250 250;
  --surface: 255 255 255;
  --raised: 244 244 246;
  --line: 228 228 233;
  --ink: 15 15 20;
  --muted: 100 100 112;
  --faint: 170 170 180;
  --accent: 108 76 240;
  --lime: 198 244 50;
  --limeink: 77 124 15;
  --onlime: 15 18 6;
  --ok: 22 163 74;
  --warn: 217 119 6;
  --danger: 225 29 72;
  color-scheme: light;
}

html.dark, :root.dark {
  --canvas: 9 9 11;
  --surface: 17 17 20;
  --raised: 26 26 31;
  --line: 39 39 46;
  --ink: 240 240 243;
  --muted: 150 150 162;
  --faint: 82 82 94;
  --accent: 139 108 255;
  --lime: 198 244 50;
  --limeink: 198 244 50;
  --onlime: 15 18 6;
  --ok: 74 222 128;
  --warn: 251 191 36;
  --danger: 251 113 133;
  color-scheme: dark;
}

/* ── Base Reset & Typography ── */
html, body {
  background: rgb(var(--canvas));
  color: rgb(var(--ink));
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgb(var(--lime));
  color: rgb(var(--onlime));
}

/* ── Thin Custom Scrollbars ── */
.scroll-thin::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
.scroll-thin::-webkit-scrollbar-track {
  background: transparent;
}
.scroll-thin::-webkit-scrollbar-thumb {
  background: rgb(var(--line));
  border-radius: 999px;
}
.scroll-thin::-webkit-scrollbar-thumb:hover {
  background: rgb(var(--muted));
}

/* ── Animations ── */
@keyframes ring-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.15);
    opacity: 0;
  }
}
.animate-ring-pulse {
  animation: ring-pulse 2.2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes radar-sweep {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.animate-radar-sweep {
  animation: radar-sweep 2s linear infinite;
}

@keyframes radar-pulse {
  0% { transform: scale(0.3); opacity: 0.8; }
  100% { transform: scale(1.05); opacity: 0; }
}
.animate-radar-pulse {
  animation: radar-pulse 1.6s ease-out infinite;
}

@keyframes ping-subtle {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(2.4); opacity: 0; }
}
.animate-ping-subtle {
  animation: ping-subtle 1.8s ease-out infinite;
}

@keyframes confettiFall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(420px) rotate(720deg); opacity: 0; }
}
.confetti-piece {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: confettiFall 2.8s linear infinite;
}

/* ── Telemetry Grid Canvas & Noise Overlay ── */
#spectre-telemetry {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

.noise-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

html.light .noise-overlay {
  opacity: 0.02;
}

/* ── Stacking & Solid Surface Enforcement ── */
#heroSection {
  position: relative;
  z-index: 10;
}

#dossierSection,
#compareSection {
  position: relative;
  z-index: 10;
}

.bg-surface {
  background-color: rgb(var(--surface));
  opacity: 1;
}

.bg-raised {
  background-color: rgb(var(--raised));
  opacity: 1;
}

