/* ============================================================
   CRELATE DESIGN SYSTEM - Colors & Type tokens
   Brand fonts: Red Hat Display (display/headers), Open Sans (body)
   Loaded from local /fonts/ - no Google Fonts substitutes.
   Canonical reference: README.md + "Crelate Design System v3.html"

   Deviations from the v3 handoff, all for WCAG 2.2 AA text contrast on white:
   --text-muted, --text-subtle and --text-link darkened; --intent-*-text added for
   status text (the --intent-* fills are unchanged). Italic faces removed: the files
   were never shipped and no italic is used.
   ============================================================ */

@font-face {
  font-family: "Red Hat Display";
  src: url("fonts/RedHatDisplay-VariableFont_wght.ttf") format("truetype-variations");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Open Sans";
  src: url("fonts/OpenSans-VariableFont_wdth_wght.ttf") format("truetype-variations");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* ---------- Type families ---------- */
  --font-display: "Red Hat Display", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body:    "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:    ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* ---------- Type scale (px / line-height) ---------- */
  --fs-h1: 40px;   --lh-h1: 52px;   --tr-h1: -0.02em;
  --fs-h2: 30px;   --lh-h2: 40px;
  --fs-h3: 24px;   --lh-h3: 32px;
  --fs-h4: 20px;   --lh-h4: 26px;
  --fs-label: 13px; --lh-label: 18px; --tr-label: 0.18em;
  --fs-body: 16px;  --lh-body: 24px;
  --fs-cap: 12px;   --lh-cap: 18px;

  /* ---------- Color - Cool primary palette (default base) ---------- */
  --crelate-blue: #008EEC;   /* PRIMARY - the single brand identity color. Fills and accents only: 3.45:1 on white. */
  --sky-blue:     #00A1ED;
  --pacific-blue: #00B4C8;
  --celadon:      #008B7D;
  --kelly-green:  #7FBA4C;
  --green:        #3FA44E;
  --indigo:       #344AA7;
  --royal-purple: #5B37A9;

  /* ---------- Color - Warm accent palette (callout only) ---------- */
  --orchid:       #9328A2;
  --amaranth:     #EA1C59;
  --cinnabar:     #F63936;
  --port-orange:  #FF4B2C;
  --cadmium:      #FF8B29;
  --amber:        #FFB732;
  --lemon:        #FFE64C;
  --june-bud:     #C7D547;

  /* ---------- Neutrals ---------- */
  --black: #1E1E29;          /* body type, dark surfaces */
  --grey:  #76818E;          /* secondary UI (not text on white: 3.96:1) */
  --white: #FFFFFF;

  /* ---------- Crelate Blue tint/shade scale (5-step) ---------- */
  --blue-base: #008EEC;
  --blue-25:   #45B0F6;      /* +25% lighter */
  --blue-50:   #6BCCF9;      /* +50% */
  --blue-100:  #A3F2FF;      /* +100% (surface fill) */
  --blue-d25:  #1973CB;      /* -25% darker. 4.82:1 on white: the blue for text and for white-on-blue buttons */
  --blue-d40:  #14609F;      /* -40% darker (hover / press for --blue-d25 surfaces) */

  /* ---------- Ink scale (neutral opacities of --black for UI) ---------- */
  --ink-90: #1E1E29;
  --ink-70: #4D4D5C;
  --ink-50: #76818E;
  --ink-30: #AEB4BC;
  --ink-15: #D8DBE0;
  --ink-08: #ECEEF1;
  --ink-04: #F5F6F8;

  /* ---------- Semantic surfaces ---------- */
  --bg:          #FFFFFF;
  --bg-subtle:   #F5F6F8;
  --bg-sunken:   #EEEFF1;
  --surface:     #FFFFFF;
  --border:      #E2E5EA;
  --border-strong:#D8DBE0;

  /* ---------- Semantic text (all >= 4.5:1 on --bg) ---------- */
  --text:        #1E1E29;    /* 16.50:1 */
  --text-muted:  #6D7783;    /* 4.55:1 */
  --text-subtle: #71777F;    /* 4.52:1 */
  --text-invert: #FFFFFF;
  --text-link:   #1973CB;    /* 4.82:1 */

  /* ---------- Semantic intent (fills) ---------- */
  --intent-info:    #008EEC;
  --intent-success: #3FA44E;
  --intent-warn:    #FFB732;
  --intent-danger:  #F63936;

  /* ---------- Semantic intent (text on --bg, all >= 4.5:1) ---------- */
  --intent-success-text: #348640;   /* 4.54:1 */
  --intent-warn-text:    #9A6F1E;   /* 4.50:1 */
  --intent-danger-text:  #DD3331;   /* 4.57:1 */

  /* ---------- Spacing - 4-point scale ---------- */
  --sp-2xs: 4px;
  --sp-xs:  8px;
  --sp-sm:  12px;
  --sp-md:  16px;
  --sp-lg:  24px;
  --sp-xl:  32px;
  --sp-2xl: 48px;
  --sp-3xl: 64px;

  /* ---------- Corner radius ---------- */
  --radius-sm:   6px;    /* inputs, badges */
  --radius-md:   12px;   /* cards, tiles */
  --radius-lg:   20px;   /* sections, hero */
  --radius-pill: 999px;  /* chips, avatars */

  /* ---------- Elevation (shadow system) ---------- */
  --elev-1: 0 1px 2px rgba(30,30,41,.06), 0 1px 3px rgba(30,30,41,.08);
  --elev-2: 0 4px 10px rgba(30,30,41,.08), 0 2px 4px rgba(30,30,41,.06);
  --elev-3: 0 12px 28px rgba(30,30,41,.14), 0 4px 10px rgba(30,30,41,.08);
  --elev-4: 0 24px 60px rgba(30,30,41,.22), 0 8px 20px rgba(30,30,41,.12);

  /* ---------- Motion ---------- */
  --motion-snap:   180ms;
  --motion-base:   280ms;
  --motion-glass:  520ms;
  --motion-ambient:12s;
  --ease-standard: cubic-bezier(.2, .8, .2, 1);
  --ease-out:      cubic-bezier(.16, 1, .3, 1);

  /* ---------- Liquid Glass tokens (Recipe A - default) ---------- */
  --glass-blur:        12px;
  --glass-bg:          rgba(255, 255, 255, 0.18);
  --glass-border:      rgba(255, 255, 255, 0.30);
  --glass-saturation:  160%;
  --glass-radius:      14px;
  --glass-shadow:      0 8px 32px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.18);
}

/* ============================================================
   SEMANTIC TYPE ROLES - apply directly or copy into components
   ============================================================ */
.ds-h1 { font-family: var(--font-display); font-weight: 500; font-size: var(--fs-h1); line-height: var(--lh-h1); letter-spacing: var(--tr-h1); color: var(--text); }
.ds-h2 { font-family: var(--font-display); font-weight: 400; font-size: var(--fs-h2); line-height: var(--lh-h2); color: var(--text); }
.ds-h3 { font-family: var(--font-display); font-weight: 400; font-size: var(--fs-h3); line-height: var(--lh-h3); color: var(--text); }
.ds-h4 { font-family: var(--font-display); font-weight: 400; font-size: var(--fs-h4); line-height: var(--lh-h4); color: var(--text); }
.ds-label { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-label); line-height: var(--lh-label); letter-spacing: var(--tr-label); text-transform: uppercase; color: var(--text-muted); }
.ds-body { font-family: var(--font-body); font-weight: 400; font-size: var(--fs-body); line-height: var(--lh-body); color: var(--text); }
.ds-caption { font-family: var(--font-body); font-weight: 400; font-size: var(--fs-cap); line-height: var(--lh-cap); color: var(--text-muted); }
