/*
  Design tokens. Every colour, size, radius and shadow in the product comes from here.
  A brand customises the look by overriding a handful of these in custom/brand.json
  (served as /brand.css after this file); components never hard-code values.

  The palette is deliberately quiet: neutral surfaces, hairline borders, and the
  brand colour reserved for actions, focus and selection.
*/
:root {
  color-scheme: light;

  /* --- Brand (override via brand.json "colors": accent, accent_ink, accent_dark, accent_ink_dark) --- */
  --brand: #18181b;
  --brand-fg: #ffffff;

  /* --- Surfaces and text (light) --- */
  --bg: #fafafa;
  --surface: #ffffff;
  --border: #e6e6e9;
  --text: #09090b;
  --text-2: #52525b;
  /* The secondary tones are mixed from the ones above, so a brand that sets bg/card/ink keeps one temperature. */
  --surface-2: color-mix(in srgb, var(--text) 4.5%, var(--surface));
  --surface-3: color-mix(in srgb, var(--text) 9%, var(--surface));
  --border-strong: color-mix(in srgb, var(--text) 17%, var(--surface));
  --text-3: color-mix(in srgb, var(--text) 50%, var(--surface));
  --overlay: rgb(9 9 11 / .45);

  /* --- Accent, derived from the brand colour so any brand works in both themes --- */
  --accent: var(--brand);
  --accent-fg: var(--brand-fg);
  --accent-hover: color-mix(in srgb, var(--accent) 88%, #000);
  --accent-soft: color-mix(in srgb, var(--accent) 7%, var(--surface));
  --accent-soft-2: color-mix(in srgb, var(--accent) 13%, var(--surface));
  --accent-text: color-mix(in srgb, var(--accent) 88%, var(--text));
  --focus: color-mix(in srgb, var(--accent) 35%, transparent);
  --ring: 0 0 0 1px var(--accent), 0 0 0 4px var(--focus);

  /* --- Status colours (fixed meaning, never brand-coloured) --- */
  --success: #15803d;   --success-soft: #ecfdf3;
  --warning: #b45309;   --warning-soft: #fff7e8;
  --danger:  #dc2626;   --danger-soft:  #fef2f2;
  --info:    #2563eb;   --info-soft:    #eff5ff;
  --violet:  #7c3aed;   --violet-soft:  #f5f0ff;
  --star:    #f59e0b;   /* review stars */
  --whatsapp: #0f7a41;  /* chat button; white text on it is 5.4:1 */

  /* --- Charts --- */
  --chart-1: var(--accent);
  --chart-2: color-mix(in srgb, var(--accent) 35%, var(--surface-3));
  --chart-grid: var(--border);

  /* --- Typography: the platform UI font for Latin (SF Pro, Segoe UI, Roboto),
         self-hosted Readex Pro for Arabic. --- */
  --font: "Store Arabic", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans Arabic", "Geeza Pro", Arial, sans-serif;
  --font-display: "Store Arabic", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Fraunces", "Store Arabic", ui-serif, "Iowan Old Style", Georgia, serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --fs-2xs: .6875rem; --fs-xs: .75rem;  --fs-sm: .8125rem; --fs-md: .9375rem; --fs-lg: 1.0625rem;
  --fs-xl: 1.25rem;   --fs-2xl: 1.5rem; --fs-3xl: 1.875rem; --fs-4xl: 2.5rem; --fs-5xl: clamp(2.5rem, 6vw, 4.5rem);
  --lh-tight: 1.12; --lh-snug: 1.35; --lh-body: 1.55;

  /* --- Space (4px base) --- */
  --s-0: 0; --s-1: .25rem; --s-2: .5rem; --s-3: .75rem; --s-4: 1rem; --s-5: 1.25rem; --s-6: 1.5rem;
  --s-8: 2rem; --s-10: 2.5rem; --s-12: 3rem; --s-16: 4rem; --s-20: 5rem; --s-24: 6rem;

  /* --- Shape: --radius-k scales every corner (brand.json "radius": sharp | soft | round) --- */
  --radius-k: 1;
  --r-xs: calc(4px * var(--radius-k));
  --r-sm: calc(6px * var(--radius-k));
  --r-md: calc(8px * var(--radius-k));
  --r-lg: calc(12px * var(--radius-k));
  --r-xl: calc(18px * var(--radius-k));
  --r-full: 999px;

  /* --- Elevation: soft, layered, never muddy --- */
  --shadow-xs: 0 1px 1px rgb(9 9 11 / .04);
  --shadow-sm: 0 1px 2px rgb(9 9 11 / .05), 0 1px 1px rgb(9 9 11 / .03);
  --shadow-md: 0 4px 12px -2px rgb(9 9 11 / .08), 0 2px 4px -2px rgb(9 9 11 / .05);
  --shadow-lg: 0 16px 40px -12px rgb(9 9 11 / .18), 0 4px 10px -4px rgb(9 9 11 / .06);
  --shadow-pop: 0 0 0 1px rgb(9 9 11 / .06), 0 12px 32px -8px rgb(9 9 11 / .2);

  /* --- Motion --- */
  --t-fast: 120ms; --t-med: 200ms; --t-slow: 380ms;
  --ease: cubic-bezier(.2, .8, .2, 1);

  /* --- Controls --- */
  --control-h: 40px;
  --control-h-sm: 32px;

  /* --- Layout --- */
  --container: 1280px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 64px;
}
