/**
 * Design Tokens - drep-ai.org
 *
 * All design decisions centralized in CSS custom properties.
 * Following design-tokens-first approach from ~/dev/workflows/style-guide.md
 *
 * Usage: var(--token-name)
 * Example: color: var(--color-primary);
 */

:root {
  /* ============================================
     COLORS
     ============================================ */

  /* Brand Colors */
  --color-primary: #E85D4A;        /* Coral - AI/modern feel, borders, accents */
  --color-primary-dark: #c23d28;   /* Button backgrounds (WCAG AA compliant with white text) */
  --color-primary-hover: #a8341f;  /* Button hover states */
  --color-primary-light: #FEE9E7;  /* Subtle backgrounds, highlights */

  /* Backgrounds */
  --color-bg-base: #F5F1EA;        /* Warm cream page background */
  --color-bg-surface: #ffffff;     /* Cards, content areas, raised surfaces */
  --color-bg-overlay: rgba(0, 0, 0, 0.5); /* Modal/dialog overlays */

  /* Text */
  --color-text-primary: #111827;   /* Headings, primary text - WCAG AA on white */
  --color-text-secondary: #6b7280; /* Secondary text, labels, metadata */
  --color-text-tertiary: #9ca3af;  /* Disabled text, placeholders */
  --color-text-inverse: #ffffff;   /* Text on dark backgrounds */

  /* Code (important for dev tool site) */
  --color-code-bg: #1e1e1e;        /* Code block background */
  --color-code-text: #d4d4d4;      /* Code text */
  --color-code-keyword: #569cd6;   /* Keywords (if, def, function) */
  --color-code-string: #ce9178;    /* Strings */
  --color-code-comment: #6a9955;   /* Comments */

  /* Semantic Colors */
  --color-success: #10b981;        /* Success states, checkmarks */
  --color-success-bg: #d1fae5;     /* Success backgrounds */
  --color-warning: #f59e0b;        /* Warning states */
  --color-warning-bg: #fef3c7;     /* Warning backgrounds */
  --color-error: #ef4444;          /* Error states */
  --color-error-bg: #fee2e2;       /* Error backgrounds */
  --color-info: #3b82f6;           /* Info states */
  --color-info-bg: #dbeafe;        /* Info backgrounds */

  /* Borders */
  --color-border-base: #e5e7eb;    /* Default borders */
  --color-border-strong: #d1d5db;  /* Emphasized borders */
  --color-border-focus: var(--color-primary); /* Focus indicators */

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-base: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);


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

  /* Font Families */
  --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Helvetica Neue', sans-serif;
  --font-secondary: var(--font-primary); /* Kept for compatibility */
  --font-code: 'JetBrains Mono', 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace; /* Code blocks only */

  /* Font Sizes (fluid typography with clamp for responsive scaling) */
  --font-size-xs: 0.75rem;      /* 12px - Small labels, metadata */
  --font-size-sm: 0.875rem;     /* 14px - Secondary text */
  --font-size-base: 1rem;       /* 16px - Body text */
  --font-size-lg: 1.125rem;     /* 18px - Large body text */
  --font-size-xl: 1.25rem;      /* 20px - Section subheadings */
  --font-size-2xl: 1.5rem;      /* 24px - Card titles */
  --font-size-3xl: 1.875rem;    /* 30px - Page headings */
  --font-size-4xl: 2.25rem;     /* 36px - Hero subheadings */
  --font-size-hero: clamp(2.5rem, 5vw, 3.5rem); /* 40-56px - Hero title (responsive) */

  /* Font Weights */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Line Heights */
  --line-height-tight: 1.25;    /* Headings */
  --line-height-normal: 1.5;    /* Body text */
  --line-height-relaxed: 1.75;  /* Long-form content */

  /* Letter Spacing */
  --letter-spacing-tight: -0.025em;  /* Large headings */
  --letter-spacing-normal: 0;        /* Body text */
  --letter-spacing-wide: 0.025em;    /* Uppercase labels */


  /* ============================================
     SPACING
     ============================================ */

  /* Base unit: 4px (0.25rem)
     Mobile-first: smaller spacing on mobile, larger on desktop
  */
  --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 */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */

  /* Semantic spacing (use these for consistency) */
  --space-section-sm: var(--space-12);  /* 48px - Small section padding (mobile) */
  --space-section-md: var(--space-16);  /* 64px - Medium section padding (tablet) */
  --space-section-lg: var(--space-20);  /* 80px - Large section padding (desktop) */

  --space-content-gap: var(--space-6);  /* 24px - Gap between content blocks */
  --space-card-padding: var(--space-6); /* 24px - Padding inside cards */


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

  /* Container widths (max-width for content) */
  --container-xs: 20rem;     /* 320px - Narrow content */
  --container-sm: 36rem;     /* 576px - Forms */
  --container-md: 48rem;     /* 768px - Articles */
  --container-lg: 64rem;     /* 1024px - Main content */
  --container-xl: 80rem;     /* 1280px - Wide layouts */

  /* Grid gaps */
  --gap-sm: var(--space-4);   /* 16px */
  --gap-md: var(--space-6);   /* 24px */
  --gap-lg: var(--space-8);   /* 32px */

  /* Border radius */
  --radius-sm: 0.25rem;  /* 4px - Small elements */
  --radius-md: 0.5rem;   /* 8px - Cards, buttons */
  --radius-lg: 1rem;     /* 16px - Large cards */
  --radius-full: 9999px; /* Circular elements */

  /* Border widths */
  --border-width-thin: 1px;
  --border-width-medium: 2px;
  --border-width-thick: 4px;


  /* ============================================
     BREAKPOINTS (for reference in media queries)
     ============================================ */

  /* Mobile-first approach: base styles = mobile (320px+)
     Use min-width media queries to enhance for larger screens

     Tablet:  768px+  (48rem)
     Desktop: 1024px+ (64rem)
     Wide:    1280px+ (80rem)
  */


  /* ============================================
     TRANSITIONS & ANIMATIONS
     ============================================ */

  /* Durations */
  --duration-fast: 150ms;
  --duration-base: 200ms;
  --duration-slow: 300ms;

  /* Easing functions */
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

  /* Common transitions */
  --transition-base: all var(--duration-base) var(--ease-in-out);
  --transition-colors: color var(--duration-base) var(--ease-in-out),
                       background-color var(--duration-base) var(--ease-in-out),
                       border-color var(--duration-base) var(--ease-in-out);
  --transition-transform: transform var(--duration-base) var(--ease-out);


  /* ============================================
     Z-INDEX SCALE
     ============================================ */

  --z-base: 0;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-toast: 600;
  --z-tooltip: 700;
}


/* ============================================
   DARK MODE TOKENS (optional future enhancement)
   ============================================ */

@media (prefers-color-scheme: dark) {
  /* Uncomment when dark mode is implemented
  :root {
    --color-bg-base: #111827;
    --color-bg-surface: #1f2937;
    --color-text-primary: #f9fafb;
    --color-text-secondary: #d1d5db;
    --color-text-tertiary: #9ca3af;
    --color-border-base: #374151;
    --color-border-strong: #4b5563;
  }
  */
}
