/*
 * Single source of truth for every colour in the app (public site, archive, admin, analyzer).
 *
 * Layer 1 – palette tokens. The values below are the default palette ("forest", see
 * colorPalettes.js). The palette the admin picks on the Ayarlar tab is applied at runtime by
 * branding.js, which overrides exactly these properties on <html>.
 * Layer 2 – derived tokens. Computed from layer 1 with color-mix(), so they follow the palette.
 * Layer 3 – status colours. Fixed hues (green/red/orange/gold/blue/violet) for results, errors
 * and charts; their soft/border/text shades are derived, so nothing in a stylesheet needs a raw
 * hex value. Use these tokens, never literals, when styling anything.
 * The two font stacks live here too so every surface that loads this file gets the same type.
 */
:root {
  /* palette (overridden by the chosen palette) */
  --primary: #195747;
  --primary-hover: #104536;
  --bg: #f4f6f5;
  --surface: #ffffff;
  --text: #172e2a;
  --text-muted: #62726d;
  --border: #dfe6e2;
  --row-border: #dfe6e2;
  --primary-soft: #e4ede7;
  --surface-muted: #e4ede7;
  --control-border: #b9cbc2;
  --scroll-thumb: #b9cbc2;

  /* derived from the palette */
  --on-primary: #ffffff;
  --on-primary-muted: color-mix(in srgb, var(--on-primary) 72%, var(--primary));
  --surface-subtle: color-mix(in srgb, var(--surface) 60%, var(--bg));
  --primary-mid: color-mix(in srgb, var(--primary) 50%, var(--surface));
  --text-subtle: color-mix(in srgb, var(--text-muted) 60%, var(--surface));
  --focus-ring: var(--primary-mid);
  --scrim: color-mix(in srgb, var(--text) 45%, transparent);
  --shadow-sm: 0 1px 3px color-mix(in srgb, var(--text) 8%, transparent);
  --shadow-md: 0 3px 16px color-mix(in srgb, var(--text) 4%, transparent);
  --shadow-lg: 0 6px 26px color-mix(in srgb, var(--text) 8%, transparent);
  --shadow-drawer: -8px 0 24px color-mix(in srgb, var(--text) 14%, transparent);

  /* status colours: success / danger / warning / gold / info / accent */
  --success: #16a34a;
  --danger: #b91c1c;
  --warning: #d9812a;
  --gold: #ca8a04;
  --info: #2563eb;
  --accent: #8b5cc4;

  --success-soft: color-mix(in srgb, var(--success) 12%, var(--surface));
  --success-border: color-mix(in srgb, var(--success) 32%, var(--surface));
  --success-text: color-mix(in srgb, var(--success) 70%, var(--text));
  --danger-soft: color-mix(in srgb, var(--danger) 10%, var(--surface));
  --danger-border: color-mix(in srgb, var(--danger) 30%, var(--surface));
  --danger-text: color-mix(in srgb, var(--danger) 85%, var(--text));
  --warning-soft: color-mix(in srgb, var(--warning) 12%, var(--surface));
  --warning-border: color-mix(in srgb, var(--warning) 34%, var(--surface));
  --warning-text: color-mix(in srgb, var(--warning) 45%, var(--text));
  --gold-soft: color-mix(in srgb, var(--gold) 13%, var(--surface));
  --gold-border: color-mix(in srgb, var(--gold) 35%, var(--surface));
  --gold-text: color-mix(in srgb, var(--gold) 45%, var(--text));
  --info-soft: color-mix(in srgb, var(--info) 10%, var(--surface));
  --info-border: color-mix(in srgb, var(--info) 30%, var(--surface));
  --info-text: color-mix(in srgb, var(--info) 70%, var(--text));
  --accent-soft: color-mix(in srgb, var(--accent) 12%, var(--surface));
  --accent-border: color-mix(in srgb, var(--accent) 32%, var(--surface));
  --accent-text: color-mix(in srgb, var(--accent) 65%, var(--text));

  /* typography */
  --font-heading: 'Lexend', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* legacy names still referenced by older rules */
  --accent-gold: var(--gold);
  --accent-gold-soft: var(--gold-soft);
  --bg-color: var(--bg);
  --card-bg: var(--surface);
  --text-color: var(--text);
  --border-color: var(--border);
}
