/* TeqanyLab site styles. Tokens follow brand/kit.html.
   Motion: everything animated sits behind html.motion, which the page sets before it renders
   unless the visitor prefers reduced motion. html.js alone means scripts run but nothing moves. */
:root {
  --cobalt: #1E4FDC;
  --navy: #0B2350;
  --tint: #DCE4FA;
  --floral: #FFFAF0;
  --cream: #F3EBD6;
  --red: #E5402A;
  --sky: #8FB0FF;
  --muted: #45557F;
  --serif: 'Playfair Display', Georgia, serif;
  --sans: Inter, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --pad: clamp(16px, 5vw, 72px);
  --ease: cubic-bezier(.2, .75, .15, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--floral); color: var(--navy); font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: clip; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; inset-inline-start: -9999px; top: 8px; z-index: 100; background: var(--navy); color: var(--floral); padding: 10px 14px; border-radius: 6px; font: 500 13px var(--mono); }
.skip:focus { inset-inline-start: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 var(--pad); }
.label { font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--cobalt); }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; color: var(--cobalt); margin: 0; }
h1 { font-size: clamp(40px, 5.6vw, 76px); line-height: 1.04; letter-spacing: -.01em; }
h2 { font-size: clamp(30px, 3.8vw, 48px); line-height: 1.08; }
h3 { font-size: 26px; line-height: 1.18; }
p { margin: 0; }
.lead { font-size: clamp(17px, 1.6vw, 20px); line-height: 1.6; max-width: 640px; }
.muted { color: var(--muted); }

.btn { display: inline-flex; align-items: center; gap: 10px; font: 500 13px/1 var(--mono); letter-spacing: .03em; padding: 15px 20px; border-radius: 6px; border: 1px solid var(--cobalt); color: var(--cobalt); background: transparent; cursor: pointer; transition: background .2s, color .2s, border-color .2s, transform .4s var(--ease); }
.btn:hover { background: var(--tint); }
.btn.solid { background: var(--cobalt); color: var(--floral); }
.btn.solid:hover { background: var(--navy); border-color: var(--navy); }
.btn.light { background: var(--floral); color: var(--cobalt); border-color: var(--floral); }
.btn.light:hover { background: var(--cream); }
.btn .arr { transition: transform .3s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }
.link { font: 500 13px/1.4 var(--mono); color: var(--cobalt); display: inline-flex; gap: 8px; align-items: center; }
.link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* nav */
nav.top { position: sticky; top: 0; z-index: 40; background: rgba(255, 250, 240, .9); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--tint); transition: transform .5s var(--ease), box-shadow .3s; view-transition-name: topnav; }
nav.top.hide { transform: translateY(-101%); }
nav.top.scrolled { box-shadow: 0 10px 30px rgba(11, 35, 80, .05); }
nav.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 72px; }
nav.top .logo svg { height: 34px; width: auto; overflow: visible; }
nav.top .links { display: flex; gap: 28px; font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
nav.top .links a { opacity: .65; transition: opacity .2s, color .2s; }
nav.top .links a:hover, nav.top .links a[aria-current] { opacity: 1; color: var(--cobalt); }
nav.top .btn { padding: 11px 16px; }
/* The link to the same page in the other language, set in that language's type. */
nav.top .lang { font: 500 14px/1 'IBM Plex Sans Arabic', var(--sans); opacity: .65; transition: opacity .2s, color .2s; }
nav.top .lang[lang="en"] { font: 500 14px/1 var(--sans); }
nav.top .lang:hover { opacity: 1; color: var(--cobalt); }
nav.top .menu { display: flex; align-items: center; gap: 36px; }
.menu-btn { display: none; width: 44px; height: 44px; border: 1px solid var(--tint); border-radius: 8px; background: #fff; cursor: pointer; align-items: center; justify-content: center; }
.menu-btn span { display: block; width: 18px; height: 2px; background: var(--navy); position: relative; transition: background .2s; }
.menu-btn span::before, .menu-btn span::after { content: ''; position: absolute; left: 0; width: 18px; height: 2px; background: var(--navy); transition: transform .3s var(--ease); }
.menu-btn span::before { top: -6px; } .menu-btn span::after { top: 6px; }
nav.top.open .menu-btn span { background: transparent; }
nav.top.open .menu-btn span::before { transform: translateY(6px) rotate(45deg); }
nav.top.open .menu-btn span::after { transform: translateY(-6px) rotate(-45deg); }
.progress { position: fixed; top: 0; left: 0; width: 100%; height: 2px; background: var(--cobalt); transform: scaleX(0); transform-origin: 0 50%; z-index: 45; pointer-events: none; }

/* The logo draws itself on the first page of a visit: the ring, then the dots along the Q,
   the tail, and the red dot last. */
.lg circle { transform-box: fill-box; transform-origin: center; }
.intro .lg-ring, .intro .lg-tail { stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.intro .lg-ring { animation: lg-draw .8s cubic-bezier(.65, 0, .35, 1) .15s forwards; }
.intro .lg-tail { animation: lg-draw .22s ease-out 1.38s forwards; }
.intro .lg circle { transform: scale(0); animation: lg-pop .42s var(--spring) forwards; animation-delay: calc(.62s + var(--i) * 21ms); }
.intro .lg .lg-red { animation: lg-land .7s var(--spring) 2s both; }
.intro .lg-word { clip-path: inset(-20% 100% -20% 0); animation: lg-wipe 1s cubic-bezier(.65, 0, .35, 1) .4s forwards; }
.motion .logo:hover .lg .lg-red { animation: lg-hop .7s var(--spring); }
@keyframes lg-draw { to { stroke-dashoffset: 0; } }
@keyframes lg-pop { to { transform: scale(1); } }
@keyframes lg-land { 0% { transform: translateY(-18px) scale(0); } 55% { transform: translateY(2px) scale(1.3); } 100% { transform: none; } }
@keyframes lg-wipe { to { clip-path: inset(-20% 0 -20% 0); } }
@keyframes lg-hop { 35% { transform: translateY(-6px) scale(1.2); } }

section { padding: 96px 0; }
.rule { border-top: 1px solid var(--tint); }
.head { display: grid; grid-template-columns: 1fr 1.3fr; gap: 40px; align-items: end; margin-bottom: 56px; }
.head .label { margin-bottom: 20px; }
.head p { font-size: 18px; max-width: 540px; }
.head > :only-child { grid-column: 1 / -1; }

/* home hero: the Q, and the Q's grid showing around the cursor */
.hero { position: relative; }
.hero::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle, rgba(30, 79, 220, .2) 0 1.4px, transparent 1.9px) var(--gx, 0) var(--gy, 0) / var(--gp, 15px) var(--gp, 15px); -webkit-mask: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), #000, transparent); mask: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), #000, transparent); opacity: 0; transition: opacity .6s; }
.hero.lit::before { opacity: 1; }
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; padding-top: 64px; padding-bottom: 56px; }
.hero h1 { margin: 22px 0 24px; }
.hero .ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 34px; }
.hero figure.q { margin: 0; position: relative; width: 100%; max-width: 560px; aspect-ratio: 1; justify-self: end; }
/* The Q comes first in the markup, so text can flow around it on phones; on wide screens it
   keeps its column beside the text. */
.hero .wrap > div { grid-column: 1; grid-row: 1; }
.hero figure.q { grid-column: 2; grid-row: 1; }
.hero figure.q > svg, .hero figure.q > canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* client bar */
.clients { padding: 8px 0 88px; }
.clients .label { text-align: center; color: var(--muted); margin-bottom: 28px; }
.marquee { overflow: hidden; -webkit-mask: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); mask: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); }
.marquee .track { display: flex; width: max-content; will-change: transform; }
.marquee .set { display: flex; align-items: center; gap: 64px; padding: 0 32px; margin: 0; list-style: none; }
.marquee li { flex: none; color: var(--navy); opacity: .5; transition: opacity .3s, color .3s; }
.marquee li:hover { opacity: 1; color: var(--cobalt); }
.marquee svg { height: 30px; width: auto; }
.marquee:not(.live) .set[aria-hidden] { display: none; }
.marquee:not(.live) .track { width: auto; justify-content: center; }
.marquee:not(.live) .set { flex-wrap: wrap; justify-content: center; row-gap: 28px; }

/* home services: the list, and the stage the figures morph on */
.story { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(32px, 5vw, 72px); }
.story-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--tint); }
.story-list li { border-bottom: 1px solid var(--tint); }
.story-item { position: relative; display: grid; grid-template-columns: 34px 52px minmax(0, 1fr); column-gap: 16px; align-items: start; align-content: center; min-height: 36vh; padding: 32px 0; transition: opacity .5s var(--ease); }
.story-item::before { content: ''; position: absolute; left: -20px; top: 32px; bottom: 32px; width: 2px; background: var(--cobalt); transform: scaleY(0); transform-origin: top; transition: transform .6s var(--ease); }
.story-item .n { font: 500 12px/1 var(--mono); letter-spacing: .08em; color: var(--cobalt); padding-top: 16px; }
.story-item .ic { width: 52px; height: 52px; color: var(--cobalt); }
.story-item h3 { font-size: clamp(26px, 2.4vw, 32px); margin: 6px 0 10px; }
.story-item p { font-size: 16px; color: var(--muted); max-width: 440px; }
.story-item .link { margin-top: 16px; }
.story-item:hover .ic circle { transform: scale(1.15); }
.story-stage { position: relative; }
.stage { position: sticky; top: max(96px, calc(50vh - 280px)); background: var(--cream); border-radius: 20px; padding: 24px 26px 22px; }
.stage-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 8px; }
.pips { display: flex; gap: 6px; }
.pips i { display: block; width: 6px; height: 6px; border-radius: 3px; background: rgba(30, 79, 220, .25); transition: width .5s var(--ease), background-color .3s; }
.pips i.on { width: 22px; background: var(--cobalt); }
.stage-fig { position: relative; width: 100%; aspect-ratio: 4 / 3; max-height: calc(100vh - 240px); }
.stage-fig > svg, .stage-fig > canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage-cap { margin-top: 8px; font: italic 400 19px/1.4 var(--serif); color: var(--navy); min-height: 2.8em; }
.motion .stage-cap.swap { animation: cap .7s var(--ease) both; }
@keyframes cap { from { opacity: 0; transform: translateY(10px); } }
@media (min-width: 961px) {
  .js .story-item:not(.on) { opacity: .36; }
  .js .story-item.on::before { transform: none; }
}

/* starting points */
.starts { border-top: 1px solid var(--tint); }
.starts a { position: relative; isolation: isolate; display: grid; grid-template-columns: 40px 1.1fr 1fr 32px; gap: 24px; align-items: center; padding: 24px 0; border-bottom: 1px solid var(--tint); transition: padding .4s var(--ease); }
.starts a::before { content: ''; position: absolute; inset: 0; z-index: -1; background: #fff; transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease); }
.starts a:hover { padding-left: 16px; padding-right: 16px; }
.starts a:hover::before { transform: none; }
.starts .ic { width: 36px; height: 36px; color: var(--cobalt); }
.starts a:hover .ic circle { transform: scale(1.18); }
.starts .q { font: 400 clamp(20px, 2.1vw, 26px)/1.25 var(--serif); color: var(--cobalt); }
.starts .a { font-size: 15px; color: var(--muted); }
.starts .go { font: 16px var(--mono); color: var(--cobalt); text-align: right; transition: transform .4s var(--ease); }
.starts a:hover .go { transform: translateX(4px); }

/* dot figures: the static SVG is the no-JavaScript fallback; with scripts, a canvas takes its place */
[data-figure] { position: relative; }
[data-figure] > canvas { display: block; }
/* A canvas's own pixel size must never feed back into its layout size. */
canvas { contain: size; }
.js [data-figure] > svg, .js [data-hero] > svg, .js [data-unresolved] > svg, .js .stage-fig > svg { display: none; }

/* work cards */
.cards { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; }
.card { grid-column: span 2; background: #fff; border: 1px solid var(--tint); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; transition: transform .4s var(--ease), box-shadow .4s, border-color .3s; }
.card.big { grid-column: span 3; }
.card:hover { transform: translateY(-4px); border-color: var(--cobalt); box-shadow: 0 18px 40px rgba(30, 79, 220, .1); }
.card .fig { background: var(--cream); aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; }
.card .fig > svg, .card .fig > canvas { width: 86%; height: auto; aspect-ratio: 4 / 3; }
.card .body { padding: 24px 24px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card h3 { font-size: 24px; }
.card .sum { font-size: 15px; opacity: .85; }
.card .metric { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--tint); display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.card .metric b { font: 400 28px/1 var(--serif); color: var(--cobalt); white-space: nowrap; font-variant-numeric: lining-nums tabular-nums; }
.card .metric > span { font: 11px/1.4 var(--mono); opacity: .7; }
.card .more { font: 500 12px/1 var(--mono); color: var(--cobalt); margin-top: 14px; }

/* process: five steps on a dotted track */
.process { display: grid; grid-template-columns: repeat(5, 1fr); gap: 24px; }
.step { position: relative; padding-top: 28px; --f: 1; }
.step .trk { position: absolute; top: 0; left: 0; right: -24px; height: 8px; background: radial-gradient(circle, var(--tint) 0 2px, transparent 2.6px) 0 50% / 12px 8px repeat-x; }
.step:last-child .trk { right: 0; }
.step .trk i { position: absolute; inset: 0; background: radial-gradient(circle, var(--cobalt) 0 2px, transparent 2.6px) 0 50% / 12px 8px repeat-x; clip-path: inset(0 calc(100% - var(--f) * 100%) 0 0); }
.step .trk::after { content: ''; position: absolute; top: 50%; left: calc(var(--f) * 100%); width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--red); transform: scale(0); transition: transform .35s var(--spring); }
.process.live .step.cur .trk::after, .process:not(.live) .step:last-child .trk::after { transform: scale(1); }
.step b { display: block; font: 500 12px/1 var(--mono); color: var(--cobalt); letter-spacing: .08em; transition: color .4s; }
.step h3 { font-size: 26px; margin: 14px 0 8px; transition: opacity .5s; }
.step p { font-size: 15px; color: var(--muted); }
.process.live .step:not(.on) b { color: rgba(69, 85, 127, .55); }
.process.live .step:not(.on) h3 { opacity: .45; }

/* faq */
.faq { display: grid; grid-template-columns: 1fr 1.5fr; gap: 64px; }
details { border-top: 1px solid var(--tint); padding: 22px 0; }
details:last-child { border-bottom: 1px solid var(--tint); }
summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 20px; font: 400 21px/1.3 var(--serif); color: var(--cobalt); }
summary::-webkit-details-marker { display: none; }
summary .pl { font: 400 20px/1 var(--mono); transition: transform .4s var(--spring); flex: none; }
details[open] summary .pl { transform: rotate(45deg); }
details p { margin-top: 12px; font-size: 16px; max-width: 640px; color: var(--muted); overflow: hidden; }

/* services page */
.page-hero { padding: 80px 0 48px; }
.page-hero h1 { margin: 20px 0 22px; max-width: 920px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.chips a { display: inline-flex; align-items: center; gap: 10px; font: 12px/1 var(--mono); padding: 8px 12px 8px 8px; border: 1px solid var(--tint); border-radius: 999px; background: #fff; transition: border-color .2s, color .2s, transform .3s var(--ease); }
.chips a svg { width: 22px; height: 22px; color: var(--cobalt); }
.chips a:hover { border-color: var(--cobalt); color: var(--cobalt); transform: translateY(-2px); }
.service { padding: 88px 0; border-top: 1px solid var(--tint); scroll-margin-top: 80px; }
.service .grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 64px; align-items: start; }
.service .ic { width: 72px; height: 72px; color: var(--cobalt); margin-bottom: 26px; }
.service .grid > div:first-child { position: sticky; top: 104px; }
.service h2 { margin: 16px 0 18px; }
.service .summary { font-size: 18px; line-height: 1.65; max-width: 520px; }
.service .proofline { margin-top: 28px; padding: 18px 20px; background: #fff; border: 1px solid var(--tint); border-left: 3px solid var(--cobalt); border-radius: 0 10px 10px 0; font-size: 15px; }
.service .proofline b { display: block; font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--cobalt); margin-bottom: 8px; }
.service .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.service .fig { background: var(--cream); border-radius: 16px; padding: 28px; margin-bottom: 28px; }
.service .fig > svg, .service .fig > canvas { width: 100%; height: auto; aspect-ratio: 4 / 3; }
.service h4 { font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--cobalt); margin: 0 0 12px; }
.checks { list-style: none; margin: 0 0 28px; padding: 0; }
.checks li { position: relative; padding: 11px 0 11px 24px; border-top: 1px solid var(--tint); font-size: 15px; }
.checks li::before { content: ''; position: absolute; left: 3px; top: 19px; width: 8px; height: 8px; border-radius: 50%; background: var(--cobalt); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.meta { display: flex; gap: 10px; align-items: baseline; font-size: 15px; margin-bottom: 20px; }
.meta b { font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--cobalt); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags span { font: 12px/1 var(--mono); padding: 9px 11px; border-radius: 5px; background: #fff; border: 1px solid var(--tint); }
.service.compact .grid { grid-template-columns: 1fr 1.15fr; }
.engage { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.engage div { background: #fff; border: 1px solid var(--tint); border-radius: 16px; padding: 28px; }
.engage h3 { font-size: 24px; margin-bottom: 10px; }
.engage p { font-size: 15px; color: var(--muted); }
.combos { border-top: 1px solid var(--tint); }
.combos div { display: grid; grid-template-columns: 120px 1fr; gap: 24px; align-items: center; padding: 22px 0; border-bottom: 1px solid var(--tint); }
.combos .pair { display: flex; align-items: center; gap: 8px; color: var(--cobalt); }
.combos .pair svg { width: 40px; height: 40px; }
.combos .pair i { font: normal 14px var(--mono); }
.combos p { font: 400 21px/1.35 var(--serif); color: var(--navy); }

/* case study */
.crumbs { font: 12px/1 var(--mono); opacity: .7; padding-top: 36px; }
.crumbs a:hover { color: var(--cobalt); opacity: 1; }
.case-hero { display: grid; grid-template-columns: 1.5fr 1fr; gap: 56px; padding-top: 40px; padding-bottom: 56px; align-items: end; }
.case-hero h1 { font-size: clamp(36px, 4.6vw, 62px); margin: 18px 0 20px; }
.facts { border-top: 1px solid var(--tint); margin: 0; }
.facts div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--tint); font-size: 15px; }
.facts dt { font: 11px/1.9 var(--mono); letter-spacing: .06em; text-transform: uppercase; opacity: .65; }
.facts dd { margin: 0; }
.case-fig { background: var(--cream); border-radius: 18px; display: flex; align-items: center; justify-content: center; padding: clamp(20px, 5vw, 64px); }
.case-fig > svg, .case-fig > canvas { width: min(100%, 820px); height: auto; aspect-ratio: 4 / 3; }
.results { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 40px; }
.result { background: #fff; border: 1px solid var(--tint); border-radius: 14px; padding: 24px; }
.result b { display: block; font: 400 clamp(32px, 3.4vw, 46px)/1.05 var(--serif); color: var(--cobalt); font-variant-numeric: lining-nums tabular-nums; }
.result > span { display: block; font: 12px/1.5 var(--mono); opacity: .75; margin-top: 12px; }
/* What a result was before: the after figure leads, the before figure follows quietly. */
.was { display: block; font: 11px/1.4 var(--mono); font-style: normal; color: var(--cobalt); opacity: .75; }
.result .was { margin-top: 6px; }
.split { display: grid; grid-template-columns: 1fr 1.6fr; gap: 56px; }
.split .label { margin-bottom: 18px; }
.prose p { font-size: 18px; line-height: 1.7; max-width: 680px; }
.prose p + p { margin-top: 16px; }
.built { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; margin: 0; padding: 0; list-style: none; }
.built li { display: grid; grid-template-columns: 40px 1fr; gap: 10px; padding: 20px 0; border-top: 1px solid var(--tint); }
.built .n { font: 500 12px/1.9 var(--mono); color: var(--cobalt); }
.built h4 { font: 400 21px/1.25 var(--serif); color: var(--cobalt); margin: 0 0 6px; }
.built p { font-size: 15px; opacity: .85; }
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.flow span { font: 13px/1 var(--mono); padding: 12px 14px; background: #fff; border: 1px solid var(--tint); border-radius: 8px; transition: background-color .35s, color .35s, border-color .35s, transform .35s var(--spring); }
.flow span.done { border-color: var(--cobalt); color: var(--cobalt); }
.flow span.on { background: var(--cobalt); border-color: var(--cobalt); color: var(--floral); transform: translateY(-2px); }
.flow i { font-style: normal; font: 13px/1 var(--mono); color: var(--cobalt); transition: color .35s; }
.motion .flow i { color: rgba(30, 79, 220, .3); }
.motion .flow i.on { color: var(--cobalt); }
table.compare { width: 100%; border-collapse: collapse; font-size: 15px; }
table.compare th { font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; text-align: left; padding: 0 12px 14px 0; color: var(--cobalt); }
table.compare td { padding: 16px 12px 16px 0; border-top: 1px solid var(--tint); vertical-align: top; }
table.compare td:first-child { font: 12px/1.6 var(--mono); opacity: .7; width: 18%; }
table.compare td:nth-child(2) { opacity: .7; }
table.compare td:last-child { color: var(--cobalt); }
.note { font-size: 14px; opacity: .75; margin-top: 16px; }
.guard { margin: 0; padding: 0; list-style: none; }
.guard li { padding: 14px 0 14px 26px; border-top: 1px solid var(--tint); position: relative; font-size: 16px; }
.guard li::before { content: ''; position: absolute; left: 4px; top: 22px; width: 8px; height: 8px; border-radius: 50%; background: var(--cobalt); }
.quote { background: var(--cream); }
.quote blockquote { margin: 0; font: 400 clamp(26px, 3.2vw, 40px)/1.28 var(--serif); color: var(--cobalt); max-width: 960px; }
.quote .who { margin-top: 26px; font: 12px/1.6 var(--mono); }
.next { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.next a h3 { transition: color .2s, transform .4s var(--ease); }
.next a:hover h3 { color: var(--navy); transform: translateX(6px); }
.work-hero { padding: 88px 0 56px; }
.work-hero h1 { margin: 20px 0 22px; max-width: 900px; }

/* about */
.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.principles div { background: #fff; border: 1px solid var(--tint); border-radius: 16px; padding: 30px; }
.principles h3 { margin-bottom: 12px; }
.principles p { font-size: 15px; color: var(--muted); }

/* contact */
.contact { display: grid; grid-template-columns: 1.3fr 1fr; gap: 64px; align-items: start; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form .full { grid-column: 1 / -1; }
.form label { display: block; font: 500 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--navy); margin-bottom: 8px; }
.form label i { font-style: normal; text-transform: none; letter-spacing: 0; color: var(--muted); }
.form input, .form select, .form textarea { width: 100%; font: 16px/1.5 var(--sans); color: var(--navy); background: #fff; border: 1px solid var(--tint); border-radius: 8px; padding: 13px 14px; transition: border-color .2s, box-shadow .2s; }
.form textarea { min-height: 160px; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--cobalt); box-shadow: 0 0 0 3px rgba(30, 79, 220, .15); }
.form [aria-invalid="true"] { border-color: var(--red); }
.form .err { display: block; min-height: 18px; margin-top: 6px; font-size: 13px; color: #B8321F; }
.form .sent { font-size: 14px; color: var(--muted); margin-top: 14px; }
.side { background: #fff; border: 1px solid var(--tint); border-radius: 16px; padding: 30px; }
.side h3 { font-size: 24px; margin-bottom: 18px; }
.side ol { list-style: none; margin: 0 0 28px; padding: 0; counter-reset: s; }
.side ol li { counter-increment: s; display: grid; grid-template-columns: 34px 1fr; padding: 12px 0; border-top: 1px solid var(--tint); font-size: 15px; }
.side ol li::before { content: '0' counter(s); font: 500 12px/1.9 var(--mono); color: var(--cobalt); }
.side dl { margin: 0 0 28px; }
.side dl div { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--tint); font-size: 15px; }
.side dt { font: 11px/1.9 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.side dd { margin: 0; }
.side dd a { color: var(--cobalt); }

/* contact: WhatsApp first, the form beside what happens next */
.wa-card { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center; background: var(--cobalt); color: var(--floral); border-radius: 20px; padding: clamp(28px, 4vw, 48px); }
.wa-card .label { color: var(--tint); margin-bottom: 16px; }
.wa-card h2 { color: var(--floral); }
.wa-card p { margin-top: 14px; font-size: 17px; opacity: .92; max-width: 520px; }
.wa-go { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; justify-self: end; }
.wa-card .btn.solid { background: var(--floral); color: var(--cobalt); border-color: var(--floral); padding: 18px 24px; font-size: 14px; }
.wa-card .btn.solid:hover { background: var(--cream); }
.formbox h3 { font-size: 26px; margin-bottom: 8px; }
.formbox > p { font-size: 15px; margin-bottom: 26px; }
.socials { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.socials a { font: 12px/1 var(--mono); padding: 9px 12px; border-radius: 999px; border: 1px solid var(--tint); color: var(--cobalt); transition: border-color .2s; }
.socials a:hover { border-color: var(--cobalt); }

/* 404 */
.notfound { min-height: 64vh; display: flex; align-items: center; }
.notfound .wrap { width: 100%; display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.notfound h1 { margin: 20px 0 22px; }
.notfound .ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px; }
.nf-q { margin: 0; width: min(100%, 420px); justify-self: end; }
.nf-q > svg, .nf-q > canvas { display: block; width: 100%; height: auto; aspect-ratio: 1; }
.nf-q .hint { display: none; margin-top: 10px; font: 12px/1.4 var(--mono); color: var(--muted); text-align: center; }
@media (pointer: fine) { .motion .nf-q .hint { display: block; } }

/* cta band */
.band { background: var(--cobalt); color: var(--floral); position: relative; overflow: hidden; }
.band .wrap { position: relative; z-index: 1; }
.band .label { color: var(--tint); margin-bottom: 22px; }
.band h2 { color: var(--floral); font-size: clamp(36px, 4.8vw, 64px); max-width: 760px; }
.band p { font-size: 18px; max-width: 520px; margin: 20px 0 32px; opacity: .92; }
.band .field { position: absolute; right: 0; top: 0; height: 100%; width: 55%; }
.band-cv { display: none; }
.js .band .field { display: none; }
.js .band-cv { display: block; position: absolute; right: 0; top: 0; width: 60%; height: 100%; pointer-events: none; }

/* footer, signed with the slogan in dots */
footer { background: var(--navy); color: var(--floral); padding: 64px 0 32px; }
.sig { position: relative; margin-bottom: 64px; }
.sig canvas { display: block; width: 100%; height: clamp(80px, 11vw, 180px); }
.sig-text { font: 400 clamp(40px, 8.6vw, 124px)/1.02 var(--serif); color: var(--tint); }
.sig-text .stop { color: var(--red); }
.sig.live .sig-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
footer .cols { display: grid; grid-template-columns: 1.5fr 1.1fr .8fr 1.1fr .8fr; gap: 36px; }
footer .logo svg { height: 38px; width: auto; }
footer .tag { margin-top: 18px; font-size: 14px; opacity: .75; max-width: 300px; }
footer h4 { font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; opacity: .6; margin: 0 0 16px; color: var(--floral); }
footer ul { list-style: none; padding: 0; margin: 0; font-size: 14px; line-height: 2.1; }
footer ul a { opacity: .85; transition: opacity .2s; }
footer ul a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
footer .base { margin-top: 56px; padding-top: 20px; border-top: 1px solid rgba(255, 250, 240, .15); display: flex; justify-content: space-between; align-items: center; font: 11px var(--mono); color: rgba(255, 250, 240, .6); flex-wrap: wrap; gap: 12px; }
.motion-toggle { display: inline-flex; align-items: center; gap: 8px; font: inherit; color: inherit; background: none; border: 1px solid rgba(255, 250, 240, .25); border-radius: 999px; padding: 6px 12px 6px 8px; cursor: pointer; transition: color .2s, border-color .2s; }
.motion-toggle::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 250, 240, .35); transition: background-color .2s; }
.motion-toggle[aria-pressed="true"]::before { background: var(--red); }
.motion-toggle:hover { color: var(--floral); border-color: rgba(255, 250, 240, .6); }
.motion-toggle[hidden] { display: none; }

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

/* Reveal: sections rise into place as they come into view, lists one item after another. */
@keyframes rise { from { opacity: 0; transform: translateY(28px); } }
.motion [data-reveal]:not(.in), .motion [data-stagger]:not(.in) > * { opacity: 0; }
.motion [data-reveal].in, .motion [data-stagger].in > * { animation: rise .95s var(--ease) backwards; animation-delay: calc(var(--d, 0s) + var(--i, 0) * 70ms); }

/* Headings rise in word by word, each word from behind its own mask. */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 .08em .15em; margin: 0 -.08em -.15em; }
.w > span { display: inline-block; }
.motion [data-split] .w > span { transform: translateY(110%); transition: transform 1.05s var(--ease); transition-delay: calc(var(--d, 0s) + var(--i) * 45ms); }
.motion [data-split].in .w > span { transform: none; }

/* Labels resolve out of random characters (main.js); they stay hidden until then. */
.label { transition: opacity .4s; }
.motion .label:not(.in) { opacity: 0; }

/* Service icons pop in dot by dot. */
.ic circle { transform-box: fill-box; transform-origin: center; transition: transform .35s var(--spring); }
.motion .ic:not(.in) circle { transform: scale(0); }
.motion .ic.in circle { animation: pop .55s var(--spring) backwards; animation-delay: calc(.1s + var(--ci, 0) * 450ms); }
@keyframes pop { from { transform: scale(0); } }

/* Section rules draw from left to right. */
.motion .rule { position: relative; border-top-color: transparent; }
.motion .rule::before { content: ''; position: absolute; left: 0; right: 0; top: -1px; height: 1px; background: var(--tint); transform: scaleX(0); transform-origin: left; transition: transform 1.6s var(--ease); }
.motion .rule.in::before { transform: none; }

/* Buttons lean toward the cursor (main.js sets --tx and --ty). */
.motion .btn { transform: translate(var(--tx, 0px), var(--ty, 0px)); }

/* A patch of the dot grid follows the cursor across cards. */
.glow { position: relative; }
.glow::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(circle, rgba(30, 79, 220, .24) 0 1.2px, transparent 1.7px) 0 0 / 14px 14px; -webkit-mask: radial-gradient(170px circle at var(--mx, 50%) var(--my, 50%), #000, transparent); mask: radial-gradient(170px circle at var(--mx, 50%) var(--my, 50%), #000, transparent); opacity: 0; transition: opacity .4s; }
.glow:hover::after { opacity: 1; }

/* The cursor ring. It grows over links and closes to a dot over the dot art. */
.cursor { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; opacity: 0; transition: opacity .3s; }
.cursor.on { opacity: 1; }
.cursor::before { content: ''; position: absolute; left: -16px; top: -16px; width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid rgba(30, 79, 220, .5); transition: transform .45s var(--spring), background-color .3s, border-color .3s; }
.cursor.link::before { transform: scale(1.6); border-color: var(--cobalt); background: rgba(30, 79, 220, .06); }
.cursor.dots::before { transform: scale(.28); border-color: var(--cobalt); background: var(--cobalt); }
.cursor.light::before { border-color: rgba(255, 250, 240, .6); }
.cursor.light.link::before { border-color: var(--floral); background: rgba(255, 250, 240, .1); }
.cursor.light.dots::before { border-color: var(--red); background: var(--red); }
.cursor.down::before { transform: scale(.8); }
.cursor.link.down::before { transform: scale(1.35); }

/* Page changes: the new page resolves in through a grid of growing dots. Without motion, pages
   switch at once. */
@view-transition { navigation: auto; }
@property --vt { syntax: '<length>'; inherits: false; initial-value: 0px; }
@keyframes vt-dots { from { --vt: 0px; } to { --vt: 16px; } }
.motion::view-transition-old(root) { animation: none; }
.motion::view-transition-new(root) { animation: vt-dots .7s cubic-bezier(.55, 0, .25, 1) both; -webkit-mask: radial-gradient(circle, #000 var(--vt), transparent calc(var(--vt) + .6px)) 50% 0 / 22px 22px; mask: radial-gradient(circle, #000 var(--vt), transparent calc(var(--vt) + .6px)) 50% 0 / 22px 22px; }
:root:not(.motion)::view-transition-group(*), :root:not(.motion)::view-transition-old(*), :root:not(.motion)::view-transition-new(*) { animation: none; }

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

@media (max-width: 1040px) {
  .process { grid-template-columns: repeat(3, 1fr); row-gap: 40px; }
  .step .trk { right: 0; }
}
@media (max-width: 960px) {
  /* The menu opens as a full-height panel. */
  .menu-btn { display: inline-flex; }
  nav.top .menu { position: absolute; left: 0; right: 0; top: 72px; height: calc(100vh - 72px); height: calc(100dvh - 72px); display: flex; flex-direction: column; justify-content: space-between; align-items: stretch; gap: 32px; padding: 8px var(--pad) calc(28px + env(safe-area-inset-bottom)); background: var(--floral); overflow-y: auto; visibility: hidden; opacity: 0; transform: translateY(-8px); transition: opacity .25s, transform .4s var(--ease), visibility 0s linear .4s; }
  nav.top.open .menu { visibility: visible; opacity: 1; transform: none; transition: opacity .25s, transform .4s var(--ease); }
  nav.top .links { flex-direction: column; gap: 0; font: 400 34px/1.15 var(--serif); letter-spacing: 0; text-transform: none; }
  nav.top .links a { display: flex; justify-content: space-between; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--tint); opacity: 1; color: var(--cobalt); }
  nav.top .links a::after { content: '→'; font: 16px var(--mono); }
  nav.top .links a[aria-current] { font-style: italic; }
  nav.top .menu .btn { justify-content: center; padding: 18px 20px; font-size: 14px; }
  nav.top .lang { opacity: 1; color: var(--cobalt); font-size: 18px; margin-top: auto; }
  .motion nav.top.open .lang { animation: rise .6s var(--ease) backwards; animation-delay: calc(.05s + var(--i) * 55ms); }
  .motion nav.top.open .links a, .motion nav.top.open .menu .btn { animation: rise .6s var(--ease) backwards; animation-delay: calc(.05s + var(--i) * 55ms); }
  html.menu-open { overflow: hidden; }

  section, .service { padding: 72px 0; }
  .head, .faq, .split, .case-hero, .contact, .service .grid, .service.compact .grid, .notfound .wrap { grid-template-columns: 1fr; gap: 28px; }
  .head { gap: 18px; margin-bottom: 40px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 0; padding-top: 36px; padding-bottom: 40px; }
  .hero figure.q { justify-self: center; width: min(62%, 290px); margin-top: 40px; }
  .clients { padding: 0 0 64px; }
  .clients .label { margin-bottom: 22px; }

  /* Home services become compact cards; the stage is for wide screens. */
  .story { display: block; }
  .story-stage { display: none; }
  .story-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; border: 0; }
  .story-list li { border: 0; }
  .story-item { min-height: 0; height: 100%; grid-template-columns: 1fr; row-gap: 12px; align-content: start; padding: 24px; background: #fff; border: 1px solid var(--tint); border-radius: 16px; }
  .story-item::before, .story-item .n { display: none; }
  .story-item .ic { width: 44px; height: 44px; }
  .story-item h3 { font-size: 24px; margin: 0 0 8px; }
  .story-item p { font-size: 15px; }

  .service .grid > div:first-child { position: static; }
  .engage, .principles { grid-template-columns: 1fr 1fr; }
  .cards { grid-template-columns: 1fr; }
  .card, .card.big { grid-column: auto; }
  .card .fig { aspect-ratio: 16 / 9; }
  .card .fig > svg, .card .fig > canvas { width: 66%; }
  .built, .results, .two { grid-template-columns: 1fr; }
  .starts a { grid-template-columns: 30px 1fr; column-gap: 16px; row-gap: 6px; align-items: start; padding: 20px 0; }
  .starts .ic { grid-row: 1 / span 2; width: 30px; height: 30px; margin-top: 3px; }
  .starts .q { grid-column: 2; }
  .starts .a { grid-column: 2; grid-row: 2; }
  .starts .go { display: none; }
  .starts a:hover { padding-left: 0; padding-right: 0; }
  .nf-q { justify-self: center; width: min(70%, 300px); }
  footer .cols { grid-template-columns: 1fr 1fr 1fr 1fr; }
  .wa-card { grid-template-columns: 1fr; gap: 24px; }
  .wa-go { justify-self: start; }
  footer .cols > :first-child { grid-column: 1 / -1; }

  /* The band's dot field sits under the text as a strip instead of behind it. */
  .band { padding-bottom: 0; }
  .band .field { position: relative; display: block; width: 100%; height: 150px; margin-top: 40px; }
  .js .band-cv { position: relative; width: 100%; height: 160px; margin-top: 40px; }
}
@media (max-width: 620px) {
  .engage, .principles, .process, .form, .story-list { grid-template-columns: 1fr; }
  .process { row-gap: 32px; }
  .story-item { grid-template-columns: 40px 1fr; column-gap: 16px; padding: 20px; }
  .story-item .ic { width: 40px; height: 40px; grid-row: 1 / span 3; }
  .story-item h3 { font-size: 22px; margin: 0 0 6px; }
  .story-item .link { margin-top: 10px; }
  .combos div { grid-template-columns: 1fr; gap: 10px; }
  .marquee svg { height: 24px; }
  .marquee .set { gap: 44px; padding: 0 22px; }
  .marquee:not(.live) .set { gap: 22px 32px; }

  /* Buttons stack and share one width. */
  .hero .ctas, .service .actions, .notfound .ctas { flex-direction: column; align-items: stretch; }
  .hero .ctas .btn, .service .actions .btn, .notfound .ctas .btn, .band .btn, .form .btn, .wa-card .btn { justify-content: center; width: 100%; }
  .wa-go { align-items: stretch; width: 100%; }
  .band .btn { display: flex; }

  /* Chips scroll sideways in one row. */
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 28px calc(-1 * var(--pad)) 0; padding: 0 var(--pad) 6px; scrollbar-width: none; -webkit-mask: linear-gradient(90deg, transparent, #000 var(--pad), #000 calc(100% - var(--pad)), transparent); mask: linear-gradient(90deg, transparent, #000 var(--pad), #000 calc(100% - var(--pad)), transparent); }
  .chips::-webkit-scrollbar { display: none; }
  .chips a { flex: none; }

  .service .fig { padding: 16px; }
  .case-fig { padding: 16px; }
  .results { gap: 12px; }
  footer .cols { grid-template-columns: 1fr 1fr; gap: 32px 20px; }
  .sig { margin-bottom: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  html:not(.motion) { scroll-behavior: auto; }
  html:not(.motion) *, html:not(.motion) *::before, html:not(.motion) *::after { transition: none !important; }
}

/* ---------- Arabic ---------- */

/* Body text is IBM Plex Sans Arabic. Display type (headings, quotes, questions) is Thmanyah
   Serif Display, set by the build as outlines: each word is an inline SVG (.tw) in the text
   colour, and the real text sits beside it for screen readers. Arabic is never letter-spaced
   or set in capitals, and runs a little larger and looser than Latin. Numbers keep Playfair. */
.tw { display: inline-block; fill: currentColor; overflow: visible; }
:root[lang="ar"] { --sans: 'IBM Plex Sans Arabic', system-ui, sans-serif; --mono: var(--sans); --serif: var(--sans); --num: 'Playfair Display', 'IBM Plex Sans Arabic', serif; }
[lang="ar"] body { font-size: 17px; line-height: 1.8; }
[lang="ar"] * { letter-spacing: 0 !important; text-transform: none !important; }
[lang="ar"] .w { padding-bottom: 0; margin-bottom: 0; }
[lang="ar"] h1, [lang="ar"] h2, [lang="ar"] h3, [lang="ar"] blockquote { line-height: 1.2; }
[lang="ar"] h1 { font-size: clamp(38px, 4.9vw, 66px); }
[lang="ar"] .case-hero h1 { font-size: clamp(34px, 4.2vw, 56px); }
[lang="ar"] .lead { font-size: clamp(18px, 1.7vw, 21px); line-height: 1.85; }
[lang="ar"] .head p, [lang="ar"] .service .summary { font-size: 18px; line-height: 1.85; }
[lang="ar"] .prose p { font-size: 19px; line-height: 1.9; }
[lang="ar"] .label { font-size: 14px; line-height: 1.5; }
[lang="ar"] nav.top .links { font-size: 15px; }
[lang="ar"] .btn { font-size: 15px; font-weight: 600; }
[lang="ar"] .link, [lang="ar"] .card .more { font-size: 15px; font-weight: 600; }
[lang="ar"] .story-item .n, [lang="ar"] .step b, [lang="ar"] .built .n { font: 500 14px/1.6 var(--num); }
[lang="ar"] .card .metric b, [lang="ar"] .result b { font-family: var(--sans); font-weight: 600; line-height: 1.3; }
[lang="ar"] .card .metric b { font-size: 26px; }
[lang="ar"] .result b { font-size: clamp(28px, 2.8vw, 38px); }
[lang="ar"] .card .metric > span, [lang="ar"] .result > span { font-size: 15px; line-height: 1.7; opacity: .85; }
[lang="ar"] .was { font-size: 14px; }
[lang="ar"] .tags span, [lang="ar"] .flow span, [lang="ar"] .chips a { font-size: 14px; }
[lang="ar"] .facts dt, [lang="ar"] .side dt, [lang="ar"] .form label, [lang="ar"] footer h4, [lang="ar"] .service h4, [lang="ar"] .proofline b, [lang="ar"] .meta b, [lang="ar"] table.compare th { font-size: 14px; font-weight: 600; }
[lang="ar"] .facts dt, [lang="ar"] .side dt { line-height: 1.6; }
[lang="ar"] table.compare td:first-child, [lang="ar"] .crumbs, [lang="ar"] .quote .who, [lang="ar"] footer .base, [lang="ar"] .nf-q .hint { font-size: 14px; }
[lang="ar"] .stage-cap { font: 500 18px/1.7 var(--sans); }
[lang="ar"] .built h4 { font: 600 19px/1.5 var(--sans); }
[lang="ar"] summary { font-size: 23px; align-items: center; }
[lang="ar"] .starts .q { font-size: clamp(22px, 2.2vw, 28px); line-height: 1.2; }
[lang="ar"] .combos p { font-size: 23px; line-height: 1.2; }
[lang="ar"] .step h3 { font-size: 28px; }
[lang="ar"] .form input, [lang="ar"] .form select, [lang="ar"] .form textarea { font-family: var(--sans); }
[lang="ar"] .form label i { font-size: 13px; }
[lang="ar"] .socials a { font-size: 14px; }
[lang="ar"] .wa-card p { font-size: 18px; line-height: 1.8; }

/* Right to left: everything that points, grows or sits on one side is mirrored. */
[dir="rtl"] .btn:hover .arr, [dir="rtl"] .starts a:hover .go { transform: translateX(-4px); }
[dir="rtl"] .next a:hover h3 { transform: translateX(-6px); }
[dir="rtl"] .progress { transform-origin: 100% 50%; }
.motion[dir="rtl"] .rule::before { transform-origin: right; }
[dir="rtl"] .story-item::before { left: auto; right: -20px; }
[dir="rtl"] .starts a::before { transform-origin: right; }
[dir="rtl"] .starts .go { text-align: left; }
[dir="rtl"] .step .trk { left: -24px; right: 0; background-position: 100% 50%; }
[dir="rtl"] .step:last-child .trk { left: 0; }
[dir="rtl"] .step .trk i { background-position: 100% 50%; clip-path: inset(0 0 0 calc(100% - var(--f) * 100%)); }
[dir="rtl"] .step .trk::after { left: auto; right: calc(var(--f) * 100%); margin: -6px -6px 0 0; }
[dir="rtl"] .service .proofline { border-left: 1px solid var(--tint); border-right: 3px solid var(--cobalt); border-radius: 10px 0 0 10px; }
[dir="rtl"] .checks li { padding: 11px 24px 11px 0; }
[dir="rtl"] .checks li::before { left: auto; right: 3px; }
[dir="rtl"] .guard li { padding: 14px 26px 14px 0; }
[dir="rtl"] .guard li::before { left: auto; right: 4px; }
[dir="rtl"] table.compare th { text-align: right; padding: 0 0 14px 12px; }
[dir="rtl"] table.compare td { padding: 16px 0 16px 12px; }
[dir="rtl"] .chips a { padding: 8px 8px 8px 12px; }
[dir="rtl"] .motion-toggle { padding: 6px 8px 6px 12px; }
[dir="rtl"] .band .field { right: auto; left: 0; transform: scaleX(-1); }
.js[dir="rtl"] .band-cv { right: auto; left: 0; }
@media (max-width: 1040px) {
  [dir="rtl"] .step .trk { left: 0; }
}
@media (max-width: 960px) {
  [lang="ar"] nav.top .links { font: 600 28px/1.3 var(--sans); }
  [dir="rtl"] nav.top .links a::after { content: '←'; }
  [lang="ar"] nav.top .links a[aria-current] { font-style: normal; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 8px; }
  [lang="ar"] .story-item h3 { font-size: 26px; }
}
@media (max-width: 620px) {
  [dir="rtl"] .starts a:hover { padding-left: 0; padding-right: 0; }
}

/* ---------- phones and tablets ---------- */

/* On touch screens: cards glow under a finger (main.js adds .lit) and things press in. The dots
   answer to fingers in dots.js. */
.glow.lit::after { opacity: 1; }
@media (hover: none) {
  .starts a, .story-item, .chips a { transition: padding .4s var(--ease), opacity .45s var(--ease), border-color .3s, transform .25s var(--ease); }
  .card:active, .starts a:active, .story-item:active, .chips a:active, .engage > div:active, .principles > div:active { transform: scale(.98); }
  .motion .btn:active { transform: scale(.97); }
}

@media (max-width: 960px) {
  /* Home hero: the Q sits at the top corner and the label and headline flow beside it, around
     its curve, then run full width below. */
  .hero .wrap { display: flow-root; padding-top: 22px; }
  .hero figure.q { float: right; width: min(50%, 300px); max-width: none; margin: 0 -4px 0 10px; shape-outside: circle(50%); shape-margin: 10px; }
  [dir="rtl"] .hero figure.q { float: left; margin: 0 10px 0 -4px; }
  /* Playfair's words are wider than Thmanyah's, so the English Q steps back a little. */
  [lang="en"] .hero figure.q { width: min(39%, 260px); margin-left: 6px; shape-margin: 4px; }
  [lang="en"] .hero h1 { font-size: clamp(31px, 8.6vw, 40px); }
  .hero .label { padding-top: 26px; }
  .hero h1 { margin: 16px 0 18px; }
  .hero .ctas { clear: both; margin-top: 26px; }

  /* Home services: the stage stays, pinned to the top of the screen (under the nav when it's
     showing), and the services scroll up beneath it, the one just under it lit. */
  .js .story { display: flex; flex-direction: column; }
  .js .story-stage { display: block; order: -1; position: sticky; top: 84px; z-index: 3; margin-bottom: 16px; transition: top .5s var(--ease); }
  .js:has(nav.top.hide) .story-stage { top: 12px; }
  .js .stage { position: static; padding: 14px 16px 10px; border-radius: 16px; box-shadow: 0 16px 36px rgba(11, 35, 80, .12); }
  .js .stage-fig { aspect-ratio: 16 / 9; max-height: 28vh; }
  .js .stage-cap { font-size: 14px; line-height: 1.45; min-height: 2.9em; margin-top: 2px; }
  .js .story-list { grid-template-columns: 1fr; gap: 12px; padding-bottom: 16vh; }
  .js .story-item { opacity: .45; }
  .js .story-item.on { opacity: 1; border-color: var(--cobalt); }
  [lang="ar"] .js .stage-cap, .js[lang="ar"] .stage-cap { font-size: 15px; line-height: 1.6; }
}

@media (max-width: 960px) {
  /* Services page: each service opens with its illustration (the small icon would repeat it),
     then what it is and what's included; the proof and the buttons close it. */
  .service .grid { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .service .grid > div { display: contents; }
  .service .ic { display: none; }
  .service .fig { order: 1; margin-bottom: 24px; }
  .service .label { order: 2; }
  .service h2 { order: 3; margin: 14px 0 14px; }
  .service .summary { order: 4; }
  .service h4:first-of-type { order: 5; margin-top: 28px; }
  .service .checks { order: 6; }
  .service .two { order: 7; }
  .service .proofline { order: 8; margin-top: 4px; }
  .service .actions { order: 9; }
}

@media (max-width: 620px) {
  /* Rows of cards you swipe through, snapping card by card, with the next one peeking in. */
  .swipe { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; margin-inline: calc(-1 * var(--pad)); padding: 4px var(--pad) 16px; scroll-padding-inline: var(--pad); scrollbar-width: none; }
  .swipe::-webkit-scrollbar { display: none; }
  .swipe > * { flex: 0 0 84%; scroll-snap-align: start; }
  .results.swipe > * { flex-basis: 72%; }
  .card .fig { aspect-ratio: 4 / 3; }
  .card .fig > svg, .card .fig > canvas { width: 82%; }
  .service .fig > svg, .service .fig > canvas { aspect-ratio: 16 / 10; }

  /* Tighter type and spacing. */
  section, .service { padding: 60px 0; }
  .head { margin-bottom: 30px; }
  .head p { font-size: 16px; }
  h1 { font-size: clamp(32px, 9.2vw, 40px); }
  h2 { font-size: clamp(26px, 7.2vw, 32px); }
  .band h2 { font-size: clamp(30px, 8.4vw, 38px); }
  .case-hero h1 { font-size: clamp(28px, 8vw, 34px); }
  .lead { font-size: 17px; }
  .page-hero, .work-hero { padding: 48px 0 32px; }
  .story-item h3, .card h3 { font-size: 21px; }
  .starts .q { font-size: 20px; }
  summary { font-size: 19px; }
  [lang="ar"] h1 { font-size: clamp(30px, 8.4vw, 36px); }
  [lang="ar"] .case-hero h1 { font-size: clamp(27px, 7.6vw, 32px); }
  [lang="ar"] .story-item h3 { font-size: 22px; }
  [lang="ar"] .starts .q, [lang="ar"] .combos p { font-size: 21px; }
  [lang="ar"] summary { font-size: 20px; }
  [lang="ar"] .lead { font-size: 17px; }
  [lang="ar"] .head p, [lang="ar"] .service .summary { font-size: 16px; }

  /* The process becomes one vertical track down the side, filling as you scroll, with the red
     dot travelling down it. */
  .process { row-gap: 0; }
  .step { padding: 0 0 30px; padding-inline-start: 36px; }
  .step:last-child { padding-bottom: 0; }
  .step .trk, .step:last-child .trk, [dir="rtl"] .step .trk, [dir="rtl"] .step:last-child .trk { top: 4px; bottom: 0; left: 0; right: auto; width: 8px; height: auto; background: radial-gradient(circle, var(--tint) 0 2px, transparent 2.6px) 50% 0 / 8px 12px repeat-y; }
  [dir="rtl"] .step .trk, [dir="rtl"] .step:last-child .trk { left: auto; right: 0; }
  .step:last-child .trk, [dir="rtl"] .step:last-child .trk { bottom: auto; height: 24px; }
  .step .trk i, [dir="rtl"] .step .trk i { background: radial-gradient(circle, var(--cobalt) 0 2px, transparent 2.6px) 50% 0 / 8px 12px repeat-y; clip-path: inset(0 0 calc(100% - var(--f) * 100%) 0); }
  .step .trk::after, [dir="rtl"] .step .trk::after { left: 50%; right: auto; top: calc(var(--f) * 100%); margin: -6px 0 0 -6px; }
  .step h3 { margin: 6px 0; }
}
