/* Reset, typography, layout primitives, accessibility helpers */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + var(--space-4));
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-body);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, fieldset { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
a { color: var(--color-blue); text-underline-offset: 0.2em; }
a:hover { color: var(--color-blue-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

h1, h2, h3, h4 {
  color: var(--color-ink);
  font-weight: 800;
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-heading);
  text-wrap: balance;
}
.lang-ar h1, .lang-ar h2, .lang-ar h3, .lang-ar h4 { font-weight: 700; }

p { text-wrap: pretty; }
main:focus { outline: none; }

/* focus: always visible, never colour-only */
:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
  border-radius: var(--radius-xs);
}
.on-dark :focus-visible { outline: var(--focus-ring-inverse); }

::selection { background: var(--color-blue-100); color: var(--color-ink); }

/* layout */
.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--wide { max-width: calc(var(--container) + var(--gutter) * 2); } /* same edge as the header so logo and content line up */
.container--narrow { max-width: calc(var(--container-narrow) + var(--gutter) * 2); }
.section { padding-block: var(--space-9); }
@media (max-width: 720px) { .section { padding-block: var(--space-8); } }

.eyebrow {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-blue);
}
.lang-ar .eyebrow { letter-spacing: 0; text-transform: none; font-size: var(--text-sm); }

.lead { font-size: var(--text-lg); color: var(--color-muted); line-height: 1.55; max-width: 60ch; }

/* a11y helpers */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  inset-block-start: var(--space-3);
  inset-inline-start: var(--space-3);
  z-index: 200;
  padding: var(--space-3) var(--space-4);
  background: var(--color-ink);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; color: #fff; }

/* icons */
.icon { width: 1.25em; height: 1.25em; flex: none; }
[dir="rtl"] .icon-dir { transform: scaleX(-1); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
