:root {
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif;
  --background: 46 33% 94%;
  --foreground: 154 25% 12%;
  --card: 44 38% 98%;
  --card-foreground: 154 25% 12%;
  --popover: 44 38% 98%;
  --popover-foreground: 154 25% 12%;
  --primary: 152 74% 28%;
  --primary-foreground: 43 48% 96%;
  --secondary: 43 32% 86%;
  --secondary-foreground: 154 25% 15%;
  --muted: 43 28% 88%;
  --muted-foreground: 154 12% 36%;
  --accent: 23 86% 53%;
  --accent-foreground: 43 48% 96%;
  --destructive: 0 74% 44%;
  --destructive-foreground: 43 48% 96%;
  --success: 145 63% 30%;
  --success-foreground: 43 48% 96%;
  --warning: 36 92% 45%;
  --warning-foreground: 154 25% 12%;
  --info: 199 82% 34%;
  --info-foreground: 43 48% 96%;
  --border: 43 20% 76%;
  --input: 43 20% 76%;
  --ring: 152 74% 28%;
  --radius: 0.625rem;
  --shadow-sm: 0 1px 2px hsl(var(--foreground) / 0.05);
  --shadow-md: 0 4px 12px hsl(var(--foreground) / 0.08);
  --shadow-lg: 0 12px 32px hsl(var(--foreground) / 0.12);
  --shadow-elegant: 0 18px 50px hsl(var(--primary) / 0.24);
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.dark {
  --background: 154 24% 8%;
  --foreground: 43 42% 92%;
  --card: 154 20% 11%;
  --card-foreground: 43 42% 92%;
  --popover: 154 20% 11%;
  --popover-foreground: 43 42% 92%;
  --primary: 148 62% 47%;
  --primary-foreground: 154 28% 8%;
  --secondary: 154 15% 18%;
  --secondary-foreground: 43 42% 92%;
  --muted: 154 14% 17%;
  --muted-foreground: 43 18% 70%;
  --accent: 23 88% 59%;
  --accent-foreground: 154 28% 8%;
  --destructive: 0 72% 58%;
  --destructive-foreground: 43 42% 96%;
  --success: 145 58% 44%;
  --success-foreground: 154 28% 8%;
  --warning: 40 95% 58%;
  --warning-foreground: 154 28% 8%;
  --info: 198 86% 58%;
  --info-foreground: 154 28% 8%;
  --border: 154 12% 25%;
  --input: 154 12% 25%;
  --ring: 148 62% 47%;
}

* { box-sizing: border-box; }

html {
  font-family: var(--font-sans);
  background: hsl(var(--background));
  color: hsl(var(--foreground));
}

body {
  margin: 0;
  min-height: 100vh;
  background: hsl(var(--background));
}

button, input {
  font: inherit;
}

input {
  font-size: max(16px, 1rem);
}

.safe-top { padding-top: env(safe-area-inset-top); }
.safe-bottom { padding-bottom: env(safe-area-inset-bottom); }

.shadow-token-sm { box-shadow: var(--shadow-sm); }
.shadow-token-md { box-shadow: var(--shadow-md); }
.shadow-token-lg { box-shadow: var(--shadow-lg); }
.shadow-token-elegant { box-shadow: var(--shadow-elegant); }

.waste-shell {
  background:
    radial-gradient(circle at 18% 10%, hsl(var(--primary) / 0.18), transparent 32%),
    radial-gradient(circle at 88% 18%, hsl(var(--accent) / 0.16), transparent 30%),
    linear-gradient(180deg, hsl(var(--background)), hsl(var(--muted) / 0.55));
}

.signal-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.signal-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(115deg, hsl(var(--primary) / 0.22), transparent 46%),
    radial-gradient(circle at 75% 26%, hsl(var(--accent) / 0.22), transparent 34%);
}

.signal-card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.14;
  background-image: linear-gradient(hsl(var(--foreground)) 1px, transparent 1px), linear-gradient(90deg, hsl(var(--foreground)) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(180deg, black, transparent 82%);
}

.radar-sweep {
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 999px;
  border: 1px solid hsl(var(--primary) / 0.32);
  right: -40px;
  top: -48px;
  animation: pulseSweep 3s ease-in-out infinite;
}

@keyframes pulseSweep {
  0%, 100% { transform: scale(0.9); opacity: 0.35; }
  50% { transform: scale(1.08); opacity: 0.7; }
}

.scanline {
  position: relative;
  overflow: hidden;
}

.scanline::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -30%;
  height: 42%;
  background: linear-gradient(180deg, transparent, hsl(var(--primary) / 0.16), transparent);
  animation: scan 4s linear infinite;
  pointer-events: none;
}

@keyframes scan {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(360%); }
}

.lift {
  transition: transform var(--transition), box-shadow var(--transition);
}

.lift:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
