/*
 * Volaren design foundation · v0.1
 * Two layers: Core (primitives, never used in components) and Semantic (role tokens
 * that flip per theme). Components consume semantic tokens only.
 * Source values: volaren.ai (--vds-* variables, Oct 2026) + extensions documented in
 * foundations/color.md.
 */

/* ───────────── Core colors (primitive) ───────────── */
:root {
  /* Gold — brand. 500 = volaren.ai --vds-gold, 300 = --vds-gold-soft, 700 = --vds-blue-deep */
  --gold-50: #FBF5E6; --gold-100: #F5E9C8; --gold-200: #F0DDAE; --gold-300: #E8CD8F;
  --gold-400: #D8B76A; --gold-500: #C8A24A; --gold-600: #A9873A; --gold-700: #8A6F2E;
  --gold-800: #574521; --gold-850: #3A3220; --gold-900: #1D180D; --gold-925: #231D10; --gold-950: #17140D;
  /* 850 tinted border, 925 active nav fill, 950 tinted button fill (sampled from the app) */

  /* Graphite — product neutrals. 50 = --vds-text-primary, 200 = --vds-text-secondary,
     800 = --vds-bg-raised, 900 = --vds-bg-base, 950 = --vds-bg-deep */
  --graphite-50: #F4F2ED; --graphite-100: #E2E0DA; --graphite-200: #C9C7C0; --graphite-300: #8F8D87;
  --graphite-400: #5E5D59; --graphite-500: #2E2E34; --graphite-600: #1E1E22; --graphite-650: #151518;
  --graphite-700: #141416; --graphite-750: #121214; --graphite-800: #0B0D10; --graphite-900: #0A0A0B;
  --graphite-950: #000000;
  /* 500 pill/tab borders, 600 table border, 650 row divider, 700 popover, 750 tab well, 800 app chrome
     (sampled from volaren.ai/alpha-hub) */

  /* Sand — marketing neutrals (cream site). 100 = body bg, 700 = ink */
  --sand-50: #FBF6EA; --sand-100: #F6EEDC; --sand-200: #EFE4CB; --sand-300: #E0D1AD;
  --sand-400: #B5A88C; --sand-500: #6F6553; --sand-600: #3D3626; --sand-700: #1E1A12;

  /* Forest — marketing green; positive data deltas only */
  --forest-50: #EEF7F1; --forest-100: #CBEBD8; --forest-200: #7FD3A3; --forest-300: #57B884;
  --forest-400: #3F8A6B; --forest-500: #2F6F4E; --forest-600: #24553A; --forest-700: #183D29;
  --forest-800: #0F2417; --forest-900: #08150D;

  /* Clay — negative / error. 400 = --vds-negative */
  --clay-50: #FBEDEC; --clay-100: #F4CFCD; --clay-200: #E8A3A0; --clay-300: #DB7C78;
  --clay-400: #C0524E; --clay-500: #A3413E; --clay-600: #7E3230; --clay-700: #522120;
  --clay-800: #2E1514; --clay-900: #1E0F0E;

  /* Amber — warning / unknowns. 400 = --vds-warning */
  --amber-50: #FBF1E5; --amber-100: #F4DABA; --amber-200: #EBBF86; --amber-300: #DFA35A;
  --amber-400: #C9883A; --amber-500: #A86E2C; --amber-600: #835522; --amber-700: #573818;
  --amber-800: #301F0F; --amber-900: #20150B;

  /* Steel — NEW: observed / verified data */
  --steel-50: #EEF3F8; --steel-100: #D3E0EC; --steel-200: #B2C8DD; --steel-300: #8FAECB;
  --steel-400: #6E92B5; --steel-500: #557797; --steel-600: #425D76; --steel-700: #2F4253;
  --steel-800: #1C2732; --steel-900: #111820;

  /* Lilac — NEW: model interpretation (the AI's voice) */
  --lilac-50: #F3F0FA; --lilac-100: #E1D9F3; --lilac-200: #C8BBE8; --lilac-300: #AE9CDB;
  --lilac-400: #937ECB; --lilac-500: #7763AE; --lilac-600: #5D4D89; --lilac-700: #423762;
  --lilac-800: #27213A; --lilac-900: #17141F;

  /* Teal — NEW (Evidence Mode): third-party consensus estimates */
  --teal-50: #EDF8F7; --teal-100: #CDEDEA; --teal-200: #9ED9D3; --teal-300: #6FC2BA;
  --teal-400: #49A79F; --teal-500: #388A83; --teal-600: #2C6D68; --teal-700: #20504C;
  --teal-800: #143331; --teal-900: #0C1F1E;

  /* Orchid — NEW (Evidence Mode): management guidance (company forward statements) */
  --orchid-50: #FAEFF6; --orchid-100: #F2D3E7; --orchid-200: #E4AED0; --orchid-300: #D488B8;
  --orchid-400: #BF659E; --orchid-500: #A04F84; --orchid-600: #7E3E68; --orchid-700: #592C4A;
  --orchid-800: #361B2D; --orchid-900: #22111D;
}

/* ───────────── Semantic colors · Dark (product default) ───────────── */
:root, [data-theme="dark"] {
  color-scheme: dark;
  /* Surfaces */
  --background: var(--graphite-950);  /* app canvas is pure black */
  --chrome: var(--graphite-800);      /* app bar, sidebar, search, inputs */
  --layer-1: var(--graphite-800);     /* wells, inputs */
  --layer-2: var(--graphite-950);     /* cards and tables: black, defined by their border */
  --layer-3: var(--graphite-700);     /* hover, inset rows */
  --surface-overlay: var(--graphite-700); /* drawers, dialogs, popovers */
  --tab-well: var(--graphite-750);    /* segmented tab container */
  --divider: var(--graphite-650);     /* table row dividers */
  --overlay: rgba(0, 0, 0, 0.64);

  /* Text */
  --text-primary: var(--graphite-50);
  --text-secondary: var(--graphite-200);
  --text-tertiary: var(--graphite-300);
  --link: var(--gold-300);
  --accent-text: var(--gold-500); /* gold used as text: amounts, one hero word */

  /* Button */
  --button-primary: var(--gold-500);
  --button-primary-hover: var(--gold-400);
  --button-primary-text: var(--graphite-900);
  --button-secondary: var(--graphite-800);
  --button-secondary-hover: var(--graphite-700);
  --button-secondary-text: var(--graphite-50);
  --button-tint: var(--gold-950);           /* row actions, like "Trade" */
  --button-tint-hover: var(--gold-925);
  --button-tint-border: var(--gold-850);
  --button-tint-text: var(--gold-300);
  --nav-active-bg: var(--gold-925);
  --nav-active-fg: var(--gold-500);
  --button-disabled: var(--graphite-700);
  --button-disabled-text: var(--graphite-400);

  /* Icon */
  --icon-primary: var(--graphite-100);
  --icon-secondary: var(--graphite-300);

  /* Border */
  --border-strong: var(--graphite-500);
  --border-subtle: var(--graphite-600);
  --border-chrome: #1C1E21;
  --border-warning: var(--amber-300);
  --border-error: var(--clay-300);
  --focus-ring: var(--gold-300);

  /* Accent pairs — source type (Evidence Mode: where did this number come from?) */
  --reported-fg: var(--steel-200);      --reported-bg: var(--steel-900);    /* filing, dataset, your input */
  --consensus-fg: var(--teal-200);      --consensus-bg: var(--teal-900);    /* analyst consensus */
  --guidance-fg: var(--orchid-200);     --guidance-bg: var(--orchid-900);   /* management guidance */
  --assumption-fg: var(--gold-300);     --assumption-bg: var(--gold-900);   /* model assumption: yours to change */
  --inference-fg: var(--lilac-200);     --inference-bg: var(--lilac-900);   /* AI inference */
  --unknown-fg: var(--amber-200);       --unknown-bg: var(--amber-900);     /* stale, missing, conflicting */
  /* v0.1 aliases */
  --observed-fg: var(--reported-fg);    --observed-bg: var(--reported-bg);
  --interpret-fg: var(--inference-fg);  --interpret-bg: var(--inference-bg);
  /* Accent pairs — data deltas only (never trust signals) */
  --positive-fg: var(--forest-200);     --positive-bg: var(--forest-800);
  --negative-fg: var(--clay-200);       --negative-bg: var(--clay-900);
  --positive-text: var(--forest-400);   /* bare numbers in tables, as in Alpha Hub */

  /* Charts */
  --chart-current: var(--graphite-300);
  --chart-proposed: var(--gold-500);
  --chart-range: rgba(200, 162, 74, 0.16);

  /* Elevation (volaren.ai shadows, tuned for dark) */
  --shadow-1: 0 1px 0 rgba(255,255,255,0.04) inset, 0 6px 18px rgba(0,0,0,0.35);
  --shadow-2: 0 1px 0 rgba(255,255,255,0.05) inset, 0 30px 70px rgba(0,0,0,0.55);
}

/* ───────────── Semantic colors · Light (marketing cream) ───────────── */
[data-theme="light"] {
  color-scheme: light;
  --background: var(--sand-100);
  --chrome: var(--sand-50);
  --layer-1: var(--sand-200);
  --layer-2: var(--sand-50);
  --layer-3: #FFFFFF;
  --surface-overlay: var(--sand-50);
  --tab-well: var(--sand-200);
  --divider: #EADFC5;
  --overlay: rgba(30, 26, 18, 0.4);

  --text-primary: var(--sand-700);
  --text-secondary: var(--sand-500);
  --text-tertiary: #8C826E;
  --link: var(--gold-700);
  --accent-text: var(--gold-700);

  --button-primary: var(--gold-500);
  --button-primary-hover: var(--gold-400);
  --button-primary-text: var(--sand-700);
  --button-secondary: var(--sand-200);
  --button-secondary-hover: var(--sand-300);
  --button-secondary-text: var(--sand-700);
  --button-tint: var(--gold-100);
  --button-tint-hover: var(--gold-200);
  --button-tint-border: var(--gold-300);
  --button-tint-text: var(--gold-800);
  --nav-active-bg: var(--gold-100);
  --nav-active-fg: var(--gold-800);
  --button-disabled: var(--sand-200);
  --button-disabled-text: var(--sand-400);

  --icon-primary: var(--sand-700);
  --icon-secondary: var(--sand-500);

  --border-strong: var(--sand-300);
  --border-subtle: #E8DCC0;
  --border-chrome: #E8DCC0;
  --border-warning: var(--amber-500);
  --border-error: var(--clay-500);
  --focus-ring: var(--gold-700);

  --reported-fg: var(--steel-700);      --reported-bg: var(--steel-50);
  --consensus-fg: var(--teal-700);      --consensus-bg: var(--teal-50);
  --guidance-fg: var(--orchid-700);     --guidance-bg: var(--orchid-50);
  --assumption-fg: var(--gold-800);     --assumption-bg: var(--gold-100);
  --inference-fg: var(--lilac-700);     --inference-bg: var(--lilac-50);
  --unknown-fg: var(--amber-700);       --unknown-bg: var(--amber-50);
  --observed-fg: var(--reported-fg);    --observed-bg: var(--reported-bg);
  --interpret-fg: var(--inference-fg);  --interpret-bg: var(--inference-bg);
  --positive-fg: var(--forest-600);     --positive-bg: var(--forest-50);
  --negative-fg: var(--clay-600);       --negative-bg: var(--clay-50);
  --positive-text: var(--forest-500);

  --chart-current: var(--sand-400);
  --chart-proposed: var(--gold-600);
  --chart-range: rgba(200, 162, 74, 0.22);

  --shadow-1: 0 6px 18px rgba(60, 40, 0, 0.12);
  --shadow-2: 0 30px 70px rgba(60, 40, 0, 0.22);
}

/* ───────────── Typography (scale from typography.md, Volaren faces) ───────────── */
:root {
  --font-base: "Jost", "Inter", -apple-system, system-ui, sans-serif;
  --font-display: "Jost", "Inter", -apple-system, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, monospace;
  --font-editorial: "Instrument Serif", Georgia, serif; /* taste: one italic word, hero only */

  /* Heading: size / line-height / weight / tracking */
  --h1: 700 42px/1.25 var(--font-display); --h1-track: -0.02em;
  --h2: 600 35px/1.25 var(--font-display); --h2-track: -0.02em;
  --h3: 600 29px/1.25 var(--font-display); --h3-track: -0.02em;
  --h4: 600 24px/1.25 var(--font-display); --h4-track: 0;
  --h5: 500 20px/1.25 var(--font-display); --h5-track: 0;
  --h6: 500 16px/1.25 var(--font-display); --h6-track: 0;
  /* Body */
  --body-1: 400 16px/1.3 var(--font-base); --body-1-track: 0;
  --body-2: 400 14px/1.3 var(--font-base); --body-2-track: 0.02em;
  --body-3: 400 12px/1.3 var(--font-base); --body-3-track: 0.02em;
  /* Interactive (buttons + links) */
  --int-1: 600 16px/1 var(--font-base);
  --int-2: 600 14px/1 var(--font-base);
  --int-3: 600 12px/1 var(--font-base);
  --int-track: 0.02em;
  /* Number (mono, tabular) */
  --num-1: 500 32px/1.1 var(--font-mono);
  --num-2: 500 24px/1.1 var(--font-mono);
  --num-3: 500 20px/1.1 var(--font-mono);
  --num-4: 500 16px/1.2 var(--font-mono);
  --num-5: 500 14px/1.2 var(--font-mono);
  --num-6: 500 12px/1.2 var(--font-mono);
}

/* ───────────── Space (spacing.md — geometric, ×2) ───────────── */
:root {
  --space-none: 0;
  --space-xxs: 2px;
  --space-xs: 4px;
  --space-s: 8px;
  --space-m: 16px;
  --space-l: 32px;
  --space-xl: 64px;
  --space-xxl: 128px;
  --space-xxxl: 256px;
}

/* ───────────── Radius (volaren.ai: 6 / 8 / 12, snapped to ×2 where possible) ───────────── */
:root {
  --radius-xs: 4px;
  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 16px;
  --radius-full: 999px;
}
