/* ============================================
   DESIGN SYSTEM — Core Tokens & Base Styles
   ============================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

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

ul, ol {
  list-style: none;
}

/* --- Custom Properties --- */
:root {
  /* Backgrounds */
  --bg-primary: #050505;
  --bg-secondary: #0A0A0A;
  --bg-tertiary: #0D0D0D;

  /* Surfaces */
  --surface: #111111;
  --surface-raised: #1A1A1A;
  --surface-overlay: #161616;

  /* Borders */
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --border-active: rgba(255, 255, 255, 0.18);

  /* Text */
  --text-primary: #FFFFFF;
  --text-secondary: #FFFFFF;
  --text-muted: #FFFFFF;
  --text-ghost: #FFFFFF;

  /* Accents */
  --accent-green: #4ADE80;
  --accent-green-muted: rgba(74, 222, 128, 0.7);
  --accent-green-subtle: rgba(74, 222, 128, 0.12);
  --accent-cyan: #67E8F9;
  --accent-cyan-muted: rgba(103, 232, 249, 0.6);
  --accent-cyan-subtle: rgba(103, 232, 249, 0.08);
  --accent-blue: #60A5FA;
  --accent-blue-muted: rgba(96, 165, 250, 0.6);
  --accent-blue-subtle: rgba(96, 165, 250, 0.1);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  /* Font Sizes — Fluid */
  --text-xs: clamp(0.625rem, 0.6rem + 0.1vw, 0.6875rem);   /* ~10-11px */
  --text-sm: clamp(0.75rem, 0.7rem + 0.15vw, 0.8125rem);    /* ~12-13px */
  --text-base: clamp(0.875rem, 0.85rem + 0.15vw, 1rem);      /* ~14-16px */
  --text-lg: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);        /* ~16-18px */
  --text-xl: clamp(1.125rem, 1rem + 0.4vw, 1.375rem);        /* ~18-22px */
  --text-2xl: clamp(1.375rem, 1.2rem + 0.6vw, 1.75rem);      /* ~22-28px */
  --text-3xl: clamp(1.75rem, 1.4rem + 1vw, 2.5rem);          /* ~28-40px */
  --text-4xl: clamp(2.25rem, 1.8rem + 1.5vw, 3.25rem);       /* ~36-52px */
  --text-5xl: clamp(2.75rem, 2rem + 2.5vw, 4.5rem);          /* ~44-72px */
  --text-hero: clamp(3rem, 2rem + 4vw, 6rem);                 /* ~48-96px */

  /* Font Weights */
  --weight-light: 300;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;

  /* Line Heights */
  --leading-none: 1;
  --leading-tight: 1.1;
  --leading-snug: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.65;

  /* Letter Spacing */
  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.05em;
  --tracking-wider: 0.1em;
  --tracking-widest: 0.2em;

  /* Spacing — 4px base grid */
  --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 */
  --space-32: 8rem;      /* 128px */
  --space-40: 10rem;     /* 160px */
  --space-48: 12rem;     /* 192px */

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

  /* Easing */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-in-out-expo: cubic-bezier(0.87, 0, 0.13, 1);

  /* Transitions */
  --transition-fast: 150ms var(--ease-out);
  --transition-base: 300ms var(--ease-out);
  --transition-slow: 500ms var(--ease-out);
  --transition-slower: 800ms var(--ease-in-out);
}

/* --- Base Styles --- */
body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
  background-color: var(--bg-primary);
  overflow-x: hidden;
  min-height: 100vh;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  color: var(--accent-green);
  font-weight: var(--weight-medium);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

h1 { font-size: var(--text-hero); font-weight: var(--weight-light); }
h2 { font-size: var(--text-4xl); font-weight: var(--weight-light); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); font-weight: var(--weight-semibold); }

p {
  max-width: 65ch;
}

/* Mono Label Style */
.mono {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  color: var(--text-muted);
}

.mono--accent {
  color: var(--accent-green-muted);
}

/* --- Selection --- */
::selection {
  background: rgba(96, 165, 250, 0.2);
  color: var(--text-primary);
}

::-moz-selection {
  background: rgba(96, 165, 250, 0.2);
  color: var(--text-primary);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--surface-raised);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* --- Focus Visible --- */
:focus-visible {
  outline: 1px solid var(--accent-blue-muted);
  outline-offset: 2px;
}
