/* ============================================================================
   AIST DESIGN SYSTEM — CORE TOKENS (raw, brand-level, medium-agnostic)
   ----------------------------------------------------------------------------
   Single source of truth. These are RAW values only — no roles, no context.
   Nothing in the product/site should reference these directly; consume the
   SEMANTIC tokens in semantic.css instead. Change a brand value here → it
   propagates everywhere.
   ========================================================================== */

:root {
  /* ---- Brand accent (the one and only action color) --------------------- */
  --aist-orange:          #E1602F;   /* canonical brand orange (light themes) */
  --aist-orange-hover:    #C14F21;   /* pressed / hover on light             */
  --aist-orange-dark:     #EC7444;   /* accent on dark themes                */
  --aist-orange-dark-hover:#F6885B;  /* pressed / hover on dark              */
  --aist-orange-tint:     #F3ECE4;   /* warm beige tint behind orange text   */
  --aist-orange-tint-2:   #FBE9E0;   /* peach tint for orange chips/eyebrows */

  /* ---- Warm neutral ramp (ONE ramp for the whole brand) ----------------- */
  /* White is a SURFACE, not a mood. Cream is the warm base. No cold grays.  */
  --aist-white:           #FFFFFF;
  --aist-cream:           #F4F1EC;   /* warm base (product background)        */
  --aist-cream-2:         #EEEAE3;   /* deeper cream (sidebars, insets)       */
  --aist-warm-100:        #F1EDE7;   /* chip / hover surface                  */
  --aist-warm-200:        #E7E2DA;   /* subtle fills, track backgrounds       */

  --aist-ink:             #1A1917;   /* primary text                          */
  --aist-ink-2:           #5C5952;   /* secondary text                        */
  --aist-ink-3:           #9B978F;   /* tertiary text / captions              */
  --aist-ink-4:           #B3AEA6;   /* disabled / quaternary                 */

  /* Borders as alpha-on-ink so they read correctly over white AND cream.    */
  --aist-border-soft:     rgba(0, 0, 0, 0.06);
  --aist-border:          rgba(0, 0, 0, 0.08);
  --aist-border-mid:      rgba(0, 0, 0, 0.12);
  --aist-border-hover:    rgba(0, 0, 0, 0.28);
  --aist-hover-veil:      rgba(0, 0, 0, 0.05);
  --aist-shadow:          rgba(0, 0, 0, 0.14);
  --aist-glow:            #F8EDE4;   /* warm radial glow (product bg)         */
  --aist-dot:             #DBD5CB;   /* hero backdrop grid dot — warm grey    */
  --aist-dot-accent:      var(--aist-orange);  /* ~12% of dots               */

  /* ---- Warm dark ramp (dark theme) -------------------------------------- */
  --aist-d-bg:            #181819;
  --aist-d-surface:       #262629;
  --aist-d-surface-2:     #1E1E20;
  --aist-d-chip:          #323236;
  --aist-d-text:          #F4F4F6;
  --aist-d-text-2:        #C4C4CA;
  --aist-d-text-3:        #9A9AA2;
  --aist-d-text-4:        #7A7A82;
  --aist-d-border-soft:   rgba(255, 255, 255, 0.07);
  --aist-d-border:        rgba(255, 255, 255, 0.12);
  --aist-d-border-mid:    rgba(255, 255, 255, 0.18);
  --aist-d-border-hover:  rgba(255, 255, 255, 0.34);
  --aist-d-hover-veil:    rgba(255, 255, 255, 0.06);
  --aist-d-shadow:        rgba(0, 0, 0, 0.45);
  --aist-d-glow:          #201F1E;   /* muted dark glow — no bloom            */
  --aist-d-tooltip-bg:    #3A3A3E;   /* tooltip surface on dark              */

  /* ---- Semantic status hues (state, never decoration) -------------------
     A state colour plays TWO roles and therefore carries TWO values:

       surface  fill, icon, dot, 3px rail, border  — non-text, >= 3:1
       text     the label itself ("Overdue", "Conflict")  — >= 4.5:1

     One value cannot serve both: tuned for the label it burns the fill,
     tuned for the fill it fails the label. WCAG 2.1 says the same thing
     in two clauses — 1.4.11 for non-text, 1.4.3 for text — and a palette
     that ignores the split answers neither.

     Measured on the PRODUCT canvas (cream #F4F1EC), on the plate
     (#FFFFFF) and, for the text half, on its own -bg tint. Light amber
     was the one surface value below the bar: #B8842B gave 2.925:1 on
     cream, i.e. it failed even the soft threshold and was unfit in any
     role. It is now #B17F29 — 3.14:1 on cream, 3.54:1 on white.

     Dark theme needs no separate text half: on graphite the same values
     clear 4.5:1 on canvas, plate and tint alike (lowest measured 4.72:1,
     danger on a tinted plate). That is measured, not assumed.

     The five text values stay distinguishable from one another after the
     darkening — closest pair (warn/danger) 55.9 in RGB distance. Meeting
     contrast by turning warning into overdue would trade one defect for
     a worse one.                                                        */
  --aist-ok:              #3F9142;   --aist-ok-bg:    #E6F2E6;   --aist-ok-dark:   #84CC8B;
  --aist-ai:              #7A5BD6;   --aist-ai-bg:    #EFE9FB;   --aist-ai-dark:   #BCA4F4;
  --aist-info:            #3B6FB0;   --aist-info-bg:  #E4EDF7;   --aist-info-dark: #8FB6E6;
  --aist-warn:            #B17F29;   --aist-warn-bg:  #F5EAD6;   --aist-warn-dark:  #E6B865;
  --aist-danger:          #C4462F;   --aist-danger-bg:#F6E3DE;   --aist-danger-dark:#EE8E78;

  /* Text half of each state colour — for the label, never for the fill. */
  --aist-ok-text:         #347937;
  --aist-ai-text:         #7251D4;
  --aist-info-text:       #396BAA;
  --aist-warn-text:       #886220;
  --aist-danger-text:     #B3402B;

  /* ---- Type families ----------------------------------------------------- */
  /* Geist + Geist Mono. Both cover Latin + Cyrillic + Greek (current builds) */
  --aist-font-sans: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --aist-font-mono: 'Geist Mono', ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;

  /* ---- Type weights ------------------------------------------------------ */
  --aist-weight-regular:  400;
  --aist-weight-medium:   500;
  --aist-weight-semibold: 600;
  --aist-weight-bold:     700;
  --aist-weight-black:    800;

  /* ---- Radius scale (unified — between the old site 2px and product 16px) */
  --aist-radius-xs:   4px;    /* chips, tags, tiny controls              */
  --aist-radius-sm:   8px;    /* buttons, inputs, small cards            */
  --aist-radius-md:   12px;   /* cards, tiles                            */
  --aist-radius-lg:   16px;   /* panels, popovers, modals, large cards   */
  --aist-radius-full: 9999px; /* pills, avatars, round icon buttons      */

  /* ---- Spacing scale (4px base) ----------------------------------------- */
  --aist-space-1:   4px;
  --aist-space-2:   8px;
  --aist-space-3:   12px;
  --aist-space-4:   16px;
  --aist-space-5:   20px;
  --aist-space-6:   24px;
  --aist-space-8:   32px;
  --aist-space-10:  40px;
  --aist-space-12:  48px;
  --aist-space-16:  64px;
  --aist-space-20:  80px;
  --aist-space-24:  96px;
  --aist-space-32:  128px;

  /* ---- Motion ------------------------------------------------------------ */
  --aist-ease:        cubic-bezier(0.4, 0, 0.2, 1);
  --aist-dur-fast:    0.12s;
  --aist-dur:         0.18s;
  --aist-dur-slow:    0.32s;
  --aist-dur-sheet:   0.35s;   /* mobile menu/chat slide in/out             */

  /* ---- Breakpoint -------------------------------------------------------- */
  /* One line: < 1024px = mobile model (single zone, overlays). See guides.  */
  --aist-bp-mobile:   1024px;
}
