/*
 * ============================================================================
 * SOREX — DESIGN TOKENS
 * Single source of truth for all visual properties.
 * Load this file BEFORE all other stylesheets.
 *
 * Usage:
 *   - Brand tokens: --brand-*
 *   - Neutral scale: --neutral-*
 *   - Status colors: --status-*
 *   - Typography: --type-*
 *   - Spacing: --space-*
 *   - Radii: --radius-*
 *   - Shadows: --shadow-*
 *   - Motion: --motion-*
 *
 * Context-specific stylesheets alias these tokens to local names.
 * Example: --kin-orange: var(--brand-orange);
 * ============================================================================
 */

:root {
  /* ─────────────────────────────────────────────
     1. BRAND COLORS
     ───────────────────────────────────────────── */
  --brand-orange:       #ff7a1a;
  --brand-orange-light: #ff8a3a;
  --brand-orange-dark:  #e86a10;
  --brand-orange-rgb:   255, 122, 26;

  --brand-ink:          #050914;
  --brand-ink-light:    #0a1326;
  --brand-ink-rgb:      5, 9, 20;

  --brand-white:        #f4f0e8;
  --brand-white-rgb:    244, 240, 232;

  /* ─────────────────────────────────────────────
     2. NEUTRAL SCALE (warm gray — matches brand warmth)
     ───────────────────────────────────────────── */
  --neutral-50:   #fafaf9;
  --neutral-100:  #f5f5f4;
  --neutral-150:  #ececec;
  --neutral-200:  #e7e5e4;
  --neutral-300:  #d6d3d1;
  --neutral-400:  #a8a29e;
  --neutral-500:  #78716c;
  --neutral-600:  #57534e;
  --neutral-700:  #44403c;
  --neutral-800:  #292524;
  --neutral-900:  #1c1917;
  --neutral-950:  #0c0a09;

  /* ─────────────────────────────────────────────
     3. SEMANTIC / STATUS COLORS
     ───────────────────────────────────────────── */
  --status-success:      #10b981;
  --status-success-light:#34d399;
  --status-success-dark: #059669;
  --status-success-bg:   #d1fae5;
  --status-success-rgb:  16, 185, 129;

  --status-warning:      #f59e0b;
  --status-warning-light:#fbbf24;
  --status-warning-dark: #d97706;
  --status-warning-bg:   #fef3c7;
  --status-warning-rgb:  245, 158, 11;

  --status-danger:       #ef4444;
  --status-danger-light: #f87171;
  --status-danger-dark:  #dc2626;
  --status-danger-bg:    #fee2e2;
  --status-danger-rgb:   239, 68, 68;

  --status-info:         #3b82f6;
  --status-info-light:   #60a5fa;
  --status-info-dark:    #2563eb;
  --status-info-bg:      #dbeafe;
  --status-info-rgb:     59, 130, 246;

  /* Logistics-specific status colors */
  --status-transit:      #f5a524;
  --status-customs:      #38bdf8;
  --status-delivered:    #4ade80;
  --status-urgent:       #f43f5e;

  /* ─────────────────────────────────────────────
     4. TYPOGRAPHY
     ───────────────────────────────────────────── */
  --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono:  'JetBrains Mono', 'SF Mono', Menlo, 'Fira Code', monospace;

  /* Type scale */
  --type-xs:    0.75rem;    /* 12px */
  --type-sm:    0.875rem;   /* 14px */
  --type-base:  1rem;       /* 16px */
  --type-lg:    1.125rem;   /* 18px */
  --type-xl:    1.25rem;    /* 20px */
  --type-2xl:   1.5rem;     /* 24px */
  --type-3xl:   1.875rem;   /* 30px */
  --type-4xl:   2.25rem;    /* 36px */
  --type-5xl:   3rem;       /* 48px */

  /* Font weights */
  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;
  --weight-black:    900;

  /* Line heights */
  --leading-none:    1;
  --leading-tight:   1.25;
  --leading-snug:    1.375;
  --leading-normal:  1.5;
  --leading-relaxed: 1.625;

  /* Letter spacing */
  --tracking-tight:  -0.025em;
  --tracking-normal: 0;
  --tracking-wide:   0.05em;
  --tracking-wider:  0.1em;

  /* ─────────────────────────────────────────────
     5. SPACING SCALE
     ───────────────────────────────────────────── */
  --space-0:   0;
  --space-1:   0.25rem;   /* 4px */
  --space-2:   0.5rem;    /* 8px */
  --space-3:   0.75rem;   /* 12px */
  --space-4:   1rem;      /* 16px */
  --space-5:   1.25rem;   /* 20px */
  --space-6:   1.5rem;    /* 24px */
  --space-8:   2rem;      /* 32px */
  --space-10:  2.5rem;    /* 40px */
  --space-12:  3rem;      /* 48px */
  --space-16:  4rem;      /* 64px */
  --space-20:  5rem;      /* 80px */
  --space-24:  6rem;      /* 96px */

  /* ─────────────────────────────────────────────
     6. BORDER RADIUS
     ───────────────────────────────────────────── */
  --radius-none: 0;
  --radius-sm:   0.375rem;  /* 6px */
  --radius-md:   0.5rem;    /* 8px */
  --radius-lg:   0.75rem;   /* 12px */
  --radius-xl:   1rem;      /* 16px */
  --radius-2xl:  1.5rem;    /* 24px */
  --radius-full: 9999px;

  /* ─────────────────────────────────────────────
     7. SHADOWS
     ───────────────────────────────────────────── */
  --shadow-xs:    0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm:    0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md:    0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg:    0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl:    0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-2xl:   0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);

  /* Brand-colored shadows */
  --shadow-orange-sm:  0 2px 8px rgba(255, 122, 26, 0.25);
  --shadow-orange-md:  0 4px 16px rgba(255, 122, 26, 0.4);
  --shadow-orange-lg:  0 14px 40px -22px rgba(255, 122, 26, 0.65);

  /* ─────────────────────────────────────────────
     8. MOTION / TRANSITIONS
     ───────────────────────────────────────────── */
  --motion-fast:   120ms;
  --motion-base:   200ms;
  --motion-slow:   320ms;
  --motion-slower: 500ms;

  --ease-default:  cubic-bezier(0.2, 0, 0, 1);
  --ease-in:       cubic-bezier(0.4, 0, 1, 1);
  --ease-out:      cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out:   cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring:   cubic-bezier(0.16, 1, 0.3, 1);

  /* ─────────────────────────────────────────────
     9. LAYOUT
     ───────────────────────────────────────────── */
  --container-sm:  640px;
  --container-md:  768px;
  --container-lg:  1024px;
  --container-xl:  1180px;
  --container-2xl: 1440px;

  --sidebar-w:          248px;
  --sidebar-w-collapsed: 64px;
  --topbar-h:           52px;
  --header-h:           64px;
  --row-h:              52px;
}

/* ─────────────────────────────────────────────
   REDUCED MOTION — global accessibility
   ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  :root {
    --motion-fast:   0.001ms;
    --motion-base:   0.001ms;
    --motion-slow:   0.001ms;
    --motion-slower: 0.001ms;
  }
}
