/* ==========================================================================
   Reset, typography, layout primitives, bilingual switching, motion base
   ========================================================================== */

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

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

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

body {
  min-height: 100dvh;
  background-color: var(--bg);
  color: var(--on-bg);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  /* Colour is the only thing that changes on a theme flip, and it should
     look like a light being switched — not like a page reload. */
  transition:
    background-color var(--dur-normal) var(--ease-standard),
    color var(--dur-normal) var(--ease-standard);
}

img,
svg,
video {
  display: block;
  max-inline-size: 100%;
  block-size: auto;
}

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

ul,
ol {
  list-style: none;
}

a {
  color: var(--accent-ink);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.22em;
}

/* ---- Focus: one ring, legible on every surface in both modes ------------- */
:where(a, button, input, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.on-accent:focus-visible {
  outline-color: var(--on-accent);
}

.skip-link {
  position: fixed;
  inset-block-start: var(--space-xs);
  inset-inline-start: var(--space-xs);
  z-index: 200;
  padding: var(--space-xs) var(--space-md);
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-display);
  border-radius: var(--radius);
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform var(--dur-normal) var(--ease-out-expo);
}

.skip-link:focus-visible {
  transform: translateY(0);
  outline-color: var(--on-accent);
}

/* ---- Bilingual switching ------------------------------------------------
   Both languages ship in the markup, so the page is complete with JS off
   (Arabic, the primary language) and the toggle is instant with JS on.
   Screen readers get a real lang attribute on the node they read.        */
html[lang="ar"] [lang="en"],
html[lang="en"] [lang="ar"] {
  display: none !important;
}

/* ---- Type ---------------------------------------------------------------- */
.display,
h1,
h2,
h3,
.numeral {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--leading-tight);
  letter-spacing: 0.005em;
}

html[lang="en"] .display,
html[lang="en"] h1,
html[lang="en"] h2,
html[lang="en"] h3 {
  line-height: 1.06;
}

h1 {
  font-size: var(--text-h1);
}

h2 {
  font-size: var(--text-h2);
}

h3 {
  font-size: var(--text-h3);
  line-height: var(--leading-snug);
}

p {
  max-inline-size: var(--measure);
}

.lead {
  font-size: var(--text-lead);
  line-height: 1.6;
  color: var(--muted);
}

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

html[lang="ar"] .eyebrow {
  letter-spacing: normal;
  text-transform: none;
}

.accent {
  color: var(--accent-ink);
}

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

.small {
  font-size: var(--text-sm);
}

.micro {
  font-size: var(--text-micro);
  letter-spacing: 0.08em;
}

/* Numerals inside Arabic copy must not flip when the paragraph is RTL. */
.ltr-num {
  unicode-bidi: isolate;
  direction: ltr;
  display: inline-block;
}

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

/* ---- Layout primitives --------------------------------------------------- */
.shell {
  inline-size: min(100% - (var(--gutter) * 2), var(--shell));
  margin-inline: auto;
}

.section {
  position: relative;
  padding-block: var(--space-section);
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-block-end: var(--space-xl);
  max-inline-size: 46ch;
}

.stack-sm > * + * {
  margin-block-start: var(--space-sm);
}

.stack > * + * {
  margin-block-start: var(--space-md);
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
}

/* A band that steps up off the page ground. In dark it is a lighter black,
   in light a whiter paper — one rule, two correct results. */
.band {
  background: var(--surface);
}

.band-raised {
  background: var(--elevated);
}

/* ---- Atmosphere ---------------------------------------------------------
   The stage light. One fixed radial wash whose centre is a custom property,
   so JS can walk it down the page without touching layout. */
.spotlight {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    58vmax 46vmax at var(--spot-x) var(--spot-y),
    var(--glow) 0%,
    transparent 68%
  );
}

.page {
  position: relative;
  z-index: 1;
}

/* ---- Reveal on scroll ----------------------------------------------------
   IntersectionObserver adds .is-in. Transform + opacity only. With JS off
   or reduced motion on, .reveal elements are simply visible.            */
.js .reveal {
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  transition:
    opacity var(--dur-reveal) var(--ease-out-expo),
    transform var(--dur-reveal) var(--ease-out-expo);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

.js .reveal-deal {
  opacity: 0;
  transform: translate3d(0, 40px, 0);
  transition:
    opacity var(--dur-reveal) var(--ease-out-expo),
    transform var(--dur-reveal) var(--ease-spring);
}

.js .reveal-deal.is-in {
  opacity: 1;
  transform: none;
}

/* The stagger ladder lives in CSS so no inline styles are needed and the
   Content-Security-Policy can stay strict. */
.js .stagger > *:nth-child(2) {
  transition-delay: 70ms;
}

.js .stagger > *:nth-child(3) {
  transition-delay: 140ms;
}

.js .stagger > *:nth-child(4) {
  transition-delay: 210ms;
}

.js .stagger > *:nth-child(5) {
  transition-delay: 280ms;
}

.js .stagger > *:nth-child(6) {
  transition-delay: 350ms;
}

@media (prefers-reduced-motion: reduce) {
  body {
    transition: none;
  }

  .js .reveal,
  .js .reveal-deal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .js .stagger > * {
    transition-delay: 0ms !important;
  }
}
