/*
  ClearSix design tokens. One file sets color, type, spacing, light and dark
  mode, and the text-size scale for every screen. Components use these variables
  and never a raw hex or pixel size.

  Name and look confirmed by Joe 2026-12-03 from his mockup: "ClearSix", with the
  line "Claim Guide", in navy, amber, and cream. The values below are tuned from
  the mockup for contrast. Font is still Poppins from the TorresIO pack, pending
  a ClearSix choice.

  Contrast, measured 2026-12-03 (WCAG 2.1 ratio against the surface it sits on):
    text on surface            14.5   AAA
    text-muted on surface       6.4   AA (5.7 on the sunken surface)
    link on surface             7.5   AAA
    white on navy (buttons)    14.2   AAA
    navy text on amber          8.6   AAA
    amber on surface            1.7   decoration only, never text or a control edge
    border-strong on surface    3.8   passes 3 to 1 for input and control edges
    ok / warn / danger          6.0 / 6.4 / 6.5   AA
    dark: text on surface      15.2   AAA
    dark: text-muted            8.3   AAA
    dark: link                  9.0   AAA
    dark: navy text on amber    8.6   AAA (buttons are amber in dark mode)
    dark: border-strong         5.4
  Amber is a fill with navy text on it, or a marker beside text. In light mode it
  is never text and never the only edge of a control.
*/

:root {
  /* Brand */
  --brand-navy: #1b2b45;
  --brand-amber: #f2b54a;
  --brand-cream: #faf6ec;

  /* Color roles, light mode */
  --surface: #faf6ec;
  --surface-raised: #ffffff;
  --surface-sunken: #efe8d8;
  --text: #14243a;
  --text-muted: #4d5b70;
  --border: #c9c0ac;                     /* dividers only */
  --border-strong: #857d6a;              /* inputs and control edges */
  --accent: #f2b54a;
  --accent-text: #14243a;                /* text on an amber fill */
  --link: #1d4f91;
  --action-bg: #1b2b45;
  --action-text: #ffffff;
  --focus-ring: #1d4f91;
  --ok: #1f6b3a;
  --warn: #7a5200;
  --danger: #a3301f;
  --danger-soft: #fbe6dc;
  --ok-soft: #e1f1e6;
  --action-soft: #e6ebf3;               /* selected option, soft callout */
  --note-bg: #fdf0cf;                    /* facts from the veteran's letters */
  --note-border: #a77a10;
  --note-text: #5c4208;
  /* Added 2026-12-03 for the redesign: calm "to review" status, info tint, illustration scene colors */
  --calm: #5b4a8a;
  --calm-soft: #ece8f5;
  --info-soft: #e6ebf3;
  --scene-sky-1: #fdf3dc;
  --scene-sky-2: #fbe2ae;
  --scene-sky-3: #f6cf86;
  --scene-sun: #f2b54a;
  --scene-hill-1: #c9d6c4;
  --scene-hill-2: #8fa996;
  --scene-hill-3: #4f6f63;
  --scene-path: #faf6ec;
  --scene-ink: #1b2b45;
  --scene-fade: #fdf3dc;
  --sev-1: #fbe8c0;
  --sev-2: #f2b54a;
  --sev-3: #d98b2b;
  --sev-3-text: #ffffff;

  /* Top bar and sidebar: navy in both modes, so the gold in the name always has contrast (7.8 to 1) */
  --chrome-bg: #1b2b45;
  --chrome-text: #f3efe4;
  --chrome-muted: #b9c2d0;
  --chrome-line: #3a4c69;
  --chrome-hover: #26395a;

  /* Type */
  --font-sans: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --text-scale: 1;                       /* 1 standard, 1.15 large, 1.3 extra large */
  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-base: 1.0625rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.625rem;
  --fs-2xl: 2.125rem;
  --lh-tight: 1.2;
  --lh-body: 1.55;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-bold: 700;
  --measure: 64ch;                       /* longest line of running text */

  /* Layout: 12 columns, 8px rhythm */
  --grid-columns: 12;
  --grid-gutter: 24px;
  --grid-margin: clamp(16px, 4vw, 48px);
  --content-max: 1200px;
  --sidebar-width: 264px;
  --sidebar-collapsed: 64px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --space-7: 72px;
  --target-min: 44px;                    /* smallest tap target */

  /* Shape: crisp, not bubbly */
  --radius: 4px;
  --radius-lg: 6px;
  --border-width: 1px;
  --shadow: none;

  /* Motion */
  --ease: cubic-bezier(.2, 0, 0, 1);
  --dur: 140ms;

  color-scheme: light;
}

/* Dark mode: the system setting by default, or the person's own choice. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface: #0f1a2b;
    --surface-raised: #18263b;
    --surface-sunken: #0a1220;
    --text: #f3efe4;
    --text-muted: #aab4c3;
    --border: #4a5a73;
    --border-strong: #7f90aa;
    --link: #8fbcff;
    --action-bg: #f2b54a;
    --action-text: #14243a;
    --focus-ring: #8fbcff;
    --ok: #7fd39a;
    --warn: #f0c36a;
    --danger: #ff9a8a;
    --danger-soft: #3a2419;
    --ok-soft: #1c3226;
    --action-soft: #1d2c44;
    --note-bg: #2f2812;
    --note-border: #d1a43f;
    --note-text: #f0d590;
    --calm: #c9b8ff;
    --calm-soft: #2c2645;
    --info-soft: #1d2c44;
    --scene-sky-1: #1d2c46;
    --scene-sky-2: #2a3d5e;
    --scene-sky-3: #3c4f72;
    --scene-sun: #f2b54a;
    --scene-hill-1: #2f4a48;
    --scene-hill-2: #253c3b;
    --scene-hill-3: #182b2b;
    --scene-path: #f3efe4;
    --scene-ink: #f3efe4;
    --scene-fade: #18263b;
    --sev-1: #4a3b1c;
    --sev-2: #b9862e;
    --sev-3: #e0913a;
    --sev-3-text: #14243a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --surface: #0f1a2b;
  --surface-raised: #18263b;
  --surface-sunken: #0a1220;
  --text: #f3efe4;
  --text-muted: #aab4c3;
  --border: #4a5a73;
  --border-strong: #7f90aa;
  --link: #8fbcff;
  --action-bg: #f2b54a;
  --action-text: #14243a;
  --focus-ring: #8fbcff;
  --ok: #7fd39a;
  --warn: #f0c36a;
  --danger: #ff9a8a;
  --danger-soft: #3a2419;
  --ok-soft: #1c3226;
  --action-soft: #1d2c44;
  --note-bg: #2f2812;
  --note-border: #d1a43f;
  --note-text: #f0d590;
  --calm: #c9b8ff;
  --calm-soft: #2c2645;
  --info-soft: #1d2c44;
  --scene-sky-1: #1d2c46;
  --scene-sky-2: #2a3d5e;
  --scene-sky-3: #3c4f72;
  --scene-sun: #f2b54a;
  --scene-hill-1: #2f4a48;
  --scene-hill-2: #253c3b;
  --scene-hill-3: #182b2b;
  --scene-path: #f3efe4;
  --scene-ink: #f3efe4;
  --scene-fade: #18263b;
  --sev-1: #4a3b1c;
  --sev-2: #b9862e;
  --sev-3: #e0913a;
  --sev-3-text: #14243a;
  color-scheme: dark;
}

/* Text size: set data-text on <html> from the Display menu. Every rem scales with it. */
html { font-size: calc(100% * var(--text-scale)); }
:root[data-text="large"] { --text-scale: 1.15; }
:root[data-text="xlarge"] { --text-scale: 1.3; --grid-gutter: 20px; }

@media (prefers-reduced-motion: reduce) {
  :root { --dur: 0ms; }
}
