@import url("https://fonts.googleapis.com/css2?family=Almarai:wght@400;700;800&family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&display=swap");

:root {
  /* ── shadcn base tokens ───────────────────────────────────────── */
  --background: oklch(0.935 0.04 100);
  --foreground: oklch(0.27 0.045 258);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.27 0.045 258);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.27 0.045 258);
  --primary: oklch(0.33 0.05 258);
  --primary-foreground: oklch(0.96 0.03 100);
  --secondary: oklch(0.89 0.045 98);
  --secondary-foreground: oklch(0.27 0.045 258);
  --muted: oklch(0.9 0.04 99);
  --muted-foreground: oklch(0.44 0.03 258);
  --accent: oklch(0.9 0.04 99);
  --accent-foreground: oklch(0.27 0.045 258);
  --destructive: oklch(0.52 0.18 8);
  --destructive-foreground: oklch(0.985 0.01 100);
  --border: oklch(0.82 0.045 98);
  --input: oklch(0.82 0.045 98);
  --ring: oklch(0.76 0.115 80);
  --success: oklch(0.5 0.11 150);
  --warning: oklch(0.76 0.115 80);
  --chart-1: oklch(0.59 0.17 5);
  --chart-2: oklch(0.76 0.115 80);
  --chart-3: oklch(0.33 0.05 258);
  --chart-4: oklch(0.82 0.045 98);
  --chart-5: oklch(0.55 0.07 200);
  --sidebar: oklch(0.33 0.05 258);
  --sidebar-foreground: oklch(0.935 0.04 100);
  --sidebar-primary: oklch(0.76 0.115 80);
  --sidebar-primary-foreground: oklch(0.27 0.045 258);
  --sidebar-accent: oklch(0.39 0.05 258);
  --sidebar-accent-foreground: oklch(0.96 0.03 100);
  --sidebar-border: oklch(0.43 0.045 258);
  --sidebar-ring: oklch(0.76 0.115 80);

  /* ── surface hierarchy ────────────────────────────────────────── */
  --background-secondary: oklch(0.905 0.042 99);
  --surface-hover:   color-mix(in srgb, var(--foreground) 6%,  var(--background));
  --surface-active:  color-mix(in srgb, var(--foreground) 10%, var(--background));
  --surface-elevated: oklch(1 0 0);

  /* ── border hierarchy ─────────────────────────────────────────── */
  --border-subtle: oklch(0.91 0.035 99);
  --border-muted: oklch(0.87 0.04 98);
  --border-strong: oklch(0.72 0.05 96);

  /* ── text hierarchy ───────────────────────────────────────────── */
  --foreground-secondary: oklch(0.37 0.04 258);

  /* ── primary depth (hover/tint states for brand colour) ─────── */
  --primary-hover: color-mix(in srgb, var(--primary) 90%, var(--foreground));
  --primary-muted: color-mix(in srgb, var(--primary) 15%, var(--background));
  --primary-soft:  color-mix(in srgb, var(--primary) 8%,  var(--background));
  --primary-tint:  color-mix(in srgb, var(--primary) 6%,  var(--background));

  /* ── highlight: the theme's second brand colour, a fill only (never text) ── */
  --highlight: oklch(0.76 0.115 80);
  --highlight-foreground: oklch(0.27 0.045 258);

  /* ── focus ring (alpha-blended, for soft ring style) ────────── */
  --focus-ring: oklch(0.76 0.115 80 / 0.5);

  /* ── error (form validation — distinct from destructive) ─────── */
  --error: oklch(0.52 0.18 8);
  --error-foreground: oklch(0.985 0.01 100);

  /* ── radius ───────────────────────────────────────────────────── */
  --radius: 0.75rem;
  --radius-none: 0rem;
  --radius-sm: 0.5rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  /* ── typography ───────────────────────────────────────────────── */
  --font-display: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --font-sans: Almarai, ui-sans-serif, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, monospace;
  --font-weight-display: 400;
  --line-height-display: 1.2;
  --tracking-display: 0em;
  --font-weight-body: 400;
  --line-height-body: 1.5;
  --tracking-body: 0em;
  --font-weight-mono: 400;

  /* ── shadows ──────────────────────────────────────────────────── */
  --shadow-sm: 0 1px 0 oklch(0.82 0.045 98);
  --shadow-md: 0 6px 18px oklch(0.27 0.045 258 / 0.1);
  --shadow-lg: 0 16px 40px oklch(0.27 0.045 258 / 0.18);

  /* ── motion ───────────────────────────────────────────────────── */
  --duration-fast: 120ms;
  --duration-normal: 200ms;
  --duration-slow: 300ms;
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-accelerate: cubic-bezier(0.4, 0, 1, 1);
  --ease-decelerate: cubic-bezier(0, 0, 0.2, 1);

  /* ── spacing ──────────────────────────────────────────────────── */
  --spacing-base: 0.25rem;
}

.dark {
  /* ── shadcn base tokens ───────────────────────────────────────── */
  --background: oklch(0.2 0.035 258);
  --foreground: oklch(0.94 0.035 100);
  --card: oklch(0.26 0.04 258);
  --card-foreground: oklch(0.94 0.035 100);
  --popover: oklch(0.26 0.04 258);
  --popover-foreground: oklch(0.94 0.035 100);
  --primary: oklch(0.78 0.115 80);
  --primary-foreground: oklch(0.22 0.04 258);
  --secondary: oklch(0.31 0.045 258);
  --secondary-foreground: oklch(0.94 0.035 100);
  --muted: oklch(0.3 0.04 258);
  --muted-foreground: oklch(0.78 0.04 98);
  --accent: oklch(0.31 0.045 258);
  --accent-foreground: oklch(0.94 0.035 100);
  --destructive: oklch(0.56 0.18 8);
  --destructive-foreground: oklch(0.985 0.01 100);
  --border: oklch(0.94 0.035 100 / 14%);
  --input: oklch(0.94 0.035 100 / 20%);
  --ring: oklch(0.78 0.115 80);
  --success: oklch(0.74 0.13 150);
  --warning: oklch(0.8 0.115 80);
  --chart-1: oklch(0.68 0.16 5);
  --chart-2: oklch(0.78 0.115 80);
  --chart-3: oklch(0.7 0.06 258);
  --chart-4: oklch(0.82 0.045 98);
  --chart-5: oklch(0.7 0.08 200);
  --sidebar: oklch(0.28 0.045 258);
  --sidebar-foreground: oklch(0.94 0.035 100);
  --sidebar-primary: oklch(0.78 0.115 80);
  --sidebar-primary-foreground: oklch(0.22 0.04 258);
  --sidebar-accent: oklch(0.34 0.05 258);
  --sidebar-accent-foreground: oklch(0.96 0.03 100);
  --sidebar-border: oklch(0.94 0.035 100 / 14%);
  --sidebar-ring: oklch(0.78 0.115 80);

  /* ── surface hierarchy ────────────────────────────────────────── */
  --background-secondary: oklch(0.23 0.038 258);
  --surface-hover:   color-mix(in srgb, var(--foreground) 6%,  var(--background));
  --surface-active:  color-mix(in srgb, var(--foreground) 10%, var(--background));
  --surface-elevated: oklch(0.3 0.045 258);

  /* ── border hierarchy ─────────────────────────────────────────── */
  --border-subtle: oklch(0.94 0.035 100 / 7%);
  --border-muted: oklch(0.94 0.035 100 / 10%);
  --border-strong: oklch(0.94 0.035 100 / 26%);

  /* ── text hierarchy ───────────────────────────────────────────── */
  --foreground-secondary: oklch(0.85 0.04 99);

  /* ── primary depth ────────────────────────────────────────────── */
  --primary-hover: color-mix(in srgb, var(--primary) 90%, var(--foreground));
  --primary-muted: color-mix(in srgb, var(--primary) 22%, var(--background));
  --primary-soft:  color-mix(in srgb, var(--primary) 12%, var(--background));
  --primary-tint:  color-mix(in srgb, var(--primary) 8%, var(--background));

  /* ── highlight ────────────────────────────────────────────────── */
  --highlight: oklch(0.78 0.115 80);
  --highlight-foreground: oklch(0.22 0.04 258);

  /* ── focus ring ───────────────────────────────────────────────── */
  --focus-ring: oklch(0.78 0.115 80 / 0.5);

  /* ── error ────────────────────────────────────────────────────── */
  --error: oklch(0.74 0.15 8);
  --error-foreground: oklch(0.2 0.035 258);

  /* ── radius ───────────────────────────────────────────────────── */
  --radius: 0.75rem;
  --radius-none: 0rem;
  --radius-sm: 0.5rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  /* ── typography ───────────────────────────────────────────────── */
  --font-mono: ui-monospace, SFMono-Regular, monospace;
  --font-weight-display: 400;
  --line-height-display: 1.2;
  --tracking-display: 0em;
  --font-weight-body: 400;
  --line-height-body: 1.6;
  --tracking-body: 0.01em;
  --font-weight-mono: 400;

  /* ── shadows ──────────────────────────────────────────────────── */
  --shadow-sm: 0 1px 0 oklch(0.94 0.035 100 / 0.1);
  --shadow-md: 0 6px 18px oklch(0 0 0 / 0.3);
  --shadow-lg: 0 16px 40px oklch(0 0 0 / 0.45);

  /* ── motion ───────────────────────────────────────────────────── */
  --duration-fast: 120ms;
  --duration-normal: 200ms;
  --duration-slow: 300ms;
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-accelerate: cubic-bezier(0.4, 0, 1, 1);
  --ease-decelerate: cubic-bezier(0, 0, 0.2, 1);

  /* ── spacing ──────────────────────────────────────────────────── */
  --spacing-base: 0.25rem;
}
