/*
  Phones only. This file is linked with media="(max-width: 760px)", so a laptop
  never applies any of it. It covers the glass menu (opened from the 3-line
  button) and the inner pages About, Services, Clients and Blog; the home
  slides and the Portfolio page are left exactly as they are. mobile.js adds
  the pieces these rules style.
*/

/* ───────── Menu: a sheet that rises from the bottom, near the thumb ───────── */
/* the menu window itself never scrolls: opening it focuses the close button, and Safari would
   otherwise scroll the window to reach it, so the sheet jumped instead of rising */
.menu { overflow: clip; }
.menu .menu__grid {
  inset: auto 0 0;
  top: max(7svh, calc(env(safe-area-inset-top) + 30px));
  transform: translate3d(0, 104%, 0);
  transition: transform .45s var(--exit);
}
.menu.is-open .menu__grid { transform: none; transition: transform .6s var(--enter); }
.menu .menu__nav,
.menu.is-open .menu__nav {
  left: 0;
  right: 0;
  width: 100%;
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  border-bottom: 0;
  border-radius: 26px 26px 0 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: none;
  opacity: 1;
  transition: opacity .3s ease, visibility 0s;
}
.menu .menu__side { border-bottom: 0; border-radius: 26px 26px 0 0; }
.menu .menu__link { height: 42px; }
.menu .menu__nav > ol { flex: none; }
.menu .menu__sep { margin-block: 4px; }
.mgrip { flex: none; display: block; width: 40px; height: 5px; margin: 0 auto 6px; border-radius: 3px; background: rgba(21, 23, 26, .2); }
.menu__head { touch-action: none; }

/* quick searches under the search box */
.mchips { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 4px 4px; }
.mchips button {
  height: 32px;
  padding: 0 14px;
  border: 1px solid rgba(21, 23, 26, .14);
  border-radius: 999px;
  background: rgba(255, 255, 255, .55);
  color: var(--m-ink);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}
.menu[data-view="search"] .mchips { display: none; }
/* searching: still one sheet; the results carry on right under the search box, with a way back */
.menu.is-open[data-view="search"] .menu__nav { bottom: 0; }
.menu.is-open[data-view="search"] .menu__side {
  top: var(--search-h, 150px);
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.menu.is-open[data-view="search"] .menu__side::before,
.menu.is-open[data-view="search"] .menu__side::after { display: none; }
.menu .menu__results { padding-top: 4px; }
.menu .menu__results .menu__back { display: inline-flex; margin: 0 0 12px; padding: 6px 0; }

/* two projects and WhatsApp, one tap away */
.mshort { margin: 6px 4px 4px; padding-top: 12px; border-top: 1px solid var(--m-rule); }
.mshort__t { margin-bottom: 8px; font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--m-dim); }
/* two cards in view, the rest a swipe away (a peek of the third says so) */
.mshort__row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 8px) / 2.2);
  gap: 8px;
  margin: 0 -4px;
  padding: 0 4px 2px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 4px;
  scrollbar-width: none;
}
.mshort__row::-webkit-scrollbar { display: none; }
.mshort__row > * { scroll-snap-align: start; }
.mshort__card {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 56px;
  padding: 4px 8px 4px 4px;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 14px;
  background: rgba(255, 255, 255, .55);
  color: var(--m-ink);
  text-align: start;
  font-family: inherit;
}
.mshort__card img { flex: none; width: 46px; height: 46px; border-radius: 10px; object-fit: cover; }
.mshort__card span { overflow: hidden; font-size: 12.5px; font-weight: 600; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.mshort__card small { display: block; font-size: 10.5px; font-weight: 500; opacity: .6; }
.mshort__more { justify-content: center; gap: 6px; padding: 4px 12px; text-decoration: none; }
.mshort__more span { font-size: 12.5px; font-weight: 600; }
.mshort__more svg { flex: none; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[dir="rtl"] .mshort__more svg { scale: -1 1; }
.menu[data-view="search"] .mshort { display: none; }

/* ───────── Inner pages (not Portfolio) ───────── */
/* a soft press on anything you tap */
body.page:not([data-page="portfolio"]) :is(a, button, .card, .chip, summary) { -webkit-tap-highlight-color: transparent; transition: scale .15s ease; }
body.page:not([data-page="portfolio"]) :is(a, button, .card, .chip):active { scale: .97; }

/* the action bar: appears once you scroll, steps aside over the contact scene */
.mbar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 30;
  display: flex;
  gap: 8px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: 999px;
  background: linear-gradient(170deg, rgba(244, 248, 252, .86), rgba(221, 232, 241, .8));
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  backdrop-filter: blur(18px) saturate(170%);
  box-shadow: 0 14px 40px rgba(30, 45, 70, .22), inset 0 1px 0 rgba(255, 255, 255, .95);
  translate: 0 calc(100% + 40px);
  opacity: 0;
  transition: translate .5s var(--exit), opacity .3s ease;
}
.mbar.is-on { translate: none; opacity: 1; transition: translate .6s var(--enter), opacity .3s ease; }
.mbar a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
}
.mbar__icon { flex: none; width: 46px; background: #fff; color: #15171a !important; }
.mbar__icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.mbar__icon--wa { background: #25d366; }
.mbar__icon--wa svg { fill: #fff; stroke: none; }
.mbar__main { flex: 1; background: #15171a; color: #fff !important; }
.mbar__main svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
html[dir="rtl"] .mbar__main svg { scale: -1 1; }
html[lang="ar"] .mbar a { letter-spacing: 0; font-size: 13px; }

/* swiping to the next page: the page slides away first */
body.page.is-leaving-l, body.page.is-leaving-r { transition: translate .32s var(--exit), opacity .32s ease; opacity: 0; }
body.page.is-leaving-l { translate: -18vw 0; }
body.page.is-leaving-r { translate: 18vw 0; }

/* the contact scene at the foot: shorter on a phone, so pages end sooner */
body.page:not([data-page="portfolio"]) .pfin { height: auto; min-height: 80svh; padding-bottom: 96px; }
body.page:not([data-page="portfolio"]) .pfin__text { padding-top: 11svh; }
.mreply { margin-top: 12px; font-size: 12px; color: rgba(243, 241, 236, .78); text-align: center; }
.mreply::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-inline-end: 7px; border-radius: 50%; background: #25d366; box-shadow: 0 0 0 3px rgba(37, 211, 102, .25); vertical-align: 1px; }

/* shared: a row of cards you swipe sideways */
.mrow { display: flex; gap: 12px; margin: 0 calc(-1 * var(--col)); padding: 4px var(--col) 10px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--col); scrollbar-width: none; overscroll-behavior-x: contain; }
.mrow::-webkit-scrollbar { display: none; }
.mrow > * { flex: none; scroll-snap-align: start; }
.mhead { margin: 44px 0 14px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--m-gold); }
html[lang="ar"] .mhead { letter-spacing: 0; font-size: 13px; }
.mglass { border: 1px solid rgba(255, 255, 255, .85); border-radius: 22px; background: var(--glass); box-shadow: 0 18px 40px rgba(40, 60, 90, .12), inset 0 1px 0 rgba(255, 255, 255, .95); }

/* ───────── About ───────── */
/* the big card, stacked: words, the founder over the clouds, then 01–04 */
.acard-wrap { padding: 70px 10px 0; }
.acard { display: flex; flex-direction: column; height: auto; border-radius: 30px; }
html[dir="rtl"] .acard { direction: ltr; }
html[dir="rtl"] .acard > :not(.acard__ceo) { direction: rtl; }
html[dir="rtl"] .acard__ceo { translate: none; }
.acard__text { position: relative; inset: auto; order: 1; padding: 30px 22px 0; }
.acard__side { order: 2; }
.acard__ceo { order: 3; }
.acard__depts { order: 4; }
.acard .eyebrow { margin-bottom: 1.1em; font-size: 10px; }
.acard .headline { font-size: 16vw; }
.acard__side { position: relative; inset: auto; width: auto; padding: 16px 22px 0; }
.acard__side p { font-size: 15px; }
.acard__side .actions { margin-top: 18px; }
.acard__ceo { position: relative; z-index: 0; left: auto; bottom: auto; align-self: flex-start; width: 128%; max-width: none; height: auto; translate: none; margin: 4px 0 0 -40%; }
.acard__clouds { left: -60%; right: -60%; bottom: 0; }
.acard::after { height: 300px; }
.acard__tag { left: auto; right: 14px; top: auto; bottom: 252px; padding: 9px 13px; border-radius: 13px; }
html[dir="rtl"] .acard__tag { left: auto; right: 14px; bottom: 270px; }
.acard .headline { line-height: .96; }
html[lang="ar"] .acard .headline { font-size: 15vw; line-height: 1.15; }
.acard__tag b { font-size: 12.5px; }
.acard__tag span { font-size: 9.5px; }
.acard__depts { position: relative; inset: auto; grid-template-columns: 1fr 1fr; margin: -96px 10px 10px; overflow: hidden; border-radius: 22px; }
.acard__depts button { border-radius: 0 !important; padding: 14px 16px; }
.acard__depts button + button { border-inline-start: 0; }
.acard__depts button:nth-child(even) { border-inline-start: 1px solid rgba(21, 23, 26, .08); }
.acard__depts button:nth-child(n+3) { border-top: 1px solid rgba(21, 23, 26, .08); }
.acard__depts b { font-size: 15px; }
.acard__depts small { font-size: 12px; }

.aintro { grid-template-columns: 1fr; gap: 16px; margin-top: 56px; padding: 0 20px; }
.aintro h2 { font-size: 38px; }
.aintro__side p { font-size: 16px; }
.acities-wrap { margin: 28px auto 0; padding: 0; }
.acities { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 20px 6px; scroll-padding-inline: 20px; scrollbar-width: none; }
.acities::-webkit-scrollbar { display: none; }
.acity { flex: 0 0 76%; scroll-snap-align: start; border-radius: 24px; }
.acity__text b { font-size: 34px; }
.abrands { flex-direction: column; align-items: stretch; gap: 16px; margin: 22px 12px 0; padding: 22px 0 16px; border-radius: 24px; }
.abrands__label { padding: 0 20px; }
.abrands__run li { width: 104px; margin-right: 10px; }
html[lang="ar"] :is(.acity__chip, .abrands__label span, .abrands__label a, .acard__tag span) { letter-spacing: 0; }

.mstats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.mstat { padding: 18px 16px 16px; }
.mstat b { display: block; font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
html[lang="ar"] .mstat b { direction: ltr; text-align: right; }
.mstat span { display: block; margin-top: 6px; font-size: 12.5px; color: var(--m-dim); }

.mtime > * { width: 72%; padding: 20px 18px; }
.mtime b { display: block; margin-bottom: 8px; font-size: 21px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.mtime p { font-size: 14px; line-height: 1.45; color: var(--m-dim); }
.mtime .mtime__k { display: block; margin-bottom: 14px; font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--m-gold); }
html[lang="ar"] .mtime .mtime__k { letter-spacing: 0; font-size: 12px; }

/* the four About cards become tabs: one shows at a time */
.mtabs {
  position: relative;
  display: flex;
  gap: 4px;
  margin: 40px 0 14px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: 999px;
  background: rgba(236, 242, 247, .82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 22px rgba(40, 60, 90, .1);
}
.mtabs button { flex: 1 1 0; min-width: 0; height: 38px; padding: 0 4px; border: 0; border-radius: 999px; background: none; color: var(--m-dim); font-family: inherit; font-size: 11px; font-weight: 700; line-height: 1; white-space: nowrap; transition: background .25s, color .25s; }
.mtabs button[aria-selected="true"] { background: #15171a; color: #fff; }
html[lang="ar"] .mtabs button { font-size: 12.5px; }
body.has-mtabs .depts { display: block; }
body.has-mtabs .depts > .dept[hidden] { display: none; }
body.has-mtabs .depts > .dept { animation: mtab-in .35s var(--enter, ease) both; }
@keyframes mtab-in { from { opacity: 0; translate: 0 8px; } }
body.page[data-page="about"] .dept { scroll-margin-top: 130px; }

/* ───────── Services ───────── */
.msteps > * { width: 64%; padding: 18px 16px; }
.msteps i { display: block; margin-bottom: 18px; font-style: normal; font-size: 11px; font-weight: 700; color: var(--m-gold); }
.msteps b { display: block; margin-bottom: 6px; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.msteps p { font-size: 13.5px; line-height: 1.45; color: var(--m-dim); }

/* each service is a row you open */
.msvc .dept__list li > strong { display: block; }
.msvc .menu__svc {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  text-align: start;
}
.msvc .menu__svc::after { content: ""; flex: none; width: 9px; height: 9px; margin-inline-end: 4px; border-right: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor; rotate: 45deg; translate: 0 -3px; transition: rotate .3s ease, translate .3s ease; opacity: .55; }
.msvc li.is-open .menu__svc::after { rotate: 225deg; translate: 0 2px; }
.msvc .dept__list li > span,
.msvc .msvc__acts { display: none; }
.msvc li.is-open > span { display: block; animation: mtab-in .3s ease both; }
.msvc li.is-open .msvc__acts { display: flex; animation: mtab-in .3s ease .05s both; }
.msvc__acts { gap: 8px; margin: 12px 0 6px; }
.msvc__acts :is(a, button) { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; font-family: inherit; font-size: 10.5px; font-weight: 700; line-height: 1; white-space: nowrap; letter-spacing: .08em; text-transform: uppercase; text-decoration: none; }
.msvc__acts button { border: 1px solid rgba(21, 23, 26, .2); background: rgba(255, 255, 255, .6); color: #15171a; }
.msvc__acts a { border: 0; background: #25d366; color: #fff !important; }
.msvc__acts svg { width: 14px; height: 14px; fill: currentColor; }
html[lang="ar"] .msvc__acts :is(a, button) { letter-spacing: 0; font-size: 12.5px; }

/* ───────── Blog: until the first posts arrive ───────── */
.msoon { position: relative; margin-top: 18px; padding: 26px 22px 24px; overflow: hidden; }
.msoon__pen { position: absolute; right: -14px; top: -10px; width: 120px; opacity: .1; }
html[dir="rtl"] .msoon__pen { right: auto; left: -14px; }
.msoon b { display: block; max-width: 18ch; margin-bottom: 10px; font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.msoon p { max-width: 32ch; margin-bottom: 18px; font-size: 14.5px; line-height: 1.5; color: var(--m-dim); }
.msoon ul { display: grid; gap: 8px; margin-bottom: 22px; }
.msoon li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; }
.msoon li::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--m-gold); }
.msoon a { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 999px; background: #25d366; color: #fff !important; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; text-decoration: none; }
.msoon a svg { width: 18px; height: 18px; fill: currentColor; }
html[lang="ar"] .msoon a { letter-spacing: 0; font-size: 13px; }

/* ───────── Arabic titles: a Kufi face with more character ───────── */
html[lang="ar"] body.page:not([data-page="portfolio"]) :is(.page__title, .acard .headline, .aintro h2, .acity__text b, .abrands__label b, .dept__name, .msoon b, .mtime b, .msteps b),
html[lang="ar"] .menu .menu__title {
  font-family: "Reem Kufi", "Cairo", system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: 0;
}

/* About: the story cards sit right on the contact scene, no blank band between */
body.page[data-page="about"] .page__main { padding-bottom: 0; }
body.page[data-page="about"] .mtime { padding-bottom: 30px; }


/* ───────── Home slides: text nearer the middle, art a little smaller ─────────
   Phones only; the laptop slides are untouched. */
.slide:is(.s1, .s2, .s3) .layer--title .px { padding-bottom: calc(var(--gutter) + 52px + 9svh); }
.home .layer--title .px { padding-top: 17svh; }
.finale .layer--title .px { padding-top: 22svh; }
/* Branding: David smaller */
.s1 .layer--cut .fill { scale: .8; transform-origin: 50% 40%; }
/* Creative: the moon and its ring smaller */
.s2 .layer--mid .plate--obj { scale: .8; translate: 0 -7svh; }
/* Marketing: the queen smaller and lower */
.subject--queen { height: 32svh; left: calc(50% - 32svh * 755 / 2762); top: 23svh; }
/* Technology: the words and Discover lower, and the balloons and the plane with them */
.s4 .layer--title .px { padding-top: 49svh; }
.b1 { top: 19svh; }
.b2 { top: 26svh; }
.b3 { top: 15svh; }
.subject--plane { top: 33svh; }
