/* ============================================================================
   Solar → app tokens  ·  revamp copy (Foundations, issue #147), 2026-09-28
   Source: marketing/06_brand/design-system/app/solar-tokens.css (values unchanged). Added here:
   @font-face (self-hosted, with metric-matched fallback faces), --sp-1..--sp-8 spacing, motion
   tokens, --field-bg, and the Bootstrap bridge re-declared per theme (R01).
   Loaded ONLY by revamp templates (app/templates/revamp/base.html), after bidworks.css; old pages
   never request it (R04). Spec: marketing/06_brand/ux_concepts/handoff/screens/foundations.yaml
   Drop-in override for the app's CALM DENSITY token names (app/static/css/bidworks.css).
   Every component keeps working because only token VALUES change; the architecture (tokens only,
   raw-hex ratchet, one focus ring, z-ladder) stays. Spec: marketing/06_brand/ux_concepts/FRONTEND_BASELINE.md

   Decisions this file assumes (FRONTEND_BASELINE.md §2): F1 Solar values replace Calm
   Density values · F2 minimum text 12 px · F3 amber = --primary only, --accent = ink ·
   F4 outcome register is lightness + words, not green/red · F5/D36 --error only for errors and blockers (failed job, upload or export; a knockout
   requirement that stops the bid, labelled "Blocker"): text, icon, border or the tint behind a banner, never a large
   fill; never for an ordinary "Not compliant" or for "needs review" (that is amber).
   ========================================================================= */

/* Fonts: SELF-HOST Instrument Sans (OFL) and IBM Plex Mono (OFL) under app/static/vendor/fonts/ with
   @font-face + font-display: swap, and preload the two text weights. Never load Google Fonts from Google's
   CDN in the product: it sends visitors' IP addresses to Google (LG München I, 20 Jan 2022, 3 O 17493/20)
   and contradicts "designed for German data sovereignty". The design canvas may use the CDN; the app may not.
   Files: app/static/vendor/fonts/ (fontsource 5.3.0 releases; versions, hashes and licences in
   OFL-LICENSES.txt). Subsets latin + latin-ext, so German umlauts, ß and € render in the real face.
   Weights: Instrument Sans 400 / 600 / 700 (700 only for display and headings), IBM Plex Mono 400 / 500. */

/* Fallback faces with the real faces' metrics, so text does not move when the font arrives (CLS).
   Measured with fontTools against Arial/Liberation Sans and Courier New/Liberation Mono. */
@font-face {
  font-family: "Instrument Sans Fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Liberation Sans");
  size-adjust: 102%;
  ascent-override: 95.1%;
  descent-override: 24.5%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "IBM Plex Mono Fallback";
  src: local("Courier New"), local("Liberation Mono"), local("Menlo");
  size-adjust: 100%;
  ascent-override: 102.5%;
  descent-override: 27.5%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Instrument Sans"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../../vendor/fonts/InstrumentSans-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Sans"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../../vendor/fonts/InstrumentSans-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Sans"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../../vendor/fonts/InstrumentSans-600-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Sans"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../../vendor/fonts/InstrumentSans-600-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Sans"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../../vendor/fonts/InstrumentSans-700-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Sans"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../../vendor/fonts/InstrumentSans-700-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../../vendor/fonts/IBMPlexMono-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../../vendor/fonts/IBMPlexMono-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../../vendor/fonts/IBMPlexMono-500-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../../vendor/fonts/IBMPlexMono-500-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---- Solar Paper (light) · setup screens ----------------------------------- */
:root,
[data-theme="paper"] {
  color-scheme: light;

  /* surfaces */
  --ground: #F4F5F2;          /* page */
  --surface: #FAFBF8;         /* panels */
  --raised: #FFFFFF;          /* cards */
  --sunk: #ECEEEA;            /* table heads, inputs at rest */

  /* ink */
  --ink: #111318;             /* 17.2:1 on ground */
  --ink-2: #39404D;           /* ink-soft · 10.1:1 */
  --ink-3: #5A6270;           /* ink-muted · 5.4:1 · lightest TEXT allowed */
  --ink-4: #8E97A6;           /* icons, disabled · never text alone */

  /* lines */
  --line: #D9DCD8;
  --line-2: #E6E8E3;
  --line-3: #B7BCC3;          /* line-strong */
  --line-ctl: #7A828F;        /* control boundaries · 3.7:1 (WCAG 1.4.11) */

  --hover: rgba(17, 19, 24, .045);
  --press: rgba(17, 19, 24, .075);

  /* interaction: ink, not a hue. Amber is reserved for --primary (one per screen) */
  --accent: #111318;
  --accent-hover: #39404D;
  --accent-ink: #F4F5F2;
  --accent-tint: #E6E8E3;
  --accent-line: #B7BCC3;

  --primary: #FFB020;         /* the one primary action · "needs you" */
  --primary-hover: #E89A00;
  --primary-ink: #0B0D12;     /* 10.6:1 on --primary */
  --primary-tint: #FFF4DC;    /* solar-tint: decision banners */
  --solar-ink: #8A5500;       /* amber TEXT on Paper · 5.4:1 */

  /* outcome register: lightness + words (fully / partially / not / needs you) */
  --ok: #111318;       --ok-tint: #E6E8E3;   --ok-line: #B7BCC3;      /* fully */
  --warn: #8A5500;     --warn-tint: #FFF4DC; --warn-line: #F2C66B;    /* needs you */
  --bad: #39404D;      --bad-tint: #ECEEEA;  --bad-line: #B7BCC3;  --bad-ink: #FFFFFF;  /* not compliant */
  --na: #5A6270;       --na-tint: #ECEEEA;   --na-line: #D9DCD8;
  --error: #A6332C;    --error-tint: #F6E3E1; /* errors and blockers only (D36) */
  /* the three answer states of a bid (Activity issue 1226 and the status mail, the same names and colours): final, in review, no answer; always with words beside them */
  --final: #1F8A5B; --review: #FFB020; --open: #C9CED6;

  /* answer map squares */
  --map-fully: #1C212A; --map-partial: #6B7482; --map-not: #C3C9D2; --map-needs: #E89A00;

  --policy: #0B0D12;  --policy-ink: #EEF0ED;

  --series-1: #111318; --series-2: #5A6270; --series-3: #8E97A6; --series-4: #C3C9D2;

  --edge-hi: 0 0 0 0 rgba(0, 0, 0, 0);
  --skel-a: #E6E8E3; --skel-b: #D9DCD8;
  --sh-pop: 0 1px 2px rgba(11, 13, 18, .10), 0 6px 16px -5px rgba(11, 13, 18, .18);
  --sh-modal: 0 2px 4px rgba(11, 13, 18, .10), 0 26px 52px -14px rgba(11, 13, 18, .32);

  /* type: Instrument Sans + IBM Plex Mono; 12 px floor */
  --f-ui: "Instrument Sans", "Instrument Sans Fallback", "Helvetica Neue", Arial, sans-serif;
  --f-data: "IBM Plex Mono", "IBM Plex Mono Fallback", Menlo, Consolas, monospace;
  --t-micro: 12px; --t-meta: 12px; --t-data: 13px; --t-body: 14px;
  --t-sub: 16px;   --t-title: 20px; --t-screen: 28px;
  --t-display-m: 40px; --t-display-l: 56px;      /* page headlines, verdict */
  --w-reg: 400; --w-emph: 600; --w-display: 700;
  --tr-caps: .12em; --tr-tight: -.03em; --tr-num: -.01em;

  /* sizes: 32 / 40 / 48 controls, 44 px touch */
  --h-chip: 24px; --h-sm: 32px; --ctl: 40px; --ctl-lg: 48px; --h-tap: 44px;
  --row: 40px; --row-dense: 32px; --row-comfy: 48px; --h-bar: 72px;
  --row-2l: 64px;   /* a MIN-HEIGHT for a two-line table row (= --sp-8), never a fixed height: a fixed height clips under the WCAG 1.4.12 text-spacing override (Answers Table, OD-at-11 and OD-at-15) */

  --r-in: 4px; --r: 8px; --r-card: 14px; --r-pill: 999px;

  --w-rail: 80px;
  --focus: #111318;

  /* revamp additions (foundations.yaml): spacing 4 · 8 · 12 · 16 · 24 · 32 · 48 · 64 */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;
  /* motion: 150-200 ms ease-out for state changes; prefers-reduced-motion removes it (components.css) */
  --dur: 150ms; --dur-2: 200ms; --ease: cubic-bezier(0, 0, .2, 1);
  --focus-w: 2px;
  /* text fields at rest: white on Paper, raised on Night (board: Components, #FFFFFF / #171B23) */
  --field-bg: #FFFFFF;
}

/* ---- Solar Night (dark) · bid work ---------------------------------------- */
[data-theme="night"] {
  color-scheme: dark;
  --ground: #0B0D12; --surface: #0F131A; --raised: #171B23; --sunk: #11151C;
  --ink: #EEF0ED; --ink-2: #C9CED6; --ink-3: #8E97A6; --ink-4: #5A6270;
  --line: #2A303B; --line-2: #1C212A; --line-3: #39404D; --line-ctl: #6B7482;
  --hover: rgba(238, 240, 237, .06); --press: rgba(238, 240, 237, .10);
  --accent: #EEF0ED; --accent-hover: #FFFFFF; --accent-ink: #0B0D12; --accent-tint: #1C212A; --accent-line: #39404D;
  --primary: #FFB020; --primary-hover: #FFC857; --primary-ink: #0B0D12; --primary-tint: #231C0E; --solar-ink: #FFB020;
  --ok: #EEF0ED;   --ok-tint: #1C212A;   --ok-line: #39404D;
  --warn: #FFB020; --warn-tint: #231C0E; --warn-line: #6B4B12;
  --bad: #C9CED6;  --bad-tint: #11151C;  --bad-line: #39404D;  --bad-ink: #0B0D12;
  --na: #8E97A6;   --na-tint: #11151C;   --na-line: #2A303B;
  --error: #E3796E; --error-tint: #2C1917;
  --final: #3DBB7E; --review: #E6A11C; --open: #39404D;
  --map-fully: #DCE1E9; --map-partial: #6B7482; --map-not: #39404D; --map-needs: #FFB020;
  --policy: #EEF0ED; --policy-ink: #0B0D12;
  --series-1: #EEF0ED; --series-2: #9AA3B0; --series-3: #6B7482; --series-4: #39404D;
  --edge-hi: inset 0 1px 0 rgba(238, 240, 237, .05);
  --skel-a: #1C212A; --skel-b: #2A303B;
  --sh-pop: 0 1px 2px rgba(0, 0, 0, .5), 0 8px 20px -6px rgba(0, 0, 0, .6);
  --sh-modal: 0 2px 6px rgba(0, 0, 0, .5), 0 28px 60px -16px rgba(0, 0, 0, .7);
  --focus: #FFB020;
  --field-bg: #171B23;
}

/* Bootstrap bridge (R01: Bootstrap stays; its variables follow the tokens). Declared on every
   theme root, not only :root: a custom property that points at another one is computed where it
   is declared, so a Night panel inside a Paper page needs its own copy. bidworks.css sets the
   Calm Density values on :root; these win because this file loads after it. */
:root,
[data-theme] {
  --bs-body-bg: var(--ground);
  --bs-body-color: var(--ink);
  --bs-body-font-family: var(--f-ui);
  --bs-body-font-size: var(--t-body);
  --bs-emphasis-color: var(--ink);
  --bs-secondary-color: var(--ink-3);
  --bs-secondary-bg: var(--sunk);
  --bs-tertiary-bg: var(--sunk);
  --bs-border-color: var(--line);
  --bs-border-radius: var(--r);
  --bs-link-color: var(--ink);
  --bs-link-hover-color: var(--ink-2);
  --bs-primary: var(--primary);
  --bs-focus-ring-color: var(--focus);
}
:root,
[data-theme="paper"] { --bs-primary-rgb: 255, 176, 32; --bs-link-color-rgb: 17, 19, 24; }
[data-theme="night"] { --bs-primary-rgb: 255, 176, 32; --bs-link-color-rgb: 238, 240, 237; }

/* View modes (user setting, Profile › Display › View mode; decision D29):
     Default  the server sets data-theme per page kind: "night" for bid work (Bids, New bid, bid tabs),
              "paper" for setup (Knowledge, Insights, Workspace, Profile, sign-in)
     Dark     data-theme="night" on every page
     Light    data-theme="paper" on every page
   Render it server-side on <body data-theme="…"> (no flash); before sign-in use the last mode from a cookie.
   Honour prefers-reduced-motion everywhere; emails, exports and PDFs keep one fixed look. */
