/* ============================================================
   BondGuru — Design Tokens
   Editorial-authoritative voice matching "The Bond Guide" primitive.
   Palette derived from subject: bond market (ink navy + parchment cream + burnished gold rule).
   ============================================================ */

:root {
  /* Type scale — fluid */
  --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(3rem, 0.5rem + 7vw, 7rem);

  /* Spacing — 4px base */
  --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;

  /* Radii */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-full: 9999px;

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

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
}

/* ============================================================
   LIGHT MODE — Parchment & Ink
   ============================================================ */
:root,
[data-theme='light'] {
  /* Surfaces — warm parchment */
  --color-bg: #f5f2ea;
  --color-surface: #faf7ef;
  --color-surface-2: #fdfbf5;
  --color-surface-offset: #ece7db;
  --color-divider: #d9d2c2;
  --color-border: #c7bfab;

  /* Text — ink navy */
  --color-text: #1a2432;
  --color-text-muted: #5a6273;
  --color-text-faint: #8b93a3;
  --color-text-inverse: #faf7ef;

  /* Primary accent — burnished gold (bond coupon rule) */
  --color-primary: #8a6a1f;
  --color-primary-hover: #6f5316;
  --color-primary-active: #533d0e;
  --color-primary-highlight: #e8dfc4;

  /* Semantic */
  --color-warning: #964219;
  --color-error: #a12c7b;
  --color-success: #437a22;

  /* Rule / hairline colors */
  --rule-primary: #c7bfab;
  --rule-strong: #8a6a1f;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(26, 36, 50, 0.06);
  --shadow-md: 0 4px 12px rgba(26, 36, 50, 0.08);
  --shadow-lg: 0 12px 32px rgba(26, 36, 50, 0.12);

  /* Fonts */
  --font-body: 'Inter', 'Helvetica Neue', sans-serif;
  --font-display-instrument: 'Instrument Serif', 'Georgia', serif;
  --font-display-newsreader: 'Newsreader', 'Georgia', serif;
  /* Site-wide display face — driven by the font-preview toggle */
  --font-display: var(--font-display-newsreader);
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
}

:root[data-display='instrument'] {
  --font-display: var(--font-display-instrument);
}
:root[data-display='newsreader'] {
  --font-display: var(--font-display-newsreader);
}

/* ============================================================
   DARK MODE — Deep Ink
   ============================================================ */
[data-theme='dark'] {
  --color-bg: #0e131c;
  --color-surface: #141a24;
  --color-surface-2: #1a212d;
  --color-surface-offset: #10151d;
  --color-divider: #26303f;
  --color-border: #384457;

  --color-text: #e8e2d0;
  --color-text-muted: #9199a7;
  --color-text-faint: #5f6674;
  --color-text-inverse: #0e131c;

  --color-primary: #d4b168;
  --color-primary-hover: #e8c982;
  --color-primary-active: #f0d99a;
  --color-primary-highlight: #3a3020;

  --color-warning: #bb653b;
  --color-error: #d163a7;
  --color-success: #6daa45;

  --rule-primary: #384457;
  --rule-strong: #d4b168;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.36);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.48);
}
