:root {
  /* Color System - Light mode */
  --color-primary: #ffb347;
  --color-primary-light: #ffd580;
  --color-primary-dark: #e6a040;

  --color-secondary: oklch(45% 50% 264deg);
  --color-secondary-light: oklch(69% 50% 264deg);

  --color-accent: oklch(50% 55% 31deg);
  --color-accent-light: oklch(80% 55% 31deg);

  --color-background: #2b110e;
  --color-background-elevated: #3a1612;
  --color-background-input: #270e0b;
  --color-background-card: #421815;

  --color-text-primary: #f5f6fa;
  --color-text-secondary: #e0e0e0;
  --color-text-muted: #888;
  --color-text-on-primary: #23272a;

  --color-border: #632420;
  --color-border-light: #a24043;
  --color-border-focus: var(--color-primary);

  /* Gray scale - using existing okLCH values but with semantic names */
  --color-gray-50: oklch(98.42% 0.0034 247.86deg);
  --color-gray-100: oklch(12% 9.5% 264deg / 5%);
  --color-gray-200: oklch(12% 9% 264deg / 8%);
  --color-gray-300: oklch(12% 8.5% 264deg / 17%);
  --color-gray-400: oklch(12% 8% 264deg / 38%);
  --color-gray-500: oklch(12% 7.5% 264deg / 50%);
  --color-gray-600: oklch(12% 7% 264deg / 67%);
  --color-gray-700: oklch(12% 6% 264deg / 77%);
  --color-gray-800: oklch(12% 5% 264deg / 85%);
  --color-gray-900: oklch(12% 5% 264deg / 90%);
  --color-gray-950: oklch(12% 5% 264deg / 95%);

  /* Spacing System */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;

  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.3);

  /* Transitions */
  --transition-fast: 0.15s ease-in-out;
  --transition-normal: 0.2s ease-in-out;
  --transition-slow: 0.3s ease-in-out;

  @media (prefers-color-scheme: dark) {
    --color-secondary: oklch(69% 50% 264deg);
    --color-accent: oklch(80% 55% 31deg);

    --color-gray-50: oklch(17% 1% 264deg);
    --color-gray-100: oklch(28% 3% 264deg / 65%);
    --color-gray-200: oklch(31% 3% 264deg / 80%);
    --color-gray-300: oklch(35% 3% 264deg / 80%);
    --color-gray-400: oklch(47% 3.5% 264deg / 80%);
    --color-gray-500: oklch(64% 4% 264deg / 80%);
    --color-gray-600: oklch(82% 4% 264deg / 80%);
    --color-gray-700: oklch(92% 4.5% 264deg / 80%);
    --color-gray-800: oklch(93% 3.5% 264deg / 85%);
    --color-gray-900: oklch(95% 2% 264deg / 90%);
    --color-gray-950: oklch(94% 1.5% 264deg / 95%);
  }

  color-scheme: light dark;

  overflow-y: overlay;
}

/* ===========================================
   BASE STYLES
=========================================== */

* {
  box-sizing: border-box;
}

body {
  background: var(--color-background);
  color: var(--color-text-primary);
  font-family:
    "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", Arial, sans-serif;
  margin: 0;
  min-height: 100vh;
  line-height: 1.6;
}

/* ===========================================
   FORM ELEMENTS
=========================================== */

input {
  background: var(--color-background-input);
  color: var(--color-text-primary);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  font-family: inherit;
  font-size: 1rem;
  transition:
    border-color var(--transition-normal),
    box-shadow var(--transition-normal);
}

input:focus {
  outline: none;
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 var(--spacing-xs) rgba(255, 179, 71, 0.2);
}

/* Button Styles - Consolidated */
button,
.button {
  background: var(--color-primary);
  color: var(--color-text-on-primary);
  border: none;
  border-radius: var(--radius-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: 0.875rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  text-align: center;
  line-height: 1.4;
  min-height: 36px;
}

button:hover,
.button:hover {
  background: var(--color-primary-light);
  color: var(--color-text-on-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

button:active,
.button:active {
  transform: translateY(0);
}

button:disabled,
.button:disabled {
  background: var(--color-gray-600);
  color: var(--color-gray-300);
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

button:disabled:hover,
.button:disabled:hover {
  transform: none;
  box-shadow: none;
  background: var(--color-gray-600);
}

/* Button variants */
.button-secondary {
  background: var(--color-background-elevated);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}

.button-secondary:hover {
  background: var(--color-background-card);
  border-color: var(--color-primary);
  color: var(--color-text-primary);
}

.button-small {
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: 0.75rem;
  min-height: 28px;
}

/* ===========================================
   TYPOGRAPHY
=========================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--color-primary);
  margin-top: 0;
  line-height: 1.2;
}

h1 {
  margin-bottom: var(--spacing-md);
}

h2 {
  margin-bottom: var(--spacing-md);
}

h3 {
  margin-bottom: var(--spacing-sm);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-normal);
}

a:hover {
  color: var(--color-primary-light);
}

/* ===========================================
   LAYOUT COMPONENTS
=========================================== */

.page-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.content {
  flex: 1;
}

.header {
  background: var(--color-background-card);
  padding: var(--spacing-sm) var(--spacing-sm) var(--spacing-sm);
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  box-shadow: var(--shadow-md);
}

.content {
  padding: var(--spacing-md);
  margin: 0 auto;
}

.footer {
  color: var(--color-text-primary);
  text-align: center;
  padding: var(--spacing-sm);
  position: relative;
  bottom: 0;
  align-items: center;
  justify-content: center;
}

.footer p {
  color: var(--color-text-muted);
  margin: 0 0 3px 0;
}

.footer-logo {
  filter: grayscale(1) contrast(200%) brightness(0.5);
  margin-right: var(--spacing-xs);
  vertical-align: sub;
}

.logo {
  width: 150px;
  transform: translateY(0.4rem);
  height: auto;
  margin: 0 auto;
}

.topnav {
  display: flex;
  gap: var(--spacing-md);
}

/* ===========================================
   HOME PAGE STYLES
=========================================== */

.home-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--spacing-md);
}

.hero {
  text-align: center;
  padding: var(--spacing-xl) 0 0 0;
}

.hero-logo {
  max-width: 25rem;
  height: auto;
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: var(--spacing-sm);
  background: linear-gradient(
    135deg,
    var(--color-primary),
    var(--color-primary-light)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  font-size: 1.3rem;
  color: var(--color-primary);
  font-style: italic;
  margin-bottom: var(--spacing-md);
}

.hero-description {
  font-size: 1.2rem;
  line-height: 1.6;
  max-width: 43.75rem;
  margin: 0 auto var(--spacing-xl) auto;
  color: var(--color-text-secondary);
}

.search-section {
  background: var(--color-background-elevated);
  padding: var(--spacing-xl);
  border-radius: var(--radius-xl);
  margin: var(--spacing-xl) 0;
  border: 2px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.search-section h3 {
  margin-top: 0;
  margin-bottom: var(--spacing-md);
  text-align: center;
}

.search-container {
  max-width: 37.5rem;
  margin: 0 auto;
  position: relative;
}

.search-input {
  width: 100%;
  padding: var(--spacing-md);
  font-size: 1.1rem;
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-md);
  box-sizing: border-box;
}

.search-status {
  text-align: center;
  color: var(--color-primary);
  font-style: italic;
  margin: var(--spacing-md) 0;
}

.search-status.error {
  color: var(--color-accent);
}

.search-results {
  background: var(--color-background-input);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  border: 1px solid var(--color-border);
}

.results-count {
  margin: 0 0 var(--spacing-sm) 0;
  color: var(--color-primary);
  font-weight: 600;
}

.results-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.results-list li {
  padding: 0;
  margin: var(--spacing-xs) 0;
}

.symbol-button {
  width: 100%;
  padding: var(--spacing-sm);
  background: var(--color-background);
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-normal);
  text-align: left;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  display: block;
}

.symbol-button:hover {
  background: var(--color-background-elevated);
  border-color: var(--color-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.more-results {
  text-align: center;
  padding: var(--spacing-md) !important;
}

/* ===========================================
   ABOUT PAGE STYLES
=========================================== */

.about-section {
  margin: var(--spacing-2xl) 0;
}

.about {
  background: var(--color-background-elevated);
  padding: var(--spacing-xl);
  border-radius: var(--radius-xl);
  border: 2px solid var(--color-border);
  max-width: 50rem;
  margin: 0 auto;
  box-shadow: var(--shadow-sm);
}

.about h2 {
  margin-top: 0;
}

.problem-solution {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-xl);
  margin: var(--spacing-2xl) 0;
}

/* ===========================================
   UTILITY CLASSES
=========================================== */

.error {
  color: var(--color-accent);
  padding: var(--spacing-md);
  background: var(--color-background-elevated);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-md);
  margin: var(--spacing-md) 0;
  font-weight: 500;
}

.loading {
  color: var(--color-text-muted);
  text-align: center;
  padding: var(--spacing-lg);
  font-style: italic;
}

.info {
  color: var(--color-text-secondary);
  padding: var(--spacing-md);
  background: var(--color-background-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin: var(--spacing-md) 0;
  font-weight: 500;
}

/* Layout utilities */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.gap-sm {
  gap: var(--spacing-sm);
}

.gap-md {
  gap: var(--spacing-md);
}

.gap-lg {
  gap: var(--spacing-lg);
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--color-text-muted);
}

.text-primary {
  color: var(--color-primary);
}

.font-mono {
  font-family:
    "SF Mono", "Monaco", "Cascadia Code", "Roboto Mono", "Consolas",
    "Courier New", monospace;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===========================================
   RESPONSIVE DESIGN
=========================================== */

@media (max-width: 768px) {
  .hero-logo {
    max-width: 18.75rem;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .about-section {
    padding: 0;
  }

  .search-section,
  .about {
    padding: var(--spacing-md);
  }

  .problem-solution {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }

  .home-container {
    padding: var(--spacing-sm);
  }
}
