:root {
  /* Arrakis Theme (Default) */
  --color-primary: #D97706; /* orange-600 */
  --color-primary-hover: #F97316; /* orange-500 */
  --color-accent: #FB923C; /* orange-400 */
  --color-accent-hover: #EA580C; /* orange-600 */
  --color-text-base: #E5E7EB; /* stone-200 */
  --color-text-muted: #A8A29E; /* stone-400 */
  --color-text-subtle: #78716C; /* stone-500 */
  --color-surface-base: #1a1a1a;
  --color-surface-window-rgb: 28, 25, 23;
  --color-surface-window: rgba(var(--color-surface-window-rgb), 0.8);
  --color-surface-inset-rgb: 41, 37, 36;
  --color-surface-inset: rgba(var(--color-surface-inset-rgb), 1);
  --color-surface-hover: rgba(255, 255, 255, 0.1);
  --color-danger: #DC2626; /* red-600 */
  --color-danger-hover: #B91C1C; /* red-700 */
  --color-border: #44403C;
  --color-border-accent: rgba(251, 146, 60, 0.3);
}

.theme-harkonnen {
  --color-primary: #DC2626; /* red-600 */
  --color-primary-hover: #EF4444; /* red-500 */
  --color-accent: #F87171; /* red-400 */
  --color-accent-hover: #B91C1C; /* red-700 */
  --color-text-base: #E5E7EB;
  --color-text-muted: #9CA3AF; /* gray-400 */
  --color-text-subtle: #6B7280; /* gray-500 */
  --color-surface-base: #111111;
  --color-surface-window-rgb: 23, 23, 23;
  --color-surface-window: rgba(var(--color-surface-window-rgb), 0.8);
  --color-surface-inset-rgb: 31, 41, 55;
  --color-surface-inset: rgba(var(--color-surface-inset-rgb), 1);
  --color-surface-hover: rgba(255, 255, 255, 0.1);
  --color-danger: #F87171; /* red-400 */
  --color-danger-hover: #EF4444; /* red-500 */
  --color-border: #374151; /* gray-700 */
  --color-border-accent: rgba(220, 38, 38, 0.3);
}

.theme-fremen {
  --color-primary: #3B82F6; /* blue-500 */
  --color-primary-hover: #60A5FA; /* blue-400 */
  --color-accent: #93C5FD; /* blue-300 */
  --color-accent-hover: #2563EB; /* blue-600 */
  --color-text-base: #E5E7EB;
  --color-text-muted: #A8A29E;
  --color-text-subtle: #78716C;
  --color-surface-base: #3d3a36;
  --color-surface-window-rgb: 41, 37, 36;
  --color-surface-window: rgba(var(--color-surface-window-rgb), 0.8);
  --color-surface-inset-rgb: 41, 37, 36;
  --color-surface-inset: rgba(var(--color-surface-inset-rgb), 1);
  --color-surface-hover: rgba(255, 255, 255, 0.1);
  --color-danger: #F472B6; /* pink-400 */
  --color-danger-hover: #EC4899; /* pink-500 */
  --color-border: #57534E; /* stone-600 */
  --color-border-accent: rgba(59, 130, 246, 0.3);
}

.theme-default .logo-recolor-container,
.theme-default .logo-recolor {
  filter: saturate(1.2) brightness(1.1);
}

.theme-fremen .logo-recolor-container,
.theme-fremen .logo-recolor {
  filter: hue-rotate(170deg) saturate(1.5);
}

.theme-harkonnen .logo-recolor-container,
.theme-harkonnen .logo-recolor {
  filter: hue-rotate(-50deg) saturate(2);
}

.high-contrast {
  --color-primary: #FBBF24; /* amber-400 */
  --color-primary-hover: #F59E0B; /* amber-500 */
  --color-accent: #FFFFFF; /* white */
  --color-accent-hover: #FDE68A; /* amber-200 */
  --color-text-base: #FFFFFF; /* white */
  --color-text-muted: #E0E0E0; /* gray-200 */
  --color-text-subtle: #BDBDBD; /* gray-400 */
  --color-surface-base: #000000;
  --color-surface-window-rgb: 10, 10, 10;
  --color-surface-window: rgba(var(--color-surface-window-rgb), 0.85);
  --color-surface-inset-rgb: 17, 17, 17;
  --color-surface-inset: rgba(var(--color-surface-inset-rgb), 1);
  --color-surface-hover: rgba(255, 255, 255, 0.2);
  --color-danger: #F44336; /* red-500 */
  --color-danger-hover: #E53935; /* red-600 */
  --color-border: #616161; /* gray-700 */
  --color-border-accent: rgba(251, 191, 36, 0.5);
}

body {
  font-family: 'Chakra Petch', sans-serif;
  background-color: var(--color-surface-base);
  color: var(--color-text-base);
  background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23333333' fill-opacity='0.2'%3E%3Ccircle cx='5' cy='5' r='1'/%3E%3Ccircle cx='15' cy='15' r='1'/%3E%3C/g%3E%3C/svg%3E");
  transition: background-color 0.3s ease;
}

.logo-recolor-container,
.logo-recolor {
  transition: filter 0.5s ease-in-out;
}

[data-motion="reduced"] *,
.reduce-motion *,
.reduce-motion *::before,
.reduce-motion *::after {
  animation-duration: 1ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 1ms !important;
  transition-delay: 0ms !important;
  scroll-behavior: auto !important;
}

.font-orbitron {
  font-family: 'Orbitron', sans-serif;
}

@keyframes morph-in {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.animate-morph-in {
    animation: morph-in 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes scroll-text {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.ticker-container:hover .ticker-content {
  animation: scroll-text 10s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Torch Light Effect for Header Navigation */
.nav-button-ripple::after {
  content: '';
  position: absolute;
  bottom: -50%;
  left: 50%;
  width: 150%;
  padding-bottom: 150%;
  background: radial-gradient(
    circle at 50% 100%,
    hsla(30, 96%, 61%, 0.5) 0%,
    hsla(28, 96%, 45%, 0.2) 40%,
    transparent 70%
  );
  border-radius: 50%;
  transform: translateX(-50%) scale(0);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease-in;
  z-index: 0;
}

.nav-button-ripple:hover::after {
  transform: translateX(-50%) scale(1);
  opacity: 1;
  animation: torch-flicker 2s infinite ease-in-out;
}

@keyframes torch-flicker {
  0%, 100% {
    transform: translateX(-50%) scale(1);
    opacity: 0.8;
  }
  50% {
    transform: translateX(-49.5%) scale(1.05);
    opacity: 1;
  }
}
