/**
 * Landing Page Design System
 * UNFOLD-inspired color palette, typography, and spacing
 * Built with Tailwind CSS + CSS custom properties for theming
 */

:root {
  /* Primary Brand Color (Indigo) */
  --primary-50: #eef2ff;
  --primary-100: #e0e7ff;
  --primary-200: #c7d2fe;
  --primary-300: #a5b4fc;
  --primary-400: #818cf8;
  --primary-500: #6366f1;
  --primary-600: #4f46e5;
  --primary-700: #4338ca;
  --primary-800: #3730a3;
  --primary-900: #312e81;

  /* Semantic Colors */
  --success-50: #f0fdf4;
  --success-500: #10b981;
  --success-600: #059669;

  --warning-50: #fffbeb;
  --warning-500: #f59e0b;
  --warning-600: #d97706;

  --danger-50: #fef2f2;
  --danger-500: #ef4444;
  --danger-600: #dc2626;

  --info-50: #eff6ff;
  --info-500: #3b82f6;
  --info-600: #2563eb;

  /* Neutral Scale (Slate) */
  --gray-0: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Dark Mode Backgrounds */
  --dark-bg-primary: #0f172a;
  --dark-bg-secondary: #1e293b;
  --dark-bg-tertiary: #334155;

  /* Borders */
  --border-light: 1px solid var(--gray-200);
  --border-dark: 1px solid var(--gray-800);

  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 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);

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Menlo", "Monaco", "Courier New", monospace;

  /* Spacing Scale (8px base) */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;
  --spacing-3xl: 64px;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;

  /* Z-Index Stack */
  --z-base: 1;
  --z-dropdown: 10;
  --z-sticky: 20;
  --z-fixed: 30;
  --z-modal-backdrop: 40;
  --z-modal: 50;
  --z-toast: 60;

  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 200ms ease-in-out;
  --transition-slow: 300ms ease-in-out;

  /* Default to Dark Mode */
  --text-primary: var(--gray-0);
  --text-secondary: var(--gray-300);
  --text-tertiary: var(--gray-500);
  --bg-primary: var(--dark-bg-primary);
  --bg-secondary: var(--dark-bg-secondary);
  --bg-tertiary: var(--dark-bg-tertiary);
  --border: var(--border-dark);
}

/* Light mode overrides */
@media (prefers-color-scheme: light) {
  :root {
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-600);
    --text-tertiary: var(--gray-500);
    --bg-primary: var(--gray-0);
    --bg-secondary: var(--gray-50);
    --bg-tertiary: var(--gray-100);
    --border: var(--border-light);
  }
}

/* Base Styles */
* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

/* Typography Scale */
h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

h3 {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}

h4 {
  font-size: 14px;
  font-weight: 600;
}

p {
  font-size: 14px;
  line-height: 1.6;
}

small {
  font-size: 12px;
  font-weight: 500;
}

.text-xs {
  font-size: 12px;
  line-height: 1.5;
}

.text-sm {
  font-size: 14px;
  line-height: 1.6;
}

.text-base {
  font-size: 16px;
  line-height: 1.6;
}

.text-lg {
  font-size: 18px;
  line-height: 1.6;
}

/* Utility Classes */
.text-primary {
  color: var(--text-primary);
}

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

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

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

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

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

.border-default {
  border: var(--border);
}

/* Focus Ring */
.focus-ring {
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1), 0 0 0 2px var(--primary-600);
}

/* Truncate utilities */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Animations */
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.7);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(79, 70, 229, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
  }
}

.animate-fade-in {
  animation: fade-in var(--transition-base);
}

.animate-slide-in {
  animation: slide-in-right var(--transition-base);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

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

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

@media (prefers-color-scheme: dark) {
  ::-webkit-scrollbar-track {
    background: var(--dark-bg-secondary);
  }

  ::-webkit-scrollbar-thumb {
    background: var(--gray-600);
  }

  ::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
  }
}
