/* ==========================================================================
   SISTEMA SONNO — Design Tokens
   Direzione: editoriale, carta & inchiostro. Tre palette selezionabili.
   ========================================================================== */

:root {
  /* Typography */
  --font-display: 'Zodiak', Georgia, serif;
  --font-body: 'General Sans', -apple-system, sans-serif;
  --font-mono: 'Space Mono', monospace;

  /* Fluid type scale */
  --text-xs: clamp(0.68rem, 0.65rem + 0.15vw, 0.75rem);
  --text-sm: clamp(0.82rem, 0.78rem + 0.2vw, 0.92rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.15rem, 1.05rem + 0.5vw, 1.4rem);
  --text-xl: clamp(1.45rem, 1.25rem + 1vw, 2rem);
  --text-2xl: clamp(1.9rem, 1.5rem + 2vw, 3rem);
  --text-3xl: clamp(2.4rem, 1.8rem + 3vw, 4rem);
  --text-hero: clamp(2.6rem, 1.8rem + 2.8vw, 4.2rem);

  /* Spacing (4px scale) */
  --space-1: 0.25rem;  --space-2: 0.5rem;  --space-3: 0.75rem;
  --space-4: 1rem;     --space-5: 1.5rem;  --space-6: 2rem;
  --space-8: 3rem;     --space-10: 4rem;   --space-12: 5rem;
  --space-16: 7rem;

  /* Layout */
  --wrap-max: 1240px;
  --wrap-narrow: 860px;
  --wrap-pad: clamp(1.25rem, 4vw, 3rem);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur: 0.55s;
}

/* --------------------------------------------------------------------------
   PALETTE 1 · AVORIO  (default) — carta avorio, inchiostro, terracotta
   -------------------------------------------------------------------------- */
:root, [data-palette="avorio"] {
  --c-bg: #f4efe5;
  --c-bg-2: #ece5d5;
  --c-text: #211b14;
  --c-text-2: #6b6153;
  --c-text-faint: #968b7a;
  --c-line: rgba(33, 27, 20, 0.16);
  --c-line-soft: rgba(33, 27, 20, 0.09);
  --c-accent-1: #a4532b;          /* terracotta bruciata */
  --c-accent-2: #2e405e;          /* inchiostro blu */
  --c-ink: #1b1610;               /* bande scure */
  --c-ink-2: #262019;
  --c-ink-text: #efe8d9;
  --c-ink-text-2: #a89d8c;
  --c-ink-line: rgba(239, 232, 217, 0.18);
  color-scheme: light;
}

/* --------------------------------------------------------------------------
   PALETTE 2 · NOTTE — blu notte profondo, osso, ottone
   -------------------------------------------------------------------------- */
[data-palette="notte"] {
  --c-bg: #101720;
  --c-bg-2: #171f2a;
  --c-text: #ece4d2;
  --c-text-2: #9c937f;
  --c-text-faint: #6d6656;
  --c-line: rgba(236, 228, 210, 0.17);
  --c-line-soft: rgba(236, 228, 210, 0.09);
  --c-accent-1: #c49d5f;          /* ottone caldo */
  --c-accent-2: #8299c2;          /* blu polvere */
  --c-ink: #0a0f16;
  --c-ink-2: #131a24;
  --c-ink-text: #ece4d2;
  --c-ink-text-2: #9c937f;
  --c-ink-line: rgba(236, 228, 210, 0.16);
  color-scheme: dark;
}

/* --------------------------------------------------------------------------
   PALETTE 3 · SALVIA — grigio-verde chiaro, inchiostro verde, ocra
   -------------------------------------------------------------------------- */
[data-palette="salvia"] {
  --c-bg: #edefe7;
  --c-bg-2: #e2e6d9;
  --c-text: #1a221b;
  --c-text-2: #5d6659;
  --c-text-faint: #8b9284;
  --c-line: rgba(26, 34, 27, 0.16);
  --c-line-soft: rgba(26, 34, 27, 0.09);
  --c-accent-1: #3d6a52;          /* verde profondo */
  --c-accent-2: #a06d33;          /* ocra */
  --c-ink: #131a15;
  --c-ink-2: #1d251f;
  --c-ink-text: #e9ecdf;
  --c-ink-text-2: #99a191;
  --c-ink-line: rgba(233, 236, 223, 0.18);
  color-scheme: light;
}
