/* ===== RRS LAW — DESIGN TOKENS ===== */

:root {
  /* Type scale (fluid) */
  --text-xs: clamp(0.75rem, 0.71rem + 0.2vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.82rem + 0.28vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1.02rem + 0.55vw, 1.375rem);
  --text-xl: clamp(1.4rem, 1.15rem + 1.1vw, 2.1rem);
  --text-2xl: clamp(1.9rem, 1.25rem + 2.2vw, 3.25rem);
  --text-3xl: clamp(2.4rem, 1.1rem + 3.6vw, 4.5rem);
  --text-hero: clamp(2.8rem, 0.9rem + 5.6vw, 6.4rem);

  /* 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.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-full: 9999px;

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

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

  /* Fonts */
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body: 'General Sans', 'Segoe UI', sans-serif;
}

/* ===== LIGHT MODE (default) — warm paper, ink navy, brass ===== */
:root,
[data-theme='light'] {
  --color-bg: #f6f3ec;
  --color-surface: #fbf9f4;
  --color-surface-2: #ffffff;
  --color-surface-offset: #ede7d9;
  --color-surface-offset-2: #e3dcc9;
  --color-surface-dynamic: #ddd4bd;
  --color-divider: #ddd4be;
  --color-border: #cdc2a3;

  --color-text: #171b24;
  --color-text-muted: #56596a;
  --color-text-faint: #93917f;
  --color-text-inverse: #f6f2e8;

  /* Ink navy — used for dark surfaces/sections in light mode */
  --color-ink: #12161f;
  --color-ink-2: #1a2030;

  /* Primary accent — brass/bronze */
  --color-primary: #93692b;
  --color-primary-hover: #765420;
  --color-primary-active: #5c4118;
  --color-primary-highlight: #ecdfbf;

  --color-success: #43684a;
  --color-error: #8c3b3b;
  --color-warning: #96601f;

  --shadow-sm: 0 1px 2px rgba(23, 20, 10, 0.06);
  --shadow-md: 0 6px 20px rgba(23, 20, 10, 0.08);
  --shadow-lg: 0 20px 48px rgba(23, 20, 10, 0.14);
}

/* ===== DARK MODE ===== */
[data-theme='dark'] {
  --color-bg: #0f1219;
  --color-surface: #151923;
  --color-surface-2: #191e29;
  --color-surface-offset: #1b2130;
  --color-surface-offset-2: #212838;
  --color-surface-dynamic: #262e40;
  --color-divider: #262c3a;
  --color-border: #333c4e;

  --color-text: #eae6d9;
  --color-text-muted: #9a9dab;
  --color-text-faint: #5f6577;
  --color-text-inverse: #171b24;

  --color-ink: #0a0d13;
  --color-ink-2: #10141d;

  --color-primary: #cc9f4e;
  --color-primary-hover: #e0b667;
  --color-primary-active: #f0cb87;
  --color-primary-highlight: #362c17;

  --color-success: #6fa877;
  --color-error: #c47070;
  --color-warning: #c99a4c;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #0f1219;
    --color-surface: #151923;
    --color-surface-2: #191e29;
    --color-surface-offset: #1b2130;
    --color-surface-offset-2: #212838;
    --color-surface-dynamic: #262e40;
    --color-divider: #262c3a;
    --color-border: #333c4e;
    --color-text: #eae6d9;
    --color-text-muted: #9a9dab;
    --color-text-faint: #5f6577;
    --color-text-inverse: #171b24;
    --color-ink: #0a0d13;
    --color-ink-2: #10141d;
    --color-primary: #cc9f4e;
    --color-primary-hover: #e0b667;
    --color-primary-active: #f0cb87;
    --color-primary-highlight: #362c17;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.5);
  }
}
