/*
 * Sabi Code — design tokens.
 *
 * Two sources, both recorded, neither invented:
 *
 *  1. Ant Design's own token scale, verified 2026-09-24 against ant.design:
 *     colorPrimary #1677ff, borderRadius 6, fontSize 14, controlHeight 32, and
 *     the 12/14/16/20/24/30/38 type scale. The rhythm below is antd's.
 *  2. The previous palette, extracted from FreeLLMAPI's published stylesheet.
 *     It is kept only where it does not fight the dark base.
 *
 * Why the base is dark: glassmorphism is decorative on a flat white page.
 * Frosted panels need something behind them to refract, and white text on a
 * deep backdrop is the combination that keeps text contrast where
 * white-on-white-glass does not. Dark is the load-bearing choice here, not a
 * mood.
 *
 * The accent is singular. One blue. No second hue competes with it.
 */

:root {
  /* ---- brand, from Ant Design ---- */
  --primary: #1677ff;
  --primary-hover: #4096ff;
  --primary-active: #0958d9;
  --primary-soft: rgba(22, 119, 255, 0.16);
  --primary-border: rgba(22, 119, 255, 0.42);

  --success: #52c41a;
  --warning: #faad14;
  --error: #ff4d4f;
  --error-soft: rgba(255, 77, 79, 0.14);
  --error-border: rgba(255, 77, 79, 0.4);

  /* ---- surfaces: a deep, slightly blue slate so the accent sits in it ---- */
  --bg: #0b0f17;
  --bg-deep: #070a10;
  --fg: #f2f5fa;
  --fg-muted: #a6b0c3;
  /* 7.5:1 on --bg, clearing WCAG AAA for the small print that uses it.
     The previous #6b7789 measured 4.22:1 and failed AA — this token is only
     ever used for secondary text, so it must still be readable. */
  --fg-faint: #95a3b8;

  /* ---- glass ----
     The blur needs a fallback colour behind it: backdrop-filter is still
     unsupported in enough places that a panel with no background is a panel
     with unreadable text. */
  --glass: rgba(255, 255, 255, 0.055);
  --glass-strong: rgba(255, 255, 255, 0.085);
  --glass-border: rgba(255, 255, 255, 0.11);
  --glass-border-bright: rgba(255, 255, 255, 0.2);
  --glass-blur: 20px;
  /* Two light sources, not one: a top rim so the panel has an edge, and a
     deep drop so it sits above the backdrop rather than on it. */
  --glass-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 18px 48px rgba(0, 0, 0, 0.42);
  --glass-shadow-sm:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 8px 22px rgba(0, 0, 0, 0.3);

  /* ---- type: the antd scale, verbatim ---- */
  --font-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, monospace;

  --fs-xs: 0.75rem;    /* antd 12 */
  --fs-sm: 0.875rem;   /* antd 14 — the base size */
  --fs-md: 1rem;       /* antd 16 */
  --fs-lg: 1.25rem;    /* antd 20 */
  --fs-xl: 1.5rem;     /* antd 24 */
  --fs-2xl: 1.875rem;  /* antd 30 */
  --fs-3xl: 2.375rem;  /* antd 38 */

  --lh-tight: 1.1;
  --lh-heading: 1.25;
  --lh-body: 1.65;

  /* ---- spacing: antd's 4/8/12/16/24/32 ---- */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;
  --sp-9: 6rem;

  /* ---- antd component metrics ---- */
  --radius-sm: 4px;   /* borderRadiusSM */
  --radius: 6px;      /* borderRadius — antd's base */
  --radius-lg: 8px;   /* borderRadiusLG */
  --control-h: 32px;  /* controlHeight */
  --control-h-lg: 40px;

  --shell: 1160px;
  --measure: 66ch;

  /* Named z-index scale. No 9999. */
  --z-base: 0;
  --z-backdrop: -1;
  --z-header: 20;
  --z-overlay: 40;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
