/**
 * tokens.css — Design tokens.
 *
 * Every visual constant in DigiPoke lives here: colours, spacing, radii,
 * typography, motion and elevation. Themes are pure token overrides keyed off
 * [data-theme], so adding a palette never touches component CSS.
 */

:root {
  /* ------------------------------------------------------------ palette */
  --bg:            #070b16;
  --bg-elev-1:     #0d1324;
  --bg-elev-2:     #141c33;
  --bg-elev-3:     #1c2745;
  --surface:       rgba(255, 255, 255, 0.045);
  --surface-hover: rgba(255, 255, 255, 0.085);
  --border:        rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);

  --text:          #e8edf9;
  --text-dim:      #a8b3cc;
  --text-faint:    #6f7d99;

  --accent:        #7c5cff;
  --accent-2:      #23d5ff;
  --accent-soft:   rgba(124, 92, 255, 0.16);
  --ok:            #4fd67c;
  --warn:          #ffd166;
  --danger:        #ff5f6d;
  --glitch:        #ff5fa2;

  /* --------------------------------------------------------- typography */
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --fs-xs: 0.72rem;
  --fs-sm: 0.82rem;
  --fs-md: 0.95rem;
  --fs-lg: 1.1rem;
  --fs-xl: 1.4rem;
  --fs-2xl: 1.9rem;

  /* ------------------------------------------------------------ spacing */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 22px;
  --sp-6: 30px;
  --sp-7: 44px;

  /* -------------------------------------------------------------- shape */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;
  --r-full: 999px;

  /* ----------------------------------------------------------- elevation */
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 6px 20px rgba(0, 0, 0, 0.35);
  --shadow-3: 0 22px 60px rgba(0, 0, 0, 0.55);

  /* -------------------------------------------------------------- motion */
  --dur-fast: 120ms;
  --dur: 190ms;
  --dur-slow: 340ms;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);

  /* --------------------------------------------------------------- chrome */
  --topbar-h: 58px;
  --tabbar-h: 62px;
  --content-max: 1180px;
}

/* ---------------------------------------------------------------- themes */

[data-theme="ember"] {
  --bg: #120806;
  --bg-elev-1: #1c0e0a;
  --bg-elev-2: #2a1610;
  --bg-elev-3: #3a1d14;
  --accent: #ff7a45;
  --accent-2: #ffd166;
  --accent-soft: rgba(255, 122, 69, 0.18);
}

[data-theme="abyss"] {
  --bg: #03080f;
  --bg-elev-1: #061420;
  --bg-elev-2: #0a2032;
  --bg-elev-3: #0e2c44;
  --accent: #00e0c6;
  --accent-2: #3db4ff;
  --accent-soft: rgba(0, 224, 198, 0.14);
}

[data-theme="mono"] {
  --bg: #0a0a0b;
  --bg-elev-1: #131316;
  --bg-elev-2: #1c1c21;
  --bg-elev-3: #27272e;
  --accent: #d4d4d8;
  --accent-2: #a1a1aa;
  --accent-soft: rgba(212, 212, 216, 0.12);
  --ok: #a1a1aa;
  --danger: #e4e4e7;
}

/* Respect the OS reduced-motion preference globally; the app also has its own
   "Animations" setting, which scales durations rather than removing motion. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 0ms;
    --dur: 0ms;
    --dur-slow: 0ms;
  }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================ extended design vocabulary
   Tokens added for the opening sequence, the character creator and the
   polished battle feedback layer. Kept separate from the core palette so the
   themes above stay readable.
   ====================================================================== */
:root {
  /* Type ramp */
  --fs-2xs: 11px;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 15px;
  --fs-lg: 18px;
  --fs-xl: 24px;
  --fs-2xl: 32px;
  --fs-3xl: clamp(34px, 9vw, 60px);

  /* Layout */
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shell-max: 1080px;
  --creator-max: 1120px;

  /* Feedback colours (used by floating numbers, ghost bars, coach cards) */
  --crit: #ffcf5c;
  --super: #ffd27a;
  --weak: #8aa0c0;
  --heal: #57e39b;
  --ghost: rgba(255, 255, 255, 0.28);

  /* Effects */
  --glow: 0 0 30px var(--accent-soft);
  --ring-shadow: 0 0 0 1px var(--border);

  /* Motion */
  --dur-fast: 120ms;
  --dur: 240ms;
  --dur-slow: 480ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-motion="off"] *,
[data-motion="off"] *::before,
[data-motion="off"] *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
}
