/* ===== tokens.css — Système de design "Vers l'Équilibre Intérieur" ===== */
/* Palette organique bien-être : crème chaude, sauge, terracotta doux */

:root {
  /* ---- Type scale (fluide) ---- */
  --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.25rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 4.5rem);
  --text-hero: clamp(2.75rem, 0.5rem + 6vw, 6.5rem);

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

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

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

  /* ---- Fonts ---- */
  --font-display: 'Fraunces', 'Georgia', serif;
  --font-body: 'Work Sans', 'Helvetica Neue', sans-serif;
}

/* ===== LIGHT MODE (default) ===== */
:root,
[data-theme='light'] {
  /* Surfaces — crème chaude */
  --color-bg: #faf6ef;
  --color-surface: #ffffff;
  --color-surface-2: #fdfbf7;
  --color-surface-offset: #f2ede1;
  --color-surface-offset-2: #eae3d3;
  --color-surface-dynamic: #e2d9c5;
  --color-divider: #e5ddc9;
  --color-border: #d7ccb2;

  /* Texte — brun chaud profond */
  --color-text: #2c2a22;
  --color-text-muted: #6d6656;
  --color-text-faint: #a49b86;
  --color-text-inverse: #faf6ef;

  /* Primaire — sauge */
  --color-primary: #55795c;
  --color-primary-hover: #405d47;
  --color-primary-active: #304536;
  --color-primary-highlight: #dbe6dc;

  /* Accent secondaire — terracotta */
  --color-accent: #c97b57;
  --color-accent-hover: #ac5f3d;
  --color-accent-active: #8a4a2f;
  --color-accent-highlight: #f0dccd;

  /* Warning — ocre */
  --color-warning: #a3701f;
  --color-warning-hover: #825918;
  --color-warning-active: #5f4211;
  --color-warning-highlight: #e8dcbe;

  /* Error — terracotta rouge */
  --color-error: #b0473c;
  --color-error-hover: #8e372e;
  --color-error-active: #6c2921;
  --color-error-highlight: #ecd3cf;

  /* Success — sauge foncée */
  --color-success: #45703f;
  --color-success-hover: #345a2f;
  --color-success-active: #274322;
  --color-success-highlight: #d8e5d3;

  /* Info — bleu doux */
  --color-info: #4a7a8c;
  --color-info-hover: #3a6172;
  --color-info-highlight: #d6e4e8;

  /* Shadows */
  --shadow-sm: 0 1px 3px oklch(0.3 0.03 80 / 0.08);
  --shadow-md: 0 6px 20px oklch(0.3 0.03 80 / 0.1);
  --shadow-lg: 0 16px 40px oklch(0.3 0.03 80 / 0.14);
}

/* ===== DARK MODE ===== */
[data-theme='dark'] {
  --color-bg: #191b16;
  --color-surface: #1f2219;
  --color-surface-2: #24271d;
  --color-surface-offset: #292c21;
  --color-surface-offset-2: #313426;
  --color-surface-dynamic: #3a3d2d;
  --color-divider: #33362a;
  --color-border: #40432f;

  --color-text: #e9e3d3;
  --color-text-muted: #a9a28c;
  --color-text-faint: #6f6a56;
  --color-text-inverse: #1f2219;

  --color-primary: #93b696;
  --color-primary-hover: #a9c8ab;
  --color-primary-active: #bcd6bd;
  --color-primary-highlight: #2c3a2c;

  --color-accent: #e2a180;
  --color-accent-hover: #ecb595;
  --color-accent-active: #f3c8ad;
  --color-accent-highlight: #3d3226;

  --color-warning: #d3a75c;
  --color-warning-hover: #ddba7c;
  --color-warning-active: #e7cc9c;
  --color-warning-highlight: #3d3623;

  --color-error: #dc8a7d;
  --color-error-hover: #e4a296;
  --color-error-active: #ecbab1;
  --color-error-highlight: #3f2b26;

  --color-success: #93b696;
  --color-success-hover: #a9c8ab;
  --color-success-highlight: #2c3a2c;

  --color-info: #8bb8c7;
  --color-info-hover: #a2c6d2;
  --color-info-highlight: #253538;

  --shadow-sm: 0 1px 3px oklch(0 0 0 / 0.25);
  --shadow-md: 0 6px 20px oklch(0 0 0 / 0.35);
  --shadow-lg: 0 16px 40px oklch(0 0 0 / 0.45);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #191b16;
    --color-surface: #1f2219;
    --color-surface-2: #24271d;
    --color-surface-offset: #292c21;
    --color-surface-offset-2: #313426;
    --color-surface-dynamic: #3a3d2d;
    --color-divider: #33362a;
    --color-border: #40432f;
    --color-text: #e9e3d3;
    --color-text-muted: #a9a28c;
    --color-text-faint: #6f6a56;
    --color-text-inverse: #1f2219;
    --color-primary: #93b696;
    --color-primary-hover: #a9c8ab;
    --color-primary-active: #bcd6bd;
    --color-primary-highlight: #2c3a2c;
    --color-accent: #e2a180;
    --color-accent-hover: #ecb595;
    --color-accent-active: #f3c8ad;
    --color-accent-highlight: #3d3226;
    --color-warning: #d3a75c;
    --color-warning-highlight: #3d3623;
    --color-error: #dc8a7d;
    --color-error-highlight: #3f2b26;
    --color-success: #93b696;
    --color-success-highlight: #2c3a2c;
    --color-info: #8bb8c7;
    --color-info-highlight: #253538;
    --shadow-sm: 0 1px 3px oklch(0 0 0 / 0.25);
    --shadow-md: 0 6px 20px oklch(0 0 0 / 0.35);
    --shadow-lg: 0 16px 40px oklch(0 0 0 / 0.45);
  }
}
