/* =============================================================================
   GAUCHOGRID — GLOBAL DESIGN SYSTEM
   Dark Mode Theme | Version 1.1
   ============================================================================= */

/* =============================================================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================================================= */
:root {
  /* --- Backgrounds --- */
  --color-bg-primary: #0a0a0a;
  --color-bg-secondary: #141414;
  --color-bg-tertiary: #1a1a1a;
  
  /* --- Surfaces --- */
  --color-surface-1: #1e1e1e;
  --color-surface-2: #252525;
  
  /* --- Brand Colors --- */
  --color-primary: #22c55e;
  --color-primary-dark: #16a34a;
  --color-primary-light: #4ade80;
  
  /* --- Text Hierarchy --- */
  --color-text-primary: #f3f4f6;
  --color-text-secondary: #d1d5db;
  --color-text-tertiary: #9ca3af;
  --color-text-quaternary: #6b7280;
  
  /* --- Borders --- */
  --color-border-subtle: rgba(34, 197, 94, 0.1);
  --color-border-default: rgba(34, 197, 94, 0.2);
  --color-border-emphasis: rgba(34, 197, 94, 0.4);
  --color-border-neutral: rgba(255, 255, 255, 0.1);
  
  /* --- Semantic Colors --- */
  --color-success: #22c55e;
  --color-success-bg: rgba(34, 197, 94, 0.1);
  --color-warning: #f59e0b;
  --color-warning-bg: rgba(245, 158, 11, 0.1);
  --color-error: #ef4444;
  --color-error-bg: rgba(239, 68, 68, 0.1);
  --color-info: #3b82f6;
  --color-info-bg: rgba(59, 130, 246, 0.1);
  
  /* --- Typography --- */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', Monaco, 'Courier New', monospace;
  
  /* --- Type Scale --- */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-6xl: 3.75rem;
  
  /* --- Line Heights --- */
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.75;
  
  /* --- Spacing Scale --- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  
  /* --- Layout --- */
  --container-max: 1120px;
  --container-wide: 1280px;
  
  /* --- Border Radius --- */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  
  /* --- Shadows --- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(34, 197, 94, 0.3);
  --shadow-glow-strong: 0 0 30px rgba(34, 197, 94, 0.5);
  
  /* --- Transitions --- */
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-slow: 0.3s ease;
}

/* =============================================================================
   CSS RESET
   ============================================================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text-secondary);
  background: var(--color-bg-primary);
  min-height: 100vh;
}

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

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

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

ul, ol {
  list-style: none;
}

/* =============================================================================
   BASE TYPOGRAPHY
   ============================================================================= */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-text-primary);
  font-weight: 700;
  line-height: var(--leading-tight);
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

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

p:last-child {
  margin-bottom: 0;
}

strong {
  font-weight: 600;
  color: var(--color-text-primary);
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--color-surface-1);
  padding: 0.2em 0.4em;
  border-radius: var(--radius-sm);
  color: var(--color-primary);
}

pre {
  font-family: var(--font-mono);
  background: var(--color-surface-1);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  overflow-x: auto;
}

pre code {
  background: transparent;
  padding: 0;
}

/* =============================================================================
   UTILITY CLASSES
   ============================================================================= */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.container--wide {
  max-width: var(--container-wide);
}

@media (min-width: 768px) {
  .container {
    padding: 0 var(--space-6);
  }
}

.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;
}

.gradient-text {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-primary { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-tertiary { color: var(--color-text-tertiary); }
.text-muted { color: var(--color-text-quaternary); }
.text-accent { color: var(--color-primary); }

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

/* =============================================================================
   FOCUS STATES (Accessibility)
   ============================================================================= */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* =============================================================================
   SELECTION
   ============================================================================= */
::selection {
  background: var(--color-primary);
  color: #000;
}

/* =============================================================================
   SCROLLBAR (WebKit)
   ============================================================================= */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border-emphasis);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-border-emphasis) var(--color-bg-secondary);
}

/* =============================================================================
   RESPONSIVE TYPOGRAPHY
   ============================================================================= */
@media (max-width: 768px) {
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-xl); }
  h4 { font-size: var(--text-lg); }
}
