/* ═══════════════════════════════════════════════════════
   DeFAI Network — Base Design Tokens
   Hybrid Theme: Dark hero/nav/footer, Light body sections
   Accents: teal #00d4aa, gold #f5a623, cyan #00e5ff, purple #a855f7
   ═══════════════════════════════════════════════════════ */

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { min-height: 100vh; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }

/* --- Spacing (4px system) --- */
:root {
  --space-0: 0px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;
  --space-32: 128px;
}

/* --- Fluid Type Scale --- */
:root {
  --text-xs: clamp(0.6875rem, 0.65rem + 0.15vw, 0.75rem);
  --text-sm: clamp(0.8125rem, 0.78rem + 0.15vw, 0.875rem);
  --text-base: clamp(0.9375rem, 0.9rem + 0.18vw, 1rem);
  --text-lg: clamp(1.0625rem, 1rem + 0.25vw, 1.125rem);
  --text-xl: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  --text-3xl: clamp(1.875rem, 1.4rem + 1.8vw, 2.5rem);
  --text-4xl: clamp(2.25rem, 1.5rem + 3vw, 3.5rem);
  --text-5xl: clamp(2.75rem, 1.5rem + 4.5vw, 4.5rem);
}

/* --- Dark Theme Colors (hero, nav, footer) --- */
:root {
  --color-bg-deep: #050810;
  --color-bg: #070b14;
  --color-bg-elevated: #0c1120;
  --color-surface: #0f1729;
  --color-surface-2: #141d34;
  --color-surface-3: #1a2540;
  --color-surface-hover: #1e2a48;

  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-strong: rgba(255, 255, 255, 0.15);

  --color-text: #e8ecf4;
  --color-text-muted: #8b95a8;
  --color-text-faint: #5a6478;

  /* Accent colors (shared across dark + light) */
  --color-teal: #00d4aa;
  --color-teal-dim: rgba(0, 212, 170, 0.15);
  --color-teal-glow: rgba(0, 212, 170, 0.25);

  --color-gold: #f5a623;
  --color-gold-dim: rgba(245, 166, 35, 0.15);

  --color-cyan: #00e5ff;
  --color-cyan-dim: rgba(0, 229, 255, 0.12);

  --color-purple: #a855f7;
  --color-purple-dim: rgba(168, 85, 247, 0.15);

  --color-error: #ef4444;
  --color-success: #22c55e;

  /* --- Light Section Tokens --- */
  --light-bg: #FFFFFF;
  --light-bg-alt: #F8F9FB;
  --light-bg-subtle: #F2F3F5;
  --light-surface: #FFFFFF;
  --light-surface-2: #F4F5F7;
  --light-border: rgba(0, 0, 0, 0.08);
  --light-border-strong: rgba(0, 0, 0, 0.12);
  --light-text: #1a1f2e;
  --light-text-muted: #4a5068;
  --light-text-faint: #6b7280;
  --light-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --light-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  --light-shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);

  /* Light-mode accent dims (slightly more saturated for visibility on white) */
  --light-teal-dim: rgba(0, 212, 170, 0.1);
  --light-gold-dim: rgba(245, 166, 35, 0.1);
  --light-cyan-dim: rgba(0, 229, 255, 0.08);
  --light-purple-dim: rgba(168, 85, 247, 0.1);
}

/* --- Radius --- */
:root {
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;
}

/* --- Shadows (dark-mode optimized) --- */
:root {
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35), 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-glow-teal: 0 0 30px rgba(0, 212, 170, 0.15), 0 0 60px rgba(0, 212, 170, 0.05);
  --shadow-glow-gold: 0 0 30px rgba(245, 166, 35, 0.15);
}

/* --- Content Widths --- */
:root {
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
  --content-max: 1400px;
  --content-full: 100%;
}

/* --- Transitions --- */
:root {
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

/* --- Base body --- */
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: var(--text-base);
  line-height: 1.6;
}
