/* ==========================================================================
   TERMINAL — design tokens
   --------------------------------------------------------------------------
   Dark-first, because this is an instrument panel that stays open for hours.
   Ground is a desaturated blue-black rather than pure black: it avoids OLED
   smearing and leaves room for a real elevation scale above it.

   The accent is periwinkle. It is the only chromatic UI colour that is not
   reserved, which keeps green, red and amber exclusively meaningful — on this
   screen green and red mean profit and loss and nothing else, ever, and amber
   means a warning. That is why the accent is none of those three hues.

   In LIVE mode every accent token is reassigned to crimson (see live-mode.css).
   The whole terminal changes colour when real money is at stake. That is the
   single most important affordance in the product.
   ========================================================================== */

:root {
  /* ---- surfaces: a deliberate elevation ladder ---- */
  --void:        #0A0C10;
  --base:        #0E1014;
  --raised:      #14171C;
  --raised-2:    #1A1E24;
  --overlay:     #22262D;
  --inset:       #090B0E;

  /* ---- lines: hairlines do the spatial work, not shadows ---- */
  --line:        #21252B;
  --line-soft:   #171A1F;
  --line-strong: #5B616B;
  --line-accent: #2C3358;

  /* ---- text ---- */
  --text-hi:     #F2F4F7;
  --text:        #A9B1BC;
  --text-lo:     #838C97;
  --text-dim:    #5C6570;

  /* ---- accent (periwinkle = paper mode; crimson in live) ---- */
  --accent:      #7C90F8;
  --accent-hi:   #98A8FB;
  --accent-lo:   #3C4A8F;
  --accent-wash: rgba(124, 144, 248, 0.13);
  --accent-edge: rgba(124, 144, 248, 0.34);
  --accent-text: #0A0C10;

  /* ---- semantics: reserved, never decorative ---- */
  --pos:         #3ED598;
  --pos-wash:    rgba(62, 213, 152, 0.12);
  --neg:         #FF7566;
  --neg-wash:    rgba(255, 117, 102, 0.12);
  --flat:        #838C97;
  --info:        #63B3E8;
  --info-wash:   rgba(99, 179, 232, 0.12);
  --warn:        #F0B152;
  --warn-wash:   rgba(240, 177, 82, 0.12);
  --crit:        #FF7566;
  --llm:         #B39BFB;
  --llm-wash:    rgba(179, 155, 251, 0.12);

  /* ---- type ---- */
  --f-ui:   "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-num:  "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --fs-micro: 10px;
  --fs-tiny:  11px;
  --fs-sm:    12px;
  --fs-base:  13px;
  --fs-md:    14px;
  --fs-lg:    16px;
  --fs-xl:    20px;
  --fs-2xl:   26px;
  --fs-3xl:   34px;
  --fs-4xl:   46px;

  /* ---- space: a 4px grid, no exceptions ---- */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px;

  /* ---- geometry: softened, not soft. Four to eight pixels reads as a
         considered instrument rather than either a spreadsheet or a phone
         app. Simple mode goes to 14; this deliberately does not. ---- */
  --r-sm: 4px;
  --r:    6px;
  --r-lg: 8px;

  /* ---- chrome dimensions ---- */
  --rail-w:        216px;
  --rail-w-collapsed: 56px;
  --topbar-h:      48px;
  --statusbar-h:   26px;

  /* ---- motion: fast and unobtrusive; this is a tool, not a showreel ---- */
  --t-fast: 90ms;
  --t:      140ms;
  --ease:   cubic-bezier(0.2, 0, 0.2, 1);

  /* ---- row density (overridden by [data-density]) ---- */
  --row-h: 28px;
  --row-pad-y: 5px;
  --row-pad-x: 10px;

  color-scheme: dark;
}

[data-density="comfortable"] {
  --row-h: 36px;
  --row-pad-y: 9px;
  --row-pad-x: 14px;
}

/* --------------------------------------------------------------------------
   Light theme. Offered because some people work in daylight, but the terminal
   is designed dark — light keeps the same structure with inverted surfaces and
   slightly deepened semantics so green and red survive on white.
   -------------------------------------------------------------------------- */
[data-theme="light"] {
  --void:        #EDECE8;
  --base:        #F6F5F2;
  --raised:      #FFFFFF;
  --raised-2:    #FBFAF7;
  --overlay:     #FFFFFF;
  --inset:       #F1F0EC;

  --line:        #E3E1DB;
  --line-soft:   #ECEAE5;
  --line-strong: #8E8B83;
  --line-accent: #C7CDF0;

  --text-hi:     #131519;
  --text:        #474D55;
  --text-lo:     #686E77;
  --text-dim:    #9299A2;

  --accent:      #3B4EC4;
  --accent-hi:   #2C3CA6;
  --accent-lo:   #C7CDF0;
  --accent-wash: rgba(59, 78, 196, 0.13);
  --accent-edge: rgba(59, 78, 196, 0.34);
  --accent-text: #FFFFFF;

  --pos:         #0A7B54;
  --pos-wash:    rgba(10, 123, 84, 0.12);
  --neg:         #C0392C;
  --neg-wash:    rgba(192, 57, 44, 0.12);
  --flat:        #686E77;
  --info:        #1F6FA8;
  --info-wash:   rgba(31, 111, 168, 0.12);
  --llm:         #5B3FBF;
  --llm-wash:    rgba(91, 63, 191, 0.12);

  /* These two were never redefined for light, so an amber picked against a
     near-black ground was carrying over onto white at 1.9:1. Every screen that
     warns about anything was doing it in a colour you could barely read. */
  --warn:        #9A6407;
  --warn-wash:   rgba(154, 100, 7, 0.10);
  --crit:        #C0392C;

  color-scheme: light;
}
