/* ================================================================
   base.css — reset, root typography, RTL defaults, helpers
   ================================================================ */

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

* { margin: 0; }

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

body {
  font-family: var(--font-base);
  font-weight: var(--fw-regular);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--color-text);
  background: var(--color-bg);
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Latin runs inside Arabic prose (brand, e-mails, numbers) stay LTR */
.ltr,
[dir="ltr"] { direction: ltr; unicode-bidi: isolate; }

img, svg, video, canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--color-primary-dark);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}
a:hover { color: var(--color-primary); }

ul, ol { list-style: none; padding: 0; }

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: none;
  border: none;
}

input, textarea, select, button { font-family: inherit; }

:focus-visible {
  outline: 3px solid var(--blue-300);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection {
  background: var(--blue-200);
  color: var(--navy-900);
}

/* ---- Headings -------------------------------------------------------- */
h1, h2, h3, h4, h5 {
  color: var(--color-heading);
  line-height: var(--lh-tight);
  font-weight: var(--fw-black);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); font-weight: var(--fw-bold); }
h4 { font-size: var(--fs-lg); font-weight: var(--fw-bold); }

p { text-wrap: pretty; }
strong, b { font-weight: var(--fw-bold); color: var(--navy-800); }

/* ---- Layout primitives ----------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 4vw, 2.5rem);
}
.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--section-y); }
.section--alt { background: var(--color-bg-alt); }
.section--tight { padding-block: clamp(2.5rem, 2rem + 2vw, 4rem); }

/* ---- Section heading block ------------------------------------------- */
.section-head {
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
  margin-bottom: clamp(2rem, 1.5rem + 2vw, 3.5rem);
}
.section-head--start {
  text-align: start;
  margin-inline: 0;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  color: var(--color-primary-dark);
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  padding: 0.4em 1em;
  border-radius: var(--radius-pill);
  margin-bottom: var(--space-4);
}
.eyebrow i { color: var(--color-primary); }
.section-head p {
  margin-top: var(--space-4);
  color: var(--color-text-muted);
  font-size: var(--fs-md);
}

/* ---- Accent helpers (full-fill, never one-sided borders) ------------- */
.text-gradient {
  background: linear-gradient(120deg, var(--blue-600), var(--emerald-500));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.text-blue    { color: var(--color-primary-dark); }
.text-emerald { color: var(--color-action-dark); }
.text-amber   { color: var(--amber-600); }
.text-muted   { color: var(--color-text-muted); }

/* ---- Utility --------------------------------------------------------- */
.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;
}
.no-scroll { overflow: hidden; }

.lead {
  font-size: var(--fs-md);
  color: var(--color-text-muted);
  line-height: var(--lh-base);
}

/* ---- Scroll-reveal animation (progressively enhanced) ---------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity var(--t-slow) var(--ease-out),
              transform var(--t-slow) var(--ease-out);
  will-change: opacity, transform;
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}
[data-reveal][data-delay="1"] { transition-delay: 80ms; }
[data-reveal][data-delay="2"] { transition-delay: 160ms; }
[data-reveal][data-delay="3"] { transition-delay: 240ms; }
[data-reveal][data-delay="4"] { transition-delay: 320ms; }
[data-reveal][data-delay="5"] { transition-delay: 400ms; }

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