/* tokens.css - Koodak design tokens. Semantic only: components must never
   use raw hex. Light theme is the default; [data-theme="dark"] has full parity.
   Source of truth: .agent/DESIGN-SYSTEM.md sections 2, 4, 8. */

:root {
  color-scheme: light;

  /* ---- surfaces & text (light) ---- */
  --c-bg: #FBFAFF;
  --c-surface: #FFFFFF;
  --c-surface-2: #F4F2FA;
  --c-surface-3: #EAE7F3;
  --c-border: #D8D4E4;
  --c-border-strong: #B6B0C8;
  --c-text: #1B1B21;
  --c-text-2: #4A4757;
  --c-text-3: #6B6879;
  --c-primary: #4758A9;
  --c-primary-hover: #3A4A93;
  --c-on-primary: #FFFFFF;
  --c-primary-soft: #DDE1FF;
  --c-on-primary-soft: #101A4D;
  --c-accent: #7A5A78;
  --c-success: #1B7F4B;
  --c-success-soft: #D6F2E2;
  --c-on-success-soft: #0B3D22;
  --c-warning: #9A5B00;
  --c-warning-soft: #FFE7C7;
  --c-on-warning-soft: #4A2A00;
  --c-danger: #B3261E;
  --c-danger-soft: #FFDAD6;
  --c-on-danger-soft: #410002;
  --c-info: #1F6FB2;
  --c-info-soft: #D6E9FB;
  --c-on-info-soft: #0A2E4A;
  --c-focus: #2F6BFF;
  --c-overlay: rgba(16, 16, 32, 0.44);

  /* ---- avatar gradients (user tiles) ---- */
  --avatar-a1: #4758A9;
  --avatar-a2: #7A5A78;
  --avatar-b1: #1F6FB2;
  --avatar-b2: #56B4E9;
  --avatar-c1: #1B7F4B;
  --avatar-c2: #6DB887;
  --avatar-d1: #B36A00;
  --avatar-d2: #E6A23C;
  --avatar-e1: #B3261E;
  --avatar-e2: #E07870;

  /* ---- chart palette (Okabe-Ito derived; every series also differs by dash/marker) ---- */
  --chart-1: #4758A9;
  --chart-2: #E69F00;
  --chart-3: #009E73;
  --chart-4: #CC79A7;
  --chart-5: #56B4E9;
  --chart-6: #D55E00;
  --chart-7: #7A5A78;
  --chart-8: #6B6879;

  /* ---- spacing (4/8 rhythm) ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* ---- radius ---- */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* ---- elevation ---- */
  --e1: 0 1px 2px rgba(16, 16, 32, .06), 0 1px 3px rgba(16, 16, 32, .10);
  --e2: 0 2px 4px rgba(16, 16, 32, .06), 0 4px 8px rgba(16, 16, 32, .10);
  --e3: 0 4px 8px rgba(16, 16, 32, .08), 0 8px 20px rgba(16, 16, 32, .12);
  --e4: 0 8px 16px rgba(16, 16, 32, .10), 0 16px 40px rgba(16, 16, 32, .16);

  /* ---- motion ---- */
  --m-instant: 80ms;
  --m-fast: 140ms;
  --m-base: 200ms;
  --m-slow: 280ms;
  --ease-out: cubic-bezier(.2, 0, 0, 1);
  --ease-in: cubic-bezier(.4, 0, 1, 1);
  --m-stagger: 40ms;

  /* ---- focus ring ---- */
  --focus-width: 2px;
  --focus-offset: 2px;

  /* ---- type ---- */
  --font-fa: "Vazirmatn", "Vazirmatn FD", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-en: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-body: var(--font-fa);

  --text-display: 40px; --lh-display: 1.25;
  --text-h1: 32px;      --lh-h1: 1.35;
  --text-h2: 26px;      --lh-h2: 1.4;
  --text-h3: 21px;      --lh-h3: 1.45;
  --text-title: 18px;   --lh-title: 1.5;
  --text-body: 16px;    --lh-body: 1.85;
  --text-body-sm: 14px; --lh-body-sm: 1.75;
  --text-label: 14px;   --lh-label: 1.4;
  --text-caption: 12.5px; --lh-caption: 1.5;
  --text-mono: 14px;    --lh-mono: 1.6;

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* ---- layout ---- */
  --content-max: 1280px;
  --measure: 68ch;
  --sidebar-w: 264px;
  --sidebar-w-collapsed: 72px;
  --topbar-h: 64px;
  --bottomnav-h: 64px;

  /* ---- z-index ---- */
  --z-dropdown: 40;
  --z-sticky: 50;
  --z-drawer: 60;
  --z-modal: 70;
  --z-toast: 80;
  --z-top: 90;

  /* ---- control sizes (web targets >= 24px, touch >= 44px) ---- */
  --control-sm: 32px;
  --control-md: 40px;
  --control-lg: 48px;
  --touch-min: 44px;
}

[data-theme="dark"] {
  color-scheme: dark;

  --c-bg: #121218;
  --c-surface: #1A1A22;
  --c-surface-2: #22222C;
  --c-surface-3: #2C2C38;
  --c-border: #3A3A48;
  --c-border-strong: #55556A;
  --c-text: #ECEAF4;
  --c-text-2: #C3C0D0;
  --c-text-3: #9C99AC;
  --c-primary: #B8C4FF;
  --c-primary-hover: #CBD4FF;
  --c-on-primary: #101A4D;
  --c-primary-soft: #2A3468;
  --c-on-primary-soft: #DDE1FF;
  --c-accent: #C9A6C4;
  --c-success: #7FD8A4;
  --c-success-soft: #12331F;
  --c-on-success-soft: #C8F5DA;
  --c-warning: #F0BE7A;
  --c-warning-soft: #3A2A0C;
  --c-on-warning-soft: #FFE3BC;
  --c-danger: #FFB4AB;
  --c-danger-soft: #3E1512;
  --c-on-danger-soft: #FFDAD6;
  --c-info: #9CCBF5;
  --c-info-soft: #10283C;
  --c-on-info-soft: #CBE5FA;
  --c-focus: #8AB4FF;
  --c-overlay: rgba(0, 0, 0, 0.6);

  /* elevation: same geometry, 1.6x alpha for dark surfaces */
  --e1: 0 1px 2px rgba(0, 0, 0, .10), 0 1px 3px rgba(0, 0, 0, .16);
  --e2: 0 2px 4px rgba(0, 0, 0, .10), 0 4px 8px rgba(0, 0, 0, .16);
  --e3: 0 4px 8px rgba(0, 0, 0, .13), 0 8px 20px rgba(0, 0, 0, .20);
  --e4: 0 8px 16px rgba(0, 0, 0, .16), 0 16px 40px rgba(0, 0, 0, .26);
}
