:root {
  --background: 222 47% 6%;
  --foreground: 185 40% 94%;
  --primary: 174 100% 48%;
  --primary-foreground: 222 47% 6%;
  --secondary: 250 70% 62%;
  --secondary-foreground: 0 0% 100%;
  --muted: 220 18% 18%;
  --muted-foreground: 190 12% 68%;
  --destructive: 348 92% 58%;
  --destructive-foreground: 0 0% 100%;
  --border: 190 40% 22%;
  --card: 224 38% 10%;
  --shadow-sm: 0 8px 22px rgba(0, 255, 224, 0.08);
  --shadow-md: 0 18px 46px rgba(0, 255, 224, 0.14);
  --shadow-lg: 0 28px 80px rgba(124, 92, 255, 0.22);
  --transition-fast: 140ms ease;
  --transition-smooth: 260ms cubic-bezier(.2,.8,.2,1);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 28px;
}

.dark {
  --background: 222 47% 6%;
  --foreground: 185 40% 94%;
  --primary: 174 100% 48%;
  --primary-foreground: 222 47% 6%;
  --secondary: 250 70% 62%;
  --muted: 220 18% 18%;
  --muted-foreground: 190 12% 68%;
  --destructive: 348 92% 58%;
  --border: 190 40% 22%;
  --card: 224 38% 10%;
  --shadow-sm: 0 8px 22px rgba(0, 255, 224, 0.08);
  --shadow-md: 0 18px 46px rgba(0, 255, 224, 0.14);
  --shadow-lg: 0 28px 80px rgba(124, 92, 255, 0.22);
}

.light {
  --background: 196 58% 96%;
  --foreground: 220 35% 11%;
  --primary: 183 94% 34%;
  --primary-foreground: 0 0% 100%;
  --secondary: 252 72% 56%;
  --muted: 199 28% 88%;
  --muted-foreground: 216 16% 38%;
  --destructive: 348 86% 48%;
  --border: 190 32% 72%;
  --card: 0 0% 100%;
  --shadow-sm: 0 8px 22px rgba(0, 143, 153, 0.08);
  --shadow-md: 0 18px 46px rgba(0, 143, 153, 0.14);
  --shadow-lg: 0 28px 80px rgba(89, 67, 214, 0.18);
}

* { box-sizing: border-box; }
html { background: hsl(var(--background)); }
body {
  margin: 0;
  min-height: 100vh;
  color: hsl(var(--foreground));
  background:
    radial-gradient(circle at 15% 5%, rgba(0,255,224,.18), transparent 28%),
    radial-gradient(circle at 90% 20%, rgba(124,92,255,.18), transparent 30%),
    linear-gradient(145deg, hsl(var(--background)), #050712 72%);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.light body {
  background:
    radial-gradient(circle at 15% 5%, rgba(0,190,205,.16), transparent 28%),
    radial-gradient(circle at 90% 20%, rgba(124,92,255,.12), transparent 30%),
    linear-gradient(145deg, hsl(var(--background)), #eef7fb 72%);
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.metal-card {
  background: linear-gradient(145deg, rgba(255,255,255,.075), rgba(255,255,255,.025));
  border: 1px solid hsla(var(--border) / .72);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(18px);
}
.light .metal-card {
  background: linear-gradient(145deg, rgba(255,255,255,.92), rgba(255,255,255,.62));
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,.9);
}

.metal-button {
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), filter var(--transition-fast);
  box-shadow: 0 12px 30px rgba(0,255,224,.18), inset 0 1px 0 rgba(255,255,255,.32);
}
.metal-button:active { transform: scale(.98); }
.metal-button:hover { filter: brightness(1.08); }

.cyber-grid {
  background-image:
    linear-gradient(rgba(0,255,224,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,255,224,.05) 1px, transparent 1px);
  background-size: 24px 24px;
}
.light .cyber-grid {
  background-image:
    linear-gradient(rgba(0,143,153,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,143,153,.08) 1px, transparent 1px);
}

.safe-scroll::-webkit-scrollbar { width: 8px; }
.safe-scroll::-webkit-scrollbar-thumb { background: hsla(var(--primary) / .35); border-radius: 999px; }

.focus-ring:focus {
  outline: 2px solid hsla(var(--primary) / .75);
  outline-offset: 2px;
}