/* Design tokens — Desire Ops. Single source of truth for colour, spacing,
   type, radius, shadow, and motion. Never hardcode these values elsewhere. */

:root {
  /* ── Colour: dark theme — JARVIS brand (azure + gold on near-black) ──── */
  --bg:            #07090e;
  --surface-1:     #0f131b;
  --surface-2:     #161b26;
  --surface-3:     #1d2330;
  --border:        rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.13);

  --text:          #e9ebf1;
  --text-muted:    #9aa1b2;
  --text-dim:      #6b7283;

  /* Primary accent — JARVIS azure (logo "SPC" / left rule) */
  --accent:        #0e9fe0;
  --accent-strong: #36b3ec;
  --accent-soft:   rgba(14, 159, 224, 0.15);
  --accent-ring:   rgba(14, 159, 224, 0.45);
  --accent-contrast: #06121d;   /* text/icon colour that sits on --accent */

  /* Secondary accent — JARVIS gold (logo "DM" / right rule / A-mark) */
  --gold:          #f1bc0b;
  --gold-strong:   #ffce3a;
  --gold-soft:     rgba(241, 188, 11, 0.14);

  --positive:      #36d399;
  --positive-soft: rgba(54, 211, 153, 0.13);
  --warning:       var(--gold);
  --warning-soft:  var(--gold-soft);
  --danger:        #f06a6a;
  --danger-soft:   rgba(240, 106, 106, 0.13);

  /* ── Spacing scale: 4 / 8 / 16 / 24 / 32 / 48 / 64 ──────────────────── */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 16px;
  --sp-4: 24px;
  --sp-5: 32px;
  --sp-6: 48px;
  --sp-7: 64px;

  /* ── Radius ─────────────────────────────────────────────────────────── */
  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-full: 999px;

  /* ── Typography ─────────────────────────────────────────────────────── */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-xs:   0.75rem;   /* 12 */
  --fs-sm:   0.875rem;  /* 14 */
  --fs-base: 1rem;      /* 16 */
  --fs-md:   1.125rem;  /* 18 */
  --fs-lg:   1.375rem;  /* 22 */
  --fs-xl:   1.75rem;   /* 28 */
  --fs-2xl:  2.25rem;   /* 36 */
  --lh-tight: 1.2;
  --lh-base:  1.55;

  /* ── Shadow ─────────────────────────────────────────────────────────── */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.30);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.50);

  /* ── Motion ─────────────────────────────────────────────────────────── */
  --ease:       cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 160ms var(--ease);

  /* ── Layout ─────────────────────────────────────────────────────────── */
  --sidebar-w: 244px;
  --topbar-h:  64px;
  --content-max: 1180px;
  --tap-min:   44px;   /* minimum touch-target on coarse pointers (Apple HIG) */
}

/* ── Light theme — same JARVIS azure/gold, tuned for contrast on white ──── */
[data-theme="light"] {
  --bg:            #f4f6f9;
  --surface-1:     #ffffff;
  --surface-2:     #f4f6f9;
  --surface-3:     #e9edf2;
  --border:        rgba(16, 24, 40, 0.09);
  --border-strong: rgba(16, 24, 40, 0.16);

  --text:          #161b24;
  --text-muted:    #586073;
  --text-dim:      #8a92a3;

  --accent:        #0c84c2;
  --accent-strong: #0a6b9e;
  --accent-soft:   rgba(12, 132, 194, 0.11);
  --accent-ring:   rgba(12, 132, 194, 0.38);
  --accent-contrast: #ffffff;

  --gold:          #b07f08;
  --gold-strong:   #936a05;
  --gold-soft:     rgba(176, 127, 8, 0.13);

  --positive:      #1f9d6b;
  --positive-soft: rgba(31, 157, 107, 0.12);
  --danger:        #d6453f;
  --danger-soft:   rgba(214, 69, 63, 0.11);

  /* --warning / --warning-soft inherit from --gold / --gold-soft above */

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 20px 50px rgba(16, 24, 40, 0.12);
}

@media (prefers-reduced-motion: reduce) {
  :root { --transition: 0ms; }
}
