/* ============================================================================
   Base Agency Design System — Design Tokens
   Style ............ Minimalism & Swiss (verified fit: enterprise dashboards)
   Brand ............ Base Agency navy #0C2445 + signal yellow #FECD08
   Series palette ... validated: lightness band / chroma floor / CVD ΔE 9.0
                     / normal-vision ΔE 19.9 on a #ffffff chart surface.
                     Contrast WARN on slots 3–5 is relieved by the table view
                     every chart ships with.
   ========================================================================= */

/* ---- Brand typeface ----------------------------------------------------
   The @font-face rules live in brand-fonts.css, which is git-ignored along
   with the font files themselves — Base Meridion is licensed and does not
   belong in a public repository. The stack below degrades to the platform
   UI sans on its own, so the published demo renders correctly without it.
   ---------------------------------------------------------------------- */

:root {
  color-scheme: light;

  /* ---- Brand ----------------------------------------------------------- */
  --brand-navy:        #0c2445;
  --brand-navy-700:    #16345c;
  --brand-navy-600:    #1f4373;
  --brand-navy-300:    #6f86a8;
  --brand-yellow:      #fecd08;
  --brand-yellow-600:  #c99f00;

  /* ---- Surfaces -------------------------------------------------------- */
  --plane:             #f4f6fa;   /* page background                        */
  --surface:           #ffffff;   /* cards, chart surface                   */
  --surface-sunken:    #f7f9fc;   /* table headers, inset wells             */
  --surface-hover:     #f1f5fb;
  --sidebar:           #0c2445;
  --sidebar-hover:     #16345c;

  /* ---- Ink ------------------------------------------------------------- */
  --ink:               #0f1e33;
  --ink-secondary:     #4b5a6f;
  /* Darkened from the source system's #77859a, which measured 3.75:1 on the
     card surface. This carries card subtitles, list meta and table meta —
     informational text that has to clear 4.5:1. Now 4.99:1 on #ffffff. */
  --ink-muted:         #64717f;
  --ink-on-dark:       #ffffff;
  --ink-on-dark-dim:   #a9b7cc;

  /* ---- Lines ----------------------------------------------------------- */
  --border:            #e3e8ef;
  --border-strong:     #cdd6e2;
  --gridline:          #edf1f6;
  --axis:              #d5dde7;

  /* ---- Status (fixed — never themed, never reused as a series) ---------- */
  --status-good:       #0ca30c;
  --status-good-bg:    #e8f7e8;
  --status-warning:    #fab219;
  --status-warning-bg: #fff5e0;
  --status-serious:    #ec835a;
  --status-serious-bg: #fdeee7;
  --status-critical:   #d03b3b;
  --status-critical-bg:#fbeaea;
  --status-info-bg:    #e9f0fc;
  --status-neutral-bg: #eef1f6;
  --success-text:      #006300;   /* accessible green for delta text        */

  /* ---- Categorical series (fixed order — never cycled, never by rank) --- */
  --series-1: #2f5fbf;   /* blue    */
  --series-2: #eb6834;   /* orange  */
  --series-3: #1baf7a;   /* aqua    */
  --series-4: #d9a406;   /* yellow  */
  --series-5: #e87ba4;   /* magenta */
  --series-6: #008300;   /* green   */

  /* ---- Sequential ramp (one hue, light → dark) ------------------------- */
  --seq-100: #cde2fb;
  --seq-200: #9ec5f4;
  --seq-300: #6da7ec;
  --seq-400: #3987e5;
  --seq-500: #256abf;
  --seq-600: #184f95;
  --seq-700: #0d366b;

  /* ---- Type ------------------------------------------------------------ */
  /* Base Meridion is loaded only when brand-fonts.css is present. The rest of
     each stack is the platform UI sans, in the order each OS actually has it,
     so the public build lands on a neutral grotesque rather than on Times. */
  --font-ui:  "Base Meridion", system-ui, -apple-system, "Segoe UI Variable Text",
              "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-rtl: "Base Meridion Arabic", "Base Meridion", system-ui, "Segoe UI",
              Tahoma, "Noto Naskh Arabic", "Arial", sans-serif;

  --text-2xs: 0.6875rem;  /* 11px — table meta, chart ticks   */
  --text-xs:  0.75rem;    /* 12px — labels, pills             */
  --text-sm:  0.8125rem;  /* 13px — table body, secondary     */
  --text-base:0.875rem;   /* 14px — UI default                */
  --text-md:  1rem;       /* 16px — body prose                */
  --text-lg:  1.125rem;   /* 18px — card titles               */
  --text-xl:  1.375rem;   /* 22px — page titles               */
  --text-2xl: 1.75rem;    /* 28px — stat values               */
  --text-3xl: 2.5rem;     /* 40px — hero figure               */

  /* ---- Space (dense dashboard scale, 4px rhythm) ----------------------- */
  --space-1: 4px;   --space-2: 8px;   --space-3: 12px;  --space-4: 16px;
  --space-5: 20px;  --space-6: 24px;  --space-8: 32px;  --space-10: 40px;
  --space-12: 48px;

  /* ---- Radius & elevation ---------------------------------------------- */
  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 12px;
  --radius-pill: 999px;

  --shadow-sm:  0 1px 2px rgba(12, 36, 69, 0.06);
  --shadow:     0 1px 3px rgba(12, 36, 69, 0.08), 0 1px 2px rgba(12, 36, 69, 0.04);
  --shadow-md:  0 4px 12px rgba(12, 36, 69, 0.10), 0 1px 3px rgba(12, 36, 69, 0.06);
  --shadow-lg:  0 12px 32px rgba(12, 36, 69, 0.14), 0 2px 8px rgba(12, 36, 69, 0.08);

  /* ---- Motion (shared tokens — one rhythm across the product) ---------- */
  --ease-out:   cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-in-out:cubic-bezier(0.4, 0, 0.2, 1);
  --dur-micro:  120ms;   /* hover, focus, press          */
  --dur-quick:  200ms;   /* pills, chips, tooltips       */
  --dur-panel:  260ms;   /* drawers, modals, menus       */

  /* ---- Layout ---------------------------------------------------------- */
  --sidebar-w: 268px;
  --topbar-h:  60px;
  --z-base: 0; --z-sticky: 20; --z-drawer: 60; --z-modal: 100; --z-toast: 200;
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur-micro: 1ms; --dur-quick: 1ms; --dur-panel: 1ms; }
}

/* ---- Corrections and additions -----------------------------------------
   Kept in a separate block so it stays obvious that these arrived after the
   base palette was drawn, and why each one was needed.
   ----------------------------------------------------------------------- */
:root {
  /* --brand-yellow-600 is a border and fill colour. As text it measures
     2.49:1 on white and fails outright, which is easy to miss because it
     looks fine. This is the gold for anything the reader has to actually
     read: 5.48:1 on #ffffff, 5.20:1 on the sunken surface, and it still
     reads as the same accent. */
  --brand-gold-ink: #8a6208;

  /* Pointer-target floors. 24px is the WCAG 2.2 AA minimum for a mouse;
     44px is what a control deserves when the screen is a touchscreen used
     standing up, and 56px for the fastest-moving control on that screen. */
  --touch:    44px;
  --touch-lg: 56px;
}
