@font-face {
  font-family: "Alexandria";
  src: url("/brand/fonts/alexandria-400.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Alexandria";
  src: url("/brand/fonts/alexandria-600.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("/brand/fonts/ibm-plex-sans-arabic-400.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("/brand/fonts/ibm-plex-sans-arabic-500.ttf") format("truetype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("/brand/fonts/ibm-plex-sans-arabic-600.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("/brand/fonts/ibm-plex-sans-arabic-700.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/brand/fonts/inter-400.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/brand/fonts/inter-500.ttf") format("truetype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/brand/fonts/inter-600.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/brand/fonts/inter-700.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url("/brand/fonts/montserrat-700.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --brand-primary: #8e4585;
  --brand-accent: #c080b9;
  --brand-frosted: #f1eff3;
  --brand-silver: #c8c5d0;
  --font-brand: "Montserrat", "Inter", sans-serif;
  --font-interface: "Alexandria", "IBM Plex Sans Arabic", "Inter", "Segoe UI", sans-serif;
  --font-data: "Inter", "IBM Plex Sans Arabic", sans-serif;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --radius-control: 10px;
  --radius-panel: 14px;
  --duration-fast: 150ms;
  --duration-standard: 220ms;
  --ease-standard: cubic-bezier(0.2, 0.7, 0.2, 1);
  --glass-bg: rgba(255, 255, 255, 0.055);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-shadow: 0 12px 32px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  --color-background: #0d0b10;
  --color-surface: #1b1620;
  --color-surface-raised: #211b26;
  --color-surface-soft: #17131b;
  --color-text: #f7f5f8;
  --color-text-secondary: #bdb5c1;
  --color-text-quiet: #bdb5c1;
  --color-border: rgba(241, 239, 243, 0.12);
  --color-border-strong: rgba(241, 239, 243, 0.2);
  --color-accent: #c080b9;
  --color-accent-strong: #c080b9;
  --color-accent-ink: #211922;
  --color-control-hover: rgba(241, 239, 243, 0.08);
  --color-chart-up: #c080b9;
  --color-chart-down: #f1eff3;
  --color-chart-grid: rgba(241, 239, 243, 0.09);
  --shadow-panel: 0 10px 28px rgba(0, 0, 0, 0.18);
  --shadow-popover: 0 16px 38px rgba(0, 0, 0, 0.28);
}

:root[data-theme="light"] {
  color-scheme: light;
  --brand-frosted: #eae6ed;
  --brand-silver: #777180;
  --glass-bg: rgba(255, 255, 255, 0.76);
  --glass-border: rgba(70, 49, 74, 0.1);
  --glass-shadow: 0 10px 28px rgba(42, 22, 46, 0.06);
  --color-background: #faf8fb;
  --color-surface: #ffffff;
  --color-surface-raised: #ffffff;
  --color-surface-soft: #f4f0f5;
  --color-text: #211922;
  --color-text-secondary: #625b67;
  --color-text-quiet: #625b67;
  --color-border: rgba(70, 49, 74, 0.11);
  --color-border-strong: rgba(70, 49, 74, 0.18);
  --color-accent: #783670;
  --color-accent-strong: #8e4585;
  --color-accent-ink: #ffffff;
  --color-control-hover: rgba(120, 54, 112, 0.08);
  --color-chart-up: #8e4585;
  --color-chart-down: #2b2431;
  --color-chart-grid: rgba(43, 36, 49, 0.1);
  --shadow-panel: 0 10px 28px rgba(42, 22, 46, 0.06);
  --shadow-popover: 0 16px 38px rgba(42, 22, 46, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-interface);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: var(--color-background);
  color: var(--color-text);
  font-size: 15px;
  line-height: 1.55;
  transition: background-color var(--duration-standard) var(--ease-standard), color var(--duration-standard) var(--ease-standard);
}

::selection {
  background: var(--brand-primary);
  color: #ffffff;
}

:focus-visible {
  outline: 2px solid var(--color-accent-strong);
  outline-offset: 3px;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  border-color: var(--glass-border);
  background-color: var(--color-surface-soft) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--color-surface-soft) inset;
  box-shadow: 0 0 0 1000px var(--color-surface-soft) inset;
  -webkit-text-fill-color: var(--color-text);
  caret-color: var(--color-text);
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

img,
svg {
  display: block;
}

[dir="ltr"],
.numeric {
  font-family: var(--font-data);
  font-variant-numeric: tabular-nums lining-nums;
}

.brand-name,
.brand-wordmark-text,
.topbar-context-label {
  font-family: var(--font-brand);
  font-weight: 700;
}

.theme-toggle {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
  backdrop-filter: blur(14px) saturate(110%);
  -webkit-backdrop-filter: blur(14px) saturate(110%);
}

.theme-toggle:hover {
  border-color: var(--color-border-strong);
  background: var(--color-control-hover);
}

.theme-toggle:active {
  background: var(--color-control-hover);
}

.theme-toggle svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.theme-icon-dark {
  display: none;
}

:root[data-theme="light"] .theme-icon-light {
  display: none;
}

:root[data-theme="light"] .theme-icon-dark {
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
