/**
 * TERREXO DESIGN SYSTEM - CSS TOKENS
 * Version 1.0
 * Source of truth for all design decisions
 * DO NOT override these tokens directly in component styles
 */

:root {
  /* ============================================
     1. BASE COLORS (Core Palette)
     ============================================ */

  /* Backgrounds */
  --bg: #0D0D0D;
  --surface: #1C1C1C;

  /* Text */
  --text: #F5F5F5;
  --muted: #A8A8A8;

  /* Accents */
  --primary: #616161;
  --secondary: #A8A8A8;
  --accent: #E0E0E0;

  /* Structural */
  --border: #2A2A2A;
  --hover: rgba(255, 255, 255, 0.06);
  --focus: #E0E0E0;

  /* ============================================
     2. SEMANTIC COLORS
     ============================================ */

  --success: #4CAF50;
  --warning: #FFC107;
  --error: #F44336;
  --info: #2196F3;

  /* ============================================
     3. TYPOGRAPHY SCALE
     ============================================ */

  /* Font Family */
  --font-family: Satoshi, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-family-serif: Playfair Display, Georgia, serif;
  --font-family-mono: "Courier New", monospace;

  /* Font Sizes */
  --font-hero: 64px;
  --font-h1: 48px;
  --font-h2: 36px;
  --font-h3: 28px;
  --font-body: 18px;
  --font-small: 14px;

  /* Font Weights */
  --font-light: 300;
  --font-normal: 400;
  --font-semibold: 600;

  /* Line Heights */
  --line-hero: 1.05;
  --line-h1: 1.1;
  --line-h2: 1.2;
  --line-h3: 1.3;
  --line-body: 1.6;
  --line-small: 1.4;

  /* Letter Spacing */
  --letter-hero: -0.02em;
  --letter-h1: -0.01em;
  --letter-body: 0;
  --letter-small: 0.01em;

  /* ============================================
     4. SPACING SCALE
     ============================================ */

  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 12px;
  --spacing-lg: 16px;
  --spacing-xl: 24px;
  --spacing-2xl: 32px;
  --spacing-3xl: 48px;
  --spacing-4xl: 64px;
  --spacing-5xl: 80px;
  --spacing-6xl: 120px;

  /* Gutters */
  --gutter-mobile: 24px;
  --gutter-desktop: 48px;

  /* Section Spacing */
  --section-mobile: 64px;
  --section-desktop: 120px;

  /* ============================================
     5. LAYOUT
     ============================================ */

  --container-width: 1280px;
  --container-max-width: 1440px;

  /* ============================================
     6. BORDER RADIUS
     ============================================ */

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* ============================================
     7. SHADOWS
     ============================================ */

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 6px 24px rgba(0, 0, 0, 0.35);
  --shadow-xl: 0 8px 32px rgba(0, 0, 0, 0.4);

  /* ============================================
     8. TRANSITIONS
     ============================================ */

  --transition-fast: 150ms ease-out;
  --transition-base: 200ms ease-in-out;
  --transition-slow: 400ms ease-in-out;
  --transition-slower: 600ms ease;
  --transition-scroll: 400ms 700ms cubic-bezier(0.4, 0, 0.2, 1);

  /* ============================================
     9. GRADIENTS
     ============================================ */

  --gradient-light-band: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 100%);
  --gradient-accent: linear-gradient(90deg, #E0E0E0 0%, #A8A8A8 100%);

  /* ============================================
     10. Z-INDEX SCALE
     ============================================ */

  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
}

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

/* Typography Utilities */
.type-hero {
  font-size: var(--font-hero);
  font-weight: var(--font-semibold);
  line-height: var(--line-hero);
  letter-spacing: var(--letter-hero);
}

.type-h1 {
  font-size: var(--font-h1);
  font-weight: var(--font-semibold);
  line-height: var(--line-h1);
  letter-spacing: var(--letter-h1);
}

.type-h2 {
  font-size: var(--font-h2);
  font-weight: 500;
  line-height: var(--line-h2);
  letter-spacing: var(--letter-body);
}

.type-h3 {
  font-size: var(--font-h3);
  font-weight: 500;
  line-height: var(--line-h3);
  letter-spacing: var(--letter-body);
}

.type-body {
  font-size: var(--font-body);
  font-weight: var(--font-normal);
  line-height: var(--line-body);
  letter-spacing: var(--letter-body);
}

.type-small {
  font-size: var(--font-small);
  font-weight: var(--font-normal);
  line-height: var(--line-small);
  letter-spacing: var(--letter-small);
}

/* Text Color Utilities */
.text-primary {
  color: var(--text);
}

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

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

/* Background Utilities */
.bg-base {
  background-color: var(--bg);
}

.bg-surface {
  background-color: var(--surface);
}

/* Container Utilities */
.container-fluid {
  max-width: var(--container-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter-mobile);
  padding-right: var(--gutter-mobile);
}

@media (min-width: 1024px) {
  .container-fluid {
    padding-left: var(--gutter-desktop);
    padding-right: var(--gutter-desktop);
  }
}

/* Shadow Utilities */
.shadow-card {
  box-shadow: var(--shadow-lg);
}

.shadow-elevation-1 {
  box-shadow: var(--shadow-sm);
}

.shadow-elevation-2 {
  box-shadow: var(--shadow-md);
}

.shadow-elevation-3 {
  box-shadow: var(--shadow-lg);
}

/* Focus State Utilities */
.focus-ring {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.focus-ring:focus {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* Transition Utilities */
.transition-fast {
  transition: all var(--transition-fast);
}

.transition-base {
  transition: all var(--transition-base);
}

.transition-slow {
  transition: all var(--transition-slow);
}

/* Gradient Utilities */
.gradient-light-band {
  background-image: var(--gradient-light-band);
}

.gradient-accent {
  background-image: var(--gradient-accent);
}

/* Border Utilities */
.border-color {
  border-color: var(--border);
}

/* Hover State */
.hover-surface {
  transition: background-color var(--transition-fast);
}

.hover-surface:hover {
  background-color: var(--hover);
}

/* Responsive Typography Scaling */
@media (max-width: 640px) {
  .type-hero {
    font-size: 40px;
  }

  .type-h1 {
    font-size: 32px;
  }

  .type-h2 {
    font-size: 24px;
  }

  .type-h3 {
    font-size: 20px;
  }

  .type-body {
    font-size: 16px;
  }
}

/* Grid Container */
.section-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(256px, 1fr));
  gap: var(--spacing-3xl);
  padding: var(--section-mobile) var(--gutter-mobile);
}

@media (min-width: 1024px) {
  .section-container {
    padding: var(--section-desktop) var(--gutter-desktop);
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  }
}

/* Section Divider */
.section-divider {
  height: 1px;
  background-color: var(--border);
  margin: var(--section-mobile) 0;
}

@media (min-width: 1024px) {
  .section-divider {
    margin: var(--section-desktop) 0;
  }
}
