/* ==========================================================================
   TIRAZ - Design System : Foundations
   Tokens, reset, typography, utilities
   ========================================================================== */

/* ---------- Design Tokens ---------- */
:root {
  /* Brand palette - warm tailoring neutrals + brass */
  --ink:        #141210;
  --ink-2:      #201D19;
  --ink-3:      #2E2A24;
  --graphite:   #4A443C;
  --muted:      #7E766A;
  --line:       #E5DED2;
  --line-2:     #EFEAE1;
  --bone:       #F7F3EC;
  --bone-2:     #FBF9F5;
  --paper:      #FFFFFF;

  --brass:      #B58E4F;
  --brass-2:    #C9A468;
  --brass-3:    #E4CFA5;
  --brass-glow: rgba(181, 142, 79, .18);

  --olive:      #3C463A;
  --clay:       #8A5A46;
  --sale:       #8C2F39;
  --success:    #3F6B4F;

  /* Semantic */
  --bg:         var(--bone-2);
  --surface:    var(--paper);
  --text:       var(--ink);
  --text-soft:  var(--graphite);
  --text-dim:   var(--muted);
  --border:     var(--line);
  --accent:     var(--brass);

  /* Typography */
  --f-display: "Reem Kufi", "Noto Kufi Arabic", "Segoe UI", Tahoma, sans-serif;
  --f-body:    "IBM Plex Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  --f-latin:   "Jost", "Segoe UI", Helvetica, Arial, sans-serif;
  --f-serif:   "Cormorant Garamond", Georgia, serif;

  --fs-xs:   .75rem;
  --fs-sm:   .8125rem;
  --fs-base: .9375rem;
  --fs-md:   1rem;
  --fs-lg:   1.125rem;
  --fs-xl:   1.375rem;
  --fs-2xl:  1.75rem;
  --fs-3xl:  2.25rem;
  --fs-4xl:  3rem;
  --fs-5xl:  4rem;

  /* Space */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-7: 32px; --sp-8: 40px;
  --sp-9: 56px; --sp-10: 72px; --sp-11: 96px; --sp-12: 128px;

  /* Radius */
  --r-xs: 3px; --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-xl: 24px; --r-full: 999px;

  /* Elevation - warm-tinted, never pure black */
  --sh-1: 0 1px 2px rgba(32, 26, 18, .05);
  --sh-2: 0 2px 8px rgba(32, 26, 18, .06), 0 1px 2px rgba(32, 26, 18, .04);
  --sh-3: 0 8px 24px rgba(32, 26, 18, .08), 0 2px 6px rgba(32, 26, 18, .04);
  --sh-4: 0 18px 48px rgba(32, 26, 18, .12), 0 4px 12px rgba(32, 26, 18, .06);
  --sh-5: 0 32px 80px rgba(32, 26, 18, .18);

  /* Motion */
  --e-out: cubic-bezier(.22, 1, .36, 1);
  --e-in-out: cubic-bezier(.65, 0, .35, 1);
  --t-fast: .18s var(--e-out);
  --t-med:  .32s var(--e-out);
  --t-slow: .6s var(--e-out);

  /* Layout */
  --container: 1320px;
  --container-narrow: 980px;
  --header-h: 76px;
  --z-drawer: 900;
  --z-header: 700;
  --z-modal: 1000;
  --z-toast: 1100;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  font-family: var(--f-body);
  font-size: var(--fs-base);
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.no-scroll { overflow: hidden; }

img, svg, video { max-width: 100%; display: block; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; line-height: 1.25; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
table { border-collapse: collapse; width: 100%; }

::selection { background: var(--brass); color: #fff; }

/* Focus - visible, brand-tinted, never removed */
:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}
:focus:not(:focus-visible) { outline: none; }

/* Scrollbar */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bone); }
::-webkit-scrollbar-thumb { background: #cfc5b4; border-radius: 99px; border: 3px solid var(--bone); }
::-webkit-scrollbar-thumb:hover { background: var(--brass); }

/* ---------- Typography ----------
   Arabic script must never carry negative tracking - the glyphs collide.
   Latin numerals and labels keep their own tighter tracking where set locally. */
.display, h1, h2 { font-family: var(--f-display); font-weight: 600; letter-spacing: 0; }
h3, h4 { font-family: var(--f-display); font-weight: 500; }

.eyebrow {
  font-family: var(--f-latin);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--brass);
}
/* Latin eyebrows sit inside RTL blocks - isolate so "01 - LOGO" does not flip */
.eyebrow:not(.ar) { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .eyebrow.ar { font-family: var(--f-body); letter-spacing: .1em; }

/* Any Latin / numeric fragment sitting inside RTL copy */
.ltr { direction: ltr; unicode-bidi: isolate; }

.lede { font-size: var(--fs-lg); line-height: 1.75; color: var(--text-soft); }
.tnum { font-family: var(--f-latin); font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.serif-i { font-family: var(--f-serif); font-style: italic; font-weight: 400; }

/* ---------- Layout utilities ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--sp-6); }
.container-narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--sp-11); }
.section-sm { padding-block: var(--sp-9); }
.section-tight { padding-block: var(--sp-8); }

.stack > * + * { margin-top: var(--gap, var(--sp-4)); }
.row { display: flex; align-items: center; gap: var(--sp-3); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); }
.grid { display: grid; gap: var(--sp-5); }
.flex-1 { flex: 1; }
.center { text-align: center; }
.mx-auto { margin-inline: auto; }
.hidden { display: none !important; }
.rel { position: relative; }

.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;
}

/* Section heading block - matches the "Title + See all" pattern */
.sec-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--sp-5); margin-bottom: var(--sp-7);
}
.sec-head__title { font-size: var(--fs-2xl); }
.sec-head__sub { color: var(--text-dim); font-size: var(--fs-sm); margin-top: 2px; }
.sec-head__link {
  font-size: var(--fs-sm); font-weight: 500; color: var(--text-soft);
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding-bottom: 2px; border-bottom: 1px solid transparent; transition: var(--t-fast);
}
.sec-head__link:hover { color: var(--brass); border-bottom-color: var(--brass); gap: 10px; }
.sec-head__link svg { width: 15px; height: 15px; }

/* Centered heading variant */
.sec-head-c { text-align: center; flex-direction: column; align-items: center; gap: var(--sp-2); }
.sec-head-c .sec-head__sub { max-width: 56ch; }

/* Decorative brass rule */
.rule-brass {
  width: 48px; height: 2px; margin-inline: auto;
  background: linear-gradient(90deg, transparent, var(--brass), transparent);
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--e-out), transform .7s var(--e-out); }
.reveal.in { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: .07s; }
.reveal-d2 { transition-delay: .14s; }
.reveal-d3 { transition-delay: .21s; }
.reveal-d4 { transition-delay: .28s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Responsive type scale ---------- */
@media (max-width: 900px) {
  :root { --fs-2xl: 1.5rem; --fs-3xl: 1.875rem; --fs-4xl: 2.25rem; --fs-5xl: 2.75rem; --header-h: 64px; }
  .section { padding-block: var(--sp-9); }
  .section-sm { padding-block: var(--sp-8); }
  .container { padding-inline: var(--sp-4); }
}
@media (max-width: 560px) {
  :root { --fs-2xl: 1.375rem; --fs-3xl: 1.625rem; --fs-4xl: 1.875rem; --fs-5xl: 2.125rem; }
  .sec-head { flex-direction: column; align-items: flex-start; gap: var(--sp-3); }
}
