/* ==========================================================================
   Zenix Academy — reset, fonts, RTL foundations, accessibility
   RTL rule: physical left/right are banned. Use logical properties only, so
   the whole sheet stays correct if a page is ever rendered LTR.
   ========================================================================== */

/* --- self-hosted fonts (no runtime request leaves this origin) ------------ */
@font-face{font-family:'Tajawal';font-style:normal;font-weight:400;font-display:swap;
  src:url('../assets/fonts/tajawal-400-arabic.woff2') format('woff2');
  unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC;}
@font-face{font-family:'Tajawal';font-style:normal;font-weight:400;font-display:swap;
  src:url('../assets/fonts/tajawal-400-latin.woff2') format('woff2');
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;}
@font-face{font-family:'Tajawal';font-style:normal;font-weight:500;font-display:swap;
  src:url('../assets/fonts/tajawal-500-arabic.woff2') format('woff2');
  unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC;}
@font-face{font-family:'Tajawal';font-style:normal;font-weight:500;font-display:swap;
  src:url('../assets/fonts/tajawal-500-latin.woff2') format('woff2');
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;}
@font-face{font-family:'Tajawal';font-style:normal;font-weight:700;font-display:swap;
  src:url('../assets/fonts/tajawal-700-arabic.woff2') format('woff2');
  unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC;}
@font-face{font-family:'Tajawal';font-style:normal;font-weight:700;font-display:swap;
  src:url('../assets/fonts/tajawal-700-latin.woff2') format('woff2');
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;}
@font-face{font-family:'Tajawal';font-style:normal;font-weight:800;font-display:swap;
  src:url('../assets/fonts/tajawal-800-arabic.woff2') format('woff2');
  unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC;}
@font-face{font-family:'Tajawal';font-style:normal;font-weight:800;font-display:swap;
  src:url('../assets/fonts/tajawal-800-latin.woff2') format('woff2');
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;}
/* Latin wordmark only. Variable file — one download covers 600 and 700. */
@font-face{font-family:'Montserrat';font-style:normal;font-weight:100 900;font-display:swap;
  src:url('../assets/fonts/montserrat-var-latin.woff2') format('woff2');
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* anchors must not land under the sticky header */
  scroll-padding-block-start: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4 {
  margin: 0;
  line-height: var(--lh-tight);
  font-weight: 800;
  letter-spacing: 0;        /* NEVER letter-space Arabic: it breaks the script */
  text-wrap: balance;
}
p  { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }

a {
  color: var(--accent-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color var(--t-fast) var(--ease);
}
a:hover { color: var(--accent); }

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

/* --- typography helpers --------------------------------------------------- */
.h1 { font-size: var(--fs-4xl); font-weight: 800; }
.h2 { font-size: var(--fs-3xl); font-weight: 800; }
.h3 { font-size: var(--fs-xl);  font-weight: 700; }

.lead {
  font-size: var(--fs-lg);
  color: var(--ink-soft);
  font-weight: 400;
  max-width: 56ch;
}
.muted { color: var(--ink-soft); }
.small { font-size: var(--fs-sm); color: var(--ink-soft); line-height: 1.7; }

/* Latin runs inside Arabic copy. Isolation stops bidi from reordering them.
   Letter-spacing is safe here precisely because the content is Latin. */
.latin      { font-family: var(--font-wordmark); unicode-bidi: isolate; direction: ltr; display: inline-block; }
.latin-track{ font-family: var(--font-wordmark); unicode-bidi: isolate; direction: ltr;
              letter-spacing: .22em; text-transform: uppercase; font-weight: 600; }

/* --- accessibility -------------------------------------------------------- */
:where(a, button, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}
:focus:not(:focus-visible) { outline: none; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  inset-block-start: -100%;
  inset-inline-start: var(--page-pad);
  z-index: 200;
  padding: .75rem 1.25rem;
  background: var(--accent-deep);
  color: #fff;
  border-radius: 0 0 var(--r-md) var(--r-md);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { inset-block-start: 0; color: #fff; }

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

/* Inline <symbol> sprite. Hidden, but <use> can still reference into it. */
.sprite { display: none; }

/* Every icon is a <svg><use href="#i-…"></svg> with no intrinsic size, so give
   them a default box; components override where a different size is wanted.
   Do NOT set fill/stroke here: CSS beats the presentation attributes carried by
   each <symbol>, which would flatten the filled icons. */
svg:not(.sprite):not([viewBox]) { inline-size: 20px; block-size: 20px; }
