/* ==========================================================================
   Plinth
   Colour, type and motion tokens first. Everything scroll-driven is fed by
   custom properties that app.js writes (--move, --morph, --q, --idx ...).
   ========================================================================== */

@property --wd { syntax: "<number>"; inherits: true; initial-value: 100; }
@property --ws { syntax: "<number>"; inherits: true; initial-value: 0; }

:root {
  --chalk: #ECEEF8;
  --cobalt: #2A2BFF;
  --ink: #0E1034;
  --pink: #FFA8D6;
  --sky: #BCC9FF;
  --paper: #F7F8FF;
  --mist: #E4E7F7;

  /* the page colours; app.js blends these between sections as you scroll */
  --bg: var(--chalk);
  --fg: var(--ink);

  --font-display: "Anybody", "Arial Narrow", Arial, sans-serif;
  --font-text: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(20px, 4vw, 56px);
  --head-h: 72px;
  /* logo colours; app.js re-blends these with the page colour */
  --logo-tile: #2A2BFF;
  --logo-a: #ECEEF8;
  --logo-b: #FFA8D6;
  --dirx: 1;            /* 1 in English, -1 in Arabic: flips horizontal motion */
}

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

html {
  background: var(--bg);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 1.0625rem/1.55 var(--font-text);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }

:focus-visible { outline: 3px solid var(--fg); outline-offset: 4px; border-radius: 4px; }

.skip {
  position: fixed; inset-inline-start: 12px; top: -80px; z-index: 100;
  padding: 10px 16px; background: var(--ink); color: var(--chalk); border-radius: 8px;
}
.skip:focus { top: 12px; }

.probe { position: fixed; left: 0; top: 0; width: 1px; height: 100svh; visibility: hidden; pointer-events: none; }

/* ---------- Display type ---------- */

.hero-title, .h2, .cta-title, .about-text, .panel h3, .proj h3, .step h3, .mq-i, .wordmark, .reel, .brand-name, .mail {
  font-family: var(--font-display);
  font-variation-settings: "wdth" calc(var(--wd) + var(--ws));
}

.h2 {
  font-weight: 800;
  font-size: clamp(2.8rem, 7.4vw, 7.5rem);
  line-height: .92;
  letter-spacing: -.025em;
}

/* ---------- Line mask reveal (headings and short paragraphs) ---------- */

.l { display: block; }

.js .rv .l {
  overflow: hidden;
  padding-block: .1em;
  margin-block: -.1em;
}
.js .rv .l > span {
  display: block;
  transform: translate3d(0, 115%, 0);
  transition: transform 1.2s cubic-bezier(.2, .8, .1, 1) calc(var(--d, 0) * 110ms);
}
.js .rv.in .l > span { transform: none; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center;
  padding: 11px 20px;
  border: 2px solid currentColor;
  border-radius: 999px;
  font-weight: 600; font-size: .95rem; line-height: 1.1;
  text-decoration: none; white-space: nowrap;
  transition: background-color .25s, color .25s;
}
.btn:hover { background: var(--fg); color: var(--bg); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  padding: 4px 12px;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  font-size: .85rem; font-weight: 500; line-height: 1.4;
}

/* ---------- Header and progress ---------- */

.progress {
  position: fixed; left: 0; top: 0; z-index: 70;
  width: 100%; height: 3px;
  background: var(--fg);
  transform-origin: 0 50%;
  transform: scaleX(var(--prog, 0));
}

.site-head {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  height: var(--head-h);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 0 var(--gutter);
  color: var(--fg);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { flex: none; display: block; }
.brand-mark .lg-tile { fill: var(--logo-tile); }
.brand-mark .lg-a { fill: var(--logo-a); }
.brand-mark .lg-b { fill: var(--logo-b); }
.brand-text { display: flex; flex-direction: column; gap: 3px; }
.brand-name { --wd: 118; font-weight: 800; font-size: 1.2rem; letter-spacing: -.015em; line-height: 1; white-space: nowrap; }
.brand small { font-size: .72rem; font-weight: 600; line-height: 1; opacity: .75; }
.site-nav { display: flex; gap: clamp(18px, 3vw, 40px); margin-inline-start: auto; }
.head-actions { display: flex; align-items: center; gap: 10px; }
.btn.lang { padding: 9px 16px; font-size: .9rem; }
.site-nav a {
  text-decoration: none; font-weight: 500; font-size: .98rem;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat;
  padding-bottom: 3px;
  transition: background-size .3s;
}
.site-nav a:hover { background-size: 100% 2px; }

/* ---------- Pinned sections ---------- */

.pin { position: relative; }
.stage { position: sticky; top: 0; height: 100svh; overflow: hidden; }

/* ==========================================================================
   1. Hero
   ========================================================================== */

.hero {
  height: 400svh;
  --w0: min(62vw, 900px);
  --h0: min(56svh, 540px);
  --w1: min(68vw, 296px);
  --h1: min(80svh, calc(var(--w1) * 2.1));
  --dx0: 15vw;
  --dy0: 33svh;
  --rot0: -4deg;
  --chip-d: min(25vw, 270px);
}

.hero .stage {
  --move: 0; --morph: 0; --exit: 0; --word: 0; --chips: 0; --dive: 0; --ud: 1; --um: 0;
}

.hero-title {
  position: absolute; z-index: 1;
  inset-inline-start: var(--gutter);
  top: clamp(92px, 15svh, 160px);
  font-weight: 800;
  font-size: clamp(3.4rem, 11vw, 12.5rem);
  line-height: .9;
  letter-spacing: -.025em;
  animation: wd-in 1.9s cubic-bezier(.2, .7, .1, 1) both paused;
}
.ready .hero-title { animation-play-state: running; }
@keyframes wd-in { from { --wd: 50; } to { --wd: 100; } }

.hero-title .l {
  transform: translate3d(calc(var(--dir) * var(--exit) * 135vw), 0, 0);
}

.hero-sub {
  position: absolute; z-index: 1;
  inset-inline-end: var(--gutter);
  top: clamp(108px, 18svh, 180px);
  width: min(27rem, 28vw);
  font-size: 1.15rem; line-height: 1.5;
  opacity: calc(1 - var(--exit) * 1.8);
  transform: translate3d(0, calc(var(--exit) * -30px), 0);
}

.behind {
  position: absolute; z-index: 1; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(5rem, 14.5vw, 16rem);
  line-height: .86;
  letter-spacing: -.03em;
  color: var(--cobalt);
  font-variation-settings: "wdth" calc(55 + var(--word) * var(--wspan, 95));
  opacity: var(--word);
  transform: scale(calc(.9 + var(--word) * .1));
  pointer-events: none;
}

.device-pos {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  animation: rise 1.6s .3s cubic-bezier(.2, .8, .1, 1) both paused;
}
.ready .device-pos { animation-play-state: running; }
@keyframes rise { from { transform: translate3d(0, 46svh, 0); opacity: 0; } to { transform: none; opacity: 1; } }

.device {
  position: absolute; left: 50%; top: 50%;
  width: calc(var(--w0) + (var(--w1) - var(--w0)) * var(--morph));
  height: calc(var(--h0) + (var(--h1) - var(--h0)) * var(--morph));
  padding: calc(10px * var(--morph));
  display: flex; flex-direction: column;
  background: var(--ink);
  border-radius: calc(14px + 42px * var(--morph));
  box-shadow: 0 50px 90px -30px rgba(14, 16, 52, .55);
  transform:
    translate(-50%, -50%)
    translate(calc(var(--dx0) * (1 - var(--move))), calc(var(--dy0) * (1 - var(--move))))
    rotate(calc(var(--rot0) * (1 - var(--move))))
    scale(calc(1 + var(--dive) * 9));
}

.chrome {
  flex: none;
  height: calc(40px * (1 - var(--morph)));
  opacity: calc(1 - var(--morph) * 2.4);
  display: flex; align-items: center; gap: 7px;
  padding: 0 16px;
  overflow: hidden;
}
.chrome i { flex: none; width: 10px; height: 10px; border-radius: 50%; background: rgba(236, 238, 248, .3); }
.chrome span {
  flex: 0 1 260px; min-width: 0; margin-inline-start: 14px;
  height: 22px; padding: 0 12px;
  border-radius: 11px; background: rgba(236, 238, 248, .12);
  color: rgba(236, 238, 248, .7);
  font-size: 12px; line-height: 22px; white-space: nowrap; overflow: hidden;
}

.screen {
  position: relative; flex: 1; min-height: 0; overflow: hidden;
  background: var(--cobalt);
  border-radius:
    calc(32px * var(--morph)) calc(32px * var(--morph))
    calc(14px + 32px * var(--morph)) calc(14px + 32px * var(--morph));
}

.island {
  position: absolute; left: 50%; top: 20px;
  width: 78px; height: 22px; margin-left: -39px;
  border-radius: 11px; background: var(--ink);
  opacity: calc((var(--morph) - .6) * 3);
}

.ui { position: absolute; inset: 0; }

/* the web-app face of the device */
.ui-desk {
  display: grid; grid-template-columns: clamp(40px, 13%, 150px) minmax(0, 1fr);
  background: var(--paper); color: var(--ink);
  font-size: 12px; line-height: 1.3;
  opacity: var(--ud);
  filter: blur(calc((1 - var(--ud)) * 8px));
}
.d-side { background: #15184A; padding: 16px 12px; display: flex; flex-direction: column; gap: 10px; }
.d-side i { display: block; height: 10px; border-radius: 5px; background: rgba(236, 238, 248, .18); }
.d-side i:first-child { width: 22px; height: 22px; border-radius: 7px; background: var(--pink); margin-bottom: 10px; }
.d-main { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.d-top { display: flex; align-items: center; gap: 12px; }
.d-top b { font-size: 15px; }
.d-search { flex: 1; max-width: 220px; height: 26px; margin-left: auto; border-radius: 13px; background: var(--mist); }
.d-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.kpi { border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi small { font-size: 11px; opacity: .8; white-space: nowrap; overflow: hidden; }
.kpi strong { font: 800 28px/1 var(--font-display); }
.k1 { background: var(--cobalt); color: var(--chalk); }
.k2 { background: var(--pink); }
.k3 { background: var(--mist); }
.d-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 1.25fr 1fr; gap: 12px; }
.d-chart { display: flex; align-items: flex-end; gap: 6px; padding: 14px; border-radius: 12px; background: #fff; min-height: 0; }
.d-chart i { flex: 1; height: var(--h); border-radius: 4px 4px 0 0; background: var(--cobalt); }
.d-chart i.hot { background: var(--pink); }
.d-list { display: flex; flex-direction: column; gap: 8px; overflow: hidden; min-width: 0; }
.d-list li { display: flex; justify-content: space-between; gap: 8px; padding: 9px 12px; border-radius: 10px; background: #fff; white-space: nowrap; }
.d-list b { font-weight: 600; color: #1E8A57; }
.d-list b.late { color: #C23B5A; }

/* the phone face of the device */
.ui-mob {
  display: flex; flex-direction: column; gap: 14px;
  padding: 18px 16px 14px;
  background: var(--cobalt); color: var(--chalk);
  font-size: 13px; line-height: 1.3;
  opacity: var(--um);
}
.m-status { display: flex; justify-content: space-between; padding: 0 12px; font-size: 12px; font-weight: 600; }
.m-head { margin-top: 10px; display: flex; flex-direction: column; }
.m-head small { opacity: .75; }
.m-head b { font: 800 30px/1.05 var(--font-display); }
.m-card { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 2px; padding: 16px; border-radius: 20px; background: var(--pink); color: var(--ink); }
.m-card small { opacity: .7; }
.m-card strong { font: 800 26px/1 var(--font-display); }
.m-card svg { display: block; width: 100%; margin-top: 10px; }
.m-list { display: flex; flex-direction: column; gap: 8px; }
.m-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(236, 238, 248, .14); }
.m-list i { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--chalk); }
.m-list span { display: flex; flex-direction: column; font-weight: 600; }
.m-list small { font-weight: 400; opacity: .7; }
.m-tabs { margin-top: auto; display: flex; justify-content: space-around; padding: 12px; border-radius: 20px; background: rgba(14, 16, 52, .35); }
.m-tabs i { width: 22px; height: 22px; border-radius: 7px; background: var(--chalk); opacity: .85; }
.m-tabs i:nth-child(2) { opacity: .35; }
.m-tabs i:nth-child(3) { opacity: .35; }

/* chips beside the phone */
.chips { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.chip {
  position: absolute; left: 50%; top: 50%;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--paper); color: var(--ink);
  font-weight: 700; font-size: 1rem; line-height: 1;
  box-shadow: 0 18px 30px -14px rgba(14, 16, 52, .5);
  transform: translate(-50%, -50%) translate(calc(var(--x) * var(--chips) * var(--chip-d)), var(--y)) scale(var(--chips));
  opacity: var(--chips);
}
.c1 { --x: -1; --y: -16svh; }
.c2 { --x: 1; --y: -4svh; background: var(--pink); }
.c3 { --x: -1.15; --y: 14svh; background: var(--ink); color: var(--chalk); }

.scroll-cue {
  position: absolute; z-index: 3; inset-inline-start: var(--gutter); bottom: 28px;
  display: flex; align-items: center; gap: 12px;
  font-weight: 600; font-size: .92rem;
  opacity: calc(1 - var(--move) * 5);
}
.scroll-cue i {
  display: block; width: 2px; height: 46px; background: currentColor;
  transform-origin: 50% 0;
  animation: cue 2s cubic-bezier(.6, 0, .3, 1) infinite;
}
@keyframes cue {
  0% { transform: scaleY(0); transform-origin: 50% 0; }
  50% { transform: scaleY(1); transform-origin: 50% 0; }
  50.01% { transform: scaleY(1); transform-origin: 50% 100%; }
  100% { transform: scaleY(0); transform-origin: 50% 100%; }
}

/* ==========================================================================
   2. About
   ========================================================================== */

.about { height: 300svh; }
.about .stage { display: flex; align-items: center; padding: 0 var(--gutter); }
.about-text {
  max-width: 19em;
  font-weight: 600;
  font-size: clamp(1.95rem, 4.5vw, 4.7rem);
  line-height: 1.1;
  letter-spacing: -.015em;
}
.w {
  display: inline-block;
  opacity: calc(.14 + var(--a, 1) * .86);
  transform: translate3d(0, calc((1 - var(--a, 1)) * .3em), 0);
}
.about-rule {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: 11svh;
  height: 4px; background: var(--pink);
  transform-origin: 0 50%;
  transform: scaleX(var(--rule, 1));
}

/* ==========================================================================
   3. Services (horizontal track)
   ========================================================================== */

.services { height: 300svh; }
.services .stage {
  display: flex; flex-direction: column; justify-content: space-between;
  padding: calc(var(--head-h) + clamp(14px, 3svh, 36px)) 0 clamp(20px, 4svh, 40px);
}
.svc-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 32px;
  padding: 0 var(--gutter);
}
.svc-head .h2 { font-size: clamp(2.6rem, 6.4vw, 6.4rem); }
.svc-intro { max-width: 22rem; font-size: 1.1rem; }

.track {
  display: flex; gap: clamp(14px, 2vw, 28px);
  width: max-content;
  padding: 0 var(--gutter);
  will-change: transform;
}

.panel {
  flex: none;
  width: clamp(300px, 56vw, 740px);
  height: min(58svh, 530px);
  padding: clamp(18px, 2.2vw, 32px);
  display: flex; flex-direction: column; justify-content: space-between; gap: 12px;
  border-radius: 32px;
  overflow: hidden;
}
.panel .ill { flex: 1; min-height: 0; width: 100%; }
.panel h3 { font-weight: 800; font-size: clamp(1.7rem, 2.8vw, 2.7rem); line-height: 1; letter-spacing: -.02em; margin-bottom: 10px; }
.panel-body p { max-width: 40ch; margin-bottom: 14px; }

.p-web { background: var(--ink); color: var(--chalk); --acc: var(--pink); }
.p-mob { background: var(--cobalt); color: var(--chalk); --acc: var(--pink); }
.p-sw  { background: var(--pink); color: var(--ink); --acc: var(--cobalt); }
.p-api { background: var(--paper); color: var(--ink); --acc: var(--cobalt); box-shadow: inset 0 0 0 2px var(--ink); }

.svc-bar { margin: 0 var(--gutter); height: 4px; background: color-mix(in srgb, var(--fg) 16%, transparent); }
.svc-bar i { display: block; height: 100%; background: var(--fg); transform-origin: 0 50%; transform: scaleX(0); }

/* ---------- Illustrations: each element reads its own progress --l (0 to 1) ---------- */

.ill * { --l: clamp(0, calc(var(--q, 0) * 1.9 - var(--i, 0) * .16), 1); }
.ill .st { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ill .acc { fill: var(--acc, currentColor); }
.ill .draw { stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--l)); opacity: clamp(0, calc(var(--l) * 30), 1); }
.ill .grow { transform-box: fill-box; transform-origin: 50% 100%; transform: scaleY(var(--l)); }
.ill .grow-x { transform-box: fill-box; transform-origin: 0 50%; transform: scaleX(var(--l)); }
.ill .pop { transform-box: fill-box; transform-origin: 50% 50%; transform: scale(var(--l)); }
.ill .slide { transform: translate3d(calc((1 - var(--l)) * var(--from, 120px)), 0, 0); opacity: var(--l); }
.ill .drop { transform: translate3d(0, calc((1 - var(--l)) * -160px), 0); opacity: var(--l); }
.ill .snap {
  transform-box: fill-box; transform-origin: 50% 50%;
  transform: translate(calc(var(--dx) * (1 - var(--l))), calc(var(--dy) * (1 - var(--l)))) rotate(calc(var(--r) * (1 - var(--l))));
  opacity: var(--l);
}

/* ==========================================================================
   4. Work (stacking deck)
   ========================================================================== */

.work { padding: 0 var(--gutter) 16svh; }
.work-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 32px;
  padding: calc(var(--head-h) + 14svh) 0 8svh;
}
.work-head p { max-width: 20rem; font-size: 1.1rem; }

.proj {
  position: sticky;
  top: calc(var(--head-h) + 16px + var(--i) * 26px);
  height: min(640px, calc(100svh - var(--head-h) - 120px));
  margin-bottom: 20svh;
  padding: clamp(18px, 3vw, 44px);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(16px, 3vw, 48px);
  border-radius: 32px;
  transform-origin: 50% 0;
  transform: scale(calc(1 - var(--cover, 0) * .06));
}
.proj:last-child { margin-bottom: 0; }
.proj::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: var(--ink); opacity: calc(var(--cover, 0) * .5);
}
.j1 { background: var(--pink); color: var(--ink); }
.j2 { background: var(--sky); color: var(--ink); }
.j3 { background: var(--paper); color: var(--ink); }
.j4 { background: var(--cobalt); color: var(--chalk); }

.proj-text { display: flex; flex-direction: column; justify-content: space-between; gap: 16px; min-width: 0; }
.proj h3 { font-weight: 800; font-size: clamp(2.6rem, 6vw, 5.6rem); line-height: .9; letter-spacing: -.03em; }
.proj-lead { font-weight: 600; font-size: 1.2rem; line-height: 1.3; margin-bottom: 10px; }
.proj-text > p { max-width: 36ch; }
.proj-vis { border-radius: 20px; overflow: hidden; min-height: 0; }
.proj-vis .ill { display: block; width: 100%; height: 100%; }
.proj-text .tags { margin-top: auto; }

/* ==========================================================================
   5. Process (numeral reel)
   ========================================================================== */

.process { padding: 0 var(--gutter); }
.process-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(20px, 4vw, 64px); }
.reel-col { position: sticky; top: 0; height: 100svh; display: flex; align-items: center; }
.reel { height: 1em; overflow: hidden; font-weight: 800; font-size: clamp(12rem, 36vw, 38rem); line-height: 1; letter-spacing: -.04em; --wd: 110; }
.reel-in { display: flex; flex-direction: column; transform: translate3d(0, calc(var(--idx, 0) * -1em), 0); }
.reel-in span { display: block; height: 1em; line-height: 1; }

.process-main { padding: calc(var(--head-h) + 14svh) 0 24svh; }
.process-main .h2 { margin-bottom: 8svh; }

.steps { --pad: clamp(34px, 5vw, 72px); position: relative; padding-inline-start: var(--pad); }
.rail { position: absolute; inset-inline-start: 0; width: 4px; background: color-mix(in srgb, var(--fg) 18%, transparent); }
.rail i { display: block; width: 100%; height: 100%; background: var(--fg); transform-origin: 50% 0; transform: scaleY(var(--lp, 0)); }

.step {
  position: relative;
  min-height: 74svh;
  display: flex; flex-direction: column; justify-content: center;
  opacity: var(--o, 1);
  transform: translate3d(calc((1 - var(--o, 1)) * 48px * var(--dirx)), 0, 0);
}
.step::before {
  content: ""; position: absolute; top: 50%; inset-inline-start: calc(var(--pad) * -1 + 2px);
  width: 16px; height: 16px; border-radius: 50%; background: var(--fg);
  transform: translate(calc(-50% * var(--dirx)), -50%) scale(calc(.5 + var(--o, 1) * .9));
}
.step h3 { font-weight: 800; font-size: clamp(2.4rem, 5.4vw, 5.2rem); line-height: .95; letter-spacing: -.025em; margin-bottom: 18px; }
.step p { max-width: 34ch; font-size: 1.2rem; }
.step-n { display: none; }

/* ==========================================================================
   6. Stack marquee
   ========================================================================== */

.stack { padding: 16svh 0 18svh; overflow: hidden; }
.mq { overflow: hidden; padding: .04em 0; direction: ltr; }
.mq-i { font-family: "Anybody", "Arial Narrow", Arial, sans-serif; }
.mq-track { display: flex; width: max-content; will-change: transform; }
.mq-set { display: flex; align-items: center; flex: none; }
.mq-i {
  flex: none; font-weight: 800; --wd: 120;
  font-size: clamp(4.4rem, 12.5vw, 12rem); line-height: 1.04; letter-spacing: -.03em;
}
.mq-i.o { color: transparent; -webkit-text-stroke: 2px currentColor; }
.mq-d { flex: none; width: .16em; height: .16em; margin: 0 clamp(20px, 3.4vw, 56px); border-radius: 50%; background: var(--cobalt); font-size: clamp(4.4rem, 12.5vw, 12rem); }
.stack-note { margin: 10svh var(--gutter) 0; max-width: 26rem; font-size: 1.25rem; font-weight: 500; }

/* ==========================================================================
   7. Contact
   ========================================================================== */

.cta {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(96px, 16svh, 170px) var(--gutter) 0;
  overflow: hidden;
}
.cta-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.cta-title { font-weight: 800; font-size: clamp(3.2rem, 9.4vw, 10.5rem); line-height: .92; letter-spacing: -.03em; }
.cta-side { max-width: none; display: flex; flex-direction: column; gap: 22px; font-size: 1.15rem; }
.cta-side p { max-width: 24rem; }
.mail { max-width: 100%; overflow-wrap: anywhere; }
.mail {
  --wd: 110;
  align-self: flex-start;
  font-weight: 700; font-size: clamp(1.4rem, 2.4vw, 2.1rem); line-height: 1.1; letter-spacing: -.01em;
  text-decoration: none;
  padding-bottom: 4px;
  background: linear-gradient(var(--pink), var(--pink)) 0 100% / 100% 4px no-repeat;
  transition: background-size .3s, color .3s;
}
.mail:hover { background-size: 100% 100%; color: var(--ink); }
@media (max-width: 520px) { .mail { font-size: clamp(.95rem, 4.3vw, 1.4rem); } }

.cta-bottom { margin-top: 10svh; }
.foot-row { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-size: .95rem; padding-bottom: 2svh; }
.foot-row nav { display: flex; gap: 24px; }
.foot-row a { text-decoration: none; }
.foot-row a:hover { text-decoration: underline; text-underline-offset: 4px; }
.wordmark {
  margin: 0;
  font-weight: 800; font-size: var(--wm-size, 11.5vw); line-height: .8; letter-spacing: .02em; text-transform: uppercase;
  white-space: nowrap; text-align: center;
  color: var(--pink);
  transform: skewX(6.3deg);
  user-select: none;
}

/* ==========================================================================
   Small screens
   ========================================================================== */

@media (max-width: 900px) {
  .site-nav { display: none; }
  .svc-head, .work-head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .svc-intro { display: none; }
}

@media (max-width: 760px) {
  :root { --head-h: 64px; }

  .hero {
    --w0: min(88vw, 900px);
    --h0: min(44svh, 420px);
    --dx0: 0px;
    --dy0: 21svh;
    --chip-d: 32vw;
  }
  .hero { --w1: min(62vw, 296px); }
  .hero-title { font-size: clamp(2.9rem, 12.6vw, 6rem); top: 92px; }
  .hero-sub { left: var(--gutter); right: var(--gutter); width: auto; top: calc(92px + 34vw + 20px); font-size: 1rem; }
  .behind { --wspan: 62; justify-content: space-between; padding: calc(var(--head-h) + 6px) 0 6svh; font-size: 18vw; }
  .chips { display: none; }
  .kpi strong { font-size: 20px; }

  .about-rule { bottom: 8svh; }

  .panel { width: min(84vw, 380px); height: min(64svh, 520px); border-radius: 26px; }
  .panel-body p { font-size: .98rem; margin-bottom: 10px; }

  .proj { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); border-radius: 26px; height: min(640px, calc(100svh - var(--head-h) - 80px)); }
  .proj-text > p:not(.proj-lead) { display: none; }
  .proj-text .tags { margin-top: 0; }
  .proj h3 { font-size: clamp(2.4rem, 12vw, 3.6rem); }

  .process-grid { grid-template-columns: 1fr; }
  .reel-col { display: none; }
  .step { min-height: 62svh; }
  .step-n { display: block; font: 800 clamp(5rem, 28vw, 8rem)/.9 var(--font-display); margin-bottom: 8px; letter-spacing: -.04em; }

  .cta-top { flex-direction: column; align-items: flex-start; }
}

@media (max-height: 640px) and (min-width: 761px) {
  .hero-title { font-size: clamp(3rem, 14svh, 9rem); }
}

/* ==========================================================================
   Reduced motion: keep layout and scroll-linked state, drop the flourishes
   ========================================================================== */

.no-intro .hero-title, .no-intro .device-pos { animation: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-title, .device-pos { animation: none; }
  .scroll-cue i { animation: none; transform: none; }
  .js .rv .l > span { transform: none; transition: none; }
  .mq-track { transform: none !important; }
}

/* ==========================================================================
   Arabic (html[lang="ar"], dir="rtl")
   Same layout, mirrored. Arabic faces have no width axis, so the "stretch"
   moments use scaleX instead, and joined letters are never letter-spaced.
   ========================================================================== */

html[lang="ar"] {
  --font-display: "Cairo", "Anybody", Arial, sans-serif;
  --font-text: "IBM Plex Sans Arabic", "Instrument Sans", system-ui, sans-serif;
}
html[dir="rtl"] { --dirx: -1; }

html[lang="ar"] body { font-size: 1.1rem; line-height: 1.75; }
html[lang="ar"] *, html[lang="ar"] *::before, html[lang="ar"] *::after { letter-spacing: 0 !important; }

/* progress fills grow from the right edge */
html[dir="rtl"] .progress,
html[dir="rtl"] .svc-bar i,
html[dir="rtl"] .about-rule { transform-origin: 100% 50%; }

/* the device sits on the opposite side and leans the other way */
html[dir="rtl"] .hero { --dx0: -15vw; --rot0: 4deg; }
html[dir="rtl"] .m-card svg { transform: scaleX(-1); }
html[dir="rtl"] .c1 { --x: 1; }
html[dir="rtl"] .c2 { --x: -1; }
html[dir="rtl"] .c3 { --x: 1.15; }
html[dir="rtl"] .chrome span { text-align: left; }

/* Arabic needs taller lines and a taller mask to avoid clipping marks */
html[lang="ar"] .rv .l { padding-block: .24em; margin-block: -.24em; }
html[lang="ar"] .hero-title { font-size: clamp(3.4rem, 10.5vw, 12rem); line-height: 1.02; }
html[lang="ar"] .h2 { line-height: 1.12; font-size: clamp(2.8rem, 7vw, 7rem); }
html[lang="ar"] .svc-head .h2 { font-size: clamp(2.6rem, 6vw, 6rem); }
html[lang="ar"] .about-text { line-height: 1.5; font-weight: 700; font-size: clamp(1.9rem, 4vw, 4.2rem); max-width: 20em; }
html[lang="ar"] .panel h3 { line-height: 1.25; font-weight: 800; }
html[lang="ar"] .proj h3 { line-height: 1.1; font-weight: 900; }
html[lang="ar"] .step h3 { line-height: 1.2; font-weight: 800; }
html[lang="ar"] .cta-title { line-height: 1.18; font-size: clamp(3rem, 8.6vw, 9.6rem); }
html[lang="ar"] .brand-name { font-weight: 800; line-height: 1.25; font-size: 1.35rem; }
html[lang="ar"] .brand small { font-size: .8rem; line-height: 1.2; }
html[lang="ar"] .proj-lead { line-height: 1.5; }
html[lang="ar"] .tags li { line-height: 1.6; }

/* stretch moments: scaleX in place of the width axis */
html[lang="ar"] .behind { font-weight: 900; line-height: 1.05; font-size: clamp(5rem, 15vw, 16rem); }
html[lang="ar"] .behind span { display: block; transform: scaleX(calc(.6 + var(--word) * .5)); }
html[lang="ar"] .wordmark {
  font-weight: 900; line-height: 1; margin: 0;
  transform: scaleX(calc(.55 + (var(--wd) - 50) / 35 * .5)) skewX(-6.3deg);
}
/* Arabic descenders (ر ن) fall below the line box: keep them inside the mask and the page */
html[lang="ar"] .wordmark .l { padding-bottom: .22em; margin-bottom: 0; }
html[lang="ar"] .cta { padding-bottom: 26px; }
html[lang="ar"] .reel { font-weight: 800; line-height: 1.1; }

@media (max-width: 760px) {
  html[dir="rtl"] .hero { --dx0: 0px; }
  html[lang="ar"] .hero-title { font-size: clamp(3.4rem, 17vw, 6.4rem); }
  html[lang="ar"] .hero-sub { top: calc(92px + 54vw + 32px); }
  html[lang="ar"] .behind { font-size: 19vw; }
  html[lang="ar"] .step-n { font-family: var(--font-display); line-height: 1.1; }
  .head-actions { gap: 8px; }
  .btn.lang { padding: 8px 12px; font-size: .85rem; }
  .site-head .btn { padding: 8px 14px; font-size: .85rem; }
  .site-head { gap: 8px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-name { font-size: 1rem; }
  html[lang="ar"] .brand-name { font-size: 1.1rem; }
  .brand small { font-size: .62rem; }
}

/* SVG labels keep a left anchor so they stay inside their shapes */
html[dir="rtl"] .ill text { direction: ltr; }

@media (max-width: 420px) {
  .site-head .head-actions .btn:not(.lang) { display: none; }
}
