/* ================= Fonts ================= */
@font-face {
  font-family: "Thmanyah Sans";
  src: url("../fonts/ThmanyahSans-Light.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Thmanyah Sans";
  src: url("../fonts/ThmanyahSans-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Thmanyah Sans";
  src: url("../fonts/ThmanyahSans-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Thmanyah Sans";
  src: url("../fonts/ThmanyahSans-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ================= Reset ================= */
*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
ul[class], ol[class] { padding: 0; list-style: none; }
img, picture, svg, video { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

html[lang="ar"] body { font-family: var(--font-ar); }
html[lang="en"] body { font-family: var(--font-en); }

/* Thmanyah Sans Arabic ships a real "Stylistic Alternates" (salt) feature:
   enabling it swaps the final form of letters like ب س ش ص ض ف ق ك ن ي
   for a wider, kashida-style elongated tail (confirmed in the font's GSUB
   table — the alternate glyphs are ~55-65% wider than the default final
   forms). "ss01"/"swsh" are switched on alongside "salt" because they are
   plain (guaranteed-applied) substitutions pointing at the exact same
   alternate glyphs, so the elongated tail renders consistently across
   every browser's shaping engine, not just ones that honor a bare "salt". */
html[lang="ar"] body {
  font-feature-settings: "salt" 1, "ss01" 1, "swsh" 1;
}

body {
  background: var(--bg);
  color: var(--text-primary);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color var(--dur-med) var(--ease), color var(--dur-med) var(--ease);
  overflow-x: hidden;
}

/* ================= Typography ================= */
h1, h2, h3, h4 {
  font-weight: 700;
  line-height: var(--lh-heading);
  letter-spacing: 0;
}
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3, html[lang="ar"] h4 { font-weight: 700; }

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

.display { font-size: var(--fs-display); line-height: var(--lh-tight); font-weight: 700; letter-spacing: -0.01em; }
.lead { font-size: var(--fs-lead); line-height: 1.55; color: var(--text-secondary); font-weight: 400; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 700;
}
html[lang="ar"] .eyebrow { letter-spacing: 0.02em; }
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}
[dir="rtl"] .eyebrow::before { order: 2; }

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
/* Phone numbers, emails, and other LTR-only strings keep their visual order
   (e.g. "+966 55 426 6446" instead of a bidi-reversed "6446 426 55 966+")
   when placed inside RTL Arabic text. */
.ltr-inline { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* ================= Layout helpers ================= */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}
.section { padding-block: var(--sp-section); }
.section-tight { padding-block: calc(var(--sp-section) * 0.6); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: -60px;
  inset-inline-start: var(--sp-4);
  background: var(--accent);
  color: var(--accent-contrast);
  padding: var(--sp-3) var(--sp-5);
  z-index: 1000;
  border-radius: var(--radius-sm);
  transition: top var(--dur-fast) var(--ease);
}
.skip-link:focus { top: var(--sp-4); }

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

/* Selection */
::selection { background: var(--text-primary); color: var(--bg); }

/* Scrollbar (webkit) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-border-strong); border-radius: 6px; }

hr {
  border: none;
  border-top: 1px solid var(--divider);
  margin: 0;
}
