/* ---------------------------------------------------------------
   Primitives
   --------------------------------------------------------------- */

:root {
  --sand-50: #faf7f2;
  --sand-100: #f2ece1;
  --sand-200: #e4d9c6;
  --sand-300: #cbbb9f;

  --blue-450: #3b3bee;
  --blue-500: #1426ff;
  --blue-600: #0000d4;
  --blue-700: #2f4f6f;
  --blue-800: #16293b;
  --slate-600: #4a6076;
  --slate-700: #42566a;
  --lilac-200: #d6d0ff;
  --lilac-500: #7570b5;
  --slate-400: #a2a8b2;

  --green-400: #6bffa0;
  --green-500: #00ff3e;
  --green-600: #00c834;
  --green-700: #00a828;
  --green-800: #006b1f;

  --ink-700: #2a2a26;
  --ink-800: #1a1a17;
  --ink-900: #0d0d0b;

  --paper: #ffffff;
  --acid: #f7ff3a;
  --orange: #ffa500;

  --pre-1: #ec983b;
  --pre-2: #e02125;
  --pre-3: #20cdd2;
  --pre-4: #efc7d3;
  --email-name: #00ff00;
  --email-at: #ffa500;
  --email-domain: #fa8072;
}

/* ---------------------------------------------------------------
   Theme: dark
   --------------------------------------------------------------- */

:root,
:root[data-theme="dark"] {
  color-scheme: dark;

  --surface-default: var(--ink-900);
  --surface-raised: var(--ink-800);
  --surface-sunken: var(--ink-800);

  --text-primary: var(--green-500);
  --text-secondary: var(--green-600);
  --text-muted: var(--green-700);
  --text-inverse: var(--ink-900);

  --border-subtle: var(--green-700);
  --border-strong: var(--green-500);

  --accent-default: var(--green-500);
  --accent-hover: var(--green-400);
  --accent-on: var(--ink-900);

  --focus-ring: var(--green-400);
  --shadow-hard-color: var(--ink-900);
  --dot-color: transparent;
}

/* ---------------------------------------------------------------
   Theme: light
   --------------------------------------------------------------- */

:root[data-theme="light"] {
  color-scheme: light;

  --surface-default: var(--sand-100);
  --surface-raised: var(--paper);
  --surface-sunken: var(--sand-200);

  --text-primary: var(--blue-600);
  --text-secondary: var(--blue-700);
  --text-muted: var(--slate-600);
  --text-inverse: var(--sand-50);

  --border-subtle: var(--slate-400);
  --border-strong: var(--blue-600);

  --accent-default: var(--blue-600);
  --accent-hover: var(--blue-500);
  --accent-on: var(--sand-50);

  --focus-ring: var(--blue-600);
  --shadow-hard-color: var(--ink-900);
  --dot-color: transparent;
}

/* ---------------------------------------------------------------
   Theme: blue
   --------------------------------------------------------------- */

:root[data-theme="blue"] {
  color-scheme: dark;

  --surface-default: var(--blue-500);
  --surface-raised: #000000;
  --surface-sunken: var(--blue-500);

  --text-primary: var(--paper);
  --text-secondary: var(--paper);
  --text-muted: var(--paper);
  --text-inverse: var(--blue-500);

  --border-subtle: #d0d5dd;
  --border-strong: var(--paper);

  --accent-default: var(--acid);
  --accent-hover: var(--acid);
  --accent-on: var(--ink-900);

  --focus-ring: var(--paper);
  --shadow-hard-color: var(--ink-900);
  --dot-color: rgba(255, 255, 255, 0.4);
}

/* ---------------------------------------------------------------
   Theme: lilac
   --------------------------------------------------------------- */

:root[data-theme="lilac"] {
  color-scheme: light;

  --surface-default: var(--lilac-200);
  --surface-raised: var(--paper);
  --surface-sunken: var(--lilac-200);

  --text-primary: var(--blue-600);
  --text-secondary: var(--blue-450);
  --text-muted: var(--slate-700);
  --text-inverse: var(--lilac-200);

  --border-subtle: var(--lilac-500);
  --border-strong: var(--blue-600);

  --accent-default: var(--blue-600);
  --accent-hover: var(--blue-450);
  --accent-on: var(--lilac-200);

  --focus-ring: var(--blue-600);
  --shadow-hard-color: var(--ink-900);
  --dot-color: transparent;
}

/* ---------------------------------------------------------------
   Brand
   --------------------------------------------------------------- */

:root {
  --cta-surface: var(--green-500);
  --cta-text: var(--ink-900);
  --footer-surface: var(--orange);
  --footer-text: var(--ink-900);

  --dot-size: 40px;

  --email-sweep: linear-gradient(90deg, #ff6b9d 0%, #c44569 20%, #ffa07a 40%, #ffd93d 60%, #6bcf7f 80%, #4ecdc4 100%);
  --email-sweep-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 28' preserveAspectRatio='none'%3E%3Cpath d='M8 23 Q130 4 224 11 T392 7' fill='none' stroke='%23fff' stroke-width='17' stroke-linecap='round'/%3E%3C/svg%3E");
  --underline-h: 2px;
  --underline-offset: 4px;
  --underline-ease: cubic-bezier(0.25, 0.8, 0.25, 1);
  --sketch-url: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 8'%3E%3Cpath d='M2 6 Q40 2 80 6 T198 6' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* ---------------------------------------------------------------
   Type
   --------------------------------------------------------------- */

:root {
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Poppins", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

  --text-display: clamp(3.5rem, 8vw, 7.375rem);
  --text-h1: clamp(3.5rem, 6vw, 5rem);
  --text-h2: clamp(1.75rem, 3vw, 2.5rem);
  --text-h3: clamp(1.375rem, 2vw, 1.75rem);
  --text-body-lg: clamp(1.125rem, 1.4vw, 1.25rem);
  --text-body: 1rem;
  --text-small: 0.875rem;
  --text-caption: 0.8125rem;

  --leading-tight: 1.1;
  --leading-snug: 1.2;
  --leading-normal: 1.45;

  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.02em;

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-bold: 700;
}

/* ---------------------------------------------------------------
   Space, radius, elevation, motion
   --------------------------------------------------------------- */

:root {
  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  --radius-sm: 4px;
  --radius-md: 16px;
  --glass-fill: rgba(255, 255, 255, 0.14);
  --glass-blur: 10px;
  --radius-pill: 999px;

  --shadow-hard: 4px 4px 0 var(--shadow-hard-color);
  --shadow-hard-sm: 2px 2px 0 var(--shadow-hard-color);

  --page-max: 1440px;
  --gutter: 24px;
  --grid-gap: 24px;
  --measure: 68ch;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 120ms;
  --duration-base: 240ms;
  --duration-slow: 480ms;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast: 0ms;
    --duration-base: 0ms;
    --duration-slow: 0ms;
  }
}