:root {
  --background: 210 18% 97%;
  --foreground: 220 18% 14%;
  --primary: 217 96% 56%;
  --secondary: 210 10% 88%;
  --muted: 210 12% 93%;
  --destructive: 0 78% 56%;
  --border: 214 14% 82%;
  --card: 0 0% 100%;
  --shadow-sm: 0 10px 30px hsla(220, 30%, 10%, 0.06);
  --shadow-md: 0 18px 50px hsla(220, 30%, 10%, 0.12);
  --shadow-lg: 0 28px 90px hsla(220, 40%, 8%, 0.18);
  --transition-fast: 160ms ease;
  --transition-smooth: 320ms cubic-bezier(0.22, 1, 0.36, 1);
  --radius-sm: 0.65rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;
}

.dark {
  --background: 220 18% 8%;
  --foreground: 210 20% 95%;
  --primary: 217 100% 61%;
  --secondary: 220 10% 18%;
  --muted: 220 12% 14%;
  --destructive: 0 78% 62%;
  --border: 220 10% 24%;
  --card: 220 14% 11%;
  --shadow-sm: 0 10px 24px hsla(220, 50%, 2%, 0.28);
  --shadow-md: 0 18px 50px hsla(220, 60%, 2%, 0.4);
  --shadow-lg: 0 35px 100px hsla(220, 80%, 1%, 0.5);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top right, hsla(217, 100%, 61%, 0.12), transparent 28%),
    radial-gradient(circle at bottom left, hsla(210, 20%, 70%, 0.08), transparent 30%),
    hsl(var(--background));
  min-height: 100vh;
}

::selection {
  background: hsla(217, 100%, 61%, 0.28);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

img,
svg {
  display: block;
}

.metal-panel {
  background:
    linear-gradient(145deg, hsla(0, 0%, 100%, 0.7), hsla(210, 12%, 88%, 0.42) 30%, hsla(210, 8%, 72%, 0.35) 50%, hsla(0, 0%, 100%, 0.55) 72%, hsla(210, 12%, 86%, 0.5));
}

.dark .metal-panel {
  background:
    linear-gradient(145deg, hsla(210, 15%, 22%, 0.9), hsla(210, 8%, 16%, 0.95) 35%, hsla(210, 10%, 26%, 0.9) 55%, hsla(210, 12%, 12%, 0.96) 80%);
}

.factory-grid {
  background-image:
    linear-gradient(hsla(0, 0%, 100%, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, hsla(0, 0%, 100%, 0.04) 1px, transparent 1px),
    linear-gradient(135deg, hsla(217, 100%, 61%, 0.08), transparent 40%);
  background-size: 36px 36px, 36px 36px, auto;
}

.steel-texture {
  background:
    linear-gradient(180deg, hsla(0, 0%, 100%, 0.08), transparent 30%),
    repeating-linear-gradient(115deg, hsla(0, 0%, 100%, 0.05) 0 2px, transparent 2px 11px),
    linear-gradient(135deg, hsla(220, 10%, 12%, 0.96), hsla(220, 12%, 8%, 0.98));
}

.glow-border {
  position: relative;
  overflow: hidden;
}

.glow-border::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, hsla(217, 100%, 61%, 0.8), hsla(0, 0%, 100%, 0.25), hsla(217, 100%, 61%, 0.18));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.hero-shine::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, hsla(0, 0%, 100%, 0.12) 38%, transparent 50%);
  transform: translateX(-120%);
  animation: shine 8s linear infinite;
}

@keyframes shine {
  to {
    transform: translateX(160%);
  }
}

.float-slow {
  animation: floatSlow 6s ease-in-out infinite;
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

.spin-slow {
  animation: spinSlow 18s linear infinite;
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.fade-in {
  animation: fadeIn 0.6s var(--transition-smooth);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-shadow {
  box-shadow: var(--shadow-md);
}

.card-shadow-lg {
  box-shadow: var(--shadow-lg);
}

.token-ring:focus-visible {
  outline: 2px solid hsla(217, 100%, 61%, 0.9);
  outline-offset: 2px;
}

.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

input[type="range"] {
  accent-color: hsl(var(--primary));
}

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