/* Derlyz Design Tokens — Teal + Purple */

:root {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 5rem);
  --text-hero: clamp(2.75rem, 0.5rem + 6vw, 6.5rem);

  /* Spacing (4px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.875rem;
  --radius-xl: 1.25rem;
  --radius-2xl: 1.75rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-interactive: 200ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 480ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Content widths */
  --content-narrow: 680px;
  --content-default: 1040px;
  --content-wide: 1240px;

  /* Fonts */
  --font-body: 'Inter', 'Helvetica Neue', -apple-system, sans-serif;
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

/* LIGHT MODE — warm white with teal + purple accents */
:root,
[data-theme='light'] {
  /* Surfaces — cool-neutral with faint teal undertone */
  --color-bg: #f7f9fa;
  --color-surface: #ffffff;
  --color-surface-2: #f1f4f6;
  --color-surface-offset: #e9eef0;
  --color-surface-dynamic: #dde4e8;
  --color-divider: #e2e8ec;
  --color-border: #d2dbe0;

  /* Text */
  --color-text: #0c1d22;
  --color-text-muted: #556871;
  --color-text-faint: #8b9aa2;
  --color-text-inverse: #f7fbfc;

  /* Primary — Deep Teal */
  --color-primary: #0d7378;
  --color-primary-hover: #0a5b5f;
  --color-primary-active: #074448;
  --color-primary-soft: #e0f1f2;
  --color-primary-ink: #074448;

  /* Accent — Rich Purple */
  --color-accent: #6b3fd4;
  --color-accent-hover: #5a2fc0;
  --color-accent-active: #4722a1;
  --color-accent-soft: #ede6fb;
  --color-accent-ink: #2d1566;

  /* Status */
  --color-success: #15803d;
  --color-warning: #b45309;
  --color-error: #b42318;

  /* Gradients */
  --gradient-brand: linear-gradient(135deg, #0d7378 0%, #2a7ab0 45%, #6b3fd4 100%);
  --gradient-brand-soft: linear-gradient(135deg, #e0f1f2 0%, #ede6fb 100%);
  --gradient-radial: radial-gradient(circle at 30% 30%, #0d7378 0%, transparent 60%),
                     radial-gradient(circle at 80% 70%, #6b3fd4 0%, transparent 55%);

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(12, 29, 34, 0.04);
  --shadow-sm: 0 2px 6px rgba(12, 29, 34, 0.06);
  --shadow-md: 0 8px 24px rgba(12, 29, 34, 0.08);
  --shadow-lg: 0 20px 48px rgba(12, 29, 34, 0.12);
  --shadow-teal: 0 12px 32px rgba(13, 115, 120, 0.24);
  --shadow-purple: 0 12px 32px rgba(107, 63, 212, 0.24);
}

/* DARK MODE */
[data-theme='dark'] {
  --color-bg: #0a1416;
  --color-surface: #0f1c1f;
  --color-surface-2: #142529;
  --color-surface-offset: #182d31;
  --color-surface-dynamic: #20383d;
  --color-divider: #1c3337;
  --color-border: #294247;

  --color-text: #e8eef0;
  --color-text-muted: #8ea4ab;
  --color-text-faint: #5c7178;
  --color-text-inverse: #0a1416;

  --color-primary: #3dc3c9;
  --color-primary-hover: #5ed4d9;
  --color-primary-active: #7ae2e6;
  --color-primary-soft: #123236;
  --color-primary-ink: #d8f5f6;

  --color-accent: #a481f0;
  --color-accent-hover: #b89af3;
  --color-accent-active: #ccb4f5;
  --color-accent-soft: #241842;
  --color-accent-ink: #ede6fb;

  --color-success: #4ade80;
  --color-warning: #fbbf24;
  --color-error: #f87171;

  --gradient-brand: linear-gradient(135deg, #3dc3c9 0%, #6a8fdb 45%, #a481f0 100%);
  --gradient-brand-soft: linear-gradient(135deg, #123236 0%, #241842 100%);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.5);
  --shadow-teal: 0 12px 32px rgba(61, 195, 201, 0.2);
  --shadow-purple: 0 12px 32px rgba(164, 129, 240, 0.22);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #0a1416;
    --color-surface: #0f1c1f;
    --color-surface-2: #142529;
    --color-surface-offset: #182d31;
    --color-surface-dynamic: #20383d;
    --color-divider: #1c3337;
    --color-border: #294247;
    --color-text: #e8eef0;
    --color-text-muted: #8ea4ab;
    --color-text-faint: #5c7178;
    --color-text-inverse: #0a1416;
    --color-primary: #3dc3c9;
    --color-primary-hover: #5ed4d9;
    --color-primary-soft: #123236;
    --color-primary-ink: #d8f5f6;
    --color-accent: #a481f0;
    --color-accent-hover: #b89af3;
    --color-accent-soft: #241842;
    --color-accent-ink: #ede6fb;
    --gradient-brand: linear-gradient(135deg, #3dc3c9 0%, #6a8fdb 45%, #a481f0 100%);
    --gradient-brand-soft: linear-gradient(135deg, #123236 0%, #241842 100%);
  }
}
