/* ==========================================================================
   Global — base elements, typography, section themes, utilities
   ========================================================================== */

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 1rem);
  background: var(--black);
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink);
  background: var(--white);
  overflow-x: clip;
}

body.menu-open {
  overflow: hidden;
}

::selection {
  background: var(--green);
  color: var(--black);
}

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

/* Latin fragments inside Arabic pages (company names, codes, e-mail) */
[lang="en"] {
  font-family: var(--font-latin);
}

/* English fragments on Arabic pages run LTR (punctuation stays in place)
   but keep the page's right-hand alignment when they are block-level */
:root[dir="rtl"] [lang="en"] {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: right;
}

/* ---- Skip link ---------------------------------------------------------- */
.skip-link {
  position: fixed;
  inset-block-start: 0.75rem;
  inset-inline-start: 0.75rem;
  z-index: 100;
  padding: 0.75rem 1.1rem;
  background: var(--green);
  color: var(--black);
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform var(--dur-fast) var(--ease);
}

.skip-link:focus {
  transform: none;
}

.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;
}

/* ---- Typography --------------------------------------------------------- */
.t-hero,
.t-display,
.t-h2,
.t-h3,
.t-h4 {
  font-weight: 650;
  letter-spacing: var(--tracking-tight);
  line-height: var(--lh-heading);
  text-wrap: balance;
}

.t-hero {
  font-size: var(--fs-hero);
  line-height: var(--lh-tight);
  font-weight: 700;
}

.t-display {
  font-size: var(--fs-display);
  line-height: var(--lh-tight);
}

.t-h2 {
  font-size: var(--fs-h2);
}

.t-h3 {
  font-size: var(--fs-h3);
  letter-spacing: -0.02em;
}

.t-h4 {
  font-size: var(--fs-h4);
  letter-spacing: -0.01em;
  font-weight: 600;
}

.t-statement {
  font-size: var(--fs-statement);
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.t-lead {
  font-size: var(--fs-lead);
  line-height: 1.55;
  font-weight: 400;
}

.t-small {
  font-size: var(--fs-small);
}

.t-muted {
  color: var(--ink-muted);
}

:root[dir="rtl"] .t-hero,
:root[dir="rtl"] .t-display,
:root[dir="rtl"] .t-h2,
:root[dir="rtl"] .t-h3,
:root[dir="rtl"] .t-h4,
:root[dir="rtl"] .t-statement {
  letter-spacing: 0;
  font-weight: 700;
}

:root[dir="rtl"] .t-statement {
  font-weight: 500;
  line-height: 1.55;
}

:root[dir="rtl"] .t-lead {
  line-height: 1.85;
}

.hl {
  color: var(--green);
}

/* Highlight on light backgrounds — green bar under text keeps contrast */
.mark {
  background-image: linear-gradient(var(--green), var(--green));
  background-repeat: no-repeat;
  background-size: 100% 0.14em;
  background-position: 0 92%;
}

.prose > * + * {
  margin-block-start: 1.1em;
}

.prose p {
  max-width: 68ch;
}

/* ---- Eyebrow label: "01 — Who we are" ---------------------------------- */
.label {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  line-height: 1.3;
}

.label::before {
  content: "";
  inline-size: 2.25rem;
  block-size: 1px;
  background: currentColor;
  opacity: 0.5;
}

.label__num {
  color: var(--green);
  font-variant-numeric: tabular-nums;
}

:root[dir="rtl"] .label {
  letter-spacing: 0;
  text-transform: none;
  font-size: 0.9375rem;
}

/* ---- Numerals ----------------------------------------------------------- */
.numeral {
  font-family: var(--font-latin);
  font-size: var(--fs-numeral);
  font-weight: 300;
  line-height: 0.85;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}

/* ---- Section themes ----------------------------------------------------- */
.section {
  position: relative;
  padding-block: var(--section-space);
}

.section--tight {
  padding-block: var(--section-space-sm);
}

.theme-white {
  background: var(--white);
  color: var(--ink);
}

.theme-steel {
  background: var(--steel-100);
  color: var(--ink);
}

.theme-mist {
  background: var(--steel-50);
  color: var(--ink);
}

.theme-charcoal {
  background: var(--charcoal);
  color: var(--on-dark);
}

.theme-black {
  background: var(--black);
  color: var(--on-dark);
}

.theme-charcoal .t-muted,
.theme-black .t-muted {
  color: var(--on-dark-muted);
}

/* ---- Brand pattern (patrn.png recoloured through a CSS mask) ------------ */
.pattern {
  position: absolute;
  aspect-ratio: 1153 / 1108;
  background-color: var(--pattern-color, var(--green));
  -webkit-mask: url("../patrn.png") center / contain no-repeat;
  mask: url("../patrn.png") center / contain no-repeat;
  pointer-events: none;
  user-select: none;
}

.pattern--steel {
  --pattern-color: var(--steel);
}

.pattern--ink {
  --pattern-color: var(--charcoal);
}

/* Photographs — one consistent grade across the whole site */
.photo {
  position: relative;
  overflow: hidden;
  background: var(--charcoal);
}

.photo > picture {
  display: block;
  inline-size: 100%;
  block-size: 100%;
}

.photo img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  filter: saturate(0.82) contrast(1.04);
}

.photo--4x5 {
  aspect-ratio: 4 / 5;
}

.photo--3x2 {
  aspect-ratio: 3 / 2;
}

.photo--16x10 {
  aspect-ratio: 16 / 10;
}

.photo--21x9 {
  aspect-ratio: 21 / 9;
}

/* Arrow icon: flips for RTL, never the logo or photography */
.icon-arrow {
  inline-size: 1.1em;
  block-size: 1.1em;
  flex: none;
  transform: scaleX(var(--dir));
}
