/* Design tokens. Components only reference these variables; a theme is a
   block that overrides them. state/theme.ts sets data-theme on <html>. */

@font-face {
  font-family: "Figtree";
  src: url("/assets/fonts/figtree.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* Surfaces, back to front */
  --surface-app: #181b20;
  --surface-sunken: #121418;
  --surface-sidebar: #20242b;
  --surface-main: #1c1f25;
  --surface-panel: #1b1e24;
  --surface-raised: #23272e;
  --surface-input: #16191e;
  --surface-control: #2a2f37;
  --surface-control-hover: #343a44;
  --surface-selected: #2e3642;
  --surface-overlay: rgba(10, 12, 15, 0.78);
  --surface-scrim: rgba(8, 10, 12, 0.72);

  --border: #2a2f37;
  --border-strong: #343a44;

  /* Text */
  --text: #e6e8eb;
  --text-strong: #f4f6f8;
  --text-secondary: #a3acb8;
  --text-muted: #99a2ae;
  --text-on-accent: #13171c;
  --text-on-avatar: #13171c;
  --text-on-danger: #f4f6f8;

  /* Roles */
  --accent: #88c0d0;
  --accent-hover: #b5dbe5;
  --accent-soft: #2e3d44;
  --success: #a3be8c;
  --danger: #a9474f;
  --danger-hover: #923c43;
  --danger-text: #e28a92;
  --danger-soft: #3a2226;
  --warning: #ebcb8b;
  --focus-ring: #88c0d0;

  /* Avatar fills, picked per user */
  --avatar-1: #88c0d0;
  --avatar-2: #b48ead;
  --avatar-3: #a3be8c;
  --avatar-4: #d08770;
  --avatar-5: #ebcb8b;
  --avatar-6: #81a1c1;
  /* How much of the avatar color a name keeps; the rest is --text-strong. */
  --name-tint: 70%;

  /* Type */
  --font-sans: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --text-xs: 11px;
  --text-caption: 12px;
  --text-sm: 13px;
  --text-md: 14px;
  --text-base: 15px;
  --text-subtitle: 16px;
  --text-lg: 17px;
  --text-title: 20px;
  --text-avatar-xl: 26px;
  --text-xl: 30px;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --leading: 1.5;
  --tracking-caps: 0.08em;

  /* Spacing scale */
  --space-1: 2px;
  --space-2: 4px;
  --space-3: 6px;
  --space-4: 8px;
  --space-5: 10px;
  --space-6: 12px;
  --space-7: 14px;
  --space-8: 16px;
  --space-9: 20px;
  --space-10: 24px;
  --space-11: 28px;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-badge: 9px;
  --radius-lg: 10px;
  --radius-xl: 12px;
  --radius-2xl: 14px;
  --radius-3xl: 16px;
  --radius-4xl: 18px;
  --radius-pill: 999px;

  /* Sizes */
  --sidebar-width: 272px;
  --server-rail-width: 68px;
  --header-height: 60px;
  --control-sm: 24px;
  --control-md: 36px;
  --control-lg: 40px;
  --control-xl: 52px;
  --media-max-w: 400px;
  --media-max-h: 300px;

  --shadow-pop: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-dialog: 0 24px 60px rgba(0, 0, 0, 0.5);
  --transition-fast: 0.1s ease;
}

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

  --surface-app: #e9edf2;
  --surface-sunken: #e1e6ec;
  --surface-sidebar: #f2f4f7;
  --surface-main: #ffffff;
  --surface-panel: #f6f7f9;
  --surface-raised: #eef1f5;
  --surface-input: #ffffff;
  --surface-control: #e3e8ee;
  --surface-control-hover: #d6dde5;
  --surface-selected: #d9e5ee;
  --surface-overlay: rgba(255, 255, 255, 0.88);
  --surface-scrim: rgba(20, 24, 30, 0.4);

  --border: #d5dbe3;
  --border-strong: #bfc8d3;

  --text: #1d242d;
  --text-strong: #0e1318;
  --text-secondary: #46515f;
  --text-muted: #56606e;
  --text-on-accent: #ffffff;
  --text-on-danger: #ffffff;

  --accent: #2b687e;
  --accent-hover: #21566a;
  --accent-soft: #d6e7ee;
  --success: #3a7029;
  --danger: #b0353f;
  --danger-hover: #962c35;
  --danger-text: #a3303a;
  --danger-soft: #f7e0e2;
  --warning: #7d5900;
  --focus-ring: #2b687e;
  --name-tint: 40%;

  --shadow-pop: 0 8px 24px rgba(20, 30, 45, 0.16);
  --shadow-dialog: 0 24px 60px rgba(20, 30, 45, 0.22);
}
