/* ==========================================================================
   Base: reset, typography, layout helpers, buttons, the orange dot.
   Uses tokens from tokens.css only.
   ========================================================================== */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-weight: 400;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg, video { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--ink); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }

/* ---- Headings: Dubai Bold, sentence case, full stop in orange ---- */
h1, h2, h3, h4 {
  color: var(--heading);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}
.display { font-size: var(--fs-display); line-height: 1.0; letter-spacing: -0.02em; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); line-height: 1.2; }
h4 { font-size: 1.125rem; line-height: 1.3; }

p { margin: 0; max-width: var(--measure); }
.lead { font-size: clamp(1.125rem, 1rem + 0.5vw, 1.35rem); line-height: 1.55; color: var(--text); }
.small { font-size: var(--fs-small); }
.caption { font-size: var(--fs-caption); font-weight: 400; color: var(--muted); }
strong { font-weight: 700; color: var(--heading); }

/* Label: Bold capitals, tracked +180, no full stop */
.label {
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1.4;
}
:lang(ar) .label { letter-spacing: 0; }

/* ---- The orange dot -------------------------------------------------
   .o  = a sentence-ending full stop (added automatically by build.py)
   .dj = the dot above a lowercase i or j in display type (Tier 2).
         Only the colour changes; the shape stays the font's own.     */
.o { color: var(--orange); }
.dj {
  color: transparent;
  background-image: linear-gradient(to bottom,
      var(--orange) 0, var(--orange) var(--dj-split),
      var(--dj-ink, var(--heading)) var(--dj-split), var(--dj-ink, var(--heading)) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
@supports not ((background-clip: text) or (-webkit-background-clip: text)) {
  .dj { color: inherit; background: none; }
}
/* The hero dot: one flat Mars-orange disc per layout. */
.hero-dot { fill: var(--orange); }

/* ---- Layout ---- */
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--s9); }
.section--tight { padding-block: var(--s8); }
.section--ice { background: var(--surface); }
.stack { display: flex; flex-direction: column; gap: var(--s4); }
.stack-l { display: flex; flex-direction: column; gap: var(--s6); }
.row { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }
.grid { display: grid; gap: var(--s5); }
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.section-head { display: grid; gap: var(--s4); margin-bottom: var(--s7); max-width: 760px; }
.section-head--split { max-width: none; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: end; gap: var(--s6); }
@media (max-width: 860px) { .section-head--split { grid-template-columns: 1fr; } }

/* Section numerals such as 01. and 02. (the dot is orange) */
.numeral { font-weight: 700; font-size: 1rem; color: var(--sky); letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }

/* ---- Buttons: never orange. Primary = dark blue text on sky (6:1). ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55em;
  min-height: 48px; padding: 0.7em 1.35em;
  border-radius: 999px; border: 1.5px solid transparent;
  font-weight: 700; font-size: 1rem; line-height: 1.1;
  text-decoration: none; cursor: pointer;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.btn svg { width: 1.1em; height: 1.1em; flex: none; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--sky); color: var(--ink); }
.btn--primary:hover { background: var(--blue-light); }
.btn--ghost { background: var(--white); color: var(--ink); border-color: var(--blue-light); }
.btn--ghost:hover { border-color: var(--sky); background: var(--ice); }
.btn--link { background: none; border: 0; padding: 0; min-height: 0; color: var(--ink); text-decoration: underline; text-underline-offset: 0.2em; }
[dir="rtl"] .btn svg.arrow { transform: scaleX(-1); }

/* ---- Icon: 2pt dark-blue line on a white tile ---- */
.icon { width: 24px; height: 24px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon .icon-dot { fill: var(--orange); stroke: none; }
.icon-tile {
  width: 56px; height: 56px; flex: none;
  display: grid; place-items: center;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
}
.icon-tile .icon { width: 28px; height: 28px; }

/* ---- Skip link and screen-reader helper ---- */
.skip { position: absolute; top: 8px; inset-inline-start: 8px; z-index: 100; background: var(--white); padding: var(--s3) var(--s4); border-radius: var(--radius-s); }
.skip:not(:focus) { width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---- Arabic ---- */
:lang(ar) body, body:lang(ar) { line-height: 1.8; }
:lang(ar) h1, :lang(ar) h2, :lang(ar) h3 { letter-spacing: 0; line-height: 1.3; }
