:root {
  color-scheme: light;
  --background: 0 0% 100%;
  --foreground: 222.2 84% 4.9%;
  --card: 0 0% 100%;
  --card-foreground: 222.2 84% 4.9%;
  --popover: 0 0% 100%;
  --popover-foreground: 222.2 84% 4.9%;
  --primary: 221.2 83.2% 53.3%;
  --primary-foreground: 210 40% 98%;
  --secondary: 210 40% 96.1%;
  --secondary-foreground: 222.2 47.4% 11.2%;
  --muted: 210 40% 96.1%;
  --muted-foreground: 215.4 16.3% 46.9%;
  --accent: 210 40% 96.1%;
  --accent-foreground: 222.2 47.4% 11.2%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 210 40% 98%;
  --border: 214.3 31.8% 91.4%;
  --input: 214.3 31.8% 91.4%;
  --ring: 221.2 83.2% 53.3%;
  --radius: 0.45rem;
  font-family: "Inter", "Space Grotesk", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

.dark {
  color-scheme: dark;
  --background: 222.2 84% 4.9%;
  --foreground: 210 40% 98%;
  --card: 222.2 84% 4.9%;
  --card-foreground: 210 40% 98%;
  --popover: 222.2 84% 4.9%;
  --popover-foreground: 210 40% 98%;
  --primary: 217.2 91.2% 59.8%;
  --primary-foreground: 222.2 47.4% 11.2%;
  --secondary: 217.2 32.6% 17.5%;
  --secondary-foreground: 210 40% 98%;
  --muted: 217.2 32.6% 17.5%;
  --muted-foreground: 215 20.2% 65.1%;
  --accent: 217.2 32.6% 17.5%;
  --accent-foreground: 210 40% 98%;
  --destructive: 0 62.8% 30.6%;
  --destructive-foreground: 210 40% 98%;
  --border: 217.2 32.6% 17.5%;
  --input: 217.2 32.6% 17.5%;
  --ring: 224.3 76.3% 48%;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  border-color: hsl(var(--border));
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: inherit;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

#root {
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

.page-shell {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 16px 96px;
}

@media (min-width: 1024px) {
  .page-shell {
    padding: 40px 24px 120px;
  }
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background: hsl(var(--muted-foreground) / 0.3);
  border-radius: 999px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

.modal-panel {
  background-color: hsl(var(--card));
}

.prompt-input {
  scrollbar-width: none;
  overflow: hidden;
  overscroll-behavior: contain;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.prompt-input::-webkit-scrollbar {
  display: none;
}

.prompt-input:focus,
.prompt-input:focus-visible {
  border-color: #9fb2d8;
  box-shadow:
    0 0 0 2px rgba(159, 178, 216, 0.8),
    0 0 0 12px rgba(228, 235, 248, 0.55),
    0 18px 48px rgba(159, 178, 216, 0.12),
    0 30px 90px rgba(12, 18, 33, 0.08);
}

.dark .prompt-input:focus,
.dark .prompt-input:focus-visible {
  border-color: hsl(var(--ring));
  box-shadow:
    0 0 0 2px hsl(var(--ring) / 0.8),
    0 0 0 12px hsl(var(--primary) / 0.2),
    0 18px 48px hsl(var(--primary) / 0.18),
    0 30px 90px hsl(var(--foreground) / 0.08);
}

.click-press {
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.click-press:active {
  transform: translateY(1px) scale(0.995);
  box-shadow:
    0 4px 10px rgba(17, 24, 39, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.5) inset;
  filter: brightness(0.98);
}

.font-hero {
  font-family: "Plus Jakarta Sans", "Space Grotesk", "Inter", system-ui, -apple-system, sans-serif;
  font-weight: 800;
}

.hero-section {
  background-color: transparent;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.hero-description {
  transition: color 0.2s ease;
}

.home-prompt-input {
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.reference-upload {
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.aspect-select-grid {
  background: #edeff3;
}

.aspect-option {
  border: 1px solid transparent;
}

.aspect-option-active {
  background: #fefefe;
  border-color: hsl(var(--primary) / 0.5);
  box-shadow:
    0 10px 25px rgba(34, 64, 117, 0.2),
    0 0 0 1px rgba(15, 23, 42, 0.05);
}

.dark .aspect-select-grid {
  background: rgba(255, 255, 255, 0.05);
}

.dark .aspect-option {
  border-color: rgba(255, 255, 255, 0.08);
}

.dark .aspect-option-active {
  background: rgba(255, 255, 255, 0.05);
  border-color: hsl(var(--primary));
  box-shadow:
    0 10px 25px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.05);
}

.aspect-option .aspect-visual {
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.aspect-option-active .aspect-visual {
  transform: translateY(1px);
  border-color: rgba(49, 71, 127, 0.5);
}

.dark .aspect-option .aspect-visual {
  border-color: rgba(255, 255, 255, 0.12);
}

.dark .aspect-option-active .aspect-visual {
  border-color: rgba(120, 162, 255, 0.5);
}

.dark .hero-section {
  background-color: #040816;
  color: #f4f6ff;
}

.dark .hero-description {
  color: #f8f9ff;
}

.dark .home-prompt-input {
  background-color: #11182d;
  border-color: #3f4a75;
  color: #f4f6ff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.dark .home-prompt-input::placeholder {
  color: #c9d0ee;
}

.dark .reference-upload {
  background-color: #111b33;
  border-color: #3f4a75;
  color: #cdd6ff;
}

.dark .reference-upload span,
.dark .reference-upload button {
  color: inherit;
}

/* Slightly tighten global radii */
.rounded-xl { border-radius: 0.55rem !important; }
.rounded-2xl { border-radius: 0.8rem !important; }
.rounded-3xl { border-radius: 1rem !important; }
