/* =========================================================
   Majid Sanad — Portfolio
   Type: Anybody (display, variable width) + Montserrat (text)
   ========================================================= */
:root {
  --red: #EF2B3C;
  --ink: #0B0B0B;
  --paper: #EFEFED;
  --mute: #8a8a8a;
  --pad: clamp(18px, 3.2vw, 56px);
  --sec: clamp(72px, 9vw, 140px);
  --ease: cubic-bezier(.7, 0, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --display: "Anybody", "Arial Narrow", sans-serif;
  --text: "Montserrat", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--ink); color: var(--paper);
  font-family: var(--text); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
body.is-loading { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p, figure { margin: 0; }
::selection { background: var(--red); color: var(--ink); }

/* ---------- type primitives ---------- */
.flex-word {
  font-family: var(--display);
  text-transform: uppercase;
  font-variation-settings: "wdth" var(--w, 62), "wght" var(--wg, 850);
  letter-spacing: -0.01em;
  line-height: .84;
  white-space: nowrap;
}
.flex-word .ch { display: inline-block; font-variation-settings: "wdth" var(--w, 62), "wght" var(--wg, 850); will-change: font-variation-settings; }
.outline { color: transparent; -webkit-text-stroke: 1.5px currentColor; }
.label {
  font-family: var(--text); font-size: 11px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
}
.big-title {
  font-family: var(--display); text-transform: uppercase;
  font-variation-settings: "wdth" 66, "wght" 800;
  font-size: clamp(56px, 11vw, 200px); line-height: .86; letter-spacing: -0.01em;
}

/* line reveal */
.line { display: block; overflow: hidden; padding-bottom: .04em; margin-bottom: -.04em; }
.line > span { display: inline-block; transform: translateY(110%); transition: transform 1.1s var(--ease-out); }
.in .line > span, .line.in > span { transform: none; }
.in .line:nth-child(2) > span { transition-delay: .08s; }
.in .line:nth-child(3) > span { transition-delay: .16s; }
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease-out), transform 1s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }

/* roll link */
.roll { display: inline-block; overflow: hidden; height: 1.3em; line-height: 1.3; vertical-align: top; }
.roll span { display: block; position: relative; transition: transform .5s var(--ease); }
.roll span::after { content: attr(data-t); position: absolute; left: 0; top: 100%; }
.roll:hover span { transform: translateY(-100%); }

/* ---------- loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 100; background: var(--ink); color: var(--paper);
  display: grid; grid-template-rows: auto 1fr; align-items: end; padding: var(--pad);
  transition: transform 1.1s var(--ease);
}
.loader__top { display: flex; justify-content: space-between; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.loader__count { text-align: right; font-family: var(--display); font-variation-settings: "wdth" 60, "wght" 800; font-size: clamp(64px, 12vw, 200px); line-height: .8; }
.loader.done { transform: translateY(-100%); }

/* ---------- cursor ---------- */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none;
  width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  background: #fff; mix-blend-mode: difference;
  display: grid; place-items: center;
  transition: width .45s var(--ease-out), height .45s var(--ease-out), margin .45s var(--ease-out);
}
.cursor__label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #000; opacity: 0; transition: opacity .2s; white-space: nowrap; }
.cursor.is-big { width: 88px; height: 88px; margin: -44px 0 0 -44px; }
.cursor.is-big .cursor__label { opacity: 1; }
.cursor.is-link { width: 44px; height: 44px; margin: -22px 0 0 -22px; }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }
@media (hover: hover) and (pointer: fine) { body.has-cursor, body.has-cursor a, body.has-cursor button { cursor: none; } }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 60; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 22px calc(var(--pad) + 12px); color: var(--paper); transition: color .4s, transform .5s var(--ease);
  font-size: 13px; font-weight: 500;
}
.nav.on-light { color: var(--ink); }
.nav.hide { transform: translateY(-110%); }
.nav__logo { font-family: var(--display); font-variation-settings: "wdth" 100, "wght" 700; font-size: 16px; letter-spacing: -.01em; justify-self: start; }
.nav__logo i { font-style: normal; color: var(--red); }
.nav__pill {
  display: flex; gap: 2px; padding: 4px; border-radius: 99px;
  background: color-mix(in srgb, currentColor 8%, transparent);
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
}
.nav__pill a { padding: 8px 16px; border-radius: 99px; transition: background .3s, color .3s; }
.nav__pill a:hover { background: currentColor; }
.nav__pill a:hover span { color: var(--paper); }
.nav.on-light .nav__pill a:hover span { color: var(--paper); }
.nav:not(.on-light) .nav__pill a:hover span { color: var(--ink); }
.nav__cta {
  justify-self: end; display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 99px;
  background: var(--red); color: var(--ink); font-weight: 600; transition: background .3s, color .3s;
}
.nav__cta i { font-style: normal; transition: transform .4s var(--ease-out); }
.nav__cta:hover { background: var(--ink); color: var(--paper); }
.nav:not(.on-light) .nav__cta:hover { background: var(--paper); color: var(--ink); }
.nav__cta:hover i { transform: rotate(45deg); }
.nav__burger { display: none; justify-self: end; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 99px; background: color-mix(in srgb, currentColor 8%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); font-weight: 600; }
.nav__burger b { display: grid; gap: 4px; }
.nav__burger b span { display: block; width: 16px; height: 1.5px; background: currentColor; transition: transform .5s var(--ease); }
.menu-open .nav__burger b span:first-child { transform: translateY(2.75px) rotate(45deg); }
.menu-open .nav__burger b span:last-child { transform: translateY(-2.75px) rotate(-45deg); }

.menu {
  position: fixed; inset: 0; z-index: 55; background: var(--red); color: var(--ink);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 100px var(--pad) var(--pad);
  clip-path: circle(0% at calc(100% - 40px) 30px); transition: clip-path .9s var(--ease); visibility: hidden;
}
.menu-open .menu { clip-path: circle(150% at calc(100% - 40px) 30px); visibility: visible; }
.menu__links a { display: flex; align-items: flex-start; gap: 14px; border-bottom: 1px solid rgba(0,0,0,.2); padding: 6px 0; }
.menu__links i { font-style: normal; font-size: 12px; font-weight: 700; padding-top: 10px; }
.menu__links span { font-family: var(--display); text-transform: uppercase; font-size: clamp(54px, 15vw, 120px); line-height: .9; font-variation-settings: "wdth" 60, "wght" 850; transition: font-variation-settings .5s var(--ease); }
.menu__links a:hover span { color: var(--paper); }
.menu__foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; }
.menu-open { overflow: hidden; }
.menu-open .nav { color: var(--ink); }
.menu-open .nav.hide { transform: none; }

/* floating whatsapp */
.wa-float {
  position: fixed; right: var(--pad); bottom: var(--pad); z-index: 50;
  width: 58px; height: 58px; border-radius: 50%; background: var(--red); color: var(--ink);
  display: grid; place-items: center; box-shadow: 0 10px 30px rgba(0,0,0,.25);
  transform: scale(0); transition: transform .6s var(--ease-out);
}
.wa-float.show { transform: scale(1); }
.wa-float svg { width: 26px; height: 26px; }

/* ---------- HERO ---------- */
.hero { background: var(--ink); padding: 12px; }
.hero__card {
  position: relative; min-height: calc(100vh - 24px); min-height: calc(100svh - 24px);
  background: var(--paper); color: var(--ink); border-radius: clamp(14px, 1.6vw, 24px); overflow: hidden;
  display: grid; grid-template-rows: 1fr auto auto auto; grid-template-columns: minmax(0, 1fr);
  padding: 96px var(--pad) var(--pad);
}
.hero__statement {
  align-self: end; font-weight: inherit;
  font-family: var(--display); font-variation-settings: "wdth" 96, "wght" 520;
  font-size: clamp(38px, min(7.4vw, 10.6vh), 150px); line-height: .97; letter-spacing: -.045em;
}
.hero__statement .red { color: var(--red); }
.hero__statement .grey { color: #a3a3a0; }
.hero__statement .ln { display: block; overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }
.hero__statement .ln > span { display: inline-block; transform: translateY(105%); transition: transform 1.1s var(--ease-out); }
.loaded .hero__statement .ln > span { transform: none; }
.loaded .hero__statement .ln:nth-child(2) > span { transition-delay: .08s; }
.loaded .hero__statement .ln:nth-child(3) > span { transition-delay: .16s; }
.loaded .hero__statement .ln:nth-child(4) > span { transition-delay: .24s; }

/* rolling word */
.roller { position: relative; display: inline-block; vertical-align: bottom; height: 1em; line-height: 1; overflow: hidden; color: var(--red); transition: width .6s var(--ease); }
.roller__w { position: absolute; left: 0; top: 0; white-space: nowrap; opacity: 0; filter: blur(8px); transform: translateY(70%); transition: transform .7s var(--ease), opacity .5s, filter .6s; }
.roller__w.on { opacity: 1; filter: none; transform: none; }
.roller__w.out { opacity: 0; filter: blur(8px); transform: translateY(-70%); }
.roller__w::before { content: "→ "; letter-spacing: 0; }

.hero__rule { display: flex; align-items: center; margin: clamp(26px, 3.4vh, 48px) 0 clamp(18px, 2.4vh, 30px); position: relative; }
.hero__rule::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(0,0,0,.14); }
.hero__pill { position: relative; font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--red); border: 1px solid rgba(239,43,60,.45); background: var(--paper); border-radius: 99px; padding: 7px 16px; display: inline-flex; align-items: center; gap: 8px; }
.hero__pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--red); animation: pulse 2.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(239,43,60,.55); } 70% { box-shadow: 0 0 0 8px rgba(239,43,60,0); } 100% { box-shadow: 0 0 0 0 rgba(239,43,60,0); } }
.hero__dot { position: absolute; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: var(--ink); }

.hero__bottom { display: flex; align-items: center; gap: clamp(28px, 4vw, 64px); }
.hero__metric { display: flex; align-items: center; gap: 10px; }
.hero__metric b { font-family: var(--display); font-variation-settings: "wdth" 96, "wght" 500; font-weight: inherit; font-size: clamp(56px, min(6.4vw, 10vh), 116px); line-height: .9; letter-spacing: -.05em; color: var(--red); }
.hero__metric span { font-size: 15px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; line-height: 1.25; color: #6b6b6b; }
.hero__scroll { margin-inline-start: auto; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 10px; }
.hero__scroll i { display: block; width: 28px; height: 1px; background: currentColor; transform-origin: left; animation: line 2.4s var(--ease) infinite; }
@keyframes line { 0% { transform: scaleX(0); } 50% { transform: scaleX(1); transform-origin: left; } 51% { transform-origin: right; } 100% { transform: scaleX(0); transform-origin: right; } }
.hero .reveal { transition-delay: .45s; }

/* work strip: continuous slow loop */
.hero__strip {
  margin: clamp(22px, 3.2vh, 40px) calc(var(--pad) * -1) 0; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  opacity: 0; transition: opacity 1s var(--ease-out) .6s;
}
.loaded .hero__strip { opacity: 1; }
.hero__track { display: flex; gap: clamp(8px, .8vw, 12px); width: max-content; animation: strip 80s linear infinite; }
.hero__strip:hover .hero__track { animation-play-state: paused; }
@keyframes strip { to { transform: translate3d(-50%, 0, 0); } }
.hero__strip a { position: relative; flex: none; height: clamp(140px, 19vh, 260px); aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: #ddd; }
.hero__strip img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease-out); }
.hero__strip a::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,.6)); opacity: 0; transition: opacity .4s; }
.hero__strip a span { position: absolute; left: 14px; bottom: 12px; z-index: 1; color: #fff; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; opacity: 0; transform: translateY(6px); transition: opacity .4s, transform .4s var(--ease-out); }
.hero__strip a:hover img { transform: scale(1.06); }
.hero__strip a:hover::after, .hero__strip a:hover span { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .hero__track { animation: none; } .hero__strip { overflow-x: auto; } }

/* ---------- about ---------- */
.about { background: var(--paper); color: var(--ink); padding: 0 var(--pad) clamp(80px, 10vw, 160px); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(12px, 1.6vw, 24px); align-items: end; }
.about__photo { grid-column: 1 / span 5; aspect-ratio: 4 / 5; overflow: hidden; background: var(--red); }
.about__photo img { width: 100%; height: 115%; object-fit: cover; object-position: 50% 30%; transform: translateY(var(--py, 0)); }
.about__text { grid-column: 7 / -1; }
.about__lead { font-size: clamp(22px, 2.3vw, 36px); line-height: 1.25; font-weight: 500; letter-spacing: -.015em; margin: 18px 0 clamp(30px, 4vw, 60px); }
.about__facts div { display: grid; grid-template-columns: 140px 1fr; gap: 20px; padding: 12px 0; border-top: 1px solid rgba(0,0,0,.12); font-size: 14px; }
.about__facts div:last-child { border-bottom: 1px solid rgba(0,0,0,.12); }
.about__facts dt { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; opacity: .55; padding-top: 2px; }
.about__facts dd { margin: 0; }

/* ---------- marquee band ---------- */
.band { overflow: hidden; padding: 18px 0; border-block: 1px solid rgba(255,255,255,.12); }
.band--black { background: var(--ink); color: var(--paper); }
.marquee { display: flex; width: max-content; will-change: transform; }
.marquee__inner { display: flex; align-items: center; gap: clamp(18px, 2.4vw, 40px); padding-right: clamp(18px, 2.4vw, 40px); }
.marquee span { font-family: var(--display); text-transform: uppercase; font-size: clamp(30px, 5vw, 76px); line-height: 1; font-variation-settings: "wdth" 70, "wght" 800; }
.marquee b { color: var(--red); font-size: clamp(22px, 3vw, 44px); display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- statement ---------- */
.statement { background: var(--paper); color: var(--ink); padding: clamp(80px, 12vw, 180px) var(--pad); }
.statement__head { display: flex; justify-content: space-between; margin-bottom: clamp(30px, 5vw, 70px); }
.statement__title {
  font-family: var(--display); text-transform: uppercase; font-size: clamp(56px, 11vw, 210px); line-height: .86;
  font-variation-settings: "wdth" 72, "wght" 850;
}
.statement__title b { font-weight: inherit; font-variant-numeric: tabular-nums; }
.obsessed { font-style: normal; color: var(--red); display: inline-block; font-variation-settings: "wdth" var(--ow, 72), "wght" 850; }
.statement__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 4vw, 70px); margin-top: clamp(60px, 9vw, 140px); }
.statement__grid h3 { font-family: var(--display); font-variation-settings: "wdth" 130, "wght" 500; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; line-height: 1.35; margin-bottom: 16px; }
.statement__grid p { color: #444; font-size: 14px; }
.statement__grid article { border-top: 1px solid rgba(0,0,0,.15); padding-top: 20px; }
.statement__grid article:nth-child(2) { transition-delay: .1s; } .statement__grid article:nth-child(3) { transition-delay: .2s; }

/* ---------- scroll-linked horizontal rows ---------- */
.js-xscroll { position: relative; left: 50%; width: max-content; transform: translate3d(calc(-50% + var(--x, 0px)), 0, 0); will-change: transform; }

/* ---------- quote ---------- */
.quote { position: relative; background: var(--ink); height: 260vh; }
.quote__sticky { position: sticky; top: 0; height: 100vh; height: 100svh; display: grid; place-items: center; padding: 0 var(--pad); overflow: hidden; }
.quote__sticky::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: clamp(200px, 30vw, 460px); height: 74%;
  background: var(--red); transform: translate(-50%, -50%) scaleY(var(--qp, 0)); transform-origin: 50% 100%;
}
.quote__text {
  position: relative; max-width: 1200px; font-family: var(--text); font-weight: 600; text-transform: uppercase;
  font-size: clamp(26px, 4.6vw, 76px); line-height: 1.08; letter-spacing: -.01em; text-align: center;
}
.quote__text .w { opacity: .14; transition: opacity .35s; }
.quote__text .w.on { opacity: 1; }
.quote__by { position: absolute; bottom: 12%; right: var(--pad); font-size: 13px; font-style: italic; opacity: .7; }

/* ---------- index ---------- */
.index { position: relative; background: var(--paper); color: var(--ink); padding: clamp(80px, 10vw, 150px) var(--pad); }
.index__head { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 20px; margin-bottom: clamp(40px, 6vw, 90px); }
.index__head p { font-size: 13px; max-width: 460px; }
.index__list li { border-top: 1px solid rgba(0,0,0,.15); }
.index__list li:last-child { border-bottom: 1px solid rgba(0,0,0,.15); }
.index__list a { display: flex; align-items: center; gap: 2vw; padding: .1em 0 .02em; position: relative; }
.index__list .flex-word { font-size: clamp(46px, 9.4vw, 170px); --w: 56; --wg: 800; transition: font-variation-settings .7s var(--ease-out); }
.index__list .flex-word { font-variation-settings: "wdth" var(--w), "wght" var(--wg); }
.index__list i { flex: 1; height: 1px; background: currentColor; opacity: .2; transform-origin: left; transition: transform .7s var(--ease-out), opacity .3s; }
.index__list b { font-family: var(--display); font-variation-settings: "wdth" 56, "wght" 800; font-size: clamp(46px, 9.4vw, 170px); line-height: .84; }
.index__list a:hover .flex-word { --w: 78; }
.index__list a:hover i { opacity: 1; transform: scaleX(.4); }
.index__list a:hover b { color: var(--red); }
.index__float {
  position: fixed; left: 0; top: 0; z-index: 20; width: clamp(220px, 24vw, 420px); aspect-ratio: 16/9;
  pointer-events: none; overflow: hidden; opacity: 0; transform: translate(-50%, -50%) scale(.7);
  transition: opacity .3s, transform .5s var(--ease-out);
}
.index__float.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.index__float img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- horizontal work ---------- */
.hwork { position: relative; background: var(--ink); }
.hwork__sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: grid; grid-template-rows: auto 1fr auto; grid-template-columns: minmax(0, 1fr); padding: 84px 0 var(--pad); }
.hwork__track { justify-self: start; }
.hwork__top { display: flex; justify-content: space-between; padding: 0 var(--pad); }
.hwork__counter b { color: var(--red); font-weight: inherit; }
.hwork__track { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 40px); padding: 0 var(--pad); width: max-content; will-change: transform; }
.hwork__bar { margin: 0 var(--pad); height: 2px; background: rgba(255,255,255,.15); }
.hwork__bar i { display: block; height: 100%; background: var(--red); transform-origin: left; transform: scaleX(var(--hp, 0)); }

.hchap {
  flex: none; width: clamp(260px, 34vw, 560px); height: min(66vh, 620px);
  display: flex; flex-direction: column; justify-content: space-between; padding: clamp(18px, 2vw, 32px);
  background: var(--red); color: var(--ink);
}
.hchap.dark { background: var(--paper); }
.hchap .flex-word { font-size: clamp(64px, 9vw, 160px); line-height: .82; white-space: normal; --w: 56; word-break: break-word; }
.hchap p { font-size: 13px; font-weight: 500; max-width: 340px; }
.hchap__top { display: flex; justify-content: space-between; }

.hcard { flex: none; width: clamp(300px, 56vw, 1060px); color: var(--paper); }
.hcard__media { position: relative; aspect-ratio: 16/9; overflow: hidden; background: #1a1a1a; }
.hcard__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-out), opacity .6s; }
.hcard__media img + img { opacity: 0; }
.hcard:hover .hcard__media img { transform: scale(1.05); }
.hcard:hover .hcard__media img + img { opacity: 1; }
.hcard__meta { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 16px; padding-top: 16px; border-bottom: 1px solid rgba(255,255,255,.15); padding-bottom: 12px; }
.hcard__no { font-size: 12px; font-weight: 700; color: var(--red); }
.hcard__title { min-width: 0; font-family: var(--display); text-transform: uppercase; font-size: clamp(26px, 3.4vw, 60px); line-height: .9; font-variation-settings: "wdth" 66, "wght" 800; transition: font-variation-settings .6s var(--ease-out); }
.hcard__cat { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; opacity: .7; text-align: right; }

/* ---------- marks ---------- */
.marks { background: var(--ink); color: var(--paper); padding: clamp(80px, 10vw, 160px) var(--pad); }
.marks__head { display: block; gap: 40px; align-items: end; margin-bottom: clamp(40px, 6vw, 80px); }
.marks__side p { margin-top: 18px; font-size: 14px; color: #444; }
.marks__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: clamp(20px, 3vw, 48px) clamp(16px, 2.4vw, 40px); }
.mark {
  --logo-bg: var(--ink);
  aspect-ratio: 1 / .78; min-height: 0; min-width: 0; overflow: hidden; position: relative;
  color: var(--paper); transition: color .35s, transform .5s var(--ease-out);
}
.mark svg { position: absolute; inset: 12% 10%; width: 80%; height: 76%; display: block; }
.mark:hover { color: var(--red); transform: scale(1.06); }
@media (max-width: 1024px) { .marks__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 600px) { .marks__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- lettering ---------- */
.lettering { background: var(--ink); padding: clamp(80px, 10vw, 160px) 0; overflow: hidden; }
.lettering__head { padding: 0 var(--pad); margin-bottom: clamp(40px, 5vw, 80px); }
.lettering__title { font-size: clamp(90px, 20vw, 380px); white-space: nowrap; margin: 20px 0; }
.lettering__title .flex-word { --w: 56; }
.lettering__title .flex-word:not(.outline) { color: var(--red); }
.lettering__head p { max-width: 420px; margin-left: auto; font-size: 14px; color: #aaa; }
.lettering__row { display: flex; gap: clamp(10px, 1.4vw, 22px); margin-bottom: clamp(10px, 1.4vw, 22px); }
.lettering__row figure { flex: none; width: clamp(200px, 22vw, 380px); aspect-ratio: 4 / 5; overflow: hidden; background: var(--bg, #000); border-radius: 4px; display: grid; place-items: center; }
.lettering__row img { width: 100%; height: 100%; object-fit: contain; transition: transform 1s var(--ease-out); }
.lettering__row figure:hover img { transform: scale(1.04); }

/* ---------- worked at ---------- */
.worked { background: var(--ink); padding: clamp(80px, 10vw, 160px) var(--pad); }
.worked__head { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; align-items: end; margin-bottom: clamp(40px, 6vw, 80px); }
.worked__head p { font-size: 14px; color: #aaa; }
.worked__list li {
  position: relative; display: grid; grid-template-columns: 1.4fr 1.3fr 1fr; align-items: center; gap: 20px;
  padding: clamp(14px, 1.6vw, 24px) 0; border-top: 1px solid rgba(255,255,255,.15); overflow: hidden; isolation: isolate;
}
.worked__list li:last-child { border-bottom: 1px solid rgba(255,255,255,.15); }
.worked__list li::before { content: ""; position: absolute; inset: 0 calc(var(--pad) * -1); background: var(--red); transform: scaleY(0); transform-origin: bottom; transition: transform .55s var(--ease); z-index: -1; }
.worked__list li:hover::before { transform: scaleY(1); }
.worked__list li:hover { color: var(--ink); }
.worked__list .n { font-size: 12px; font-weight: 700; opacity: .6; }
.worked__list .a { font-family: var(--display); text-transform: uppercase; font-size: clamp(30px, 4.4vw, 80px); line-height: .9; font-variation-settings: "wdth" 62, "wght" 800; transition: font-variation-settings .6s var(--ease-out); }
.worked__list .r { font-size: 14px; }
.worked__list .d { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; text-align: right; font-variant-numeric: tabular-nums; }


/* ---------- skills ---------- */
.skills { background: var(--paper); color: var(--ink); padding: clamp(80px, 10vw, 160px) var(--pad); overflow: hidden; }
.skills__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: clamp(24px, 3vw, 50px); margin-top: clamp(50px, 7vw, 100px); }
.skills__grid > div { border-top: 1px solid rgba(0,0,0,.15); padding-top: 20px; font-size: 14px; }
.skills__grid .label { display: block; margin-bottom: 14px; color: var(--red); }
.skills__grid p + p { margin-top: 14px; }
.skills__lead { font-family: var(--display); font-variation-settings: "wdth" 130, "wght" 600; text-transform: uppercase; font-size: 15px; letter-spacing: .03em; }
.skills__grid li { padding: 4px 0; border-bottom: 1px solid rgba(0,0,0,.08); }
.skills__quote {
  margin-top: clamp(70px, 9vw, 140px); white-space: nowrap;
  font-family: var(--display); font-variation-settings: "wdth" 130, "wght" 400; text-transform: uppercase;
  font-size: clamp(40px, 7vw, 130px); line-height: 1; color: var(--ink);
}

/* ---------- contact ---------- */
.contact { background: var(--ink); padding: 84px var(--pad) var(--pad); min-height: 100vh; display: flex; flex-direction: column; }
.contact__top { display: flex; justify-content: space-between; }
.contact__title { margin-top: auto; padding-top: 60px; text-align: right; font-weight: inherit; }
.contact__title .flex-word { display: inline-block; }
.contact__title .red { color: var(--red); }
.contact__grid { display: grid; grid-template-columns: auto 1fr; gap: clamp(30px, 5vw, 80px); align-items: end; margin-top: clamp(40px, 6vw, 80px); }
.contact__cta {
  width: clamp(150px, 15vw, 220px); aspect-ratio: 1; border-radius: 50%; background: var(--red); color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-family: var(--display); font-variation-settings: "wdth" 100, "wght" 700; text-transform: uppercase; font-size: clamp(16px, 1.4vw, 20px);
  transition: background .3s;
}
.contact__cta i { font-style: normal; font-size: 1.6em; line-height: 1; transition: transform .5s var(--ease-out); }
.contact__cta:hover { background: var(--paper); }
.contact__cta:hover i { transform: rotate(45deg); }
.contact__list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 40px; }
.contact__list li { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.15); font-size: 15px; }
.contact__list li span { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; opacity: .6; padding-top: 3px; }
.contact__list a, .contact__list button { transition: color .3s; text-align: right; }
.contact__list a:hover, .contact__list button:hover { color: var(--red); }
.foot { display: grid; grid-template-columns: auto auto 1fr auto; gap: 30px; margin-top: clamp(50px, 6vw, 90px); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; opacity: .8; }
.foot span:nth-child(3) { text-align: center; }

.toast { position: fixed; left: 50%; bottom: 30px; z-index: 95; transform: translate(-50%, calc(100% + 60px)); background: var(--paper); color: var(--ink); padding: 12px 20px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; transition: transform .6s var(--ease-out); }
.toast.show { transform: translate(-50%, 0); }

/* =========================================================
   PROJECT PAGE
   ========================================================= */
.p-hero { background: var(--pbg, var(--ink)); color: var(--pfg, var(--paper)); padding: 110px var(--pad) var(--pad); min-height: 88vh; min-height: 88svh; display: flex; flex-direction: column; }
.p-hero__top { display: flex; justify-content: space-between; gap: 20px; }
.p-back { display: inline-flex; gap: 10px; align-items: center; }
.p-title { margin-top: auto; font-family: var(--display); text-transform: uppercase; font-variation-settings: "wdth" 62, "wght" 850; font-size: clamp(56px, 12vw, 240px); line-height: .84; padding-top: 60px; }
.p-title .line > span { transition-duration: 1.2s; }
.p-hero__row { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-top: 24px; }
.p-sub { font-family: var(--display); font-variation-settings: "wdth" 130, "wght" 500; text-transform: uppercase; font-size: clamp(14px, 1.4vw, 20px); letter-spacing: .04em; }
.p-no { font-family: var(--display); font-variation-settings: "wdth" 90, "wght" 700; font-size: clamp(32px, 4vw, 70px); line-height: 1; }
.p-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 24px var(--pad); background: var(--pbg, var(--ink)); color: var(--pfg, var(--paper)); border-top: 1px solid currentColor; border-color: color-mix(in srgb, currentColor 25%, transparent); }
.p-meta div span { display: block; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; opacity: .6; margin-bottom: 4px; }
.p-meta div { font-size: 14px; font-weight: 500; }
.p-cover { overflow: hidden; background: var(--pbg); }
.p-cover img { width: 100%; transform: scale(var(--pc, 1.15)); transform-origin: 50% 0; will-change: transform; }
.p-about { background: var(--paper); color: var(--ink); padding: clamp(70px, 9vw, 140px) var(--pad); }
.p-about h2 { font-family: var(--display); text-transform: uppercase; font-variation-settings: "wdth" 66, "wght" 800; font-size: clamp(48px, 8vw, 150px); line-height: .86; margin-bottom: clamp(40px, 6vw, 80px); }
.p-about__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 4vw, 70px); }
.p-about__grid article { border-top: 1px solid rgba(0,0,0,.15); padding-top: 20px; }
.p-about__grid article:nth-child(2) { transition-delay: .1s; } .p-about__grid article:nth-child(3) { transition-delay: .2s; }
.p-about__grid h3 { font-family: var(--display); font-variation-settings: "wdth" 130, "wght" 500; text-transform: uppercase; font-size: 14px; letter-spacing: .04em; margin-bottom: 14px; }
.p-about__grid p { font-size: 14px; color: #444; }
.p-gallery { background: var(--ink); padding: clamp(10px, 1.4vw, 22px); display: grid; gap: clamp(10px, 1.4vw, 22px); }
.p-gallery figure { overflow: hidden; background: #151515; }
.p-gallery .g-row { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: clamp(10px, 1.4vw, 22px); }
.p-gallery .g-row figure { aspect-ratio: var(--ar, 4 / 5); }
.p-gallery .g-row img { width: 100%; height: 100%; object-fit: cover; }
.p-gallery .g-wide.is-photo { aspect-ratio: 16 / 9; }
.p-gallery .g-wide.is-photo img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 600px) { .p-gallery .g-row[style*="--n:4"] { grid-template-columns: 1fr 1fr; } .p-gallery .g-row { --ar: 4 / 5; } }
.p-gallery img { width: 100%; opacity: 0; transform: scale(1.06); transition: opacity 1s var(--ease-out), transform 1.6s var(--ease-out); }
.p-gallery figure.in img { opacity: 1; transform: none; }
.p-next { display: block; background: var(--red); color: var(--ink); padding: clamp(60px, 8vw, 120px) var(--pad); overflow: hidden; }
.p-next .label { display: block; margin-bottom: 20px; }
.p-next__title { font-family: var(--display); text-transform: uppercase; font-size: clamp(56px, 13vw, 260px); line-height: .84; font-variation-settings: "wdth" 56, "wght" 850; transition: font-variation-settings .9s var(--ease-out); white-space: nowrap; }
.p-next:hover .p-next__title { font-variation-settings: "wdth" 72, "wght" 850; }
.p-next__row { display: flex; justify-content: space-between; margin-top: 20px; font-size: 13px; font-weight: 600; }
.p-cta { background: var(--ink); padding: clamp(50px, 6vw, 90px) var(--pad); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 30px; }
.p-cta p { font-family: var(--display); text-transform: uppercase; font-variation-settings: "wdth" 66, "wght" 800; font-size: clamp(32px, 5vw, 80px); line-height: .9; }
.p-cta p em { font-style: normal; color: var(--red); }

/* page transition curtain */
.curtain { position: fixed; inset: 0; z-index: 99; background: var(--red); transform: translateY(100%); pointer-events: none; }
.curtain.in { transform: translateY(0); transition: transform .7s var(--ease); }
.curtain.out { transform: translateY(-100%); transition: transform .8s var(--ease); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1024px) {
  .statement__grid, .p-about__grid { grid-template-columns: 1fr 1fr; }
  .skills__grid { grid-template-columns: 1fr 1fr; }
  .worked__list li { grid-template-columns: 1.4fr 1fr; }
  .worked__list .d { grid-column: 2 / -1; text-align: left; opacity: .7; margin-top: -10px; }
  .contact__list { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .nav { grid-template-columns: 1fr auto; padding: 18px calc(var(--pad) + 8px); }
  .nav__pill, .nav__cta { display: none; }
  .nav__burger { display: inline-flex; }
  .hero { padding: 8px; }
  .hero__card { min-height: calc(100svh - 16px); padding-top: 84px; }
  .hero__scroll { display: none; }
  .hero__strip a { height: 140px; }
  .about { grid-template-columns: 1fr; row-gap: 40px; }
  .about__photo, .about__text { grid-column: 1 / -1; }
  .about__photo { aspect-ratio: 4 / 4.4; }
  .index__head { grid-template-columns: 1fr 1fr; }
  .index__head p { grid-column: 1 / -1; }
  .marks__head, .worked__head { grid-template-columns: 1fr; gap: 20px; }
  .hchap { height: min(62vh, 520px); width: 76vw; }
  .hcard { width: 84vw; }
  .p-meta { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  body { font-size: 14px; }
  .statement__grid, .p-about__grid, .skills__grid { grid-template-columns: 1fr; }
  .about__facts div { grid-template-columns: 110px 1fr; }
  .worked__list li { grid-template-columns: 1fr; gap: 4px; }
  .worked__list .n { display: none; }
  .worked__list .d { grid-column: auto; margin-top: 0; }
  .contact__grid { grid-template-columns: 1fr; }
  .contact__cta { justify-self: start; }
  .foot { grid-template-columns: 1fr auto; gap: 10px 20px; }
  .foot span:nth-child(2) { display: none; }
  .foot span:nth-child(3) { grid-column: 1 / -1; grid-row: 2; text-align: left; }
  .wa-float { width: 52px; height: 52px; }
  .hcard__meta { grid-template-columns: 1fr; }
  .hcard__cat { grid-column: 1 / -1; text-align: left; }
  .p-hero__row { flex-direction: column; align-items: flex-start; }
  .lettering__row figure { width: 62vw; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

.p-foot { margin-top: 0; padding: 30px var(--pad) var(--pad); background: var(--ink); }

/* introduction principles as cards */
.statement__cards article { background: #fff; border: 0; border-radius: 16px; padding: clamp(22px, 2.4vw, 36px); display: flex; flex-direction: column; gap: 14px; min-height: 260px; }
.statement__cards h3 { font-size: 16px; margin-bottom: 0; }
.statement__cards article::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--red); margin-bottom: auto; }

/* contact title: two lines, smaller */
.contact__title .flex-word { font-size: inherit; }

/* free consultation */
.consult { background: var(--red); color: var(--ink); padding: clamp(80px, 11vw, 170px) var(--pad); }
.consult__inner { max-width: 1100px; }
.consult__title { font-family: var(--display); font-variation-settings: "wdth" 96, "wght" 520; letter-spacing: -.045em; font-size: clamp(44px, 7vw, 120px); line-height: .98; margin: 18px 0 28px; font-weight: inherit; }
.consult__text { font-size: clamp(16px, 1.4vw, 21px); max-width: 40ch; line-height: 1.45; }
.consult__btn { display: inline-flex; align-items: center; gap: 12px; margin-top: 36px; padding: 18px 30px; border-radius: 99px; background: var(--ink); color: var(--paper); font-weight: 600; font-size: 16px; transition: background .3s, color .3s; }
.consult__btn i { font-style: normal; transition: transform .4s var(--ease-out); }
.consult__btn:hover { background: var(--paper); color: var(--ink); }
.consult__btn:hover i { transform: rotate(45deg); }

/* intro without principles */
.statement { padding-bottom: clamp(70px, 9vw, 140px); }

/* marks: compact moving rows */
.marks { padding: clamp(60px, 8vw, 120px) 0; overflow: hidden; }
.marks__head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 var(--pad); margin-bottom: clamp(28px, 4vw, 56px); }
.marks__title { font-family: var(--display); font-variation-settings: "wdth" 96, "wght" 520; font-weight: inherit; letter-spacing: -.045em; font-size: clamp(36px, 5vw, 84px); line-height: 1; }
.marks__rows { display: grid; gap: clamp(28px, 4vw, 60px); }
.marks__row { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marks__track { display: flex; align-items: center; gap: clamp(48px, 6vw, 110px); width: max-content; animation: strip 70s linear infinite; }
.marks__row--rev .marks__track { animation-direction: reverse; }
@media (hover: hover) and (pointer: fine) { .marks__rows:hover .marks__track { animation-play-state: paused; } }
.mk { --logo-bg: var(--ink); flex: none; height: clamp(54px, 6vw, 92px); color: var(--paper); transition: color .3s, transform .4s var(--ease-out); }
.mk svg { height: 100%; width: auto; display: block; }
.mk:hover { color: var(--red); transform: scale(1.08); }

/* lettering: cards scattered around the word, then settle into rows */
.lettering { position: relative; height: 320vh; padding: 0; background: var(--ink); }
.lt-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: grid; place-items: center; }
.lt-word { font-weight: inherit; color: #2c2c2c; font-size: clamp(90px, 21vw, 420px); line-height: .8; white-space: nowrap; opacity: var(--wo, 1); transform: scale(var(--ws, 1)); }
.lt-word .flex-word { --w: 58; }
.lt-cards { position: absolute; inset: 0; }
.lt-cards figure {
  position: absolute; left: 50%; top: 50%; margin: 0; width: var(--cw, 200px); aspect-ratio: 4 / 5;
  translate: -50% -50%; background: var(--bg, #000); border-radius: 6px; overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,.45); will-change: transform, opacity;
}
.lt-cards img { width: 100%; height: 100%; object-fit: contain; display: block; }

.contact { min-height: auto; }
.contact__grid { margin-top: clamp(30px, 4vw, 60px); }
.lettering { overflow: clip; }
.lt-word { color: #3d3d3d; }

/* lettering back to two horizontal rows */
.lettering--rows { height: auto; padding: clamp(80px, 10vw, 160px) 0; }

/* ===== smoothness + mobile fixes ===== */
/* seamless loops: spacing lives on each item, so -50% lands exactly on the copy */
.hero__track, .marks__track, .marquee { gap: 0 !important; will-change: transform; backface-visibility: hidden; transform: translateZ(0); }
.hero__strip a { margin-right: clamp(8px, .8vw, 12px); }
.mk { margin-right: clamp(48px, 6vw, 110px); }
.marquee { animation: strip 45s linear infinite; }
.hero__strip img, .marks__track svg { backface-visibility: hidden; }

/* dots sit on the free part of the line, never on the pill */
.hero__dot:nth-of-type(2) { left: max(60%, 300px) !important; }
.hero__dot:nth-of-type(3) { left: max(82%, 420px) !important; }

@media (max-width: 860px) {
  .hero__dot { display: none; }
  /* blur and masks are expensive on phones */
  .nav__pill, .nav__burger { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .nav__burger { background: color-mix(in srgb, currentColor 10%, var(--paper)); }
  .nav:not(.on-light) .nav__burger { background: rgba(255,255,255,.12); }
  .hero__strip, .marks__row { -webkit-mask-image: none; mask-image: none; }
  .hero__track { animation-duration: 60s; }
}

/* text icons drawn as SVG (iOS turns arrows and stars into emoji) */
.ico { width: .9em; height: .9em; display: inline-block; vertical-align: -.08em; }
.marquee b .ico { width: .8em; height: .8em; }

/* hero copy in capitals */
.hero__card { text-transform: uppercase; }
.hero__statement { font-size: clamp(32px, min(6.3vw, 9.2vh), 128px); letter-spacing: -.03em; }
.hero__strip a span { text-transform: uppercase; }

/* ===== language switch ===== */
.nav__end { justify-self: end; display: flex; align-items: center; gap: 10px; }
.nav__lang { padding: 9px 14px; border-radius: 99px; background: color-mix(in srgb, currentColor 9%, transparent); font-weight: 600; font-size: 13px; line-height: 1; transition: background .3s, color .3s; }
.nav__lang[lang="ar"] { font-family: "IBM Plex Sans Arabic", "Geeza Pro", sans-serif; font-size: 14px; }
.nav__lang[lang="en"] { font-family: "Montserrat", sans-serif; letter-spacing: .04em !important; }
.nav__lang:hover { background: var(--red); color: var(--ink); }

/* ===== Arabic / RTL ===== */
html[lang="ar"] {
  --display: "Alexandria", "Anybody", sans-serif;
  --text: "IBM Plex Sans Arabic", "Montserrat", system-ui, sans-serif;
}
html[lang="ar"] body { font-size: 16px; line-height: 1.8; }
html[lang="ar"] *:not(.nav__lang):not([lang="en"]) { letter-spacing: 0 !important; }
html[lang="ar"] :is(.flex-word, .big-title, .statement__title, .hero__statement, .consult__title, .marks__title,
  .p-title, .p-next__title, .p-about h2, .hcard__title, .worked__list .a, .menu__links span, .p-cta p,
  .lettering__title, .marquee span, .hchap .flex-word, .loader__count) { line-height: 1.3; }
html[lang="ar"] :is(.line, .ln) { padding-bottom: .16em; margin-bottom: -.16em; }
html[lang="ar"] :is(.statement__title, .big-title, .p-title, .p-next__title, .p-about h2, .hchap .flex-word, .worked__list .a, .lettering__title, .marquee span, .menu__links span, .hcard__title) { font-variation-settings: "wght" 800; font-weight: 800; }
html[lang="ar"] .hero__statement { font-variation-settings: "wght" 600; font-weight: 600; font-size: clamp(30px, min(5.4vw, 7.6vh), 112px); line-height: 1.28; }
html[lang="ar"] .consult__title, html[lang="ar"] .marks__title { font-variation-settings: "wght" 600; font-weight: 600; }
html[lang="ar"] .statement__title { font-size: clamp(48px, 9vw, 170px); }
html[lang="ar"] .p-title { font-size: clamp(48px, 9vw, 180px); }
html[lang="ar"] .p-next__title { font-size: clamp(44px, 9vw, 180px); }
html[lang="ar"] .big-title { font-size: clamp(48px, 8.5vw, 160px); }
html[lang="ar"] .hchap .flex-word { font-size: clamp(48px, 6.5vw, 120px); white-space: normal; }
html[lang="ar"] .lettering__title { font-size: clamp(80px, 15vw, 300px); }
html[lang="ar"] .hcard__title { font-size: clamp(24px, 2.8vw, 48px); }
html[lang="ar"] .worked__list .a { font-size: clamp(26px, 3.4vw, 60px); }
html[lang="ar"] .label, html[lang="ar"] .hero__metric span, html[lang="ar"] .hcard__cat, html[lang="ar"] .foot { font-size: 13px; }
html[lang="ar"] .quote__text { line-height: 1.5; font-weight: 600; }

/* rolling word */
html[lang="ar"] .roller { height: 1.32em; vertical-align: bottom; }
html[lang="ar"] .roller__w { left: auto; right: 0; line-height: 1.32; }
html[lang="ar"] .roller__w::before { content: "← "; }

/* loops keep running left-to-right (order of a loop doesn't matter) */
html[dir="rtl"] :is(.hero__track, .marks__track, .marquee) { direction: ltr; }
html[dir="rtl"] .hero__strip a span { left: auto; right: 14px; direction: rtl; }
html[dir="rtl"] .marquee span { direction: rtl; }

/* scroll-linked rows: centre from the right in RTL */
html[dir="rtl"] .js-xscroll { left: auto; right: 50%; transform: translate3d(calc(50% + var(--x, 0px)), 0, 0); }

/* things that were aligned to the right in English go left */
html[dir="rtl"] :is(.hcard__cat, .worked__list .d, .contact__list a, .contact__list button, .loader__count) { text-align: left; }
html[dir="rtl"] .quote__by { right: auto; left: var(--pad); }
html[dir="rtl"] .hwork__bar i { transform-origin: right; }
html[dir="rtl"] .hero__scroll i { transform-origin: right; }

/* menu opens from the burger, which sits on the left in RTL */
html[dir="rtl"] .menu { clip-path: circle(0% at 40px 30px); }
html[dir="rtl"] .menu-open .menu { clip-path: circle(150% at 40px 30px); }

/* arrows turn the other way on hover */
html[dir="rtl"] :is(.nav__cta, .consult__btn, .contact__cta):hover i { transform: rotate(-45deg); }

/* loop containers also run LTR so the track starts at the left edge */
html[dir="rtl"] :is(.hero__strip, .marks__row, .band) { direction: ltr; }

@media (max-width: 420px) { .hero__bottom { flex-wrap: wrap; gap: 14px 24px; } .hero__metric b { font-size: clamp(44px, 13vw, 60px); } }

/* ===== Arabic font: Cairo ===== */
html[lang="ar"] { --display: "Cairo", sans-serif; --text: "Cairo", sans-serif; }
html[lang="ar"] .hero__statement { font-variation-settings: "wght" 700; font-weight: 700; line-height: 1.32; }
html[lang="ar"] :is(.statement__title, .big-title, .p-title, .p-next__title, .p-about h2, .hchap .flex-word, .worked__list .a, .lettering__title, .marquee span, .menu__links span, .hcard__title) { font-variation-settings: "wght" 900; font-weight: 900; }
html[lang="ar"] .consult__title, html[lang="ar"] .marks__title { font-variation-settings: "wght" 700; font-weight: 700; }
/* the site name always stays in English */
html[lang="ar"] .nav__logo, html[lang="ar"] [lang="en"] { font-family: "Anybody", "Montserrat", sans-serif; }
html[lang="ar"] .nav__logo { font-variation-settings: "wdth" 100, "wght" 700; letter-spacing: -.01em !important; }
html[lang="ar"] .foot [lang="en"], html[lang="ar"] .loader__top [lang="en"] { font-family: "Montserrat", sans-serif; letter-spacing: .06em !important; }

/* galleries of single posters: two per row on desktop, one per row on phones */
@media (max-width: 600px) { .p-gallery--stack .g-row { grid-template-columns: 1fr; } }
.roller--plain .roller__w::before { content: none; }
.mbr { display: none; }
@media (max-width: 600px) { .mbr { display: inline; } }
/* pill, metrics and scroll link: sentence case */
.hero__card :is(.hero__pill, .hero__metric span, .hero__scroll) { text-transform: none; letter-spacing: 0; }

/* CTA fill effect: the cursor disappears and a circle floods the button from the entry point */
.cursor { transition: width .45s var(--ease-out), height .45s var(--ease-out), margin .45s var(--ease-out), opacity .25s; }
.cursor.is-hidden { width: 0; height: 0; margin: 0; opacity: 0; }
.cta-fx { position: relative; overflow: hidden; isolation: isolate; transition: color .45s var(--ease-out) !important; }
.cta-fx > .fx {
  position: absolute; z-index: -1; pointer-events: none; border-radius: 50%;
  left: var(--fx-x, 50%); top: var(--fx-y, 50%); width: var(--fx-d, 0); height: var(--fx-d, 0);
  transform: translate(-50%, -50%) scale(0); transition: transform .6s var(--ease-out);
  background: var(--fx-bg);
}
.cta-fx.fx-on > .fx { transform: translate(-50%, -50%) scale(1); }
.nav__cta.cta-fx { --fx-bg: var(--ink); }
.nav .nav__cta.cta-fx:hover, .nav:not(.on-light) .nav__cta.cta-fx:hover { background: var(--red); color: var(--paper); }
.consult__btn.cta-fx { --fx-bg: var(--paper); }
.consult__btn.cta-fx:hover { background: var(--ink); color: var(--ink); }
.contact__cta.cta-fx { --fx-bg: var(--paper); }
.contact__cta.cta-fx:hover { background: var(--red); color: var(--ink); }

/* contact button: compact pill instead of the big circle */
.contact__cta {
  width: auto; aspect-ratio: auto; border-radius: 99px; flex-direction: row; gap: 10px;
  padding: 15px 26px; font-family: var(--text); font-variation-settings: normal; font-weight: 600;
  text-transform: none; font-size: 15px; letter-spacing: 0; white-space: nowrap; align-self: end; justify-self: start;
}
.contact__cta i { font-size: 1em; display: inline-flex; }

/* soft blurred bar behind the nav once the page scrolls: tinted with the section underneath, fading out at the bottom */
.nav::before {
  content: ""; position: absolute; inset: 0 0 -28px; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, rgba(var(--nav-bg, 11, 11, 11), .78) 0%, rgba(var(--nav-bg, 11, 11, 11), .5) 60%, rgba(var(--nav-bg, 11, 11, 11), 0) 100%);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent); mask-image: linear-gradient(to bottom, #000 55%, transparent);
  opacity: 0; transition: opacity .5s var(--ease-out);
}
.nav.is-scrolled::before { opacity: 1; }
.menu-open .nav::before { opacity: 0; }

/* phone logo rows use <img> */
.mk img { height: 100%; width: auto; display: block; }

/* logo rows are driven from JS (pixel distances) */
.marks__track { animation: none !important; }

/* hero red word: typewriter */
.roller.roller--type { display: inline; height: auto; overflow: visible; width: auto !important; white-space: nowrap; }
.roller__t { color: var(--red); }
.roller__caret {
  display: inline-block; width: .07em; height: .82em; margin-left: .04em; vertical-align: -.04em;
  background: var(--red); animation: caret 1s steps(1) infinite;
}
.roller.is-empty .roller__caret { margin-left: 0; }
@keyframes caret { 50% { opacity: 0; } }

/* combined images split into single posters on phones */
.p-gallery .g-mob { display: none; }
@media (max-width: 600px) {
  .p-gallery .g-desk { display: none; }
  .p-gallery .g-mob { display: grid; gap: clamp(10px, 1.4vw, 22px); }
  .p-gallery--stack .g-row figure { aspect-ratio: auto; }
  .p-gallery--stack .g-row img { height: auto; }
}

/* lettering rows: drag / swipe sideways */
.lettering__row.js-drag { touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab; }
.lettering__row.js-drag.is-drag { cursor: grabbing; }
.lettering__row.js-drag img { pointer-events: none; -webkit-user-drag: none; }

/* about page */
.ab-hero { min-height: 72vh; min-height: 72svh; }
.ab-intro { display: grid; grid-template-columns: 1fr 1fr; background: var(--paper); color: var(--ink); }
.ab-photo { overflow: hidden; background: #c9c9c7; aspect-ratio: 4 / 5; }
.ab-photo img { width: 100%; height: 100%; object-fit: cover; transform: scale(var(--pc, 1.12)); transform-origin: 50% 30%; will-change: transform; }
.ab-intro__text { padding: clamp(40px, 6vw, 110px) var(--pad); display: flex; flex-direction: column; justify-content: flex-end; gap: 28px; }
.ab-intro__text .label { color: var(--red); }
.ab-lead { font-family: var(--text); font-weight: 500; letter-spacing: -.02em; font-size: clamp(22px, 2.1vw, 36px); line-height: 1.25; }
.ab-body { font-size: clamp(15px, 1.15vw, 18px); color: #444; max-width: 46ch; }
.ab-body.reveal { transition-delay: .1s; }

.ab-why h2 em { font-style: normal; color: var(--red); }
.ab-why .p-about__grid h3 { font-size: 15px; line-height: 1.3; }
.ab-hero, .ab-meta { --pbg: var(--red); --pfg: var(--ink); }
.ab-for { background: var(--ink); color: var(--paper); padding: clamp(80px, 10vw, 160px) 0; overflow: hidden; }
.ab-for .worked__head { padding: 0 var(--pad); }
.worked + .ab-for { padding-top: 0; }
.ab-logos { display: grid; gap: clamp(30px, 4vw, 60px); border-top: 1px solid rgba(255,255,255,.15); padding-top: clamp(40px, 5vw, 70px); }
.ab-logos__row { overflow: hidden; -webkit-mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.ab-logos__track { display: flex; align-items: center; width: max-content; animation: abLogos 70s linear infinite; }
.ab-logos__row--rev .ab-logos__track { animation-direction: reverse; animation-duration: 60s; }
.ab-logos img { height: calc(clamp(40px, 4.4vw, 70px) * var(--s, 1)); width: auto; margin-right: clamp(50px, 6vw, 110px); opacity: .9; }
.ab-logos img:hover { opacity: 1; }
@keyframes abLogos { to { transform: translateX(-50%); } }
@media (hover: hover) and (pointer: fine) { .ab-logos__row:hover .ab-logos__track { animation-play-state: paused; } }
@media (prefers-reduced-motion: reduce) { .ab-logos__track { animation: none; } .ab-logos__row { overflow-x: auto; } }
.ab-gap { margin-top: 30px; }
@media (max-width: 1024px) { .skills__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) {
  .ab-intro { grid-template-columns: 1fr; }

}
@media (max-width: 600px) { .skills__grid { grid-template-columns: 1fr; } }

/* nav over a red section: the red CTA turns ink so it stays visible */
.nav.on-red .nav__cta { background: var(--ink); color: var(--paper); }
.nav.on-red .nav__pill { background: rgba(11,11,11,.1); }

/* lettering: stacked carousel on black. Horizontal edge to edge on laptop / tablet, vertical on phones */
.lettering--drum { height: auto; padding: 0 0 var(--sec); overflow: hidden; }
.lettering--drum .lettering__head { padding: 0 var(--pad); margin-bottom: clamp(24px, 3vw, 44px); }
.lettering--drum .lettering__title { font-size: clamp(48px, 7vw, 120px); margin: 0; white-space: nowrap; }
.lettering--drum .lettering__title .flex-word { color: var(--red); }
.drum { --ch: min(64vh, 620px, 62vw); position: relative; height: var(--ch); user-select: none; -webkit-user-select: none; touch-action: pan-y; cursor: grab; outline: none; }
.drum.is-drag { cursor: grabbing; }
.drum__stage { position: absolute; inset: 0; }
.drum__card { position: absolute; left: 50%; top: 50%; margin: 0; height: var(--ch); aspect-ratio: 4 / 5; overflow: hidden; background: #111; transform-origin: 50% 50%; will-change: transform; cursor: pointer;
  box-shadow: 0 0 0 1px rgba(239,239,237,.08), 0 10px 40px rgba(0,0,0,.45); }
.drum.is-drag .drum__card { cursor: grabbing; }
.drum__card img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.drum__ui { display: flex; align-items: center; justify-content: center; gap: 22px; margin-top: clamp(24px, 3vw, 40px); padding: 0 var(--pad); font-size: 12px; font-weight: 600; letter-spacing: .08em; color: rgba(239,239,237,.55); font-variant-numeric: tabular-nums; }
.drum__count b { color: var(--paper); font-weight: 600; }
.drum__btn { width: 52px; height: 52px; border-radius: 50%; border: 1px solid rgba(239,239,237,.25); display: grid; place-items: center; color: var(--paper); transition: background .3s, border-color .3s; }
.drum__btn svg { width: 18px; height: 18px; }
.drum__btn:hover { background: var(--red); border-color: var(--red); }
@media (max-width: 600px) {
  .drum { --ch: auto; height: calc(74vw * 1.25 * 1.69); }
  .drum__card { height: auto; width: 74vw; }
  .drum__ui { justify-content: space-between; }
}

/* ===== one rhythm for section spacing =====
   every section breathes by --sec; when two sections share a background the second one drops its top
   padding, so the gap between them is one --sec, not two */
.statement { padding-top: var(--sec); padding-bottom: var(--sec); }
.marks { padding-top: var(--sec); padding-bottom: var(--sec); }
.lettering--drum { padding-top: 0; padding-bottom: var(--sec); }
.lettering--drum + .worked { padding-top: 0; }
.worked { padding-bottom: var(--sec); }
.consult { padding-top: var(--sec); padding-bottom: var(--sec); }
.contact { padding-top: var(--sec); }
/* lettering head: same pattern as Marks & Logotypes */
.lettering--drum .lettering__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: clamp(28px, 4vw, 56px); }

/* phones: the posters take the vertical swipe (reels style); the page scrolls from outside them */
@media (max-width: 600px) { .drum { touch-action: none; } }
/* poster = picture in a clipped frame */
.drum__card { overflow: visible; background: none; box-shadow: none; }
.drum__pic { position: absolute; inset: 0; overflow: hidden; border-radius: 6px; background: #111; box-shadow: 0 0 0 1px rgba(239,239,237,.08), 0 10px 40px rgba(0,0,0,.45); }
/* lettering title: same as Worked at */
.lettering--drum .lettering__head { display: block; }

/* chapter cards: the big word on one line (size set by fitChapters in main.js) */
.hchap .flex-word { white-space: nowrap; word-break: normal; display: inline-block; align-self: flex-start; }
html[lang="ar"] .hchap .flex-word { white-space: nowrap; }

/* marks: each logo sized by visual mass (--s set per logo in main.js), so the row reads even */
.mk { height: calc(clamp(48px, 5.4vw, 84px) * var(--s, 1)); }
.marks__track { align-items: center; }

/* projects strip: can be dragged / swiped sideways (main.js); vertical page scroll still works */
.hwork__sticky { touch-action: pan-y; }
.hwork__sticky.is-drag { cursor: grabbing; user-select: none; -webkit-user-select: none; }
.hwork__track img, .hwork__track a { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; }

/* ===== unslop polish (2026-11-13) — the whole block can be deleted to go back; tag before-unslop has the exact old site =====
   unslop by Damir Sokolovsky (@heydamir), CC BY 4.0 */

/* 1. the dot next to "Available for projects" stays still: nothing here is live */
.hero__pill i { animation: none; }

/* 2. the line next to "Selected work" no longer loops; it reaches out a little on hover */
.hero__scroll i { animation: none; transform: none; transition: transform .4s var(--ease-out); transform-origin: left; }
.hero__scroll:hover i { transform: scaleX(1.4); }

/* 3. no zoom on hover: cards and logos answer with a colour / light change instead */
.hcard:hover .hcard__media img, .hero__strip a:hover img, .lettering__row figure:hover img { transform: none; }
.mk:hover, .mark:hover { transform: none; }
.hero__strip a img { transition: filter .4s var(--ease-out); }
.hero__strip a:hover img { filter: brightness(.82); }

/* 4. the quote's author: plain, muted, not italic */
.quote__by { font-style: normal; opacity: .55; }

/* 5. small labels: sentence case, 12px, normal tracking (the big display titles stay uppercase, they are the brand) */
.label, .hcard__cat, .contact__list li span, .p-meta div span, .foot, .worked__list .d,
.hero__pill, .hero__metric span, .hero__scroll, .about__facts dt, .toast {
  text-transform: none; letter-spacing: .01em;
}
.label, .hcard__cat, .contact__list li span, .p-meta div span, .foot, .about__facts dt { font-size: 12px; }
.hero__metric span { font-size: 15px; }

/* 6. header: a calm surface, no glass saturation */
.nav__pill { backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }

/* 7. one button size: the two big buttons are 48 tall, the header button 36 */
.consult__btn, .contact__cta { padding: 16px 24px; font-size: 15px; line-height: 16px; gap: 12px; }
.consult__btn { margin-top: 40px; }
.nav__cta { padding: 10px 16px; line-height: 16px; }

/* 8. spacing on the 4px grid */
.nav { padding-top: 24px; padding-bottom: 24px; }
@media (max-width: 860px) { .nav { padding-top: 16px; padding-bottom: 16px; } }
.hero__pill { padding: 8px 16px; }
.nav__lang { padding: 8px 16px; }
.drum__ui { gap: 24px; }
.foot { gap: 32px; }

/* 9. the last capital, wide-spaced small text goes sentence case */
.loader__top, .cursor__label, .drum__ui, .hero__card .hero__strip a span {
  text-transform: none; letter-spacing: .01em;
}
.loader__top, .cursor__label { font-size: 12px; }

/* 10. small text at weight 500, not 600 / 700 */
.label, .loader__top, .cursor__label, .nav__cta, .nav__burger, .nav__lang, .menu__foot, .menu__links i,
.hero__pill, .hero__metric span, .hero__scroll, .hero__strip a span,
.hcard__no, .hcard__cat, .worked__list .n, .worked__list .d, .contact__list li span,
.foot, .toast, .p-meta div span, .p-next__row, .drum__ui, .drum__count b,
.consult__btn, .contact__cta, .about__facts dt { font-weight: 500; }
/* ===== end unslop polish ===== */
