/* Evokes Business Software — design tokens
   Companion to EBS-UI-UX-Specification.md, section 4.
   Use these variables. No raw hex in component code. */

:root {
  /* Chrome — dark. Top bar, suite shell, sign-in, launcher. */
  --chrome:            #0F1620;
  --chrome-2:          #18212C;
  --chrome-ink:        #F4F7FA;
  --chrome-muted:      #A9B6C4;
  --chrome-line:       rgba(255, 255, 255, 0.10);

  /* Work surface — light. Everything below the top bar. */
  --bg:                #F6F7F9;
  --surface:           #FFFFFF;
  --surface-2:         #EEF1F4;
  --line:              #E3E8ED;
  --line-strong:       #CBD3DC;

  /* Text */
  --ink:               #121A22;
  --muted:             #5A6773;
  --dim:               #6B7988;   /* lightest grey permitted for text, 13px and above */

  /* Primary action — graphite, deliberately not a colour */
  --primary:           #2B3540;
  --primary-hover:     #1B232C;
  --primary-ink:       #FFFFFF;

  /* Brand accent — brass. Brand moments and active states only.
     Never a primary action. Never a warning. */
  --accent:            #A9712A;   /* fills and borders */
  --accent-strong:     #8A5C21;   /* text and icons on white */
  --accent-tint:       #F8F1E6;

  /* Status — each differs in lightness as well as hue */
  --ok:                #1C6B45;   --ok-bg:      #E6F2EC;
  --info:              #1F4E8C;   --info-bg:    #E6EEF9;
  --warn:              #8A4B10;   --warn-bg:    #FBF0E4;
  --danger:            #A3221E;   --danger-bg:  #FBE9E8;
  --neutral:           #5A6773;   --neutral-bg: #EEF1F4;

  /* Product identity — tiles, switcher, cross-links only */
  --orbit:             #3258D1;
  --pulse:             #037D76;
  --compass:           #A9712A;
  --ceydesk:           #00847C;

  /* Type */
  --font: Inter, "Segoe UI", system-ui, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;

  /* Radius */
  --r-control: 8px;
  --r-card:    12px;
  --r-modal:   16px;
  --r-pill:    100px;

  /* Elevation — two levels, no more */
  --shadow-1: 0 1px 2px rgba(18, 26, 34, .05);
  --shadow-2: 0 1px 2px rgba(18, 26, 34, .05), 0 12px 28px -12px rgba(18, 26, 34, .18);

  /* Motion */
  --t-fast: .14s ease;
  --t-base: .2s ease;
}

/* Dark mode.
   The chrome is dark in both themes, so only the work surface, the text and the status
   colours are restated. Nothing else in the application names a colour, so every component
   follows from here.

   Three selectors, in order: the reader's own choice when it is dark, the system preference
   when the reader has made no choice, and the same preference again for a reader who chose
   light explicitly — which must keep the light values. */
:root[data-theme="dark"] {
  --bg:                #0B1118;
  --surface:           #141C25;
  --surface-2:         #1C2631;
  --line:              #242F3B;
  --line-strong:       #33404E;

  --ink:               #E8EDF3;
  --muted:             #9FADBC;
  --dim:               #8795A4;

  --primary:           #2F3C49;
  --primary-hover:     #3B4A59;
  --primary-ink:       #F4F7FA;

  --accent:            #C08A3E;
  --accent-strong:     #D8A15A;
  --accent-tint:       #2A2015;

  --ok:                #5CC48E;   --ok-bg:      #14271F;
  --info:              #7FB2FF;   --info-bg:    #152130;
  --warn:              #E0A458;   --warn-bg:    #2A2015;
  --danger:            #F3818A;   --danger-bg:  #2C171A;
  --neutral:           #9FADBC;   --neutral-bg: #1C2631;

  --orbit:             #6E8DEB;
  --pulse:             #2FA79F;
  --compass:           #D8A15A;
  --ceydesk:           #2FA79F;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, .40);
  --shadow-2: 0 1px 2px rgba(0, 0, 0, .40), 0 12px 28px -12px rgba(0, 0, 0, .60);

  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:                #0B1118;
    --surface:           #141C25;
    --surface-2:         #1C2631;
    --line:              #242F3B;
    --line-strong:       #33404E;

    --ink:               #E8EDF3;
    --muted:             #9FADBC;
    --dim:               #8795A4;

    --primary:           #2F3C49;
    --primary-hover:     #3B4A59;
    --primary-ink:       #F4F7FA;

    --accent:            #C08A3E;
    --accent-strong:     #D8A15A;
    --accent-tint:       #2A2015;

    --ok:                #5CC48E;   --ok-bg:      #14271F;
    --info:              #7FB2FF;   --info-bg:    #152130;
    --warn:              #E0A458;   --warn-bg:    #2A2015;
    --danger:            #F3818A;   --danger-bg:  #2C171A;
    --neutral:           #9FADBC;   --neutral-bg: #1C2631;

    --orbit:             #6E8DEB;
    --pulse:             #2FA79F;
    --compass:           #D8A15A;
    --ceydesk:           #2FA79F;

    --shadow-1: 0 1px 2px rgba(0, 0, 0, .40);
    --shadow-2: 0 1px 2px rgba(0, 0, 0, .40), 0 12px 28px -12px rgba(0, 0, 0, .60);

    color-scheme: dark;
  }
}

/* Printing is always on white, whatever the screen is set to. */
@media print {
  :root, :root[data-theme="dark"] {
    --bg:          #FFFFFF;
    --surface:     #FFFFFF;
    --surface-2:   #FFFFFF;
    --line:        #CCCCCC;
    --line-strong: #999999;
    --ink:         #000000;
    --muted:       #333333;
    --dim:         #444444;
    color-scheme: light;
  }
}

/* Every number in a column, total or figure */
.num, td.num, .figure {
  font-variant-numeric: tabular-nums;
}

/* Codes, identifiers, reference numbers */
.code, .ref {
  font-family: var(--mono);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
