/* ============================================================
   BrokerageLoop — base reset & typography
   Logical properties used throughout so the entire stylesheet
   mirrors automatically when [dir="rtl"] is set on <html>.
   ============================================================ */

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

html{
  -webkit-text-size-adjust: 100%;
}
/* Smooth scrolling only where the jumps are short. The home page is around
   20,000px on a phone, so a smooth "back to top" from the footer animates
   through the entire document. */
@media (min-width: 900px){
  html{ 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;
  }
}

body{
  margin: 0;
  min-height: 100dvh;
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

html[lang="ar"] body,
body.lang-ar{
  font-family: var(--font-arabic);
}
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3, html[lang="ar"] h4,
body.lang-ar h1, body.lang-ar h2, body.lang-ar h3, body.lang-ar h4,
html[lang="ar"] .font-heading, body.lang-ar .font-heading{
  font-family: var(--font-arabic);
  letter-spacing: 0;
}

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

a{ color: inherit; text-decoration: none; }

button, input, select, textarea{ font: inherit; color: inherit; }
button{ background: none; border: 0; cursor: pointer; }

ul, ol{ margin: 0; padding: 0; list-style: none; }
p{ margin: 0; }
h1,h2,h3,h4,h5,h6{ margin: 0; font-family: var(--font-heading); font-weight: 700; letter-spacing: -0.01em; color: var(--color-fg); }

h1{ font-size: var(--fs-5xl); line-height: var(--lh-display); letter-spacing: var(--tracking-display); }
h2{ font-size: var(--fs-3xl); line-height: 1.08; letter-spacing: var(--tracking-heading); }
h3{ font-size: var(--fs-xl); line-height: var(--lh-snug); letter-spacing: -0.015em; }
h4{ font-size: var(--fs-md); line-height: var(--lh-snug); letter-spacing: -0.01em; }

/* Arabic headings: IBM Plex Sans Arabic needs its natural spacing — negative
   tracking breaks letter joining, and 1.02 leading clips ascenders. */
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3, html[lang="ar"] h4,
body.lang-ar h1, body.lang-ar h2, body.lang-ar h3, body.lang-ar h4{
  letter-spacing: 0;
  line-height: 1.3;
}

/* h1/h2 scale fluidly via clamp() in tokens.css — no breakpoint step needed. */

/* ---- Focus states: CRITICAL a11y requirement ---- */
:focus-visible{
  outline: 2.5px solid var(--color-ring);
  outline-offset: 2px;
  border-radius: 4px;
}
a:focus-visible, button:focus-visible{
  outline-offset: 3px;
}

/* ---- Skip link ---- */
.skip-link{
  position: absolute;
  inset-inline-start: var(--space-4);
  top: -60px;
  background: var(--color-primary);
  color: #fff;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  z-index: var(--z-modal);
  transition: top var(--dur-base) var(--ease-out);
  font-weight: 600;
}
.skip-link:focus{ top: var(--space-4); }

/* ---- Selection ---- */
::selection{ background: var(--brand-cerulean-100); color: var(--brand-cerulean-900); }

/* ---- Layout helpers ---- */
.container{
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-6);
}
.container-wide{
  width: 100%;
  max-width: var(--container-wide);
  margin-inline: auto;
  padding-inline: var(--space-6);
}
@media (max-width: 640px){
  .container, .container-wide{ padding-inline: var(--space-4); }
}

.section{ padding-block: var(--space-24); }
@media (max-width: 900px){ .section{ padding-block: var(--space-16); } }

.section-head{
  max-width: 680px;
  margin-block-end: var(--space-12);
}
.section-head.center{ margin-inline: auto; text-align: center; }
.section-lede{
  color: var(--color-fg-muted);
  font-size: var(--fs-md);
  margin-block-start: var(--space-4);
  line-height: var(--lh-relaxed);
}

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

[hidden]{ display: none !important; }

.text-balance{ text-wrap: balance; }
