:root {
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --background: 210 40% 98%;
  --foreground: 222 47% 11%;
  --card: 0 0% 100%;
  --card-foreground: 222 47% 11%;
  --popover: 0 0% 100%;
  --popover-foreground: 222 47% 11%;
  --primary: 217 91% 52%;
  --primary-foreground: 0 0% 100%;
  --secondary: 190 86% 92%;
  --secondary-foreground: 222 47% 11%;
  --muted: 214 32% 91%;
  --muted-foreground: 215 18% 38%;
  --accent: 188 92% 45%;
  --accent-foreground: 222 47% 11%;
  --destructive: 0 72% 51%;
  --destructive-foreground: 0 0% 100%;
  --success: 145 63% 36%;
  --success-foreground: 0 0% 100%;
  --warning: 38 92% 50%;
  --warning-foreground: 222 47% 11%;
  --info: 199 89% 48%;
  --info-foreground: 0 0% 100%;
  --border: 214 32% 86%;
  --input: 214 32% 86%;
  --ring: 188 92% 45%;
  --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 20px 60px hsl(var(--primary) / 0.22);
  --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: 222 47% 8%;
  --foreground: 210 40% 96%;
  --card: 222 40% 12%;
  --card-foreground: 210 40% 96%;
  --popover: 222 40% 12%;
  --popover-foreground: 210 40% 96%;
  --primary: 213 94% 68%;
  --primary-foreground: 222 47% 8%;
  --secondary: 217 33% 18%;
  --secondary-foreground: 210 40% 96%;
  --muted: 217 33% 17%;
  --muted-foreground: 215 20% 72%;
  --accent: 188 86% 58%;
  --accent-foreground: 222 47% 8%;
  --destructive: 0 63% 55%;
  --destructive-foreground: 0 0% 100%;
  --success: 145 60% 45%;
  --success-foreground: 222 47% 8%;
  --warning: 38 92% 58%;
  --warning-foreground: 222 47% 8%;
  --info: 199 89% 58%;
  --info-foreground: 222 47% 8%;
  --border: 217 33% 22%;
  --input: 217 33% 22%;
  --ring: 188 86% 58%;
}

* { 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)); color: hsl(var(--foreground)); }
button, input, textarea, select { font: inherit; }
input, textarea, select { font-size: max(16px, 1rem); }

.logo-mark {
  background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--accent)));
  box-shadow: var(--shadow-elegant);
}

.animated-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.animated-bg::before,
.animated-bg::after {
  content: "";
  position: absolute;
  width: 22rem;
  height: 22rem;
  border-radius: 9999px;
  filter: blur(48px);
  opacity: 0.24;
  animation: floaty 10s ease-in-out infinite;
}
.animated-bg::before { background: hsl(var(--primary)); top: 4rem; left: -6rem; }
.animated-bg::after { background: hsl(var(--accent)); right: -4rem; bottom: 2rem; animation-delay: -4s; }

@keyframes floaty {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(2rem, -1rem, 0) scale(1.08); }
}

.block-chip { cursor: grab; user-select: none; }
.block-chip:active { cursor: grabbing; }
.snap-zone { background-image: radial-gradient(hsl(var(--border)) 1px, transparent 1px); background-size: 24px 24px; }

.safe-bottom { padding-bottom: calc(0.75rem + env(safe-area-inset-bottom)); }
.safe-top { padding-top: env(safe-area-inset-top); }

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