/* =============================================================
   BasmatDecor — Design Tokens (single source of truth)
   -------------------------------------------------------------
   Phase 0 of the Design Audit & Upgrade report
   (assests/docs/Basmat_Decor_Design_Audit_and_Upgrade.md).

   Rules:
   1. New CSS must consume these tokens — never raw hex values.
   2. The five legacy aliases at the bottom (--primary-color,
      --secondary-color, --light-background, --black-background,
      --white) keep the Webflow-era theme CSS working until it is
      retired. This file is their ONLY definition point — the theme's
      local :root shadow copy was deleted in the Phase 1 consolidation.
   3. rgba() gold variants (194,145,91 / 207,160,112 / 205,162,116)
      are still literal in site.css — they collapse onto --gold-500/
      --gold-600 in Phase 1 via color-mix().
   ============================================================= */

:root {
  /* ---------- Ink (cool slate) — text & dark surfaces ---------- */
  --ink-950: #171717;   /* header CTA, darkest chrome */
  --ink-night: #23272c; /* projects hero backdrop */
  --ink-900: #292f36;   /* brand slate: headings, dark buttons */
  --ink-800: #252c35;   /* hero title over photo */
  --ink-700: #3f464f;   /* long-form body copy */
  --ink-600: #454b52;   /* footer links */
  --ink-500: #51565d;   /* secondary body copy */
  --ink-400: #62666b;   /* meta text, captions */
  --ink-300: #8a857f;   /* quiet labels, pagination */

  /* ---------- Gold (brand accent) ---------- */
  --gold-500: #cda274;  /* primary accent — lines, marks, hover fills */
  --gold-600: #c2915b;  /* deeper gold — shadows, borders */
  --gold-700: #8c725d;  /* text gold on light surfaces - WCAG 4.49:1 on white,
                         3.96:1 on sand-200 (passes 3:1 large-text, not 4.5:1 normal) */
  --gold-800: #7d6650;  /* AA-normal tier for small gold text on light surfaces
                           (~5.9:1 on the sand-300 wash — the audit §12.4 note:
                           "Strict AA-normal on sand would need a darker ~#7d6650") */

  /* ---------- Sand (warm light backgrounds) ---------- */
  --sand-50: #fffdf8;   /* lightest — buttons, empty states */
  --sand-100: #faf8f5;  /* nav hover, brand strip */
  --sand-200: #f4f0ec;  /* legacy --light-background — cards */
  --sand-250: #f4efea;  /* counters band, footer mark */
  --sand-300: #f7f1e9;  /* page hero washes */
  --sand-400: #ded6cb;  /* image placeholders, hero fallback */

  --sand-line: #e7e3df; /* footer hairlines */

  /* ---------- Semantic surfaces ---------- */
  --surface-page: #ffffff;
  --surface-card: #ffffff;   /* cards are white on the light page (Phase 2.2:
                                re-pointed from the sand-200 alias — 0 existing
                                consumers at audit time) */
  --surface-inset: #fdfbf7;  /* the warm inset paper (faq card, pdx insets) */
  --surface-glass: rgba(255, 255, 255, 0.92); /* form skeleton panel */
  --surface-glass-soft: rgba(255, 255, 255, 0.72); /* quote pill over washes */
  --surface-dark: #292f36;   /* theme-INVARIANT dark slabs: pdx buttons, CTA
                                bands (kept literal on purpose — in dark mode
                                these stay dark; re-aliased from --ink-900,
                                which flips with the theme since Phase 2.2) */

  /* rgb triplets for rgba() tint lines — flip with the theme */
  --ink-900-rgb: 31, 37, 45;
  --gold-500-rgb: 205, 162, 116;
  --gold-tint-rgb: 194, 145, 91;

  /* ---------- Home hero wash (site.css §8) ---------- */
  /* rgb triplet of the veil over the home hero photograph — sand-300
     family in light. Dark mode re-pins it to warm charcoal (the dark
     page tone) so the theme-following inks keep their contrast over
     the wash: the veil flips with the theme instead of staying a
     literal light panel under light copy. */
  --hero-wash-rgb: 247, 241, 233;

  /* ---------- Hairlines (gold-tinted) ---------- */
  --line-ink: rgba(27, 35, 47, 0.12);
  --line-gold: rgba(194, 145, 91, 0.5);
  --line-gold-soft: rgba(207, 160, 112, 0.2);

  /* ---------- Radii ---------- */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 34px;
  --radius-2xl: 54px;
  --radius-pill: 999px;

  /* The signature Egyptian arch — image frames and identity shapes. */
  --radius-arch: var(--radius-pill) var(--radius-pill) 26px 26px;
  --radius-hero: 0 0 0 190px;
  /* Declared arch scale — sub-levels of the signature motifs:
     the hero sweep shrinks in the breakpoints; the "بصمة" brand-mark
     cap repeats in header and footer. */
  --radius-hero-md: 0 0 0 120px;
  --radius-hero-sm: 0 0 0 70px;
  --radius-cap-lg: 18px 18px 0 0;
  --radius-cap-sm: 9px 9px 0 0;

  /* ---------- Shadows ---------- */
  --shadow-card: 0 18px 40px rgba(31, 37, 45, 0.08);
  --shadow-card-hover: 0 26px 54px rgba(31, 37, 45, 0.14);
  --shadow-float: 0 24px 48px rgba(31, 37, 45, 0.14);
  --shadow-gold: 0 12px 26px rgba(194, 145, 91, 0.4);

  /* ---------- Motion ---------- */
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 0.2s;
  --dur-med: 0.3s;
  --dur-slow: 0.45s;

  /* ---------- Typography ---------- */
  /* Cairo (variable 200–1000) is the body face. Phase 2.4: the display slot
     is now Readex Pro (variable 200–700, self-hosted arabic/latin subsets,
     OFL — see fonts/ReadexPro-OFL.txt). Chosen via the 4-face live demo
     among Cairo / Alexandria / Readex Pro / Noto Kufi Arabic.
     Note: Readex carries ≤700 natively — the 800 asked on some headings
     clamps to 700 (engine behaviour, no faux-bold synthesis); flagged for
     the human pass in §17. */
  --font-body: 'Cairo', 'Helvetica Neue', Helvetica, 'Segoe UI', Verdana, sans-serif;
  --font-display: 'Readex Pro', 'Cairo', 'Helvetica Neue', Helvetica, 'Segoe UI', Verdana, sans-serif;
  --font-numeric: 'Jost', sans-serif; /* latin digits only — counters */

  /* ---------- Layout ---------- */
  --container-max: 940px; /* .w-container's effective width */
  /* --header-h is measured and set by site.js at runtime. */

  /* =============================================================
     Legacy aliases — consumed by basmat-decor-theme.css and the
     existing site.css sections. This file is now the ONLY definition
     point (the theme's local :root shadow copy was deleted in Phase 1).
     Do not remove until the Webflow theme CSS is retired.
     ============================================================= */
  --primary-color: var(--gold-500);
  --secondary-color: var(--ink-900);
  --light-background: var(--sand-200);
  --black-background: #4d5053; /* template legacy, near-unused */
  --white: var(--surface-page); /* template-era alias, 14 uses inside the theme primitives */
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 0s;
    --dur-med: 0s;
    --dur-slow: 0s;
  }
}

/* =============================================================
   Phase 2.2 — dark mode (first-class, warm charcoal)
   -------------------------------------------------------------
   Activated three ways, in order of precedence:
   1. [data-theme='dark'] on <html> — user's explicit toggle.
   2. No stored value → OS via prefers-color-scheme (JS sets the
      attribute; no media query here so both toggles and OS stay
      one mechanism).
   3. Default = light.
   The ink/sand ladders flip tone-role (ink = text → becomes light;
   sand = surfaces → becomes dark). Theme-INVARIANT pieces:
   --surface-dark slabs, the gold accent family, photo scrims,
   the ink-950/ink-night chrome.
   ============================================================= */
[data-theme='dark'] {
  color-scheme: dark;

  /* text ladder — light on dark */
  --ink-900: #ece7df;   /* headings, strong text */
  --ink-800: #ded8ce;
  --ink-700: #c8c2b8;   /* long-form body */
  --ink-600: #afa9a0;
  --ink-500: #969088;   /* secondary body copy */
  --ink-400: #7c766e;   /* meta, captions */
  --ink-300: #6f6962;   /* quiet labels */

  /* rgb triplet follows the flipped ink-900 */
  --ink-900-rgb: 236, 231, 224;

  /* surface ladder — dark warm */
  --sand-50: #26211a;   /* hovered fills, subtle chips */
  --sand-100: #252019;
  --sand-200: #241f18;  /* cards, scrollbar track */
  --sand-250: #211c15;  /* counters band */
  --sand-300: #1e1913;  /* section washes */
  --sand-400: #342a1e;  /* image placeholders */
  --sand-line: #332b22;

  --surface-page: #17140f;
  --surface-card: #241f18;
  --surface-inset: #282118;
  --surface-glass: rgba(34, 29, 22, 0.92); /* form skeleton panel — the alpha
                                              light-mode had, kept for parity */
  --surface-glass-soft: rgba(38, 32, 25, 0.78);

  /* text-gold flips to a lighter face to keep ≥4.5:1 on dark cards */
  --gold-700: #cdb091;

  /* hairlines flip direction */
  --line-ink: rgba(236, 231, 224, 0.14);

  /* home hero wash: the sand veil becomes warm charcoal (dark
     --surface-page tone) so light copy still sits on a dark base */
  --hero-wash-rgb: 23, 18, 12;

  /* legacy aliases follow the flipped ladders */
  --secondary-color: var(--ink-900);   /* implicit (kept for pdx/labels) */
  --light-background: var(--sand-200); /* implicit */
  --black-background: var(--ink-500);  /* used as TEXT in the theme CSS */
}
