/* Palette — the single source for the site's colors.
 *
 * Six core colors (the --palette-* lines) feed every role token below.
 * Stylesheets, page <style> blocks and inline styles use the role tokens,
 * never hex values. Change a core color to retint everything built on it,
 * or point one role at a different core color to change only that use.
 * Linked by every page right after /css/typography.css.
 *
 *   ink    #1A1A1A  all text on cream (primary, secondary, nav), headings
 *   cocoa  #6A5A4C  buttons, table headers
 *   taupe  #B4A291  borders, progress bars, disabled text
 *   linen  #E0D8CB  subtle sections, table header backgrounds, block borders
 *   cream  #FBF7EE  page and card backgrounds, light sections
 *   sage   #89917D  accent, success, selected states, links / hover
 *
 * Danger, warning and info keep their own colors (not part of the core six).
 *
 * Categories
 *   Brand      accent family
 *   Text       ink for words, plus text on dark fills
 *   Surfaces   page, card and panel backgrounds
 *   Borders    divider and outline lines (blocks use the lighter linen)
 *   Elements   navigation, table headers, progress bars, links, selection
 *   Action     the primary-button fill
 *   Status     success / danger / warning / info, each with a tint
 *   Legacy     colors that used to be off-palette, now folded into the core
 *
 * Several tokens in a category used to hold different shades and now point at
 * the same core color; they stay separate so a use can be split out again.
 *
 * Still literal: rgba() shadows/overlays, danger/warning/info shades, and
 * colors that can't read CSS variables (canvas, charts, email HTML). */

:root {
  /* Core */
  --palette-ink: #1A1A1A;
  --palette-cocoa: #6A5A4C;
  --palette-taupe: #B4A291;
  --palette-linen: #E0D8CB;
  --palette-cream: #FBF7EE;
  --palette-sage: #89917D;

  /* Brand */
  --color-accent: var(--palette-sage);
  --color-accent-strong: var(--palette-sage);
  --color-accent-gold-light: var(--palette-sage);
  --color-accent-deep: var(--palette-cocoa);
  --color-accent-bronze: var(--palette-cocoa);
  --color-accent-taupe: var(--palette-taupe);
  --color-accent-stone: var(--palette-ink);     /* text only */
  --color-accent-clay: var(--palette-ink);      /* text only */
  --color-sage: var(--palette-sage);

  /* Text */
  --color-text-strong: var(--palette-ink);
  --color-text-dark: var(--palette-ink);
  --color-text: var(--palette-ink);
  /* Text on cream is always ink: secondary / muted shades used to be taupe,
   * which read too faint. Disabled stays taupe so it still looks inactive. */
  --color-text-secondary: var(--palette-ink);
  --color-text-muted: var(--palette-ink);
  --color-text-soft: var(--palette-ink);
  --color-text-subtle: var(--palette-ink);
  --color-text-faint: var(--palette-ink);
  --color-text-disabled: var(--palette-taupe);
  --color-text-inverse: var(--palette-cream);  /* text on dark or colored fills */
  --color-on-primary: var(--palette-cream);    /* text on the primary button */

  /* Surfaces */
  --color-bg: var(--palette-cream);            /* page */
  --color-surface: var(--palette-cream);       /* cards, modals, inputs */
  --color-surface-warm: var(--palette-linen);  /* hover rows, sunken panels */
  --color-surface-sand: var(--palette-linen);  /* chips, selected states */
  --color-surface-cream: var(--palette-cream);
  --color-surface-ivory: var(--palette-cream);
  --color-surface-linen: var(--palette-linen);
  --color-surface-grey: var(--palette-linen);
  --color-surface-mist: var(--palette-linen);

  /* Borders */
  --color-border: var(--palette-taupe);        /* default line */
  --color-border-soft: var(--palette-taupe);
  --color-border-sand: var(--palette-taupe);
  --color-border-linen: var(--palette-taupe);
  --color-border-grey: var(--palette-taupe);
  --color-border-light: var(--palette-taupe);
  --color-border-mid: var(--palette-taupe);
  --color-border-strong: var(--palette-taupe);
  --color-border-block: var(--palette-linen);  /* cards, sections, panels: lighter than the default line */

  /* Elements */
  --color-nav: var(--palette-ink);             /* sidebar, top nav and tab text */
  --color-table-head: var(--palette-cocoa);    /* table header text */
  --color-table-head-bg: var(--palette-linen); /* table header background */
  --color-progress: var(--palette-taupe);      /* progress bar fill */
  --color-progress-track: var(--palette-linen);
  --color-progress-success: var(--palette-sage);
  --color-link: var(--palette-sage);           /* links and hover text */
  --color-selected: var(--palette-sage);       /* selected / active states */

  /* Action */
  --color-primary: var(--palette-cocoa);       /* primary button fill and outline */
  --color-primary-hover: var(--palette-ink);

  /* Status: success */
  --color-success: var(--palette-sage);
  --color-success-strong: var(--palette-sage);
  --color-success-text: color-mix(in srgb, var(--palette-sage) 60%, var(--palette-ink));
  --color-success-tint: color-mix(in srgb, var(--palette-sage) 22%, var(--palette-cream));
  --color-success-tint-soft: color-mix(in srgb, var(--palette-sage) 14%, var(--palette-cream));
  --color-success-border: color-mix(in srgb, var(--palette-sage) 45%, var(--palette-cream));

  /* Status: danger */
  --color-danger: #dc3545;
  --color-danger-strong: #c62828;
  --color-danger-alt: #d32f2f;
  --color-danger-soft: #e57373;
  --color-danger-text: #721c24;
  --color-danger-tint: #f8d7da;
  --color-danger-tint-soft: #ffebee;
  --color-danger-tint-faint: #fff5f5;
  --color-danger-border: #f5c6cb;

  /* Status: warning */
  --color-warning: #ffc107;
  --color-warning-text: #856404;
  --color-warning-tint: #fff3cd;
  --color-warning-orange: #f57c00;
  --color-warning-orange-tint: #fff3e0;

  /* Status: info */
  --color-info: #1976d2;
  --color-info-alt: #0077b6;
  --color-info-link: var(--color-link);
  --color-info-tint: #e3f2fd;
  --color-info-tint-soft: #f0f8ff;
  --color-info-tint-faint: #f0f7ff;
  --color-info-tint-sky: #e7f5ff;
  --color-info-border: #74c0fc;

  /* Legacy */
  --color-legacy-indigo: var(--palette-sage);
  --color-legacy-violet: var(--palette-sage);
  --color-legacy-grey: var(--palette-ink);     /* text only */
  --color-legacy-grey-dark: var(--palette-ink);
  --color-legacy-grey-light: var(--palette-linen);
  --color-legacy-grey-mid: var(--palette-taupe);

  /* Shadows: the resting shadow under cards, sections and panels (hover,
   * dropdown and modal shadows stay literal) */
  --shadow-block: 0 1px 3px rgba(26, 26, 26, 0.04);

  /* Older names still read by some rules and scripts */
  --color-muted: var(--color-text-muted);
  --color-muted-border: var(--color-border);
  --color-card-bg: var(--color-surface);
}
