:root {
  --background: 210 38% 97%;
  --foreground: 218 36% 13%;
  --primary: 172 82% 36%;
  --primary-foreground: 0 0% 100%;
  --secondary: 252 86% 63%;
  --secondary-foreground: 0 0% 100%;
  --muted: 213 24% 91%;
  --muted-foreground: 218 12% 42%;
  --destructive: 0 78% 56%;
  --destructive-foreground: 0 0% 100%;
  --border: 215 22% 84%;
  --card: 0 0% 100%;
  --card-foreground: 218 36% 13%;
  --accent: 39 96% 55%;
  --radius-sm: 0.55rem;
  --radius-md: 0.9rem;
  --radius-lg: 1.35rem;
  --shadow-sm: 0 8px 22px hsl(218 36% 13% / 0.07);
  --shadow-md: 0 18px 45px hsl(218 36% 13% / 0.12);
  --shadow-lg: 0 28px 80px hsl(218 36% 13% / 0.18);
  --transition-fast: 160ms ease;
  --transition-smooth: 280ms cubic-bezier(.2,.8,.2,1);
}

.dark {
  --background: 217 43% 8%;
  --foreground: 204 38% 96%;
  --primary: 172 76% 44%;
  --primary-foreground: 213 44% 9%;
  --secondary: 252 85% 70%;
  --secondary-foreground: 213 44% 9%;
  --muted: 218 33% 15%;
  --muted-foreground: 211 18% 72%;
  --destructive: 0 74% 62%;
  --destructive-foreground: 0 0% 100%;
  --border: 218 27% 22%;
  --card: 217 39% 11%;
  --card-foreground: 204 38% 96%;
  --accent: 39 96% 58%;
  --shadow-sm: 0 8px 22px hsl(0 0% 0% / 0.2);
  --shadow-md: 0 18px 45px hsl(0 0% 0% / 0.28);
  --shadow-lg: 0 28px 80px hsl(0 0% 0% / 0.38);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
input, textarea, select { font-size: max(16px, 1rem); }
:focus-visible { outline: 3px solid hsl(var(--primary) / 0.45); outline-offset: 3px; }
.code-grid {
  background-image:
    linear-gradient(hsl(var(--border) / 0.5) 1px, transparent 1px),
    linear-gradient(90deg, hsl(var(--border) / 0.5) 1px, transparent 1px);
  background-size: 28px 28px;
}
.glow-orb {
  background: radial-gradient(circle, hsl(var(--primary) / 0.32), transparent 62%);
  filter: blur(8px);
}
.safe-bottom { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom)); }
.bottom-safe { padding-bottom: env(safe-area-inset-bottom); }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { scrollbar-width: none; }
