/* ============================================================
   TAMAYOUZ — tamayouz.sa design system
   Brand Bible v1.4 EN · Build Brief v1.1 · 11 June 2026
   Five colors. Two-tier type (Tier 2: Thmanyah). Burgundy is
   punctuation, not paint. Shadow Gray never carries text.
   ============================================================ */

/* ---------- Fonts (Tier 2 web faces, self-hosted) ---------- */
@font-face {
  font-family: 'Thmanyah Serif Display';
  src: url('../fonts/thmanyahserifdisplay-Bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Thmanyah Serif Text';
  src: url('../fonts/thmanyahseriftext-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Thmanyah Serif Text';
  src: url('../fonts/thmanyahseriftext-Bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Thmanyah Sans';
  src: url('../fonts/thmanyahsans-Medium.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}

/* ---------- Tokens (locked) ---------- */
:root {
  color-scheme: light; /* the brand does not render in dark mode */
  --burgundy: #650032;
  --smoke:    #F5F4F2;
  --dust:     #DCD7D4;
  --shadow:   #B8B3B0; /* never text */
  --black:    #000000;

  --font-display: 'Thmanyah Serif Display', Georgia, serif;
  --font-body:    'Thmanyah Serif Text', Georgia, serif;
  --font-ui:      'Thmanyah Sans', system-ui, sans-serif;

  /* Fluid type — EN base (AR gets +10% via :lang overrides) */
  --fs-h1:    clamp(2.25rem, 1.6rem + 3.2vw, 4.25rem);   /* 36 → 68 */
  --fs-h2:    clamp(1.5rem, 1.2rem + 1.4vw, 2.25rem);    /* 24 → 36 */
  --fs-h3:    clamp(1.1875rem, 1.08rem + .5vw, 1.4375rem);
  --fs-body:  1.0625rem;                                  /* 17 */
  --fs-cap:   .8125rem;                                   /* 13 */
  --fs-label: .8125rem;
  --fs-stat:  clamp(2.5rem, 1.8rem + 3vw, 4rem);

  --lh-body: 1.5;
  --container: 76rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --section: clamp(4.5rem, 5rem + 4vw, 9rem);
  --ease: cubic-bezier(.25,.46,.45,.94); /* ease-out */
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--smoke);
  color: var(--black);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--burgundy); }
p a, li a { text-decoration: underline; text-underline-offset: .15em; } /* affordance ≠ color alone */
:focus-visible { outline: 3px solid var(--burgundy); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--burgundy); color: var(--smoke); }

/* Arabic: +10% optical, generous leading, never letterspaced, never italic */
:lang(ar) { line-height: 1.7; letter-spacing: 0 !important; }
:lang(ar) body, body:lang(ar) { font-size: 1.1875rem; } /* 19 */
:lang(ar) .h1, [lang="ar"] .h1 { font-size: calc(var(--fs-h1) * 1.08); }
:lang(ar) .h2, [lang="ar"] .h2 { font-size: calc(var(--fs-h2) * 1.08); }
:lang(ar) em, :lang(ar) i { font-style: normal; font-weight: 700; }
[dir="ltr"] { unicode-bidi: isolate; } /* Latin islands inside Arabic flow */

.skip-link {
  position: absolute; inset-inline-start: 1rem; top: -4rem;
  background: var(--burgundy); color: var(--smoke);
  font-family: var(--font-ui); padding: .75rem 1.25rem; z-index: 200;
  transition: top .2s var(--ease); text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* ---------- Layout primitives ---------- */
.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section); position: relative; }

/* Section label — Bible 6.4: caps tracked burgundy (EN); AR untracked */
.label {
  font-family: var(--font-ui); font-weight: 500;
  font-size: var(--fs-label); color: var(--burgundy);
  text-transform: uppercase; letter-spacing: .12em;
  display: flex; align-items: center; gap: .9rem; margin-block-end: 1.25rem;
}
.label::before { content: ""; inline-size: 2.25rem; block-size: 2px; background: var(--burgundy); }
:lang(ar) .label { letter-spacing: 0 !important; }

.h1, .h2, .h3 { font-family: var(--font-display); font-weight: 700; color: var(--black); }
.h1 { font-size: var(--fs-h1); line-height: 1.12; letter-spacing: -.01em; }
.h2 { font-size: var(--fs-h2); line-height: 1.18; max-inline-size: 24ch; }
.h3 { font-size: var(--fs-h3); line-height: 1.25; }
:lang(ar) .h1, :lang(ar) .h2, :lang(ar) .h3 { letter-spacing: 0 !important; line-height: 1.35; }
.h1 .accent, .h2 .accent { color: var(--burgundy); }
.lede { max-inline-size: 58ch; margin-block-start: 1.25rem; }
.muted-rule { border: 0; border-block-start: 1px solid var(--dust); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--font-ui); font-weight: 500; font-size: .9375rem;
  min-block-size: 48px; padding: .8rem 1.6rem;
  text-decoration: none; border: 1.5px solid var(--burgundy);
  transition: background-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.btn-solid { background: var(--burgundy); color: var(--smoke); }
.btn-solid:hover { transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--burgundy); }
.btn-ghost:hover { background: var(--burgundy); color: var(--smoke); }
.btn .arrow { transition: transform .2s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
[dir="rtl"] .btn:hover .arrow { transform: translateX(-4px); }
.on-burgundy .btn-solid { background: var(--smoke); color: var(--burgundy); border-color: var(--smoke); }
.on-burgundy .btn-ghost { color: var(--smoke); border-color: var(--smoke); }
.on-burgundy .btn-ghost:hover { background: var(--smoke); color: var(--burgundy); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset-inline: 0; top: 0; z-index: 100;
  background: var(--smoke);
  border-block-end: 1px solid transparent;
  transition: border-color .2s var(--ease);
}
.site-header.scrolled { border-color: var(--dust); }
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  min-block-size: 4.5rem; gap: 1.5rem;
}
.brand { color: var(--burgundy); text-decoration: none; display: inline-flex; }
.brand svg { block-size: 2.6rem; inline-size: auto; }
.nav-desktop { display: none; }
.nav-desktop a {
  font-family: var(--font-ui); font-weight: 500; font-size: .9rem;
  color: var(--black); text-decoration: none; padding: .5rem .85rem;
  border-block-end: 2px solid transparent;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.nav-desktop a:hover { color: var(--burgundy); border-color: var(--burgundy); }
.lang-switch {
  font-family: var(--font-ui); font-weight: 500; font-size: .9rem;
  color: var(--burgundy); text-decoration: none;
  border: 1.5px solid var(--dust); padding: .45rem 1rem; min-block-size: 44px;
  display: inline-flex; align-items: center;
  transition: border-color .2s var(--ease), background-color .2s var(--ease), color .2s var(--ease);
}
.lang-switch:hover { border-color: var(--burgundy); background: var(--burgundy); color: var(--smoke); }
.nav-toggle {
  inline-size: 48px; block-size: 48px; border: 0; background: transparent;
  display: grid; place-items: center; cursor: pointer; color: var(--burgundy);
}
.nav-toggle .bars, .nav-toggle .bars::before, .nav-toggle .bars::after {
  content: ""; display: block; inline-size: 26px; block-size: 2px;
  background: currentColor; position: relative; transition: transform .2s var(--ease), opacity .2s var(--ease);
}
.nav-toggle .bars::before { position: absolute; top: -8px; }
.nav-toggle .bars::after  { position: absolute; top:  8px; }
.nav-open .nav-toggle { color: var(--smoke); position: relative; z-index: 130; }
.nav-open .nav-toggle .bars { transform: rotate(45deg); }
.nav-open .nav-toggle .bars::before { transform: rotate(-90deg); top: 0; }
.nav-open .nav-toggle .bars::after { opacity: 0; }

/* Mobile overlay — the sanctioned reversed moment */
.nav-overlay {
  position: fixed; inset: 0; z-index: 120; background: var(--burgundy);
  display: grid; align-content: center; padding-inline: var(--gutter);
  opacity: 0; visibility: hidden; transition: opacity .25s var(--ease), visibility .25s;
}
.nav-open .nav-overlay { opacity: 1; visibility: visible; }
.nav-overlay a {
  font-family: var(--font-display); font-weight: 700; color: var(--smoke);
  font-size: clamp(1.75rem, 6.5vw, 2.6rem); text-decoration: none;
  padding-block: .55rem; display: block; opacity: 0; transform: translateY(16px);
}
.nav-open .nav-overlay a { opacity: 1; transform: none; transition: opacity .3s var(--ease), transform .3s var(--ease); }
.nav-open .nav-overlay a:nth-child(2) { transition-delay: .04s; }
.nav-open .nav-overlay a:nth-child(3) { transition-delay: .08s; }
.nav-open .nav-overlay a:nth-child(4) { transition-delay: .12s; }
.nav-open .nav-overlay a:nth-child(5) { transition-delay: .16s; }
.nav-open .nav-overlay a:nth-child(6) { transition-delay: .20s; }
.nav-open { overflow: hidden; }

@media (min-width: 64rem) {
  .nav-desktop { display: flex; gap: .25rem; }
  .nav-toggle, .nav-overlay { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  min-block-size: 100svh;
  display: grid; align-content: center;
  padding-block: 8rem 5rem; position: relative; isolation: isolate;
}
.hero-linework {
  position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
}
.hero-linework svg {
  right: -22%; /* physical fallback for engines without inset-inline */ position: absolute; inset-block-start: -18%; inset-inline-end: -22%; inline-size: 72vw; min-inline-size: 540px; }
[dir="rtl"] .hero-linework svg {
  right: auto; left: -22%; /* physical fallback */
  right: -22%; /* physical fallback for engines without inset-inline */ inset-inline-end: auto; inset-inline-start: -22%; transform: scaleX(-1); }
.hero-linework circle { stroke: var(--dust); stroke-width: 1.25; fill: none; }
.hero .h1 { max-inline-size: 16ch; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: .9rem; margin-block-start: 2.25rem; }
.hero-meta {
  margin-block-start: 3.5rem; padding-block-start: 1.5rem;
  border-block-start: 1px solid var(--dust);
  font-family: var(--font-ui); font-size: var(--fs-cap); color: var(--black);
  display: flex; flex-wrap: wrap; gap: .5rem 2rem;
}

/* ---------- Proof band ---------- */
.proof-grid {
  display: grid; gap: 2.25rem 1.5rem;
  grid-template-columns: repeat(2, 1fr);
  margin-block-start: 3rem;
}
@media (min-width: 48rem) { .proof-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 64rem) { .proof-grid { grid-template-columns: repeat(6, 1fr); } }
.stat .num {
  font-family: var(--font-display); font-weight: 700;
  font-size: var(--fs-stat); color: var(--burgundy); line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat .desc { margin-block-start: .5rem; font-size: var(--fs-cap); color: var(--black); }
.proof-caveat { margin-block-start: 2rem; font-size: var(--fs-cap); color: var(--black); }
.iso-line { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-block-start: 2.25rem; font-family: var(--font-ui); font-size: .9rem; }
.iso-line .badge {
  border: 1.5px solid var(--burgundy); color: var(--burgundy);
  font-weight: 500; padding: .3rem .7rem; font-size: .8rem; white-space: nowrap;
}

/* ---------- Services ---------- */
.cards {
  display: grid; gap: 1.25rem; margin-block-start: 3rem;
  grid-template-columns: 1fr;
}
@media (min-width: 48rem) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64rem) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card {
  background: #fff; padding: 2rem 1.75rem 2.25rem; position: relative;
  border: 1px solid var(--dust);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.card::before {
  content: ""; position: absolute; inset-inline: 0; inset-block-start: 0;
  block-size: 4px; background: var(--burgundy);
  transform: scaleX(.32); transform-origin: 0 50%;
  transition: transform .2s var(--ease);
}
[dir="rtl"] .card::before { transform-origin: 100% 50%; }
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px -18px rgba(0,0,0,.25); }
.card:hover::before { transform: scaleX(1); }
.card .icon { color: var(--burgundy); inline-size: 30px; block-size: 30px; margin-block-end: 1.1rem; }
.card .h3 { margin-block-end: .6rem; }
.card p { font-size: .96rem; }

/* ---------- Methodology ---------- */
.method { counter-reset: step; margin-block-start: 3.5rem; position: relative; }
.method-track {
  position: absolute; background: var(--dust);
  inset-inline-start: 1.4rem; inset-block: 1.4rem; inline-size: 2px;
}
.method-progress { position: absolute; inset-inline-start: 1.4rem; inset-block-start: 1.4rem; inline-size: 2px; background: var(--burgundy); block-size: 0; }
.step { display: grid; grid-template-columns: 2.8rem 1fr; gap: 1.25rem; padding-block: 1.25rem; position: relative; }
.step-num {
  inline-size: 2.8rem; block-size: 2.8rem; border-radius: 50%;
  background: var(--burgundy); color: var(--smoke);
  font-family: var(--font-display); font-weight: 700;
  display: grid; place-items: center; font-size: 1rem; position: relative; z-index: 1;
}
.step .h3 { margin-block-end: .25rem; }
.step p { font-size: .96rem; max-inline-size: 52ch; }
@media (min-width: 64rem) {
  .method { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.5rem; }
  .method-track { inset-inline: 1.4rem auto; inset-block-start: 1.4rem; block-size: 2px; inline-size: calc(100% - 2.8rem); }
  .method-progress { inset-block-start: 1.4rem; block-size: 2px; inline-size: 0; }
  .step { grid-template-columns: 1fr; gap: 1.1rem; padding-block: 0; }
}

/* ---------- Sustain signals ---------- */
.signals { display: grid; gap: 1.5rem 2.5rem; margin-block-start: 3rem; grid-template-columns: 1fr; }
@media (min-width: 48rem) { .signals { grid-template-columns: 1fr 1fr; } }
@media (min-width: 64rem) { .signals { grid-template-columns: 1fr 1fr 1fr; } }
.signal { border-inline-start: 4px solid var(--burgundy); padding-inline-start: 1.25rem; }
.signal .h3 { color: var(--burgundy); font-size: 1.125rem; margin-block-end: .35rem; }
.signal p { font-size: .95rem; }
.signals-note { margin-block-start: 2.25rem; font-size: var(--fs-cap); }

/* ---------- Differentiators ---------- */
.diff-list { margin-block-start: 2.5rem; }
.diff { display: grid; grid-template-columns: 2.2rem 1fr; gap: 1.25rem; padding-block: 1.75rem; border-block-start: 1px solid var(--dust); align-items: start; }
.diff:last-child { border-block-end: 1px solid var(--dust); }
.diff .icon { color: var(--burgundy); inline-size: 30px; block-size: 30px; }
.diff .h3 { margin-block-end: .3rem; }
.diff p { max-inline-size: 70ch; font-size: .98rem; }

/* ---------- Sectors (trust in words) ---------- */
.sectors { display: flex; flex-wrap: wrap; gap: .7rem; margin-block-start: 2.25rem; }
.sector {
  font-family: var(--font-ui); font-size: .9rem; font-weight: 500;
  border: 1px solid var(--dust); background: #fff; color: var(--black);
  padding: .55rem 1.05rem; transition: border-color .2s var(--ease);
}
.sector:hover { border-color: var(--burgundy); }

/* ---------- CTA band (sanctioned full-burgundy moment) ---------- */
.cta-band { background: var(--burgundy); color: var(--smoke); position: relative; isolation: isolate; overflow: clip; }
.cta-band .label { color: var(--smoke); }
.cta-band .label::before { background: var(--smoke); }
.cta-band .h2 { color: var(--smoke); max-inline-size: 28ch; }
.cta-linework { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.cta-linework circle { stroke: var(--smoke); stroke-opacity: .12; stroke-width: 1; fill: none; } /* the single sanctioned translucency */
.cta-actions { display: flex; flex-wrap: wrap; gap: .9rem; margin-block-start: 2.25rem; }
.cta-contact { margin-block-start: 2.5rem; display: grid; gap: .4rem; font-family: var(--font-ui); font-size: .95rem; }
.cta-contact a { color: var(--smoke); text-decoration: underline; text-underline-offset: .18em; }
.cta-tagline { margin-block-start: 3.5rem; display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 1.5rem; }
.cta-tagline .word { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.2rem, 3vw, 1.6rem); }
.cta-tagline svg { block-size: 4.5rem; inline-size: auto; color: var(--smoke); }

/* ---------- Footer ---------- */
.site-footer { background: var(--smoke); border-block-start: 1px solid var(--dust); padding-block: 2.25rem; }
.footer-inner { display: grid; gap: 1rem; font-size: var(--fs-cap); }
.footer-legal { color: var(--black); }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.25rem; font-family: var(--font-ui); }
.footer-links a { color: var(--burgundy); text-decoration: underline; text-underline-offset: .15em; }

/* ---------- Reveal pre-states (JS removes; no-JS stays visible) ---------- */
.js .reveal { opacity: 0; transform: translateY(26px); }
.js .reveal-line { visibility: hidden; }

/* ---------- Reduced motion: everything visible, nothing moves ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  .js .reveal-line { visibility: visible !important; }
}

/* ---------- Apex language chooser ---------- */
.chooser { min-block-size: 100svh; display: grid; place-content: center; text-align: center; gap: 2.5rem; background: var(--burgundy); color: var(--smoke); padding: var(--gutter); }
.chooser svg { block-size: 7rem; inline-size: auto; margin-inline: auto; color: var(--smoke); }
.chooser-links { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.chooser-links a {
  font-family: var(--font-ui); font-weight: 500; font-size: 1.05rem;
  color: var(--smoke); border: 1.5px solid var(--smoke);
  padding: .9rem 2.2rem; text-decoration: none; min-inline-size: 11rem;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.chooser-links a:hover { background: var(--smoke); color: var(--burgundy); }
