/**
 * Design tokens — Substack-derived (see substack.md in repo root).
 * Keep client + landing/tokens.css identical; extension mirrors in themes.ts CLIENT.
 */
:root {
  /* --- Substack names (source of truth) --- */
  --color-bg-primary: #fafaf9;
  --color-bg-secondary: #f0efeb;
  --color-bg-tertiary: #e8e7e3;
  --color-bg-inverse: #0f0f0f;

  --color-text-primary: #0f0f0f;
  --color-text-secondary: #6b6b6b;
  --color-text-tertiary: #9b9b9b;
  --color-text-inverse: #ffffff;

  /* Gleanit brand accent */
  --color-accent: #e8621a;
  --color-accent-hover: #c24e14;
  --color-accent-subtle: #fff3eb;

  --color-border-default: #e8e7e3;
  --color-border-strong: #d1d0cb;

  /* --- Gleanit aliases (map to Substack / product needs) --- */
  --paper: var(--color-bg-primary);
  --paper2: var(--color-bg-secondary);
  --paper3: var(--color-bg-tertiary);
  --paper4: #e0dfda;
  --surface-card: var(--paper);

  --ink: var(--color-text-primary);
  --ink2: #1a1a1a;
  --ink3: #2a2a2a;

  --muted: var(--color-text-secondary);
  --muted2: var(--color-text-tertiary);

  --border: var(--color-border-default);
  --border2: var(--color-border-strong);

  /* Brand / primary CTA */
  --amber: var(--color-accent);
  --amber-hover: var(--color-accent-hover);
  --amber-bg: var(--color-accent-subtle);
  --amber-border: #f0a060;
  --amber-soft: rgba(232, 98, 26, 0.12);
  --amber-dark: var(--color-accent-hover);

  /* Secondary terracotta — UI hints, links (not Substack; kept warm) */
  --crail: #c15f3c;
  --crail-bg: #fdf0eb;
  --crail-border: #e8c4b8;

  /* Semantic (tags, states) — unchanged hue intent */
  --coral: #c2410c;
  --coral-bg: #fff0eb;
  --coral-soft: rgba(194, 65, 12, 0.07);
  --sage: #4d7c0f;
  --sage-bg: #f0fdf4;
  --sage-soft: rgba(77, 124, 15, 0.07);
  --rose: #be185d;
  --rose-bg: #fff0f5;
  --rose-soft: rgba(190, 24, 93, 0.07);
  --sky: #0369a1;
  --sky-bg: #f0f9ff;
  --sky-soft: rgba(3, 105, 161, 0.07);
  --violet: #6d28d9;
  --violet-bg: #f5f3ff;
  --violet-soft: rgba(109, 40, 217, 0.07);
  --red: #dc2626;
  --red-bg: #fef2f2;
  --note-accent: #9a6b52;

  --sidebar-w: 220px;

  /* Spacing (4px grid) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Borders */
  --border-thin: 1px;
  --border-medium: 2px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 8px 32px rgba(0, 0, 0, 0.12);

  /* Type scale (sizes + line-height) */
  --text-xs: 12px;
  --lh-xs: 1.4;
  --text-sm: 14px;
  --lh-sm: 1.5;
  --text-base: 16px;
  --lh-base: 1.6;
  --text-lg: 18px;
  --lh-lg: 1.6;
  --text-xl: 24px;
  --lh-xl: 1.3;
  --text-2xl: 32px;
  --lh-2xl: 1.2;
  --text-3xl: 40px;
  --lh-3xl: 1.1;
  /* Accent-colored link emphasis (help contacts, compact list links) */
  --text-accent-link: 13px;
  --lh-accent-link: 1.35;

  /* Font stacks (Substack: Inter UI, Georgia reading) */
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-serif: 'Georgia', 'Times New Roman', serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Focus — neutral, not brand (Substack) */
  --focus-border: var(--color-text-primary);
  --focus-ring: 0 0 0 2px rgba(15, 15, 15, 0.1);
  --input-bg: #ffffff;
}
