/* Crovesta — brand tokens (Brand Book v3.0)
 * Single source of truth for colour, type, radius, shadow, motion and layout.
 *
 * TWO SURFACES, TWO SCALES.
 *   --cv-*      the PRODUCT scale. Warm neutrals, Geist, dense. Consumed as CSS
 *               custom properties by apps/platform and apps/identity.
 *   --cv-web-*  the EDITORIAL scale. Cool neutrals, Hanken Grotesk, spacious. Used by
 *               apps/website, which inlines the VALUES rather than referencing the
 *               properties: those pages are inline-styled for progressive paint, so
 *               there is no stylesheet for them to read. scripts/check-tokens.mjs
 *               parses this file and refuses any website colour not declared here.
 *
 * The two scales are not the same palette drifted apart. Measured in CIELAB the
 * brand blues sit ΔE 12.8 apart, and the neutrals are opposite in temperature —
 * the editorial rule at b* −3.9, the product rule at b* +3.8. Whether that is the
 * intended brand or an accident of two teams is OPEN DECISION OD-12. Until it is
 * settled, neither scale is changed to match the other: doing so would visibly
 * alter either the public brand or the product.
 */

:root {
  /* ── Brand ─────────────────────────────────────────────── */
  --cv-brand:              #0A61DA;
  --cv-brand-deep:         #04346F;
  --cv-brand-tint:         #E7F0FC;
  --cv-brand-tint-weak:    #F1F7FE;

  /* ── Ink ramp ──────────────────────────────────────────── */
  --cv-ink-900:            #11131A;
  --cv-ink-700:            #2A2D38;
  --cv-ink-500:            #5A5D68;
  --cv-ink-400:            #8E909A;
  --cv-ink-300:            #B8B8BC;
  --cv-ink-200:            #D9D9DC;

  /* Contrast guidance (WCAG AA) — ALWAYS surface-scoped:
   *
   * On LIGHT surfaces (--cv-paper #FFFFFF, --cv-canvas #F6F5F2):
   *   informational text must be --cv-ink-500 (~6.6:1) or darker.
   *   --cv-ink-400 measures ~3.2:1 → FAILS AA. Decorative dividers / disabled only.
   *
   * On DARK surfaces (--cv-ink-900 #11131A, --cv-ink-700):
   *   informational text must be --cv-ink-400 (~5.9:1) or LIGHTER (ink-300, ink-200, #fff).
   *   --cv-ink-500 measures ~2.8:1 on ink-900 → FAILS AA. Never use it on dark.
   *
   * Never find-and-replace an ink token across a file: the correct value depends on
   * the surface behind each element, not on the role of the text.
   */

  /* ── Surfaces ──────────────────────────────────────────── */
  --cv-paper:              #FFFFFF;
  --cv-canvas:             #F6F5F2;
  --cv-canvas-warm:        #EFEDE6;
  --cv-rule:               #E7E4DD;

  /* ── Module accents (one per product family) ───────────── */
  --cv-accent-cobalt:      #0A61DA;
  --cv-accent-indigo:      #4A4FA8;
  --cv-accent-violet:      #6B4BE3;
  --cv-accent-teal:        #0E9F87;
  --cv-accent-ocean:       #2078B8;
  --cv-accent-forest:      #2F7A4D;
  --cv-accent-amber:       #E3A93C;
  --cv-accent-coral:       #E07050;
  --cv-accent-rose:        #D14C6B;
  --cv-accent-slate:       #4A5160;

  /* ── Status ────────────────────────────────────────────── */
  --cv-ok:                 #1E7A48;
  --cv-warn:               #C77A1A;
  --cv-danger:             #B83A3A;
  --cv-info:               #2078B8;

  /* Status INK — label text on a 10%-alpha status tint over white.
   * The base status hues are tuned for fills/dots, not small text: --cv-warn
   * measures 3.03:1 and --cv-info 4.16:1 as 11px labels, both below AA 4.5:1.
   * Use the base hue for the tint/dot and the matching *-ink for the label. */
  --cv-ok-ink:             #14603A;
  --cv-warn-ink:           #7A4A0F;
  --cv-danger-ink:         #8F2C2C;
  --cv-info-ink:           #16537E;

  /* ── Type ──────────────────────────────────────────────── */
  --cv-font-sans:          'Geist', system-ui, -apple-system, sans-serif;
  --cv-font-mono:          'Geist Mono', ui-monospace, SFMono-Regular, monospace;
  /* Display. Sans on every surface — the website and the product are one
     company, and a serif on one of them made them read as two. The website
     sets its display face in Hanken Grotesk (its body face) at weight 600;
     the product UI and the brand descriptor use Geist, per the brand book. */
  --cv-font-display:       'Hanken Grotesk', system-ui, sans-serif;
  --cv-font-display-weight: 600;
  --cv-font-descriptor:    'Geist', system-ui, sans-serif;

  /* ── Radius ────────────────────────────────────────────── */
  --cv-r-4:  4px;
  --cv-r-8:  8px;
  --cv-r-12: 12px;
  --cv-r-16: 16px;
  --cv-r-20: 20px;
  --cv-r-pill: 999px;

  /* ── Elevation ─────────────────────────────────────────── */
  --cv-shadow-1: 0 1px 2px rgba(17,19,26,.06);
  --cv-shadow-2: 0 2px 8px rgba(17,19,26,.08);
  --cv-shadow-3: 0 8px 20px -8px rgba(17,19,26,.16);
  --cv-shadow-4: 0 20px 40px -20px rgba(17,19,26,.24);
  --cv-shadow-5: 0 32px 64px -32px rgba(17,19,26,.32);

  /* ── Motion ────────────────────────────────────────────── */
  --cv-dur-instant: 75ms;
  --cv-dur-fast:    150ms;
  --cv-dur-base:    220ms;
  --cv-dur-slow:    360ms;
  --cv-ease:        cubic-bezier(.2,.6,.2,1);
  --cv-ease-out:    cubic-bezier(0,.6,.3,1);

  /* ── Layout ────────────────────────────────────────────── */
  --cv-container:   1200px;
  --cv-gutter:      24px;

  /* ══ EDITORIAL SCALE — apps/website ══════════════════════════════════════
   * Cool-neutral. These are the values the website already uses, written down so
   * they can be governed; nothing was recoloured to produce this list.
   *
   * Contrast, measured (AA needs 4.5:1 for body, 3:1 for large):
   *                  on paper #FFF   on canvas #F6F8FB   on ink-900 #0E1524
   *   ink-900            18.2 AA          17.1 AA               —
   *   ink-700            12.5 AA          11.7 AA               —
   *   ink-600            10.2 AA           9.6 AA               —
   *   ink-500             7.9 AA           7.4 AA               —
   *   ink-400             6.1 AA           5.8 AA               —   ← lightest on light
   *   ink-300             3.2 large only   3.0 FAILS          5.7 AA
   *   ink-200             2.0 FAILS        1.9 FAILS          9.0 AA
   *
   * ink-300 and ink-200 are DARK-SURFACE ONLY. Never use them as text on paper or
   * canvas — scripts/check-contrast.mjs fails the build if you do.
   */
  --cv-web-brand:        #0B4FD6;   /* primary action, links, active state */
  --cv-web-brand-deep:   #093FB0;   /* hover on brand */
  --cv-web-brand-tint:   #EEF3FC;   /* brand-tinted surface */

  --cv-web-ink-900:      #0E1524;   /* headings; also the dark surface itself */
  --cv-web-ink-700:      #2C3444;
  --cv-web-ink-600:      #3A4152;
  --cv-web-ink-500:      #4A5262;
  --cv-web-ink-400:      #5A6273;   /* lightest text permitted on a light surface */
  --cv-web-ink-300:      #8791A3;   /* dark surfaces only */
  --cv-web-ink-200:      #AEB6C6;   /* dark surfaces only */

  --cv-web-paper:        #FFFFFF;
  --cv-web-canvas:       #F6F8FB;
  --cv-web-canvas-tint:  #F7F9FC;
  --cv-web-rule:         #E6EAF1;
  --cv-web-rule-strong:  #D4DAE4;   /* input border, stronger divider */
  --cv-web-rule-soft:    #C7D5EA;   /* hover border on brand-tinted cards */

  --cv-web-ok:           #0A6B5C;
  --cv-web-ok-tint:      #E7F4F0;
  --cv-web-warn:         #7A4A0F;
  --cv-web-warn-tint:    #FDF8F1;
  --cv-web-danger:       #A8321F;
  --cv-web-danger-tint:  #FCF2F0;

  /* Status ink — the one place the two scales already agree. Identical to
     --cv-ok-ink / --cv-danger-ink / --cv-info-ink above. */
  --cv-web-ok-ink:       #14603A;
  --cv-web-danger-ink:   #8F2C2C;
  --cv-web-info-ink:     #16537E;
}
