/* ==========================================================================
   Reset, document defaults, typography, layout primitives
   ========================================================================== */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--masthead-h) + 1.5rem);
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: var(--lh-body);
  min-height: 100svh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-synthesis-weight: none;
}

body.is-locked { overflow: hidden; }

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

img { height: auto; background-color: #0d0d0d; }

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button { background: none; border: 0; }

a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 0.28em;
  text-decoration-thickness: 1px;
}

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

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: var(--lh-head);
  letter-spacing: var(--tr-display);
  text-wrap: balance;
}

p { text-wrap: pretty; }

::selection {
  background: var(--brand-accent);
  color: var(--brand-on-primary);
}

/* --- focus ------------------------------------------------------------- */

:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

.skip-link {
  position: fixed;
  inset-block-start: 0;
  inset-inline-start: 0;
  z-index: 200;
  transform: translateY(-120%);
  background: var(--brand-accent);
  color: var(--brand-on-primary);
  padding: 0.85rem 1.4rem;
  font-size: var(--fs-sm);
  font-weight: 600;
  transition: transform var(--t-fast) var(--ease);
}

.skip-link:focus-visible { transform: translateY(0); }

main:focus { outline: none; }

/* --- layout primitives -------------------------------------------------- */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--shell-pad);
}

.shell--wide { max-width: 96rem; }

.section { padding-block: var(--section-y); position: relative; }
.section--tight { padding-block: clamp(3rem, 2rem + 4vw, 6rem); }
.section--flush-top { padding-block-start: 0; }
.section--alt { background: var(--bg-2); }

.measure { max-width: var(--measure); }
.measure-tight { max-width: var(--measure-tight); }

.stack > * + * { margin-block-start: var(--flow, 1.1em); }

/* --- headings ----------------------------------------------------------- */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--tr-eyebrow);
  text-transform: uppercase;
  color: var(--ink-3);
  margin-block-end: 1.15rem;
}

html[lang='ar'] .eyebrow {
  text-transform: none;
  letter-spacing: 0.06em;
  font-size: 0.82rem;
}

.eyebrow::before {
  content: '';
  inline-size: 1.9rem;
  block-size: 1px;
  background: var(--brand-accent);
  flex: none;
}

.eyebrow--plain::before { display: none; }

/* Section headings no longer carry the document's ordinal, so an eyebrow with
   nothing left to say is removed rather than rendered as a stray rule. */
.eyebrow:empty { display: none; }

.title-xl { font-size: var(--fs-h1); font-weight: 700; }
.title-lg { font-size: var(--fs-h2); font-weight: 650; }
.title-md { font-size: var(--fs-h3); font-weight: 600; }
.title-sm { font-size: var(--fs-h4); font-weight: 600; letter-spacing: -0.01em; }

.lead {
  font-size: var(--fs-lead);
  color: var(--ink-2);
  font-weight: 300;
  line-height: 1.72;
}

html[lang='ar'] .lead { font-weight: 300; line-height: 1.95; }

.body-text { color: var(--ink-2); }
.muted { color: var(--ink-3); }
.accent { color: var(--brand-accent); }

html[lang='ar'] p,
html[lang='ar'] li { line-height: 1.95; }

.num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -0.03em;
}

/* --- utility ------------------------------------------------------------ */

.visually-hidden {
  position: absolute !important;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.hp-field {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

[hidden] { display: none !important; }

/* --- motion preferences -------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
