/*
 * Design tokens. Every color, size, duration and easing in the client comes
 * from here. See docs/design/nexum.md.
 */
:root {
  /* Surfaces */
  --bg-0: #05070b;
  --bg-1: #0a0f17;
  --bg-2: #111927;
  --bg-veil: rgb(5 7 11 / 0.82);
  --line: rgb(255 255 255 / 0.1);
  --line-strong: rgb(255 255 255 / 0.22);

  /* Text */
  --text: #e8eef7;
  --text-dim: #9aa7b8;

  /* Signal. --accent and --on-accent are replaced with the player's color. */
  --accent: #35b6ff;
  --on-accent: #05070b;
  --accent-soft: color-mix(in srgb, var(--accent) 18%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 55%, transparent);
  --ok: #46f09a;
  --warn: #ffc247;
  --danger: #ff5d73;
  --node: #ffd23f;
  /* Shots a unit has left. Blue against the amber of energy. */
  --ammo: #6fdcff;
  --guardian: #ff3df0;

  /* Type */
  --font-ui: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono:
    ui-monospace, 'Cascadia Mono', 'Cascadia Code', Consolas, 'SF Mono', Menlo, monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.25rem;
  --text-xl: 1.75rem;
  --text-hero: clamp(2.25rem, 9vw, 3rem);

  /* Space */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;

  /* Shape */
  --radius: 3px;
  --radius-inner: 1px;
  --target: 2.75rem; /* 44px minimum touch target */

  /* Motion: quick, precise, electric */
  --dur-instant: 80ms;
  --dur-quick: 140ms;
  --dur-base: 220ms;
  --dur-expressive: 340ms;
  --dur-cinematic: 600ms;
  --ease-enter: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-exit: cubic-bezier(0.7, 0, 0.84, 0);
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-snap: cubic-bezier(0.34, 1.56, 0.64, 1);
  --stagger: 40ms;
  /* Distance things travel when they enter. Zero when motion is reduced. */
  --travel: 8px;
}

/*
 * Reduced motion keeps every state change but swaps movement for a short fade.
 * It follows the system preference unless the player chose otherwise in
 * Settings (data-motion on <html>).
 */
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion='full']) {
    --dur-quick: 80ms;
    --dur-base: 80ms;
    --dur-expressive: 120ms;
    --dur-cinematic: 160ms;
    --ease-snap: var(--ease-standard);
    --travel: 0px;
  }
}

:root[data-motion='reduced'] {
  --dur-quick: 80ms;
  --dur-base: 80ms;
  --dur-expressive: 120ms;
  --dur-cinematic: 160ms;
  --ease-snap: var(--ease-standard);
  --travel: 0px;
}
