/* Orpitek — editorial design system
   Layout uses CSS logical properties throughout so an Arabic RTL build is a
   `dir="rtl"` switch, not a rewrite. Do not reintroduce left/right physical
   properties.
   Brass (--accent) is reserved for hairlines, numerals and small marks. It must
   never fill a large area: at scale it reads muddy rather than premium. */

:root {
  --paper: #EFEBE3;
  --paper-2: #E6E1D7;
  --ink: #14120F;
  --ink-2: #45403A;
  --ink-3: #665E51;
  --accent: #7E5811;
  --accent-ink: #5F420C;
  --accent-light: #D9A441;
  --accent-fg: #FFFFFF;
  --rule: rgba(20, 18, 15, 0.14);
  --rule-strong: rgba(20, 18, 15, 0.32);
  /* Inverted blocks (dark bands, footer, primary button) go through their own
     tokens. Binding them to --ink/--paper directly would flip them to light
     bands in the dark theme. */
  --invert-bg: #14120F;
  --invert-fg: #EFEBE3;
  --on-dark: rgba(239, 235, 227, 0.72);
  --on-dark-soft: rgba(239, 235, 227, 0.5);
  --on-dark-rule: rgba(239, 235, 227, 0.22);

  --font-sans: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-ar: 'IBM Plex Sans Arabic', 'Noto Sans Arabic', var(--font-sans);
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --shell: clamp(1rem, 5vw, 6rem);
  --maxw: 1480px;

  --step-1: clamp(0.78rem, 0.74rem + 0.2vw, 0.86rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.09rem);
  --step-1u: clamp(1.2rem, 1.1rem + 0.5vw, 1.5rem);
  --step-2: clamp(1.5rem, 1.3rem + 1vw, 2.1rem);
  --step-3: clamp(2rem, 1.6rem + 2vw, 3.2rem);
  --display: clamp(2.4rem, 1.5rem + 4vw, 5.4rem);
  --display-xl: clamp(2.8rem, 1.5rem + 5.6vw, 7rem);
}

[data-theme="dark"] {
  --paper: #14120F;
  --paper-2: #1C1915;
  --ink: #EFEBE3;
  --ink-2: #C6C0B5;
  --ink-3: #948D80;
  --accent: #D9A441;
  --accent-ink: #E8BC64;
  --accent-light: #D9A441;
  --accent-fg: #14120F;
  --rule: rgba(239, 235, 227, 0.14);
  --rule-strong: rgba(239, 235, 227, 0.30);
  --invert-bg: #241F19;
  --invert-fg: #EFEBE3;
  --on-dark: rgba(239, 235, 227, 0.74);
  --on-dark-soft: rgba(239, 235, 227, 0.52);
  --on-dark-rule: rgba(239, 235, 227, 0.20);
}

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

/* overflow-x: clip (not hidden) — `hidden` on the root makes ScrollTrigger
   mis-measure sticky offsets and can fix elements at the page top. */
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: clip;
  /* Keeps anchor targets clear of the sticky masthead. */
  scroll-padding-block-start: 6rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, p, dl, dd, figure, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--accent); color: var(--accent-fg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip-link {
  position: absolute;
  inset-inline-start: -9999px;
  inset-block-start: 0;
  z-index: 100;
  background: var(--invert-bg);
  color: var(--invert-fg);
  padding: 0.75rem 1.25rem;
  font-size: var(--step-1);
}
.skip-link:focus { inset-inline-start: 0; }

/* ---------- shared type ---------- */

.meta {
  font-family: var(--font-mono);
  font-size: var(--step-1);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}
.meta .num { color: var(--accent); font-weight: 500; }
.meta__dot {
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  align-self: center;
  flex: none;
}

.display {
  font-size: var(--display);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.032em;
  text-wrap: balance;
}
.display--xl { font-size: var(--display-xl); }
.display--sm { font-size: var(--step-3); line-height: 1.04; }

.display__sub {
  font-size: var(--step-2);
  font-weight: 300;
  color: var(--ink-2);
  letter-spacing: -0.01em;
  margin-block-start: 0.6rem;
}

.statement {
  font-size: var(--step-1u);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.muted { color: var(--ink-2); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 1.6rem;
  min-height: 48px;
  font-size: var(--step-1);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  border: 1px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}
.btn .arw { transition: transform 180ms ease; }
.btn:hover .arw { transform: translateX(4px); }

.btn--ink { background: var(--invert-bg); color: var(--invert-fg); border-color: var(--invert-bg); }
.btn--ink:hover { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.btn--ghost:hover { background: var(--invert-bg); color: var(--invert-fg); border-color: var(--ink); }
.btn--accent { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn--accent:hover { background: var(--accent-ink); color: var(--accent-fg); border-color: var(--accent-ink); }
.btn--sm { padding: 0.65rem 1.1rem; min-height: 40px; white-space: nowrap; }
.btn--lg { padding: 1.25rem 2.2rem; font-size: var(--step-0); }
.btn__icon { width: 18px; height: 18px; flex: none; }

/* ---------- masthead ---------- */

.masthead {
  position: sticky;
  inset-block-start: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: saturate(120%) blur(6px);
  border-block-end: 1px solid var(--rule);
}
.masthead__inner {
  position: relative;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 0.9rem var(--shell);
  display: flex;
  align-items: center;
  gap: 2rem;
}
.wordmark {
  display: flex;
  min-width: 0;
  white-space: nowrap;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 1.2rem;
  margin-inline-end: auto;
}
.wordmark__mark {
  width: 26px; height: 26px;
  flex: none;
  color: var(--accent);
}
.footer__mark { width: 34px; height: 34px; color: var(--accent-light); }
.masthead__panel { display: flex; align-items: center; gap: 2rem; }
.nav { display: flex; gap: 1.9rem; font-size: var(--step-1); font-weight: 500; }
.nav a {
  text-decoration: none;
  color: var(--ink-2);
  padding-block: 0.4rem;
  position: relative;
  transition: color 180ms ease;
}
.nav a::after {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  inset-block-end: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 220ms ease;
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after { width: 100%; }

.navtoggle {
  display: none;
  width: 44px;
  height: 44px;
  flex: none;
  border: 1px solid var(--rule-strong);
  background: transparent;
  border-radius: 0;
  cursor: pointer;
  padding: 0;
  place-items: center;
  /* align-content must be centre, not the default stretch: stretched auto rows
     would spread the two bars across the full 44px and the close cross would
     never meet. */
  align-content: center;
  gap: 5px;
  grid-auto-flow: row;
}
.navtoggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 200ms ease, opacity 200ms ease;
}
.navtoggle[aria-expanded="true"] span:first-child { transform: translateY(3.25px) rotate(45deg); }
.navtoggle[aria-expanded="true"] span:last-child { transform: translateY(-3.25px) rotate(-45deg); }

/* ---------- language + theme switches ---------- */

.switches { display: flex; align-items: center; gap: 0.75rem; flex: none; }

.langtoggle,
.themetoggle {
  display: flex;
  border: 1px solid var(--rule-strong);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  overflow: hidden;
}
.langtoggle button,
.langtoggle a,
.themetoggle button {
  border: 0;
  background: transparent;
  color: var(--ink-3);
  font: inherit;
  padding: 0.45rem 0.6rem;
  min-height: 34px;
  cursor: pointer;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}
.langtoggle button[aria-pressed="true"],
.langtoggle a[aria-current="page"],
.themetoggle button[aria-pressed="true"] {
  background: var(--invert-bg);
  color: var(--invert-fg);
}
.langtoggle a:hover,
.langtoggle button:hover {
  background: transparent;
  color: var(--ink);
}
.langtoggle a[aria-current="page"]:hover {
  background: var(--invert-bg);
  color: var(--invert-fg);
}


.themetoggle button { display: grid; place-items: center; padding-inline: 0.55rem; }
.themetoggle svg { width: 15px; height: 15px; }

.masthead__progress { height: 2px; }
.masthead__progress i { display: block; height: 100%; width: 0; background: var(--accent); }

/* ---------- hero ---------- */

.hero {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(3rem, 7vw, 6.5rem) var(--shell) clamp(3rem, 6vw, 5rem);
}

.hero__top {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
  margin-block-end: clamp(2.5rem, 5vw, 4rem);
}

.hero__title { min-width: 0; }

.hero__h1 {
  font-size: clamp(2.6rem, 1.2rem + 4.6vw, 5.6rem);
  font-weight: 800;
  line-height: 0.94;
  letter-spacing: -0.04em;
  margin-block-start: clamp(1.25rem, 3vw, 2.25rem);
}
.hero__h1 .line { display: block; }
.hero__h1 .char { display: inline-block; will-change: transform, opacity; }

.hero__device {
  justify-self: stretch;
  position: relative;
  width: 100%;
  /* Rectangular, not square: a circular composition left dead corners in a
     rectangular slot. */
  aspect-ratio: 5 / 4;
  touch-action: pan-y;
  cursor: pointer;
}

.hero__device canvas { width: 100%; height: 100%; display: block; }

.hero__body {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
  border-block-start: 1px solid var(--rule);
  padding-block-start: clamp(1.75rem, 3vw, 2.75rem);
}

.hero__lede p {
  font-size: var(--step-1u);
  line-height: 1.5;
  letter-spacing: -0.012em;
  max-width: 48ch;
}
.hero__lede p + p { margin-block-start: 1.1rem; }

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-block-start: clamp(1.75rem, 3vw, 2.5rem);
}

.hero__index ol { border-block-start: 1px solid var(--rule); }
.hero__index li {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  border-block-end: 1px solid var(--rule);
  padding-block: 0.7rem;
}
.hero__index span { font-family: var(--font-mono); font-size: var(--step-1); color: var(--accent); }
.hero__index a {
  text-decoration: none;
  font-weight: 500;
  color: var(--ink-2);
  transition: color 180ms ease, transform 180ms ease;
}
.hero__index li:hover a { color: var(--ink); transform: translateX(4px); }

/* ---------- section shell ---------- */

.section {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(4rem, 9vw, 8rem) var(--shell);
  border-block-start: 1px solid var(--rule);
}
.section__head { margin-block-end: clamp(2.5rem, 5vw, 4rem); }
.section__head .meta { margin-block-end: 1.5rem; }
.section__note {
  margin-block-start: clamp(1.25rem, 2.5vw, 2rem);
  max-width: 62ch;
  margin-inline-start: auto;
}
.section__note p + p { margin-block-start: 0.7rem; color: var(--ink-2); }

/* ---------- split layout (rhythm break) ---------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 2.4fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: start;
}
.split__side { position: sticky; inset-block-start: 6rem; }
.split__aside {
  margin-block-start: 1.25rem;
  font-size: var(--step-1);
  color: var(--ink-3);
  max-width: 34ch;
}
.split__main .display { margin-block-end: clamp(1.5rem, 3vw, 2.5rem); }

/* ---------- capability cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-block-start: 1px solid var(--ink);
}
.card {
  padding: clamp(1.4rem, 2.4vw, 2.1rem) clamp(1.15rem, 1.9vw, 1.8rem) clamp(2.2rem, 3.5vw, 3rem);
  border-block-end: 1px solid var(--rule);
  border-inline-end: 1px solid var(--rule);
  transition: background 220ms ease;
}
.card:nth-child(4n) { border-inline-end: none; }
.card:hover { background: var(--paper-2); }
.card__num {
  font-family: var(--font-mono);
  font-size: var(--step-1);
  color: var(--accent);
  display: block;
  margin-block-end: clamp(1.75rem, 3.5vw, 2.75rem);
}
.card h3 {
  font-size: var(--step-1u);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-block-end: 0.85rem;
  text-wrap: balance;
  /* Two lines are reserved so single-line headings still push their paragraph
     to the same baseline as the wrapping ones; without this the body copy
     starts at a different height in every column. */
  min-block-size: 2.3em;
}
.card p { color: var(--ink-2); }

/* A horizontal band, not a tall panel: number, title and description share one
   line so the block stays proportionate to its content. */
.card--wide {
  grid-column: span 4;
  border-inline-end: none;
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr) minmax(0, 1.5fr);
  gap: clamp(1rem, 3vw, 2.5rem);
  align-items: baseline;
  padding-block: clamp(1.5rem, 2.8vw, 2.25rem);
  background: var(--invert-bg);
  color: var(--invert-fg);
}
.card--wide:hover { background: var(--invert-bg); }
.card--wide .card__num { margin-block-end: 0; color: var(--accent-light); }
.card--wide h3 {
  font-size: var(--step-2);
  margin-block-end: 0;
  /* The two-line reserve exists to align the four narrow cards with each other;
     in this single full-width band it only opens an empty gap. */
  min-block-size: 0;
}
.card--wide p { color: var(--on-dark); }

/* ---------- demo ---------- */

.section--demo { background: var(--paper-2); max-width: none; }
.section--demo > * { max-width: var(--maxw); margin-inline: auto; }

.demo {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
.demo__text > p { max-width: 58ch; color: var(--ink-2); }
.demo__text > p + p { margin-block-start: 1.1rem; }

.questions {
  margin-block: clamp(2rem, 4vw, 3rem);
  border-block-start: 1px solid var(--rule-strong);
  padding-block-start: 1.25rem;
}
.questions .meta { margin-block-end: 1rem; }
.questions li {
  padding-block: 0.85rem;
  padding-inline-start: 2.2rem;
  border-block-end: 1px solid var(--rule);
  position: relative;
  font-weight: 500;
  text-wrap: pretty;
}
.questions li::before {
  content: '?';
  position: absolute;
  inset-inline-start: 0;
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 500;
}

.disclaimer {
  margin-block-start: 1.5rem;
  font-size: var(--step-1);
  color: var(--ink-3);
  max-width: 54ch;
}

.stats {
  border: 1px solid var(--ink);
  padding: clamp(1.4rem, 2.6vw, 2rem);
  background: var(--paper);
  position: sticky;
  inset-block-start: 6rem;
}
.stats .meta { margin-block-end: 1.25rem; }
.stat { border-block-start: 1px solid var(--rule); padding-block: 1rem; }
.stat dt { font-size: var(--step-1); color: var(--ink-3); margin-block-end: 0.3rem; }
.stat dd {
  margin: 0;
  font-size: var(--step-3);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stats__src {
  margin-block-start: 1.25rem;
  padding-block-start: 1rem;
  border-block-start: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: var(--step-1);
  color: var(--ink-3);
}

/* ---------- transfer flow ----------
   Three columns rather than full-width bands: the item lists are short, so
   stretched bands left roughly a third of each row empty. */

.flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
}

.flow__col {
  border: 1px solid var(--ink);
  padding: clamp(1.25rem, 2.2vw, 1.9rem);
  background: var(--paper);
  display: flex;
  flex-direction: column;
}

.flow__label {
  font-family: var(--font-mono);
  font-size: var(--step-1);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-block-end: 0.6rem;
}
.flow__step { color: var(--accent); font-weight: 500; }

.flow__col h3 {
  font-size: var(--step-2);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-block-end: clamp(1rem, 2vw, 1.5rem);
}

.flow__list li {
  border-block-start: 1px solid var(--rule);
  padding-block: 0.6rem;
  font-size: var(--step-1);
  font-weight: 500;
}

.flow__col--mid { background: var(--invert-bg); color: var(--invert-fg); }
.flow__col--mid .flow__label { color: var(--on-dark-soft); }
.flow__col--mid .flow__step { color: var(--accent-light); }
.flow__col--mid .flow__list li { border-block-start-color: var(--on-dark-rule); }

/* Output column: brass as a frame and a rule, never as a fill. */
.flow__col--out { border-color: var(--accent); background: var(--paper-2); }
.flow__col--out .flow__list li { border-block-start-color: rgba(126, 88, 17, 0.35); }

.flow__link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-inline: clamp(0.5rem, 1.5vw, 1.25rem);
  color: var(--rule-strong);
}
.flow__link svg { width: clamp(28px, 3vw, 40px); height: auto; }

.pull {
  margin-block-start: clamp(2.5rem, 5vw, 4rem);
  border-block-start: 1px solid var(--ink);
  padding-block-start: clamp(1.5rem, 3vw, 2.25rem);
}
.pull p {
  font-size: var(--step-3);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.14;
  max-width: 28ch;
}
.pull em { font-style: normal; font-weight: 700; }

/* ---------- engineering rows ---------- */

.rows__lede {
  font-family: var(--font-mono);
  font-size: var(--step-1);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-block-end: 1rem;
}
.rows { border-block-start: 1px solid var(--ink); }
.row {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr) minmax(0, 1.3fr);
  gap: clamp(1rem, 3vw, 2.5rem);
  align-items: baseline;
  padding-block: clamp(1.25rem, 2.4vw, 1.9rem);
  border-block-end: 1px solid var(--rule);
  transition: padding-inline-start 220ms ease;
}
.row:hover { padding-inline-start: 0.75rem; }
.row__num { font-family: var(--font-mono); font-size: var(--step-1); color: var(--accent); }
.row h3 {
  font-size: var(--step-1u);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.row p { color: var(--ink-2); font-size: var(--step-1); }

/* ---------- process steps ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--rule-strong);
  border: 1px solid var(--rule-strong);
}
.step {
  background: var(--paper);
  padding: clamp(1.4rem, 2.5vw, 2rem) clamp(1.1rem, 2vw, 1.6rem) clamp(2.2rem, 3.5vw, 3rem);
  transition: background 220ms ease, color 220ms ease;
}
.step:hover { background: var(--invert-bg); color: var(--invert-fg); }
.step:hover p { color: var(--on-dark); }
.step:hover .step__num { color: var(--accent-light); }
.step__num {
  font-family: var(--font-mono);
  font-size: var(--step-2);
  font-weight: 500;
  color: var(--accent);
  display: block;
  margin-block-end: clamp(1.25rem, 2.5vw, 2rem);
  letter-spacing: -0.02em;
  transition: color 220ms ease;
}
.step h3 {
  font-size: var(--step-1u);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-block-end: 0.6rem;
}
.step p { color: var(--ink-2); transition: color 220ms ease; }

.process__note {
  margin-block-start: clamp(1.75rem, 3.5vw, 2.75rem);
  font-size: var(--step-1u);
  font-weight: 500;
  letter-spacing: -0.015em;
  max-width: 56ch;
  margin-inline-start: auto;
  text-align: end;
  color: var(--ink-2);
}

/* ---------- about ---------- */

.section--about { background: var(--paper-2); max-width: none; }
.section--about > * { max-width: var(--maxw); margin-inline: auto; }

.about {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
.about__text .meta { margin-block-end: 1.5rem; }
.about__text .display { margin-block-end: clamp(1.5rem, 3vw, 2.25rem); }
.about__text p { line-height: 1.6; max-width: 58ch; color: var(--ink-2); }
.about__text p + p { margin-block-start: 1rem; }

.about__card {
  border: 1px solid var(--ink);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  background: var(--paper);
}
.about__card .meta { margin-block-end: 1.25rem; }
.about__name {
  font-size: var(--step-1u);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-block-end: 0.5rem;
}
.credentials { margin-block-start: 1.25rem; }
.credentials div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-block-start: 1px solid var(--rule);
  padding-block: 0.7rem;
  font-size: var(--step-1);
}
.credentials dt { color: var(--ink-3); }
.credentials dd { margin: 0; font-weight: 600; text-align: end; font-family: var(--font-mono); }

/* ---------- contact ---------- */

.section--contact {
  background: var(--invert-bg);
  color: var(--invert-fg);
  max-width: none;
  border-block-start: none;
}
.section--contact > * { max-width: var(--maxw); margin-inline: auto; }
.section--contact .display { margin-block-end: clamp(2rem, 4vw, 3rem); }

.contact {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto;
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
  border-block-start: 1px solid var(--on-dark-rule);
  padding-block-start: clamp(1.75rem, 3vw, 2.5rem);
}
.contact p { font-size: var(--step-1u); line-height: 1.5; max-width: 50ch; }
.contact__sub { color: var(--on-dark); margin-block-start: 0.6rem; }
.contact__actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }
.contact .btn--ghost { color: var(--paper); border-color: var(--on-dark-rule); }
.contact .btn--ghost:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }

/* ---------- footer ---------- */

.footer {
  background: var(--invert-bg);
  color: var(--invert-fg);
  padding: clamp(3rem, 6vw, 5rem) var(--shell) 2rem;
}
.footer__inner {
  max-width: var(--maxw);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 4vw, 4rem);
  border-block-start: 1px solid var(--on-dark-rule);
  padding-block-start: clamp(2rem, 4vw, 3rem);
}
.footer__brand .wordmark__mark { margin-block-end: 1rem; }
.footer__name {
  font-size: var(--step-2);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-block-end: 0.5rem;
}
.footer__tag { color: var(--on-dark-soft); font-size: var(--step-1); }
.footer__col .meta { color: var(--on-dark-soft); margin-block-end: 1rem; }
.footer__col a {
  display: inline-block;
  text-decoration: none;
  font-weight: 500;
  border-block-end: 1px solid var(--accent-light);
  padding-block-end: 2px;
  margin-block-end: 0.6rem;
  transition: color 180ms ease;
}
.footer__col a:hover { color: var(--accent-light); }
.footer__addr { margin-block-start: 1rem; color: var(--on-dark-soft); font-size: var(--step-1); }

.footer__legal {
  max-width: var(--maxw);
  margin-inline: auto;
  margin-block-start: clamp(2.5rem, 5vw, 4rem);
  padding-block-start: 1.5rem;
  border-block-start: 1px solid rgba(239, 235, 227, 0.14);
  font-family: var(--font-mono);
  font-size: var(--step-1);
  color: var(--on-dark-soft);
}

[data-reveal] { will-change: transform, opacity; }

/* ---------- Arabic / RTL ----------
   Arabic script has no case and reacts badly to the tight negative tracking the
   Latin display type relies on, so tracking is reset rather than inherited. */

[dir="rtl"] body { font-family: var(--font-ar); }
[dir="rtl"] .display,
[dir="rtl"] .hero__h1,
[dir="rtl"] .statement,
[dir="rtl"] .flow__col h3,
[dir="rtl"] .card h3,
[dir="rtl"] .about__name,
[dir="rtl"] .footer__name { letter-spacing: normal; line-height: 1.25; }

[dir="rtl"] .meta,
[dir="rtl"] .flow__label,
[dir="rtl"] .langtoggle,
.themetoggle { letter-spacing: 0.04em; }

[dir="rtl"] .hero__h1 { line-height: 1.15; }
[dir="rtl"] .pull p { line-height: 1.4; }

/* Directional glyphs must mirror; the layout itself is already logical. */
[dir="rtl"] .arw,
[dir="rtl"] .flow__link svg { transform: scaleX(-1); }
[dir="rtl"] .btn:hover .arw { transform: scaleX(-1) translateX(4px); }
[dir="rtl"] .footer__col a,
[dir="rtl"] .about__ref a { unicode-bidi: isolate; }

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
  .navtoggle { display: grid; }

  /* Language and theme controls move out of the bar and into the panel: five
     competing elements in a ~400px row clipped the wordmark and wrapped the
     CTA onto two lines. */
  .masthead__panel {
    position: absolute;
    inset-inline: 0;
    inset-block-start: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border-block-end: 1px solid var(--rule);
    padding: 0 var(--shell) 1.25rem;
    display: none;
  }
  .masthead__panel[data-open] { display: flex; }

  .nav { flex-direction: column; gap: 0; }
  .nav a {
    padding-block: 0.95rem;
    border-block-start: 1px solid var(--rule);
    font-size: var(--step-0);
    color: var(--ink);
  }
  .nav a::after { display: none; }

  .switches {
    justify-content: flex-start;
    gap: 1rem;
    padding-block-start: 1.25rem;
    border-block-start: 1px solid var(--rule);
  }

  .flow { grid-template-columns: 1fr; }
  .flow__link { padding-block: 0.75rem; padding-inline: 0; }
  .flow__link svg { transform: rotate(90deg); width: 34px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .card:nth-child(4n) { border-inline-end: 1px solid var(--rule); }
  .card:nth-child(2n) { border-inline-end: none; }
  .card--wide { grid-column: span 2; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .split__side { position: static; }
}

@media (max-width: 900px) {
  .hero__top { grid-template-columns: 1fr; }
  .hero__device { width: min(80%, 22rem); margin-block-start: 1.5rem; }

  .hero__body,
  .demo,
  .about,
  .contact,
  .footer__inner { grid-template-columns: 1fr; }

  .stats { position: static; }
  .row { grid-template-columns: 3rem 1fr; }
  .row p { grid-column: 2; }
  .process__note { text-align: start; margin-inline-start: 0; }
  .section__note { margin-inline-start: 0; }
  .card--wide { grid-template-columns: 3rem minmax(0, 1fr); }
  .card--wide p { grid-column: 2; margin-block-start: 0.75rem; }
}

@media (max-width: 700px) {
  .masthead__inner { gap: 0.75rem; }
  /* The CTA is the conversion action — shrink it, never hide it. */
  .masthead .btn { padding: 0.6rem 0.85rem; font-size: 0.75rem; }
  /* On a phone the headline, lede and CTA own the first screen; a 600px tall
     decorative canvas pushed all three below the fold. */
  .hero__device { display: none; }
}

@media (max-width: 600px) {
  .cards { grid-template-columns: 1fr; }
  .card { border-inline-end: none !important; }
  .card--wide { grid-column: span 1; }
  .steps { grid-template-columns: 1fr; }
  .wordmark { font-size: 1.05rem; }
  .wordmark__mark { width: 22px; height: 22px; }
}

@media (max-width: 380px) {
  .masthead .btn { display: none; }
}

/* ---------- reduced motion ---------- */

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