/* ==========================================================================
   Lynx - Launch Your Next Experience
   Core Styles: Color Tokens, Typography, Dark Mode, Base Layout
   ========================================================================== */

/* --------------------------------------------------------------------------
   Google Fonts Import
   -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Red+Hat+Display:wght@400;500;600;700&display=swap');

/* --------------------------------------------------------------------------
   CSS Custom Properties - Light Mode (Default)
   -------------------------------------------------------------------------- */
:root {
  /* Amethyst-Quartz Scale */
  --amethyst-900: #1B142c;
  --amethyst-700: #342858;
  --amethyst-500: #5d5279;
  --amethyst-400: #987fb8;
  --amethyst-300: #c1b2d4;
  --amethyst-100: #eae6f1;
  --amethyst-50:  #f5f2f8;

  /* Emerald Scale */
  --emerald-900: #003333;
  --emerald-700: #006666;
  --emerald-500: #008080;
  --emerald-400: #62b3b3;
  --emerald-300: #97cccc;
  --emerald-100: #cbe6e6;

  /* Obsidian Scale */
  --obsidian-900: #1f181d;
  --obsidian-700: #342830;
  --obsidian-500: #5d5359;
  --obsidian-400: #857e83;
  --obsidian-300: #aea9ac;
  --obsidian-100: #d6c4d6;

  /* Rainbow Accents */
  --rainbow-red:    #e40b14;
  --rainbow-orange: #ec8b04;
  --rainbow-yellow: #fbd100;
  --rainbow-green:  #66b632;
  --rainbow-teal:   #67c1bf;
  --rainbow-navy:   #242c67;
  --rainbow-pink:   #e72270;

  /* Semantic Tokens - Light Mode */
  --color-primary:         var(--amethyst-700);
  --color-primary-dark:    var(--amethyst-900);
  --color-primary-light:   var(--amethyst-500);
  --color-primary-lighter: var(--amethyst-400);
  --color-primary-pale:    var(--amethyst-300);
  --color-primary-faint:   var(--amethyst-100);

  --color-accent:       var(--emerald-500);
  --color-accent-dark:  var(--emerald-700);
  --color-accent-light: var(--emerald-400);
  --color-accent-pale:  var(--emerald-300);

  --color-error:   var(--rainbow-red);
  --color-cta:     var(--rainbow-orange);
  --color-success: var(--rainbow-green);
  --color-warning: var(--rainbow-yellow);

  --color-text:       var(--amethyst-700);
  --color-text-light: var(--amethyst-500);
  --color-text-muted: var(--obsidian-400);

  --color-bg:      #ffffff;
  --color-bg-alt:  var(--amethyst-100);
  --color-surface: #ffffff;

  --color-border:      var(--amethyst-300);
  --color-border-dark: var(--obsidian-500);

  /* Typography */
  --font-primary: 'Red Hat Display', sans-serif;
  --font-mono:    Consolas, monospace;

  --text-base:   1rem;      /* 16px */
  --text-sm:     0.875rem;  /* 14px */
  --text-xs:     0.75rem;   /* 12px */
  --text-lg:     1.125rem;  /* 18px */
  --text-xl:     1.25rem;   /* 20px */
  --text-2xl:    1.75rem;   /* 28px */

  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;

  --leading-tight:   1.2;
  --leading-snug:    1.25;
  --leading-normal:  1.5;

  /* Spacing */
  --space-1:  0.25rem;  /* 4px */
  --space-2:  0.5rem;   /* 8px */
  --space-3:  0.75rem;  /* 12px */
  --space-4:  1rem;     /* 16px */
  --space-5:  1.25rem;  /* 20px */
  --space-6:  1.5rem;   /* 24px */
  --space-8:  2rem;     /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */

  /* Borders */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-pill: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 2px rgba(0, 0, 0, 0.08);
  --shadow-md:  0 2px 4px rgba(0, 0, 0, 0.15);
  --shadow-lg:  0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-xl:  0 8px 24px rgba(0, 0, 0, 0.18);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;

  /* Layout */
  --max-width:    1280px;
  --nav-height:   64px;
  --filter-height: 48px;
}

/* --------------------------------------------------------------------------
   Dark Mode (Amethyst Dark)
   -------------------------------------------------------------------------- */
[data-theme="dark"] {
  --color-primary:         var(--amethyst-300);
  --color-primary-dark:    var(--amethyst-100);
  --color-primary-light:   var(--amethyst-400);
  --color-primary-lighter: var(--amethyst-500);
  --color-primary-pale:    var(--amethyst-700);
  --color-primary-faint:   var(--amethyst-900);

  --color-text:       var(--amethyst-100);
  --color-text-light: var(--amethyst-300);
  --color-text-muted: var(--amethyst-400);

  --color-bg:      var(--amethyst-900);
  --color-bg-alt:  var(--amethyst-700);
  --color-surface: var(--amethyst-700);

  --color-border:      var(--amethyst-500);
  --color-border-dark: var(--amethyst-400);

  /* Accent colors stay the same for contrast */
  --color-accent:       var(--emerald-500);
  --color-accent-dark:  var(--emerald-700);
  --color-accent-light: var(--emerald-400);
  --color-accent-pale:  var(--emerald-300);

  --shadow-sm:  0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md:  0 2px 4px rgba(0, 0, 0, 0.4);
  --shadow-lg:  0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-xl:  0 8px 24px rgba(0, 0, 0, 0.5);
}

/* --------------------------------------------------------------------------
   Base Reset & Typography
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-primary);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  line-height: var(--leading-snug);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
}

h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }
h4 { font-size: var(--text-base); font-weight: var(--weight-bold); }

p {
  margin-bottom: var(--space-4);
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent-dark);
}

strong {
  font-weight: var(--weight-bold);
}

code, pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

/* --------------------------------------------------------------------------
   Accessibility
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

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

/* Screen reader only */
.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;
}

/* --------------------------------------------------------------------------
   Layout Container
   -------------------------------------------------------------------------- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.page-content {
  padding-top: calc(var(--nav-height) + var(--space-4));
  min-height: 100vh;
}

/* --------------------------------------------------------------------------
   Responsive Typography
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  html {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 13px;
  }
}
