:root {
  --bg: #11151a;
  --bg-2: #181d24;
  --paper: #ecebe4;
  --ink: #11151a;
  --text: #e8e9ea;
  --muted: #98a0aa;
  --accent: #ff6a2b;
  --line: rgba(255, 255, 255, .12);
  --line-ink: rgba(17, 21, 26, .16);
  --display: "Space Grotesk", "Cairo", system-ui, sans-serif;
  --body: "Space Grotesk", "Cairo", system-ui, sans-serif;
  --mono: "IBM Plex Mono", "Cairo", ui-monospace, monospace;
  --wrap: 1200px;
}
html[lang="ar"] { --display: "Cairo", sans-serif; --body: "Cairo", sans-serif; --mono: "Cairo", sans-serif; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { font-family: var(--body); color: var(--text); background: var(--bg); line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
.wrap { width: min(var(--wrap), 100% - 40px); margin-inline: auto; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* header */
.site-header { position: fixed; inset: 0 0 auto 0; z-index: 50; background: rgba(17, 21, 26, .86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; height: 76px; gap: 24px; }
.nav-cta { font: 600 .8rem "Space Grotesk", sans-serif; padding: 8px 16px; background: var(--accent); color: var(--ink); transition: background .2s; }
.nav > a.nav-cta { color: var(--ink); letter-spacing: .04em; }
.nav > a.nav-cta:hover { background: #fff; color: var(--ink); }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; letter-spacing: -.01em; }
.nav { display: flex; align-items: center; gap: 30px; margin-inline-start: auto; }
.nav > a { font: 500 .76rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); transition: color .2s; }
.nav > a:hover { color: var(--accent); }
html[lang="ar"] .nav > a { font-size: .92rem; letter-spacing: 0; }
.lang { display: flex; border: 1px solid var(--line); }
.lang button { background: none; border: 0; cursor: pointer; padding: 6px 11px; font: 500 .74rem var(--mono); color: var(--muted); }
.lang button.on { background: var(--accent); color: var(--ink); }
.burger { display: none; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; margin-inline-start: auto; }
.burger span { display: block; height: 2px; width: 22px; margin: 5px auto; background: var(--text); transition: transform .3s, opacity .3s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 12px; font: 500 .8rem var(--mono); letter-spacing: .1em; text-transform: uppercase; padding: 15px 24px; border: 1px solid transparent; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
html[lang="ar"] .btn { font-size: .95rem; letter-spacing: 0; font-weight: 700; }
.btn-solid { background: var(--accent); color: var(--ink); }
.btn-solid:hover { background: #fff; }
.btn-line { border-color: var(--line); }
.btn-line:hover { border-color: var(--accent); color: var(--accent); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #fff; color: var(--ink); }
.arrow { width: 0; height: 0; border-block: 5px solid transparent; border-inline-start: 8px solid currentColor; transition: transform .2s; }
.btn:hover .arrow { transform: translateX(4px); }
[dir="rtl"] .btn:hover .arrow { transform: translateX(-4px); }

/* hero */
.hero {
  padding-top: 76px; position: relative; display: flex; flex-direction: column;
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 56px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 56px 100%,
    radial-gradient(900px 500px at 75% 30%, rgba(255, 106, 43, .13), transparent 70%),
    var(--bg);
}
.hero-grid { flex: 1; display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; padding-block: 72px 80px; }
.tag { display: inline-flex; align-items: center; gap: 10px; font: 500 .76rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 22px; }
html[lang="ar"] .tag { font-size: .95rem; letter-spacing: 0; }
.tag i { width: 28px; height: 1px; background: var(--accent); }
h1 { font: 700 clamp(3.2rem, 9vw, 7.2rem)/.92 "Space Grotesk", sans-serif; letter-spacing: -.04em; text-transform: uppercase; }
h1 { text-shadow: 0 0 80px rgba(255, 106, 43, .18); }
h1 em { font-style: normal; text-shadow: none; color: transparent; -webkit-text-stroke: 2px var(--accent); }
.hero-sub { max-width: 52ch; margin-top: 26px; font-size: 1.08rem; color: #c3c8ce; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }

.portrait { position: relative; justify-self: end; width: min(100%, 400px); }
.portrait::before { content: ""; position: absolute; inset: 8% -10% -6% -10%; background: radial-gradient(closest-side, rgba(255, 106, 43, .28), transparent); filter: blur(30px); z-index: -1; }
.portrait-frame { box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .9); }
.portrait-frame { position: relative; padding: 12px; border: 1px solid var(--line); background: var(--bg-2); }
.portrait-frame img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 12%; filter: saturate(.92) contrast(1.03); }
.c { position: absolute; width: 18px; height: 18px; border: 2px solid var(--accent); }
.c1 { top: -2px; inset-inline-start: -2px; border-inline-end: 0; border-bottom: 0; }
.c2 { top: -2px; inset-inline-end: -2px; border-inline-start: 0; border-bottom: 0; }
.c3 { bottom: -2px; inset-inline-start: -2px; border-inline-end: 0; border-top: 0; }
.c4 { bottom: -2px; inset-inline-end: -2px; border-inline-start: 0; border-top: 0; }
.dim { display: block; font: 400 .7rem var(--mono); letter-spacing: .14em; color: var(--muted); margin-bottom: 8px; text-align: end; }
.portrait figcaption { display: flex; justify-content: space-between; margin-top: 10px; font: 400 .72rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

.strip { border-top: 1px solid var(--line); background: rgba(17, 21, 26, .7); }
.strip-row { display: grid; grid-template-columns: repeat(3, 1fr); }
.strip-row a { display: flex; align-items: baseline; gap: 14px; padding: 22px 20px; border-inline-start: 1px solid var(--line); transition: background .2s; }
.strip-row a:last-child { border-inline-end: 1px solid var(--line); }
.strip-row a:hover { background: rgba(255, 106, 43, .1); }
.strip-row b { font: 700 1.9rem "Space Grotesk", sans-serif; color: var(--accent); letter-spacing: -.03em; }
.strip-row span { font-size: .9rem; color: #c3c8ce; }

/* marquee */
.marquee { overflow: hidden; background: var(--accent); color: var(--ink); padding-block: 12px; }
.marquee-track { display: flex; align-items: center; width: max-content; animation: slide 36s linear infinite; }
.marquee span { font: 700 1.15rem "Space Grotesk", sans-serif; text-transform: uppercase; letter-spacing: -.01em; white-space: nowrap; }
.marquee i { width: 10px; height: 10px; background: var(--ink); transform: rotate(45deg); margin-inline: 30px; flex: none; }
@keyframes slide { to { transform: translateX(-50%); } }

/* sections */
.section { padding-block: 96px; }
.section-head { margin-bottom: 44px; max-width: 760px; }
.kicker { display: flex; align-items: center; gap: 12px; font: 500 .74rem var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 16px; }
html[lang="ar"] .kicker { font-size: .9rem; letter-spacing: 0; }
.kicker span:first-child { padding: 2px 7px; border: 1px solid currentColor; font-family: "IBM Plex Mono", monospace; }
h2 { font: 700 clamp(1.9rem, 4.2vw, 3.1rem)/1.08 var(--display); letter-spacing: -.03em; text-wrap: balance; }
html[lang="ar"] h2 { letter-spacing: 0; line-height: 1.3; }
.section-note { margin-top: 14px; color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.card { background: var(--bg); padding: 34px 30px 36px; transition: background .25s; position: relative; }
.card::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; transition: transform .35s; }
[dir="rtl"] .card::after { transform-origin: 100% 50%; }
.card:hover::after { transform: scaleX(1); }
.card:hover { background: var(--bg-2); }
.icon { width: 44px; height: 44px; color: var(--accent); margin-bottom: 22px; }
.card h3 { font: 600 1.25rem var(--display); margin-bottom: 10px; }
.card p { color: #b9bfc6; font-size: .96rem; }
.card ul { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.card li { position: relative; padding-inline-start: 18px; font-size: .9rem; color: var(--muted); margin-top: 6px; }
.card li::before { content: ""; position: absolute; inset-inline-start: 0; top: .72em; width: 8px; height: 1px; background: var(--accent); }

/* work */
.section-paper { background: var(--paper); color: var(--ink); }
.section-paper .kicker { color: #c8460f; }
.section-paper .section-note { color: #5b626b; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filters button { display: inline-flex; align-items: center; gap: 9px; background: none; border: 1px solid var(--line-ink); padding: 9px 16px; cursor: pointer; font-size: .9rem; font-weight: 500; transition: background .2s, color .2s, border-color .2s; }
.filters button b { font: 400 .72rem "IBM Plex Mono", monospace; opacity: .6; }
.filters button:hover { border-color: var(--ink); }
.filters button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.tile { position: relative; display: flex; flex-direction: column; width: 100%; padding: 0; border: 1px solid var(--line-ink); background: #fff; cursor: zoom-in; text-align: start; overflow: hidden; transition: transform .25s, box-shadow .25s, border-color .25s; }
.tile:hover { transform: translateY(-3px); border-color: var(--ink); box-shadow: 0 14px 30px -18px rgba(17, 21, 26, .55); }
.tile[hidden] { display: none; }
.tile img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #fff; transition: transform .5s; }
.tile.draw img { object-fit: contain; background: #e9e8dc; }
.tile.art img { background: #3a3a3a; }
.tile:hover img { transform: scale(1.04); }
.tile-cap { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 11px 13px 12px; border-top: 1px solid var(--line-ink); background: #fff; position: relative; }
.tile-cap b { font-weight: 600; font-size: .92rem; line-height: 1.3; }
.tile-cap span { font: 400 .68rem "IBM Plex Mono", monospace; color: #6c737c; white-space: nowrap; }

/* featured projects */
.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 72px; }
.pcard { display: flex; flex-direction: column; padding: 0; border: 1px solid var(--line-ink); background: #fff; cursor: pointer; text-align: start; overflow: hidden; transition: transform .25s, box-shadow .25s, border-color .25s; }
.pcard:hover { transform: translateY(-4px); border-color: var(--ink); box-shadow: 0 22px 40px -24px rgba(17, 21, 26, .6); }
.pcard-img { position: relative; display: block; overflow: hidden; }
.pcard-img img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: transform .5s; }
.pcard:hover .pcard-img img { transform: scale(1.05); }
.pcard-img em { position: absolute; inset-inline-start: 0; bottom: 0; font: 500 .72rem var(--mono); font-style: normal; letter-spacing: .08em; text-transform: uppercase; background: var(--accent); color: var(--ink); padding: 8px 14px; transform: translateY(100%); transition: transform .25s; }
html[lang="ar"] .pcard-img em { font-size: .85rem; letter-spacing: 0; font-weight: 700; }
.pcard:hover .pcard-img em, .pcard:focus-visible .pcard-img em { transform: none; }
.pcard-body { display: block; padding: 18px 20px 22px; border-top: 1px solid var(--line-ink); }
.pcard-body small { display: flex; justify-content: space-between; gap: 10px; font: 500 .7rem var(--mono); letter-spacing: .08em; text-transform: uppercase; color: #c8460f; }
.pcard-body b { display: block; margin: 8px 0 6px; font: 700 1.3rem/1.2 var(--display); letter-spacing: -.02em; }
html[lang="ar"] .pcard-body b { letter-spacing: 0; }
.pcard-body i { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-style: normal; font-size: .9rem; color: #5b626b; }
.sub-h { font: 700 1.5rem var(--display); letter-spacing: -.02em; margin-bottom: 20px; padding-top: 28px; border-top: 1px solid var(--line-ink); }

.proj { position: fixed; inset: 0; z-index: 90; background: rgba(8, 10, 13, .8); backdrop-filter: blur(6px); overflow-y: auto; overscroll-behavior: contain; padding: 40px 20px; }
.proj[hidden] { display: none; }
.proj-panel { position: relative; width: min(1100px, 100%); margin-inline: auto; background: var(--bg); border: 1px solid var(--line); padding: 48px 48px 52px; }
.proj-close { position: absolute; top: 12px; inset-inline-end: 14px; width: 48px; height: 48px; background: none; border: 0; cursor: pointer; color: #fff; font-size: 2.2rem; line-height: 1; }
.proj-close:hover { color: var(--accent); }
.proj-desc { max-width: 68ch; margin-top: 16px; color: #c3c8ce; font-size: 1.05rem; }
.proj-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-block: 32px; }
.proj-grid .tile { border-color: var(--line); }
.proj-grid .tile:first-child:nth-last-child(odd) { grid-column: span 2; }
.proj-grid .tile:first-child:nth-last-child(odd) img { aspect-ratio: 16 / 9; }
.proj-grid .tile-cap { color: var(--ink); }
.proj-3d { position: relative; margin-top: 32px; border: 1px solid var(--line); background: radial-gradient(circle at 50% 40%, #2a313b, #151a20); }
.proj-3d model-viewer { display: block; width: 100%; height: min(60vh, 520px); }
.proj-3d span { position: absolute; bottom: 12px; inset-inline-start: 14px; font: 400 .72rem var(--mono); color: var(--muted); }

/* about */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
.about-text { margin-top: 22px; color: #c3c8ce; font-size: 1.05rem; max-width: 54ch; }
.tools > div { display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 18px 0; border-top: 1px solid var(--line); }
.tools > div:last-child { border-bottom: 1px solid var(--line); }
.tools dt { font-weight: 700; font-size: 1.1rem; }
.tools dd { color: var(--muted); font-size: .95rem; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 34px; }
.steps span { font: 500 .72rem "IBM Plex Mono", monospace; color: var(--accent); }
.steps b { display: block; margin: 6px 0 4px; font-size: 1.05rem; }
.steps p { font-size: .88rem; color: var(--muted); }

/* contact */
.section-accent { background: var(--accent); color: var(--ink); padding-block: 80px; }
.section-accent .kicker { color: var(--ink); }
.section-accent .section-note { color: rgba(17, 21, 26, .78); }
.section-accent h2 { font-size: clamp(1.9rem, 4.2vw, 3.1rem); }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-ink-line { border-color: var(--ink); }
.btn-ink-line:hover { background: var(--ink); color: #fff; }
.contact-row { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }

.footer { border-top: 1px solid var(--line); padding-block: 26px; font-size: .84rem; color: var(--muted); }
.footer-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(8, 10, 13, .94); display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; }
.lightbox[hidden] { display: none; }
.lightbox figure { grid-column: 2; display: flex; flex-direction: column; align-items: center; gap: 14px; min-width: 0; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 130px); max-height: calc(100dvh - 130px); object-fit: contain; background: #fff; }
.lightbox figcaption { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; align-items: baseline; }
.lightbox figcaption b { font-size: 1.05rem; }
.lightbox figcaption span { font-size: .8rem; color: var(--muted); }
.lb-nav, .lb-close { background: none; border: 0; cursor: pointer; color: #fff; font-size: 2.6rem; line-height: 1; width: 56px; height: 56px; justify-self: center; transition: color .2s; }
.lb-nav:hover, .lb-close:hover { color: var(--accent); }
.lb-close { position: absolute; top: 10px; inset-inline-end: 12px; font-size: 2.2rem; }
[dir="rtl"] .lb-nav { transform: scaleX(-1); }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s, transform .6s; }
.reveal.in, .no-js .reveal { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .burger { display: block; }
  html { font-size: 100%; }
  .hero { min-height: 0; }
  .nav-cta { margin-top: 14px; }
  .marquee span { font-size: 1.05rem; }
  .marquee i { margin-inline: 18px; width: 7px; height: 7px; }
  .section-accent { padding-block: 64px; }
  .nav { position: fixed; inset: 76px 0 auto 0; flex-direction: column; align-items: flex-start; gap: 0; padding: 8px 20px 20px; background: var(--bg); border-bottom: 1px solid var(--line); transform: translateY(-130%); transition: transform .3s; margin: 0; }
  .nav.open { transform: none; }
  .nav > a { width: 100%; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: .86rem; }
  .lang { margin-top: 16px; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; padding-block: 44px 52px; }
  .portrait { justify-self: start; width: min(100%, 340px); }
  .strip-row { grid-template-columns: 1fr; }
  .strip-row a { border-inline: 0; border-top: 1px solid var(--line); padding: 14px 0; }
  .strip-row a:first-child { border-top: 0; }
  .strip-row a:last-child { border-inline-end: 0; }
  .section { padding-block: 64px; }
  .cards { grid-template-columns: 1fr; }
  .projects { grid-template-columns: 1fr; margin-bottom: 52px; }
  .proj { padding: 0; }
  .proj-panel { padding: 56px 20px 40px; border: 0; min-height: 100%; }
  .proj-grid { grid-template-columns: 1fr; }
  .proj-grid .tile:first-child:nth-last-child(odd) { grid-column: auto; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tile-cap { flex-direction: column; gap: 2px; padding: 9px 10px 10px; }
  .tile-cap b { font-size: .84rem; }
  .lightbox { grid-template-columns: 40px 1fr 40px; }
  .lb-nav { width: 40px; }
}
@media (max-width: 520px) {
  .steps { grid-template-columns: 1fr; gap: 16px; }
  .tools > div { grid-template-columns: 1fr; gap: 4px; }
  .btn { padding: 14px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
  .marquee-track { animation: none; }
  .reveal { opacity: 1; transform: none; }
}
