/* SPDX-License-Identifier: Apache-2.0 */
/* Maqāyīs (مَقاييس) — Scholarly Obsidian-Navy & Warm Parchment Design Tokens */

:root,
[data-theme="dark"] {
  --bg-canvas: #06101e;
  --bg-surface: #0b1c31;
  --bg-elevated: #102642;
  --bg-subtle: #153154;
  --bg-glass: rgba(8, 22, 40, 0.86);
  --bg-modal-backdrop: rgba(3, 9, 18, 0.78);

  --text-primary: #f1f5f9;
  --text-secondary: #b8c7db;
  --text-muted: #7f95b2;
  --text-inverse: #071324;

  --accent-gold: #e5c158;
  --accent-gold-strong: #f6da86;
  --accent-gold-soft: rgba(229, 193, 88, 0.14);
  --accent-teal: #2dd4bf;
  --accent-teal-strong: #5eead4;
  --accent-teal-soft: rgba(45, 212, 191, 0.14);
  --accent-blue: #60a5fa;
  --accent-blue-soft: rgba(96, 165, 250, 0.15);

  --status-ok: #34d399;
  --status-ok-bg: rgba(52, 211, 153, 0.14);
  --status-warn: #fbbf24;
  --status-warn-bg: rgba(251, 191, 36, 0.15);
  --status-danger: #fb7185;
  --status-danger-bg: rgba(251, 113, 133, 0.15);

  --border-subtle: rgba(148, 163, 184, 0.18);
  --border-strong: rgba(229, 193, 88, 0.38);
  --border-teal: rgba(45, 212, 191, 0.42);

  --shadow-sm: 0 2px 8px rgba(2, 8, 18, 0.35);
  --shadow-md: 0 10px 28px rgba(2, 8, 18, 0.48);
  --shadow-lg: 0 22px 54px rgba(1, 6, 14, 0.68);
  --focus-ring: 0 0 0 3px rgba(45, 212, 191, 0.45);
}

[data-theme="light"] {
  --bg-canvas: #faf6ee;
  --bg-surface: #ffffff;
  --bg-elevated: #f3ece0;
  --bg-subtle: #e9dfd0;
  --bg-glass: rgba(250, 246, 238, 0.9);
  --bg-modal-backdrop: rgba(15, 30, 50, 0.52);

  --text-primary: #0d1f36;
  --text-secondary: #2e435e;
  --text-muted: #5b708b;
  --text-inverse: #faf6ee;

  --accent-gold: #8c640c;
  --accent-gold-strong: #6e4d06;
  --accent-gold-soft: rgba(164, 118, 16, 0.12);
  --accent-teal: #0f766e;
  --accent-teal-strong: #115e59;
  --accent-teal-soft: rgba(15, 118, 110, 0.11);
  --accent-blue: #1d4ed8;
  --accent-blue-soft: rgba(29, 78, 216, 0.1);

  --status-ok: #047857;
  --status-ok-bg: rgba(4, 120, 87, 0.12);
  --status-warn: #b45309;
  --status-warn-bg: rgba(180, 83, 9, 0.12);
  --status-danger: #be123c;
  --status-danger-bg: rgba(190, 18, 60, 0.11);

  --border-subtle: rgba(15, 35, 62, 0.14);
  --border-strong: rgba(140, 100, 12, 0.38);
  --border-teal: rgba(15, 118, 110, 0.36);

  --shadow-sm: 0 2px 6px rgba(15, 31, 54, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 31, 54, 0.1);
  --shadow-lg: 0 20px 48px rgba(15, 31, 54, 0.18);
  --focus-ring: 0 0 0 3px rgba(15, 118, 110, 0.35);
}

:root {
  --font-serif-ar: "Amiri", "Traditional Arabic", Georgia, serif;
  --font-sans-ar: "IBM Plex Sans Arabic", "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --font-sans-en: "IBM Plex Sans", "IBM Plex Sans Arabic", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --max-width: 1440px;
  --header-height: 68px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 18% 0%, rgba(45, 212, 191, 0.07), transparent 42%),
              radial-gradient(circle at 85% 6%, rgba(229, 193, 88, 0.08), transparent 40%),
              var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans-ar);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

html[lang="en"] body {
  font-family: var(--font-sans-en);
}

.font-classical {
  font-family: var(--font-serif-ar);
  line-height: 1.9;
}

.font-mono {
  font-family: var(--font-mono);
  direction: ltr;
  unicode-bidi: isolate;
}

a {
  color: var(--accent-teal);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-gold-strong);
  text-decoration: underline;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
