/* ============================================================
   Cat & Moonlight — Design Tokens
   Concept: intimate, mystical tarot practice. Warm candlelit
   cream by day, deep midnight indigo by night — mirroring the
   brand mark's crescent moon and gold linework.
   ============================================================ */

: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 + 6vw, 6.5rem);

  /* 4px spacing 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;

  /* Fonts */
  --font-display: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Jost', 'Helvetica Neue', Arial, sans-serif;

  /* Radius — refined, restrained */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.875rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

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

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

/* ---------- LIGHT MODE (Candlelight) ---------- */
:root,
[data-theme='light'] {
  --color-bg: #faf3e6;
  --color-surface: #fdf9f0;
  --color-surface-2: #ffffff;
  --color-surface-offset: #f2e8d4;
  --color-surface-offset-2: #ecdfc3;
  --color-surface-dynamic: #e5d6b3;
  --color-divider: #e2d2ac;
  --color-border: #d3bd8b;

  --color-text: #2a2118;
  --color-text-muted: #6c5c47;
  --color-text-faint: #a8967a;
  --color-text-inverse: #faf3e6;

  /* Primary accent — antique gold, matches logo linework */
  --color-primary: #a9782f;
  --color-primary-hover: #8a611f;
  --color-primary-active: #6d4b17;
  --color-primary-highlight: #ecdfba;

  --color-warning: #9c5a24;
  --color-warning-hover: #7a4519;
  --color-warning-active: #593311;
  --color-warning-highlight: #e3d2bd;

  --color-error: #8f3b3b;
  --color-error-hover: #712c2c;
  --color-error-active: #521f1f;
  --color-error-highlight: #e3cfcb;

  --color-success: #4f6b3a;
  --color-success-hover: #3c5329;
  --color-success-active: #2b3c1c;
  --color-success-highlight: #d6ddc7;

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

/* ---------- DARK MODE (Midnight) ---------- */
[data-theme='dark'] {
  --color-bg: #131220;
  --color-surface: #181725;
  --color-surface-2: #1d1c2b;
  --color-surface-offset: #201f30;
  --color-surface-offset-2: #262538;
  --color-surface-dynamic: #302e46;
  --color-divider: #29283c;
  --color-border: #3a3852;

  --color-text: #ece3cf;
  --color-text-muted: #a89f8b;
  --color-text-faint: #6d6759;
  --color-text-inverse: #131220;

  --color-primary: #dcb15f;
  --color-primary-hover: #e8c47c;
  --color-primary-active: #f2d493;
  --color-primary-highlight: #3c3320;

  --color-warning: #cf9256;
  --color-warning-hover: #dba770;
  --color-warning-active: #e6ba8c;
  --color-warning-highlight: #4a3b28;

  --color-error: #c97a7a;
  --color-error-hover: #d69595;
  --color-error-active: #e2adad;
  --color-error-highlight: #3f2a2a;

  --color-success: #93ad78;
  --color-success-hover: #a7bd90;
  --color-success-active: #bacca8;
  --color-success-highlight: #2b3324;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md: 0 6px 20px oklch(0 0 0 / 0.4);
  --shadow-lg: 0 20px 48px oklch(0 0 0 / 0.55);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #131220;
    --color-surface: #181725;
    --color-surface-2: #1d1c2b;
    --color-surface-offset: #201f30;
    --color-surface-offset-2: #262538;
    --color-surface-dynamic: #302e46;
    --color-divider: #29283c;
    --color-border: #3a3852;
    --color-text: #ece3cf;
    --color-text-muted: #a89f8b;
    --color-text-faint: #6d6759;
    --color-text-inverse: #131220;
    --color-primary: #dcb15f;
    --color-primary-hover: #e8c47c;
    --color-primary-active: #f2d493;
    --color-primary-highlight: #3c3320;
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
    --shadow-md: 0 6px 20px oklch(0 0 0 / 0.4);
    --shadow-lg: 0 20px 48px oklch(0 0 0 / 0.55);
  }
}
