/*
 * Design tokens — the single source of truth for the site's look.
 * Only this file defines raw values. Everything else uses var(--token).
 * See DESIGN.md for the rules.
 */

:root {
  color-scheme: light dark;

  /* Color — light (default) */
  --color-bg: #F7F7F4;
  --color-surface: #FFFFFF;
  --color-text: #1B1F24;
  --color-text-muted: #5A636E;
  --color-border: #E3E3DD;
  --color-accent: #2D6A5A;
  --color-accent-hover: #24574A;
  --color-accent-soft: #E3EFEA;
  --color-on-accent: #FFFFFF;
  --color-focus: #3B82F6;

  /* Typography */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: var(--font-sans); /* page and section titles; an app theme may set a display face */
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --fs-sm: 0.875rem;   /* 14px — meta, footer, labels */
  --fs-base: 1rem;     /* 16px — body */
  --fs-md: 1.125rem;   /* 18px — lead text, card titles */
  --fs-lg: 1.375rem;   /* 22px — section headings */
  --fs-xl: 1.75rem;    /* 28px — page title on mobile */
  --fs-2xl: 2.25rem;   /* 36px — page title from 640px */

  --lh-tight: 1.25;
  --lh-body: 1.65;

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-bold: 650;
  --fw-display: var(--fw-bold); /* weight of page and section titles */

  --tracking-tight: -0.01em;

  /* Spacing — 4px base */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* Elevation */
  --shadow-card: 0 1px 2px rgba(20, 24, 28, 0.04), 0 2px 8px rgba(20, 24, 28, 0.05);

  /* Sizes */
  --page-width: 64rem;     /* max width of header, main and footer */
  --content-width: 44rem;  /* max width of a reading column (~70 characters) */
  --header-height: 60px;
  --icon-size: 48px;
  --brand-mark-size: 28px;
  --check-size: 22px;
  --tap-min: 40px;
  --border-width: 1px;
  --focus-width: 2px;

  /* Motion */
  --duration-fast: 150ms;
}

/* Color — dark, follows the visitor's system setting */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #111315;
    --color-surface: #191C1F;
    --color-text: #ECEDEE;
    --color-text-muted: #A2A9B1;
    --color-border: #2A2F34;
    --color-accent: #6CC3A6;
    --color-accent-hover: #86D1B8;
    --color-accent-soft: #1C2D28;
    --color-on-accent: #0E1A16;
    --color-focus: #60A5FA;
    --shadow-card: none;
  }
}

/*
 * Breakpoints (custom properties cannot be used inside @media,
 * so these are documented here and used literally in site.css):
 *   --bp-md: 40rem  (640px)  — wider gutters, 2-column app grid, larger titles
 *   --bp-lg: 60rem  (960px)  — 3-column app grid
 */
