@font-face {
  font-family: "Geist";
  src: url("fonts/geist-latin-wght-normal.woff2?v=3") format("woff2");
  font-weight: 100 900; font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("fonts/geist-mono-latin-wght-normal.woff2?v=3") format("woff2");
  font-weight: 100 900; font-display: swap;
}

:root {
  --bg: #0A0D11;
  --text: #ECEAE4;
  --muted: #8D939C;
  --faint: #5B616A;
  --line: rgba(236, 234, 228, 0.12);
  --c: #ECEAE4;
  --pad: clamp(22px, 6vw, 96px);
  --col: min(540px, 44vw);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { overflow-x: clip; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 17px/1.6 "Geist", system-ui, sans-serif;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; border-radius: 4px; }
::selection { background: var(--text); color: var(--bg); }

.skip { position: absolute; inset-inline-start: 12px; top: 12px; transform: translateY(-300%); z-index: 20; background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 6px; }
.skip:focus { transform: none; }

#scene { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
#progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; background: var(--text); transform-origin: 0 50%; transform: scaleX(0); z-index: 11; opacity: .7; }

/* nav */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px var(--pad) 28px;
  background: linear-gradient(to bottom, rgba(10,13,17,.92) 55%, rgba(10,13,17,0));
}
.brand { font-weight: 600; letter-spacing: -0.01em; text-decoration: none; font-size: 15px; }
.nav nav { display: flex; gap: 28px; }
.nav nav a { color: var(--muted); text-decoration: none; font-size: 15px; transition: color .2s; }
.nav nav a:hover { color: var(--text); }
body[data-active="about"] .nav a[href="#about"],
body[data-active="stack"] .nav a[href="#stack"],
body[data-active="contact"] .nav a[href="#contact"] { color: var(--text); }
body:is([data-active="mtjry"],[data-active="menupro"],[data-active="markabati"],[data-active="clients"]) .nav a[href="#work"] { color: var(--text); }

main { position: relative; z-index: 1; }
.has-3d .col { opacity: var(--vis, 1); transform: translateY(var(--off, 0px)); will-change: opacity, transform; }
/* projects: text stays pinned while the model changes from symbol to device */
.has-3d .project[data-device] { display: block; min-height: 190vh; }
.has-3d .project[data-device] .col { position: sticky; top: 50vh; transform: translateY(calc(-50% + var(--off, 0px))); }
.big { font-size: clamp(21px, 1.9vw, 27px); line-height: 1.38; letter-spacing: -0.015em; color: var(--text); margin-bottom: 26px; }
section { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: 120px var(--pad); position: relative; }
.col { width: var(--col); }
.hero .col { width: auto; }

/* hero */
.name {
  font-weight: 640; font-size: clamp(52px, 7.6vw, 136px);
  line-height: .88; letter-spacing: -0.052em; margin: 0 0 32px;
  margin-inline-start: -0.05em;
}
.name .line { display: block; overflow: hidden; padding-bottom: .06em; }
.name .line > span { display: inline-block; }
.lede { font-size: clamp(19px, 1.6vw, 23px); line-height: 1.45; color: var(--text); max-width: 30ch; margin: 0 0 36px; letter-spacing: -0.012em; }
.hint { position: absolute; inset-inline-start: var(--pad); bottom: 32px; margin: 0; color: var(--faint); font-size: 14px; }

/* load: one orchestrated moment, timed with the particles assembling */
.loaded .name .line > span { animation: rise 1.1s cubic-bezier(.2,.8,.2,1) both; }
.loaded .name .line:nth-child(2) > span { animation-delay: .12s; }
.loaded .reveal { animation: fade 1s ease both; animation-delay: .9s; }
.loaded .hint { animation-delay: 1.8s; }
@keyframes rise { from { transform: translateY(105%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; height: 46px; padding: 0 20px;
  border-radius: 8px; text-decoration: none; font-weight: 500; font-size: 15px;
  border: 1px solid var(--line); background: rgba(10,13,17,.4); backdrop-filter: blur(6px);
  transition: border-color .2s, background .2s, color .2s;
}
.btn:hover { border-color: rgba(236,234,228,.4); }
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn.primary:hover { background: #fff; }

/* headings */
h2 { font-weight: 620; font-size: clamp(38px, 4.6vw, 68px); line-height: 1; letter-spacing: -0.042em; margin: 0 0 26px; }
h3 { font-size: 15px; font-weight: 500; color: var(--muted); margin: 0 0 6px; letter-spacing: 0; }
p { margin: 0 0 18px; color: #C9CBCB; max-width: 60ch; }

/* projects */
.project h2 { color: var(--text); }
.project h2::after {
  content: ""; display: block; width: 44px; height: 3px; border-radius: 2px;
  background: var(--c); margin-top: 22px;
}
.figure { display: flex; align-items: baseline; gap: 16px; margin: 30px 0 30px; color: var(--text); }
.figure strong { font-size: clamp(64px, 7vw, 104px); font-weight: 600; letter-spacing: -0.06em; line-height: .9; color: var(--c); font-variant-numeric: tabular-nums; }
.figure span { font-size: 17px; max-width: 16ch; line-height: 1.35; color: var(--text); }
.facts { margin: 28px 0 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.facts div { display: grid; grid-template-columns: 120px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); font-size: 15px; }
.facts dd { margin: 0; font-size: 15px; color: var(--text); }
.facts a { text-decoration: none; border-bottom: 1px solid var(--c); padding-bottom: 1px; }
.facts a:hover { color: var(--c); }
.more { margin-top: 44px; padding-inline-start: 16px; border-inline-start: 2px solid var(--line); color: var(--muted); font-size: 15.5px; }

/* stack */
.stack { display: grid; grid-template-columns: 1fr 1fr; gap: 30px 36px; border-top: 1px solid var(--line); padding-top: 26px; }
.stack p { margin: 0; color: var(--text); font-size: 17px; line-height: 1.5; }

/* more work */
.more-work .col { width: min(640px, 48vw); }
.gallery { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 26px 22px; }
.gallery a { display: block; text-decoration: none; color: var(--text); }
.gallery img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); transition: transform .35s cubic-bezier(.2,.8,.2,1), border-color .2s; }
.gallery a:hover img { transform: translateY(-3px); border-color: rgba(236,234,228,.35); }
.g-name { display: block; margin-top: 10px; font-weight: 560; font-size: 15.5px; }
.g-type { display: block; color: var(--muted); font-size: 14px; margin-top: 1px; }

/* contact */
.contact h2 { max-width: 18ch; font-size: clamp(34px, 3.6vw, 54px); }
.contact { align-items: flex-start; padding-top: max(110px, 14vh); }
form { margin-top: 26px; display: grid; gap: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 14px; }
input, textarea { font: inherit; font-size: 16px; color: var(--text); background: rgba(236,234,228,.04); border: 1px solid var(--line); border-radius: 8px; padding: 11px 13px; transition: border-color .2s, background .2s; }
textarea { resize: vertical; min-height: 92px; }
input:focus, textarea:focus { outline: none; border-color: rgba(236,234,228,.5); background: rgba(236,234,228,.07); }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none; }
.form-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.form-foot .btn { cursor: pointer; font-family: inherit; }
.form-foot .btn:disabled { opacity: .6; cursor: default; }
.form-status { margin: 0; font-size: 14.5px; color: var(--muted); }
.form-status.ok { color: #9DD6B8; }
.form-status.err { color: #F0A28C; }
.mail-alt { margin-top: 22px; color: var(--muted); font-size: 15px; }
.mail-alt a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line); }
.mail { font-size: clamp(20px, 2vw, 28px); letter-spacing: -0.02em; margin: 30px 0 28px; }
.mail a { text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 3px; transition: border-color .2s; }
.mail a:hover { border-color: var(--text); }

.foot { position: relative; z-index: 1; display: flex; justify-content: space-between; padding: 28px var(--pad); color: var(--faint); font-size: 14px; border-top: 1px solid var(--line); }
.foot a { text-decoration: none; color: var(--muted); }
.foot-links { display: flex; gap: 22px; flex-wrap: wrap; }
.social { list-style: none; display: flex; gap: 26px; margin: 34px 0 0; padding: 26px 0 0; border-top: 1px solid var(--line); }
.social a { text-decoration: none; color: var(--text); font-size: 16px; border-bottom: 1px solid transparent; padding-bottom: 2px; transition: border-color .2s; }
.social a:hover { border-color: var(--text); }
.foot a:hover { color: var(--text); }

/* without WebGL the page is still complete */
.no-webgl .hint { display: none; }

/* small screens: model in the top of the screen, text underneath */
@media (max-width: 820px) {
  :root { --col: 100%; }
  .nav nav a:not([href="#contact"]):not([href="/#contact"]):not([href="/blog"]):not([href="/ar/#contact"]):not([href="/ar/blog"]):not(.lang-switch) { display: none; }
  .nav nav { gap: 20px; }
  section { padding: 96px var(--pad) 72px; align-items: center; }
  .has-3d section { align-items: flex-start; padding-top: calc(54svh + 8px); min-height: 100svh; }
  .has-3d .project[data-device] { min-height: 175svh; }
  .has-3d .project[data-device] { padding-top: 46svh; padding-bottom: 40px; }
  .has-3d .project[data-device] .col { top: 46svh; transform: translateY(var(--off, 0px)); }
  .has-3d .more-work { padding-top: 40svh; }
  .more-work .col { width: 100%; }
  .gallery { gap: 18px 12px; }
  .g-name { font-size: 14px; } .g-type { font-size: 12.5px; }
  .row2 { grid-template-columns: 1fr; }
  .has-3d .hero { padding-top: 52svh; }
  .name { font-size: clamp(46px, 13.5vw, 72px); margin-bottom: 20px; }
  .lede { max-width: none; font-size: 18px; margin-bottom: 26px; }
  .hint { display: none; }
  h2 { font-size: clamp(34px, 10vw, 46px); margin-bottom: 18px; }
  .project h2::after { margin-top: 16px; }
  p { font-size: 16px; }
  .big { font-size: 19px; }
  .figure { margin: 20px 0; }
  .figure strong { font-size: 64px; }
  .facts { margin-top: 20px; }
  .facts div { grid-template-columns: 76px 1fr; padding: 10px 0; }
  .stack { grid-template-columns: 1fr; gap: 18px; }
  .btn { height: 44px; }
  .foot { flex-direction: column; gap: 14px; }
  .foot-links { gap: 18px; }
  .social { gap: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .loaded .name .line > span, .loaded .reveal { animation: none; }
}

/* ======================= Rubik for Arabic ======================= */
@font-face { font-family: "Rubik"; src: url("fonts/rubik-arabic-wght-normal.woff2?v=3") format("woff2"); font-weight: 300 900; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E; }
@font-face { font-family: "Rubik"; src: url("fonts/rubik-latin-wght-normal.woff2?v=3") format("woff2"); font-weight: 300 900; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
.lang-ar, [dir="rtl"] { font-family: "Rubik", "Geist", system-ui, sans-serif; letter-spacing: 0; }
.lang-ar .page-title, [dir="rtl"] .pl-title { letter-spacing: 0; line-height: 1.25; }

/* ======================= plain pages: blog, posts ======================= */
.page { position: relative; z-index: 1; }
.article-wrap, section.article-wrap { display: block; min-height: 0; max-width: 720px; margin: 0 auto; padding: 140px var(--pad) 100px; box-sizing: content-box; }
.page-title { font-weight: 640; font-size: clamp(38px, 5vw, 64px); line-height: 1.02; letter-spacing: -0.042em; margin: 0 0 18px; }
.page-lede { font-size: 19px; color: var(--muted); max-width: 52ch; margin-bottom: 48px; }
.sub-title { font-size: clamp(26px, 2.6vw, 34px); letter-spacing: -0.03em; margin: 80px 0 20px; }
.back { display: inline-block; color: var(--muted); text-decoration: none; font-size: 15px; margin-bottom: 26px; }
.back:hover { color: var(--text); }
.empty { color: var(--muted); padding: 28px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.nav a[aria-current="page"] { color: var(--text); }

.post-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.post-list li { border-bottom: 1px solid var(--line); }
.post-list a { display: grid; grid-template-columns: 1fr; gap: 20px; padding: 26px 0; text-decoration: none; color: var(--text); }
.post-list a:has(img) { grid-template-columns: 200px 1fr; }
.post-list img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.pl-title { display: block; font-size: 23px; font-weight: 580; letter-spacing: -0.02em; line-height: 1.25; }
.post-list a:hover .pl-title { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.pl-desc { display: block; color: #C9CBCB; margin-top: 8px; font-size: 16px; }
.pl-meta, .post-meta { display: flex; gap: 16px; color: var(--muted); font-size: 14px; margin-top: 10px; }
.post-meta { margin: 0 0 34px; font-size: 15px; }
.post-cover { width: 100%; border-radius: 10px; border: 1px solid var(--line); margin-bottom: 36px; }

/* long-form text */
.prose { font-size: 18px; line-height: 1.72; color: #D6D7D6; }
.lang-ar .prose { font-size: 18.5px; line-height: 1.9; }
.prose > * { max-width: 68ch; }
.prose p { margin: 0 0 22px; color: inherit; }
.prose h2 { font-size: clamp(26px, 2.6vw, 32px); letter-spacing: -0.03em; line-height: 1.15; margin: 52px 0 16px; color: var(--text); }
.prose h3 { font-size: 21px; font-weight: 600; color: var(--text); margin: 36px 0 10px; }
.lang-ar .prose h2, .lang-ar .prose h3 { letter-spacing: 0; }
.prose a { color: var(--text); text-decoration: underline; text-decoration-color: var(--c, rgba(236,234,228,.4)); text-underline-offset: 3px; }
.prose ul, .prose ol { padding-inline-start: 22px; margin: 0 0 22px; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--muted); }
.prose strong { color: var(--text); font-weight: 600; }
.prose blockquote { margin: 28px 0; padding: 4px 0; padding-inline-start: 20px; border-inline-start: 2px solid var(--c, var(--line)); color: var(--text); font-size: 20px; }
.prose img { max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); margin: 10px 0; }
.prose code { font-family: "Geist Mono", ui-monospace, monospace; font-size: .88em; background: rgba(236,234,228,.07); padding: 2px 6px; border-radius: 5px; }
.prose pre { background: #0F1318; border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; overflow-x: auto; max-width: none; direction: ltr; text-align: left; }
.prose pre code { background: none; padding: 0; font-size: 14.5px; line-height: 1.6; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 26px; font-size: 16px; }
.prose th, .prose td { text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose th { color: var(--muted); font-weight: 500; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 44px 0; }

.related { margin-top: 56px; padding: 22px 24px; border: 1px solid var(--line); border-inline-start: 3px solid var(--c); border-radius: 10px; }
.related p { margin: 0 0 8px; font-size: 16px; }
.related-name { font-weight: 600; color: var(--text); font-size: 18px !important; }
.related-links { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 12px !important; }
.related-links a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--c); }
.tags { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 30px; }
.tags a { color: var(--muted); text-decoration: none; font-size: 15px; }
.tags a:hover { color: var(--text); }

.case-links { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.case-links a { display: grid; grid-template-columns: 200px 1fr; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text); align-items: baseline; }
.cl-name { font-weight: 600; font-size: 18px; }
.cl-name::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); margin-inline-end: 10px; transform: translateY(-1px); }
.cl-desc { color: var(--muted); font-size: 15.5px; }
.case-links a:hover .cl-name { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }

/* ======================= case study pages ======================= */
.page-case #scene { position: absolute; height: 100vh; height: 100svh; }
.case-hero { min-height: 100vh; min-height: 100svh; }
.case-title { font-weight: 640; font-size: clamp(54px, 7vw, 112px); line-height: .92; letter-spacing: -0.05em; margin: 0 0 22px; }
.case-title::after { content: ""; display: block; width: 52px; height: 3px; border-radius: 2px; background: var(--c); margin-top: 24px; }
.case-hero .lede { max-width: 38ch; }
.case-body { padding-top: 40px; }
.case-body .prose figure { margin: 34px 0; max-width: none; }
.case-body .prose figcaption { color: var(--muted); font-size: 14.5px; margin-top: 8px; }
.case-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 52px 0 0; }

@media (max-width: 820px) {
  .article-wrap, section.article-wrap { padding-top: 110px; }
  .post-list a:has(img) { grid-template-columns: 1fr; }
  .case-links a { grid-template-columns: 1fr; gap: 4px; }
  .prose { font-size: 17px; }
  .has-3d .case-hero { padding-top: 52svh; }
  .case-title { font-size: clamp(44px, 13vw, 64px); }
}
.prose img[src*="-mobile"] { display: block; max-width: 300px; margin: 10px auto; }
.prose p > img + em { display: block; color: var(--muted); font-style: normal; font-size: 14.5px; margin-top: 2px; text-align: center; }

/* ======================= Arabic site (html[lang=ar]) ======================= */
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2?v=3") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F, U+060C, U+061B, U+061F; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2?v=3") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2?v=3") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2?v=3") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }

/* Arabic type rules: never track letters (it breaks joining), more leading, slightly larger body */
html[lang="ar"] body, html[lang="ar"] .lang-ar, html[lang="ar"] input, html[lang="ar"] textarea, html[lang="ar"] button {
  font-family: "IBM Plex Sans Arabic", "Geist", system-ui, sans-serif;
}
html[lang="ar"] body { font-size: 18px; line-height: 1.85; font-feature-settings: normal; }
html[lang="ar"] * { letter-spacing: 0 !important; }
html[lang="ar"] .name { font-weight: 700; font-size: clamp(54px, 8.2vw, 132px); line-height: 1.12; margin-inline-start: 0; }
html[lang="ar"] .name .line { padding-bottom: .12em; }
html[lang="ar"] .lede { font-size: clamp(19px, 1.55vw, 22px); line-height: 1.75; max-width: 34ch; font-weight: 400; }
html[lang="ar"] h2 { font-weight: 700; line-height: 1.3; font-size: clamp(36px, 4.2vw, 62px); }
html[lang="ar"] .case-title { font-weight: 700; line-height: 1.15; }
html[lang="ar"] .page-title { font-weight: 700; line-height: 1.3; }
html[lang="ar"] p { line-height: 1.9; }
html[lang="ar"] .big { font-size: clamp(21px, 1.8vw, 25px); line-height: 1.7; font-weight: 500; }
html[lang="ar"] .facts dt, html[lang="ar"] .facts dd { font-size: 15.5px; line-height: 1.7; }
html[lang="ar"] .figure span { font-size: 17px; line-height: 1.6; }
html[lang="ar"] .prose { font-size: 18.5px; line-height: 1.95; }
html[lang="ar"] .prose h2 { line-height: 1.4; }
html[lang="ar"] .btn { font-weight: 500; font-size: 16px; }
html[lang="ar"] .nav nav a, html[lang="ar"] .brand { font-size: 16px; }
html[lang="ar"] .g-name { font-weight: 600; }
html[lang="ar"] .stack p { line-height: 1.7; }
/* Latin words (brand names, tech) inside Arabic text keep Geist via the font stack; digits stay Western */
.nav .lang-switch { color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 2px 10px; }
.nav .lang-switch:hover { border-color: rgba(236,234,228,.4); }
.nav .lang-switch[lang="ar"] { font-family: "IBM Plex Sans Arabic", system-ui, sans-serif; }

/* ======================= word-by-word heading reveal ======================= */
.has-3d .split .w { display: inline-block; opacity: 0; transform: translateY(.45em); transition: opacity .6s ease, transform .8s cubic-bezier(.2,.8,.2,1); transition-delay: calc(var(--i) * 60ms); }
.has-3d .is-in .split .w { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .has-3d .split .w { opacity: 1; transform: none; transition: none; } }

/* ======================= legibility over the 3D model =======================
   A soft dark halo around text, the same colour as the page background.
   On empty background it is invisible; where text crosses the particles it
   carves out a calm area so every line stays readable. */
.has-3d section .col :is(h1, h2, h3, p, dt, dd, li, label, .lede, .figure span, .g-name, .g-type, .back),
.has-3d .hint {
  text-shadow:
    0 0 2px rgba(10, 13, 17, .95),
    0 1px 6px rgba(10, 13, 17, .9),
    0 0 18px rgba(10, 13, 17, .85),
    0 0 36px rgba(10, 13, 17, .6);
}
.has-3d section .col :is(h1, h2, .case-title) {
  text-shadow:
    0 0 3px rgba(10, 13, 17, .95),
    0 2px 14px rgba(10, 13, 17, .9),
    0 0 40px rgba(10, 13, 17, .75),
    0 0 80px rgba(10, 13, 17, .5);
}
/* the big stat number keeps its colour but gets the same calm area */
.has-3d .figure strong { text-shadow: 0 0 3px rgba(10,13,17,.95), 0 2px 16px rgba(10,13,17,.9), 0 0 44px rgba(10,13,17,.7); }
/* buttons and fields already have solid or blurred fills; give the outline buttons a darker glass */
.has-3d .btn:not(.primary) { background: rgba(10, 13, 17, .72); }
.has-3d input, .has-3d textarea { background: rgba(14, 18, 23, .85); }

/* ======================= Display typefaces (headings) =======================
   Latin headings: Fraunces (soft, optical-size serif) — pairs with the handwritten signature.
   Arabic headings: Amiri (classical Naskh) — the Arabic counterpart to a serif.
   Body text stays Geist / IBM Plex Sans Arabic. */
@font-face { font-family: "Fraunces"; src: url("fonts/fraunces-latin-full-normal.woff2?v=3") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Amiri"; src: url("fonts/amiri-arabic-700-normal.woff2?v=3") format("woff2"); font-weight: 400 700; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
:root { --display: "Fraunces", "Geist", Georgia, serif; --display-ar: "Amiri", "Fraunces", "IBM Plex Sans Arabic", serif; }

.name, h2, .case-title, .page-title, .sub-title, .prose h2, .figure strong, .pl-title, .cl-name, .related-name, .stat-num, .next-title {
  font-family: var(--display);
  font-optical-sizing: auto;
  font-variation-settings: "SOFT" 50, "WONK" 0;
}
.name { font-weight: 500; letter-spacing: -0.035em; line-height: .92; font-size: clamp(56px, 8.2vw, 146px); }
h2 { font-weight: 480; letter-spacing: -0.025em; line-height: 1.02; }
.case-title { font-weight: 480; letter-spacing: -0.035em; line-height: .95; }
.page-title { font-weight: 480; letter-spacing: -0.025em; }
.sub-title, .prose h2 { font-weight: 500; letter-spacing: -0.015em; }
.figure strong { font-weight: 400; letter-spacing: -0.04em; font-variation-settings: "SOFT" 100, "WONK" 1; }
.pl-title, .cl-name, .related-name { font-weight: 500; letter-spacing: -0.01em; }

html[lang="ar"] :is(.name, h2, .case-title, .page-title, .sub-title, .prose h2, .pl-title, .cl-name, .related-name, .next-title),
.lang-ar :is(.page-title, .pl-title, .prose h2) {
  font-family: var(--display-ar);
  font-variation-settings: normal;
}
html[lang="ar"] .name { font-weight: 700; font-size: clamp(60px, 8.6vw, 144px); line-height: 1.32; }
html[lang="ar"] .name .line { padding-bottom: .2em; margin-bottom: -.2em; }
html[lang="ar"] h2 { font-weight: 700; line-height: 1.38; font-size: clamp(40px, 4.4vw, 66px); }
html[lang="ar"] .case-title { font-weight: 700; line-height: 1.3; }
html[lang="ar"] .page-title { font-weight: 700; line-height: 1.4; }
html[lang="ar"] .sub-title, html[lang="ar"] .prose h2 { font-weight: 700; line-height: 1.45; }
html[lang="ar"] :is(.pl-title, .cl-name, .related-name) { font-weight: 700; font-size: 1.12em; }
html[lang="ar"] .next-title { line-height: 1.35; }
/* Arabic pages keep Western digits in the Latin display face */
html[lang="ar"] .figure strong, html[lang="ar"] .stat-num { font-family: var(--display); }

/* ======================= loader ======================= */
#loader { position: fixed; inset: 0; z-index: 60; background: var(--bg); color: var(--text); display: grid; grid-template-rows: 1fr auto auto; padding: clamp(22px, 4vw, 56px) var(--pad); clip-path: inset(0 0 0 0); transition: clip-path 1s cubic-bezier(.76,0,.24,1); animation: ld-fallback .01s 10s forwards; }
.ld-name { color: var(--muted); font-size: 15px; align-self: start; }
.ld-num { font-family: var(--display); font-weight: 300; font-size: clamp(88px, 16vw, 260px); line-height: .8; letter-spacing: -0.05em; justify-self: end; font-variant-numeric: tabular-nums; direction: ltr; }
.ld-bar { display: block; height: 1px; margin-top: clamp(18px, 3vw, 34px); background: var(--line); position: relative; overflow: hidden; }
.ld-bar::after { content: ""; position: absolute; inset: 0; background: var(--text); transform: scaleX(var(--p, 0)); transform-origin: left; transition: transform .35s ease; }
html[dir="rtl"] .ld-bar::after { transform-origin: right; }
.loaded #loader { clip-path: inset(0 0 100% 0); pointer-events: none; }
.arrived #loader { display: none; }
@keyframes ld-fallback { to { clip-path: inset(0 0 100% 0); visibility: hidden; } }
.has-3d #scene { opacity: 0; transition: opacity 1s ease .25s; }
.has-3d.loaded #scene { opacity: 1; }
.arrived #scene { transition-duration: .35s; transition-delay: 0s; }

/* ======================= page transitions ======================= */
main, .nav, .foot { transition: opacity .42s ease, transform .42s cubic-bezier(.6,0,.4,1); }
.leaving :is(main, .nav, .foot, #progress) { opacity: 0; transform: translateY(-16px); pointer-events: none; }
.arrived main { animation: arrive .8s cubic-bezier(.2,.8,.2,1) both; }
@keyframes arrive { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ======================= smooth scroll (Lenis) ======================= */
html.lenis, html.lenis body { height: auto; }
html.lenis { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* ======================= model interaction ======================= */
html.can-grab, html.can-grab body { cursor: grab; }
html.grabbing, html.grabbing * { cursor: grabbing !important; user-select: none; }

/* ======================= case pages: numbers, shots, next project ======================= */
.stat-band { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 30px 34px; margin: 0 0 70px; padding: 34px 0 36px; border-block: 1px solid var(--line); }
.stat-num { display: block; font-size: clamp(46px, 5.4vw, 78px); line-height: 1; letter-spacing: -0.04em; color: var(--text); font-variant-numeric: tabular-nums lining-nums; direction: ltr; unicode-bidi: isolate; }
html[dir="rtl"] .stat-num { text-align: right; }
.stat-label { display: block; color: var(--muted); font-size: 15px; line-height: 1.45; margin-top: 12px; max-width: 24ch; }
.stat::before { content: ""; display: block; width: 18px; height: 2px; background: var(--c); margin-bottom: 18px; border-radius: 2px; }

.prose .shot { display: block; perspective: 1500px; margin: 10px 0; }
.prose .shot img { margin: 0; transform: rotateX(var(--rx, 0deg)) scale(var(--sc, 1)); transform-origin: 50% 100%; will-change: transform; }
.prose .shot-m img { transform: translateY(var(--ty, 0px)); }
.prose p > .shot + em { display: block; color: var(--muted); font-style: normal; font-size: 14.5px; margin-top: 8px; text-align: center; }

.next-project { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 96px var(--pad) 120px; border-top: 1px solid var(--line); }
.next-link { display: block; text-decoration: none; color: var(--text); }
.next-kicker { display: block; color: var(--muted); font-size: 15px; margin-bottom: 18px; }
.next-title { display: inline-block; font-size: clamp(64px, 11vw, 188px); line-height: .9; letter-spacing: -0.05em; transition: transform .7s cubic-bezier(.2,.8,.2,1), color .35s ease; }
.next-title::after { content: ""; display: inline-block; width: .13em; height: .13em; border-radius: 50%; background: var(--c); margin-inline-start: .08em; vertical-align: .05em; transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.next-desc { display: block; color: var(--muted); max-width: 46ch; margin-top: 22px; font-size: 17px; line-height: 1.55; }
.next-link:hover .next-title, .next-link:focus-visible .next-title { transform: translateX(14px); color: var(--c); }
html[dir="rtl"] .next-link:hover .next-title, html[dir="rtl"] .next-link:focus-visible .next-title { transform: translateX(-14px); }
.next-link:hover .next-title::after { transform: scale(1.5); }
.next-rest { margin: 34px 0 0; color: var(--muted); font-size: 15.5px; }
.next-rest a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--c); margin-inline-start: 6px; }
html[lang="ar"] .next-title { letter-spacing: 0; }

/* ======================= 404 ======================= */
.page-404 .nf .page-title { font-size: clamp(40px, 5vw, 72px); max-width: 14ch; }
.page-404 .nf .lede { margin-bottom: 28px; }

/* ======================= hover details ======================= */
.btn { transition: background-color .25s ease, border-color .25s ease, color .25s ease, transform .25s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.nav nav a { transition: color .2s ease; }
.cl-name, .pl-title { transition: color .25s ease; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  #loader { transition: none; }
  .has-3d #scene, main, .nav, .foot { transition: none; }
  .arrived main { animation: none; }
  .next-title, .btn { transition: none; }
}
