/* Keystone CS design tokens · theme: Architectural Precision · see docs/PLAN.md, "Design direction".
 * Dark (primary): graphite and blue steel, from the Precision mockup canvas. Light: frost with steel framing and
 * blue-steel mastheads. One light source, upper left: top and left edges catch --edge-light, lower surfaces sit in --shade.
 * Four accents: Electric (default), Arctic, Cobalt, Ember, set by data-accent on <html>.
 * --color-trace (#00BAFF) belongs to the approved navigation trace only. Do not reuse or change it.
 * tracker/tests/test_tokens.py checks every text pair below against WCAG AA in both modes.
 */
@font-face { font-family: "Inter"; src: url("fonts/inter-latin-opsz-normal.4b73e2ff3024.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/jetbrains-mono-latin-wght-normal.b058178d7f30.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  color-scheme: light dark;
  --font-display: "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --text-xs: 0.75rem; --text-sm: 0.8125rem; --text-base: 0.9375rem; --text-lg: 1.125rem; --text-xl: 1.5rem; --text-2xl: 2.25rem; --text-hero: 3.25rem;
  --space-2xs: 0.25rem; --space-xs: 0.5rem; --space-sm: 0.75rem; --space-md: 1rem; --space-lg: 1.5rem; --space-xl: 2rem; --space-2xl: 3rem;
  --radius-sm: 2px; --radius-md: 3px;
  --chamfer: 18px;
  --rule-width: 1px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 120ms;

  /* Surfaces. Dark is primary: graphite and blue steel. Light: frost with steel framing. */
  --color-paper: light-dark(#DCE4EC, #0A111B);
  --color-surface: light-dark(#FAFCFE, #111C2A);
  --paper: #F4F6F9; --paper-card: #FFFFFF; --paper-ink: #1B2333; --paper-muted: #5B6676; --paper-ink-2: #3D485A; --paper-rule: #C9D1DC; --paper-rule-soft: #E3E8EF; /* the client view stays light in both themes */
  --color-logo-plate: #F4F6F9; /* a client's logo sits on this in both themes, so any logo keeps its own colors */
  --color-raised: light-dark(#F3F6F9, #142234);
  --color-elevated: light-dark(#E5ECF3, #1D2D42);
  --color-sunken: light-dark(#D7E0EA, #070D16);
  --color-side: light-dark(#F3F6F9, #0C1521);
  --color-ink: light-dark(#0F1B2A, #E8EEF6);
  --color-ink-2: light-dark(#2B3D52, #C3D0DE);
  --color-ink-3: light-dark(#43566C, #9AACC1);
  --color-label: light-dark(#3B4F68, #A9BBD0);
  --color-rule: light-dark(#C3CFDC, #22344A);
  --color-structure: light-dark(#9DB0C5, #2F4762);
  --color-rule-strong: light-dark(#5E7189, #56769A);
  /* Steel edge: a frame that catches the light at the upper left. */
  --color-edge-hi: light-dark(#FFFFFF, #B4C8DE);
  --color-edge-mid: light-dark(#A9BDD2, #4A6688);
  --color-edge-lo: light-dark(#3E5874, #22344A);
  /* Mastheads and panel headers. In light mode they are blue steel with white text. */
  --color-mast-1: light-dark(#4C6C94, #2F5079);
  --color-mast-mid: light-dark(#40607F, #1E3454);
  --color-mast-2: light-dark(#2B4360, #101C2D);
  /* The steel frame round a masthead or panel: bright at the upper left, fading to the lower right. */
  --frame-1: light-dark(#FFFFFF, #B4C8DE);
  --frame-2: light-dark(#A9BDD2, #4A6688);
  --frame-3: light-dark(#6F88A5, #22344A);
  --frame-4: light-dark(#3E5874, #1A2838);
  --color-mast-ink: light-dark(#FFFFFF, #E8EEF6);
  --color-mast-muted: light-dark(#E7EEF7, #C9D6E5);
  --color-head-1: light-dark(#4E6D90, #1D2D42);
  --color-head-2: light-dark(#3C5877, #142234);
  --color-head-ink: light-dark(#FFFFFF, #E8EEF6);
  /* Secondary buttons: a raised steel face. */
  --color-btn-1: light-dark(#FFFFFF, #2B3F58);
  --color-btn-2: light-dark(#DCE4ED, #1A293C);
  --edge-light: light-dark(rgb(255 255 255 / 0.9), rgb(180 200 222 / 0.16));
  --shade: light-dark(rgb(15 27 42 / 0.1), rgb(0 0 0 / 0.45));
  --shadow-card: 0 1px 0 var(--edge-light) inset, 0 1px 2px light-dark(rgb(15 27 42 / 0.08), rgb(0 0 0 / 0.4));
  --shadow-panel: 0 1px 0 var(--edge-light) inset, 0 14px 30px -18px light-dark(rgb(15 27 42 / 0.3), rgb(0 0 0 / 0.75));
  --shadow-recess: inset 0 2px 4px var(--shade), inset 0 -1px 0 var(--edge-light);

  /* Accent: Electric by default. data-accent on <html> picks Arctic, Cobalt or Ember (blocks below).
   * --color-accent is for text, links and focus: darker in light mode, lighter in dark mode.
   * --color-accent-line is the raw accent for lines, edges and glows, never for text. */
  --color-accent: light-dark(#0A62BA, #5CC6FF);
  --color-accent-line: #1FA8FF;
  --color-accent-glow: rgb(31 168 255 / 0.2);
  --color-accent-wash: light-dark(#E1EEFB, #0F2A44);
  --color-focus: light-dark(#0A62BA, #5CC6FF);
  --color-electric: #1FA8FF;
  --color-ion: #5CC6FF;
  /* Accent fills with --color-accent-ink text: primary buttons, the selected segment, today's date. */
  --color-brand: #0B55B4;
  --color-brand-top: #1A84EC;
  --color-brand-hover: #0A4A9E;
  --color-accent-ink: #FFFFFF;
  /* The approved navigation trace. Exactly #00BAFF, in both modes. */
  --color-trace: #00BAFF;

  --color-good: light-dark(#1A6E44, #5CC98A);
  --color-good-wash: light-dark(#E3F3EA, #13291F);
  --color-warn: light-dark(#7E5200, #E8B44A);
  --color-warn-wash: light-dark(#FBF1DC, #2A2414);
  --color-fav: light-dark(#7A4F00, #E8B44A);  /* favorites: the gold bell, edge and star */
  --color-fav-ink: light-dark(#FFFFFF, #1B1405);  /* text on a gold fill */
  --color-fav-mast: #F2C14E;  /* a favorite's star on the masthead, which is dark blue in both modes */
  --color-fav-wash: light-dark(#FBF1DC, #2A2414);
  --color-bad: light-dark(#B3261E, #F07D72);
  --color-bad-wash: light-dark(#FBE7E5, #2E1A1E);

  --viz-credited: light-dark(#2E8B57, #4CBF7E);
  --viz-overdue: light-dark(#D2453B, #E5645A);
  --viz-progress: light-dark(#9C6E00, #E8B44A);
  --viz-upcoming: light-dark(#C2CEDB, #34485E);
  --heat-0: transparent;
  --heat-1: light-dark(#E3EEFB, #0F2A44);
  --heat-2: light-dark(#B9D6F6, #11406A);
  --heat-3: light-dark(#6FA9EC, #0F5FA8);
  --heat-4: light-dark(#2F86E6, #0870D6);
  --heat-5: light-dark(#0A66C2, #38BDF8);
  --heat-ink-2: light-dark(#0B1420, #E8EFF7);
  --heat-ink-3: light-dark(#0B1420, #FFFFFF);
  --heat-ink-4: light-dark(#0B1420, #FFFFFF);
  --heat-ink-5: light-dark(#FFFFFF, #0B1420);

  /* Density: Standard by default. Compact and Spacious set data-density on <html>. */
  --pad-panel: 1.25rem;
  --row-pad: 0.5rem;
  --figure-size: 2.5rem;
}
:root[data-density="compact"] { --pad-panel: 0.875rem; --row-pad: 0.3rem; --figure-size: 2rem; --text-base: 0.875rem; }
:root[data-density="spacious"] { --pad-panel: 1.75rem; --row-pad: 0.7rem; --figure-size: 3.25rem; --text-base: 1rem; }

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* Accents. Each block restates every accent token, so tests can check each one on its own. */
[data-accent="arctic"] {
  --color-accent: light-dark(#086470, #6FE3E8);
  --color-accent-line: #2FD0D6;
  --color-accent-glow: rgb(47 208 214 / 0.18);
  --color-accent-wash: light-dark(#DDF3F4, #0B2E33);
  --color-focus: light-dark(#086470, #6FE3E8);
  --color-electric: #2FD0D6;
  --color-ion: #6FE3E8;
  --color-brand: #0B6F7B;
  --color-brand-top: #13A3B0;
  --color-brand-hover: #095F69;
  --color-accent-ink: #FFFFFF;
}
[data-accent="cobalt"] {
  --color-accent: light-dark(#2C43C4, #9AAEFF);
  --color-accent-line: #5B7CFF;
  --color-accent-glow: rgb(91 124 255 / 0.22);
  --color-accent-wash: light-dark(#E6EAFF, #1A2350);
  --color-focus: light-dark(#2C43C4, #9AAEFF);
  --color-electric: #5B7CFF;
  --color-ion: #9AAEFF;
  --color-brand: #2C3FC2;
  --color-brand-top: #4A68F2;
  --color-brand-hover: #2535A8;
  --color-accent-ink: #FFFFFF;
}
[data-accent="ember"] {
  --color-accent: light-dark(#8F4A00, #FFC171);
  --color-accent-line: #F2A23A;
  --color-accent-glow: rgb(242 162 58 / 0.18);
  --color-accent-wash: light-dark(#FBEEDB, #2E2410);
  --color-focus: light-dark(#8F4A00, #FFC171);
  --color-electric: #F2A23A;
  --color-ion: #FFC171;
  --color-brand: #D27F18;
  --color-brand-top: #F5AE4E;
  --color-brand-hover: #C2730F;
  --color-accent-ink: #1A0F02;
}

/* Service tier plates: metal materials from the Precision Identity board. The same in both themes (each plate is its
 * own dark material). data-tier on a plate picks one; a tier without a material uses brushed steel. */
.tier-plate { --plate-1: #4D5B6D; --plate-2: #222A35; --plate-edge: #BCCADA; --plate-ink: #E8EEF5; }
.tier-plate[data-tier="block-hours"] { --plate-1: #3C3364; --plate-2: #221C3D; --plate-edge: #A797E2; --plate-ink: #DAD0FB; }
