/* Design tokens. Components use only these variables, so a theme is a token swap. */
@font-face {
  font-family: "Cairo";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/cairo-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "Cairo";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/cairo-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Cairo";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/cairo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Brand */
  --brand-blue: #1f9bd8;
  --brand-yellow: #ffd21f;
  --brand-navy: #071521;

  /* Type */
  --font: "Cairo", "Segoe UI", Tahoma, system-ui, sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-md: 0.9375rem;
  --text-lg: 1.0625rem;
  --text-xl: clamp(1.375rem, 1.1rem + 1vw, 1.875rem);
  --text-metric: clamp(1.625rem, 1.3rem + 1.2vw, 2.25rem);

  /* Space (4px grid) and shape */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --page-gutter: clamp(16px, 2.6vw, 32px);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --control-height: 40px;
  --sidebar-width: 264px;
  --topbar-height: 64px;
  --content-max: 1440px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  /* Light theme (default) */
  color-scheme: light;
  --bg: #f3f6f9;
  --surface: #ffffff;
  --surface-2: #f6f9fb;
  --surface-hover: #eef3f7;
  --border: #e1e8ee;
  --border-strong: #c9d5df;
  --text: #0f1e2b;
  --text-muted: #5a6b7b;
  --primary: #0d6fa8;
  --primary-hover: #0b5d8d;
  --primary-soft: #e3f1fa;
  --on-primary: #ffffff;
  --accent: var(--brand-yellow);
  --on-accent: #1a1a12;
  --success: #12704f;
  --success-soft: #e2f4ec;
  --warning: #855400;
  --warning-soft: #fff2d1;
  --danger: #b42318;
  --danger-soft: #fdebe9;
  --violet: #5b4bc4;
  --violet-soft: #ecebfb;
  --sidebar-bg: #ffffff;
  --sidebar-text: #334453;
  --sidebar-active-bg: var(--primary-soft);
  --sidebar-active-text: var(--primary);
  --backdrop: rgba(7, 21, 33, 0.45);
  --shadow-sm: 0 1px 2px rgba(15, 30, 43, 0.06), 0 1px 3px rgba(15, 30, 43, 0.05);
  --shadow-lg: 0 18px 48px rgba(15, 30, 43, 0.18);
  --focus: 0 0 0 3px rgba(31, 155, 216, 0.45);

  /* Data visualization: categorical slots in fixed order (validated for colour-vision deficiency
     on the light surface), and a single-hue activity scale built from the primary colour. */
  --chart-1: #2a78d6;
  --chart-2: #eb6834;
  --chart-3: #1baf7a;
  --chart-4: #eda100;
  --chart-5: #e87ba4;
  --chart-6: #4a3aa7;
  --chart-grid: #e8edf1;
  --heat-0: var(--surface-hover);
  --heat-1: color-mix(in srgb, var(--primary) 22%, var(--surface));
  --heat-2: color-mix(in srgb, var(--primary) 45%, var(--surface));
  --heat-3: color-mix(in srgb, var(--primary) 70%, var(--surface));
  --heat-4: var(--primary);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a1117;
  --surface: #111b23;
  --surface-2: #15212b;
  --surface-hover: #1a2833;
  --border: #22313d;
  --border-strong: #31444f;
  --text: #e7eff5;
  --text-muted: #94a7b6;
  --primary: #5bbcf0;
  --primary-hover: #7cc9f3;
  --primary-soft: #14344a;
  --on-primary: #06131c;
  --success: #5ad6a0;
  --success-soft: #10322a;
  --warning: #ffcf6b;
  --warning-soft: #3a2d10;
  --danger: #ff8f85;
  --danger-soft: #3d1c1a;
  --violet: #b2a8ff;
  --violet-soft: #29244d;
  --sidebar-bg: #0d161d;
  --sidebar-text: #c3d2dd;
  --sidebar-active-bg: #16303f;
  --sidebar-active-text: #ffffff;
  --backdrop: rgba(0, 0, 0, 0.6);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.55);
  --focus: 0 0 0 3px rgba(91, 188, 240, 0.5);

  /* The same hues stepped for the dark surface. */
  --chart-1: #3987e5;
  --chart-2: #d95926;
  --chart-3: #199e70;
  --chart-4: #c98500;
  --chart-5: #d55181;
  --chart-6: #9085e9;
  --chart-grid: #1d2a34;
  --heat-0: #17232d;
  --heat-1: color-mix(in srgb, var(--primary) 25%, var(--surface));
  --heat-2: color-mix(in srgb, var(--primary) 48%, var(--surface));
  --heat-3: color-mix(in srgb, var(--primary) 72%, var(--surface));
  --heat-4: var(--primary);
}
