/* LiemComputing design tokens. docs/DESIGN-STANDARD.md explains each one.
   Loaded first on every page, before any other stylesheet. Only custom
   properties live here: nothing is styled by this file on its own.

   Two layers:
   - Palette and scales (--grey-700, --radius-md, --duration-fast): the
     literal values the site uses. A literal in an existing file is replaced
     by the palette token of the same value.
   - Roles (--color-border, --radius-control): what new styles use, so a role
     can be retuned in one place.

   test/design-tokens.test.cjs treats every colour, radius, font size and
   duration defined here as on-token, and fails on new values that are not. */

:root {
  /* Greys. The site is dark grey, never tinted blue or slate. */
  --grey-900: #1e1e1e;
  --grey-875: #292929;
  --grey-850: #252526;
  --grey-800: #2d2d2d;
  --grey-750: #353535;
  --grey-700: #3a3a3a;
  --grey-600: #5a5a5a;
  --grey-400: #9a9a9a;
  --grey-300: #b5b5b5;
  --grey-200: #d4d4d4;
  --grey-100: #e8e8e8;
  --white: #ffffff;
  --black: #000000;

  /* The one blue (owner 11-11), plus the light blue used for focus rings. */
  --blue-600: #285bc1;
  --blue-500: #3e70d0;
  --blue-200: #9ed0ff;

  /* Grade colours: public/js/grade-colors.js TIERS (80% and up good, 50% and
     up mid, below low). from = pill gradient start, solid = pill end, bars and
     borders, text = score written on a dark surface. */
  --green-600: #246b3b;
  --green-500: #2d7f47;
  --green-300: #7cc28e;
  --amber-600: #8a6814;
  --amber-500: #a67e1c;
  --amber-300: #d9b45a;
  --red-600: #8e2d2c;
  --red-500: #a83a38;
  --red-400: #d9534f;
  --red-300: #d97d77;

  /* Colour roles. */
  --color-page: var(--grey-900);
  --color-page-texture: var(--grey-875);
  --color-surface: var(--grey-850);
  --color-raised: var(--grey-800);
  --color-hover: var(--grey-750);
  --color-border: var(--grey-700);
  --color-border-hover: var(--grey-600);
  --color-text-strong: var(--white);
  --color-text: var(--grey-100);
  --color-text-body: var(--grey-200);
  --color-text-secondary: var(--grey-300);
  --color-text-muted: var(--grey-400);
  --color-primary: var(--blue-600);
  --color-primary-hover: var(--blue-500);
  --color-primary-border: var(--blue-500);
  --color-on-primary: var(--white);
  --color-focus: var(--blue-500);
  --color-focus-light: var(--blue-200);
  --color-danger: var(--red-400);
  --color-terminal: var(--black);
  --color-grade-good: var(--green-500);
  --color-grade-good-from: var(--green-600);
  --color-grade-good-text: var(--green-300);
  --color-grade-mid: var(--amber-500);
  --color-grade-mid-from: var(--amber-600);
  --color-grade-mid-text: var(--amber-300);
  --color-grade-low: var(--red-500);
  --color-grade-low-from: var(--red-600);
  --color-grade-low-text: var(--red-300);
  --color-grade-none: var(--grey-750);
  --color-grade-none-from: var(--grey-800);
  --color-grade-none-text: var(--grey-400);
  --color-scrim: rgba(0, 0, 0, 0.6);

  /* Corner radii. Nested corners are concentric:
     inner = outer - border - padding, never below 4px unless 0. */
  --radius-2xs: 2px;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;
  --radius-2xl: 14px;
  --radius-frame: 20px;
  --radius-pill: 999px;
  --radius-round: 50%;

  --radius-tag: var(--radius-xs);
  --radius-chip: var(--radius-sm);
  --radius-control-inner: var(--radius-sm);
  --radius-control: var(--radius-md);
  --radius-row: var(--radius-md);
  --radius-track: var(--radius-lg);
  --radius-card: var(--radius-xl);
  --radius-section: var(--radius-2xl);
  --radius-dialog: var(--radius-xl);

  /* Type. Quicksand for everything; the original JetBrains Mono .ttf
     (Editor-Font face) for code and fixed-width numbers. */
  --font-sans: 'Quicksand', sans-serif;
  --font-mono: Editor-Font, monospace;

  --font-size-3xs: 0.62rem;
  --font-size-2xs: 0.68rem;
  --font-size-xs: 0.72rem;
  --font-size-sm: 0.78rem;
  --font-size-md: 0.82rem;
  --font-size-base: 0.9rem;
  --font-size-lg: 1rem;
  --font-size-xl: 1.15rem;
  --font-size-2xl: 1.6rem;
  --font-size-3xl: 2rem;

  /* Fixed control text (the px files: ELSIE, content preview). 12px is
     button and chip text, 13px input text, 11px small tags, 14px row text. */
  --font-size-tag: 11px;
  --font-size-control: 12px;
  --font-size-input: 13px;
  --font-size-row: 14px;

  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-heavy: 800;

  --line-height-tight: 1.2;
  --line-height-ui: 1.35;
  --line-height-body: 1.5;

  /* Spacing (padding, margin, gap), in px. */
  --space-2: 2px;
  --space-3: 3px;
  --space-4: 4px;
  --space-6: 6px;
  --space-8: 8px;
  --space-10: 10px;
  --space-12: 12px;
  --space-14: 14px;
  --space-16: 16px;
  --space-18: 18px;
  --space-20: 20px;
  --space-24: 24px;
  --space-28: 28px;
  --space-32: 32px;
  --space-40: 40px;

  /* Control heights. */
  --control-height-sm: 26px;
  --control-height: 30px;
  --control-height-md: 34px;
  --control-height-lg: 40px;

  /* Elevation. Cards in the page have none; only what floats has a shadow. */
  --shadow-notice: 0 4px 10px rgba(0, 0, 0, 0.35);
  --shadow-popover: 0 12px 28px rgba(0, 0, 0, 0.36);
  --shadow-sticky: 0 8px 18px rgba(0, 0, 0, 0.2);
  --shadow-dialog: 0 24px 60px rgba(0, 0, 0, 0.5);
  --ring-focus-input: 0 0 0 3px rgba(40, 91, 193, 0.28);

  /* Motion. Never shortened or removed; only the site's own Reduce
     animations switch (html.liem-reduce-animations) turns it off. */
  --duration-120: 120ms;
  --duration-140: 140ms;
  --duration-150: 150ms;
  --duration-160: 160ms;
  --duration-180: 180ms;
  --duration-200: 200ms;
  --duration-220: 220ms;
  --duration-240: 240ms;
  --duration-260: 260ms;
  --duration-280: 280ms;
  --duration-300: 300ms;
  --duration-320: 320ms;
  --duration-380: 380ms;

  --duration-press: var(--duration-120);
  --duration-hover: var(--duration-150);
  --duration-fast: var(--duration-160);
  --duration-base: var(--duration-200);
  --duration-enter: var(--duration-240);
  --duration-leave: var(--duration-200);
  --duration-glide: var(--duration-320);
  --duration-slow: var(--duration-380);

  --ease-standard: ease;
  --ease-out: ease-out;
  --ease-glide: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-move: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-enter: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-exit: cubic-bezier(0.4, 0, 1, 1);
}
