/* tokens.css — Matthias Höchst personal brand site, design system
   Palette concept: Anthracite + Deep Blue + White, one warm champagne/gold accent.
   Typography: Switzer (display) + Satoshi (body), both via Fontshare. */

:root {
  /* ---- Type scale (fluid clamp) ---- */
  --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, 1rem + 6.5vw, 7rem);

  /* ---- Spacing (4px system) ---- */
  --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.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.875rem;
  --radius-xl: 1.25rem;
  --radius-full: 9999px;

  /* ---- Transitions ---- */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

  /* ---- Content widths ---- */
  --content-narrow: 640px;
  --content-default: 980px;
  --content-wide: 1240px;
  --content-full: 100%;

  /* ---- Fonts ---- */
  --font-display: 'Switzer', 'Georgia', serif;
  --font-body: 'Satoshi', 'Helvetica Neue', sans-serif;
}

/* ================= LIGHT MODE (default) ================= */
:root,
[data-theme='light'] {
  /* Surfaces — soft white / cool paper */
  --color-bg: #f7f8fa;
  --color-surface: #ffffff;
  --color-surface-2: #ffffff;
  --color-surface-offset: #eef0f3;
  --color-surface-offset-2: #e4e7ec;
  --color-surface-dynamic: #dde1e7;
  --color-divider: #e2e5ea;
  --color-border: #d3d8df;

  /* Text — anthracite scale */
  --color-text: #171b23;
  --color-text-muted: #565f6d;
  --color-text-faint: #9aa3b0;
  --color-text-inverse: #f7f8fa;

  /* Primary — deep executive blue */
  --color-primary: #163259;
  --color-primary-hover: #0e2540;
  --color-primary-active: #0a1c30;
  --color-primary-highlight: #dbe4f0;

  /* Accent — warm champagne gold */
  --color-accent: #a9812f;
  --color-accent-hover: #8c6a22;
  --color-accent-active: #6f5419;
  --color-accent-highlight: #f0e6cf;
  --color-accent-soft: #f6f1e2;

  /* Status (kept minimal, used sparingly) */
  --color-success: #3d7a4c;
  --color-error: #a13b3b;

  /* Shadows — cool-tinted for anthracite/blue surfaces */
  --shadow-sm: 0 1px 2px oklch(0.2 0.02 250 / 0.06);
  --shadow-md: 0 6px 20px oklch(0.2 0.02 250 / 0.08);
  --shadow-lg: 0 20px 48px oklch(0.2 0.02 250 / 0.14);

  --logo-accent: var(--color-accent);
  --grain-opacity: 0.035;
}

/* ================= DARK MODE ================= */
[data-theme='dark'] {
  --color-bg: #12151c;
  --color-surface: #181c25;
  --color-surface-2: #1d222c;
  --color-surface-offset: #20252f;
  --color-surface-offset-2: #262c38;
  --color-surface-dynamic: #2d3441;
  --color-divider: #2a303c;
  --color-border: #363d4b;

  --color-text: #eceef2;
  --color-text-muted: #a3aab8;
  --color-text-faint: #6b7383;
  --color-text-inverse: #12151c;

  --color-primary: #7ea3d6;
  --color-primary-hover: #9cbae3;
  --color-primary-active: #5c86bd;
  --color-primary-highlight: #223350;

  --color-accent: #d9b96a;
  --color-accent-hover: #e8ca87;
  --color-accent-active: #c4a353;
  --color-accent-highlight: #3a3222;
  --color-accent-soft: #262115;

  --color-success: #6bb37e;
  --color-error: #d1706f;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.35);
  --shadow-md: 0 8px 24px oklch(0 0 0 / 0.4);
  --shadow-lg: 0 24px 56px oklch(0 0 0 / 0.55);

  --logo-accent: var(--color-accent);
  --grain-opacity: 0.05;
}

/* System preference fallback for users who have not toggled manually */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #12151c;
    --color-surface: #181c25;
    --color-surface-2: #1d222c;
    --color-surface-offset: #20252f;
    --color-surface-offset-2: #262c38;
    --color-surface-dynamic: #2d3441;
    --color-divider: #2a303c;
    --color-border: #363d4b;

    --color-text: #eceef2;
    --color-text-muted: #a3aab8;
    --color-text-faint: #6b7383;
    --color-text-inverse: #12151c;

    --color-primary: #7ea3d6;
    --color-primary-hover: #9cbae3;
    --color-primary-active: #5c86bd;
    --color-primary-highlight: #223350;

    --color-accent: #d9b96a;
    --color-accent-hover: #e8ca87;
    --color-accent-active: #c4a353;
    --color-accent-highlight: #3a3222;
    --color-accent-soft: #262115;

    --color-success: #6bb37e;
    --color-error: #d1706f;

    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.35);
    --shadow-md: 0 8px 24px oklch(0 0 0 / 0.4);
    --shadow-lg: 0 24px 56px oklch(0 0 0 / 0.55);

    --logo-accent: var(--color-accent);
    --grain-opacity: 0.05;
  }
}
