/* ==========================================================================
   Waymarch — Design tokens « Grimoire & Régie »
   Toute la charte est pilotée ici : couleurs, typographie, rythme, ombres.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* --- Surfaces (obsidienne chaude) --- */
  --bg: hsl(220 8% 6.5%);
  --bg-raised: hsl(220 8% 9%);
  --surface: hsl(220 8% 11%);
  --surface-2: hsl(220 8% 14%);
  --surface-glass: hsl(220 10% 12% / 0.72);
  --line: hsl(40 20% 90% / 0.09);
  --line-strong: hsl(40 20% 90% / 0.18);

  /* --- Texte (parchemin) --- */
  --text: hsl(42 30% 90%);
  --text-soft: hsl(40 12% 68%);
  --text-faint: hsl(40 8% 52%);

  /* --- Accents --- */
  --amber: hsl(40 74% 58%);
  --amber-strong: hsl(38 78% 50%);
  --amber-ink: hsl(35 60% 9%);           /* texte posé sur fond ambre */
  --amber-soft: hsl(40 74% 58% / 0.12);
  --emerald: hsl(152 42% 52%);
  --emerald-soft: hsl(152 42% 52% / 0.14);
  --ruby: hsl(5 62% 62%);
  --ruby-soft: hsl(5 62% 62% / 0.14);
  --sky: hsl(200 50% 62%);
  --sky-soft: hsl(200 50% 62% / 0.14);

  /* --- Typographie --- */
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --step--1: clamp(0.8rem, 0.78rem + 0.1vw, 0.875rem);
  --step-0: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --step-1: clamp(1.15rem, 1.08rem + 0.35vw, 1.3rem);
  --step-2: clamp(1.4rem, 1.25rem + 0.75vw, 1.8rem);
  --step-3: clamp(1.9rem, 1.5rem + 1.9vw, 2.9rem);
  --step-4: clamp(2.5rem, 1.7rem + 3.8vw, 4.6rem);

  /* --- Rythme & formes --- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 5rem;
  --section-pad: clamp(4rem, 3rem + 5vw, 8rem);
  --container: 72rem;
  --radius-s: 0.5rem;
  --radius-m: 0.875rem;
  --radius-l: 1.375rem;

  /* --- Ombres & texture --- */
  --shadow-1: 0 1px 0 hsl(40 30% 100% / 0.04) inset, 0 8px 24px -12px hsl(0 0% 0% / 0.6);
  --shadow-2: 0 1px 0 hsl(40 30% 100% / 0.06) inset, 0 28px 60px -24px hsl(0 0% 0% / 0.75);
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --grain-opacity: 0.045;

  /* --- Mouvement --- */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.45s;
}

/* Variante « Parchemin » (thème clair) */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: hsl(41 38% 94%);
  --bg-raised: hsl(41 36% 91%);
  --surface: hsl(42 45% 97%);
  --surface-2: hsl(41 32% 90%);
  --surface-glass: hsl(42 45% 97% / 0.8);
  --line: hsl(30 25% 20% / 0.12);
  --line-strong: hsl(30 25% 20% / 0.24);

  --text: hsl(28 28% 13%);
  --text-soft: hsl(28 16% 30%);
  --text-faint: hsl(28 10% 40%);

  --amber: hsl(32 82% 36%);
  --amber-strong: hsl(32 85% 30%);
  --amber-ink: hsl(42 60% 96%);
  --amber-soft: hsl(32 82% 36% / 0.12);
  --emerald: hsl(155 55% 25%);
  --emerald-soft: hsl(155 55% 25% / 0.12);
  --ruby: hsl(5 62% 40%);
  --ruby-soft: hsl(5 62% 40% / 0.12);
  --sky: hsl(205 60% 32%);
  --sky-soft: hsl(205 60% 32% / 0.12);

  --shadow-1: 0 1px 0 hsl(0 0% 100% / 0.6) inset, 0 10px 24px -14px hsl(28 40% 20% / 0.35);
  --shadow-2: 0 1px 0 hsl(0 0% 100% / 0.6) inset, 0 28px 60px -26px hsl(28 40% 20% / 0.4);
  --grain-opacity: 0.07;
}
