/* Mostafa Kwelah — portfolio */
:root {
  --bg: #000000;
  --bg-2: #0A0A0A;
  --surface: #0E0E0E;
  --line: #262626;
  --line-2: #3A3A3A;
  --text: #FFFFFF;
  --soft: #D0D0D0;
  --muted: #A6A6A6;
  --grey: #8C8C8C;
  --red: #FF1A0D;
  --red-dark: #D91409;
  --pad: clamp(16px, 3.4vw, 48px);
  --nav-h: 84px;
  --grain-opacity: 0.06;
  --blur: 0px;
  --skew: 0deg;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Archivo', system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--red); }
button { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 200; background: var(--red); padding: 12px 18px; font-weight: 800; }
.skip:focus { top: 12px; color: #fff; }

/* ---------- type ---------- */
.display { font-weight: 900; font-style: italic; text-transform: uppercase; line-height: 0.88; letter-spacing: -0.02em; }
.eyebrow { display: block; font-weight: 800; font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--red); }
.grey { color: var(--grey); }
.red { color: var(--red); }
.lead { font-weight: 700; font-style: italic; font-size: 18px; line-height: 1.45; color: #B3B3B3; }
.lead::before { content: "● "; color: var(--red); }
.body { color: var(--muted); font-size: clamp(16px, 1.3vw, 19px); line-height: 1.65; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 24px;
  border: 1px solid var(--line-2); background: transparent;
  font-weight: 800; font-style: italic; font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase;
  cursor: pointer; transition: background .2s, border-color .2s, color .2s;
}
.btn:hover { border-color: var(--red); color: var(--text); }
.btn--red { background: var(--red); border-color: var(--red); }
.btn--red:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- grain ---------- */
.grain {
  position: fixed; inset: -50%; z-index: 150; pointer-events: none;
  background-image: url(../grain.png); background-size: 320px 320px;
  opacity: var(--grain-opacity);
  animation: grain .9s steps(5) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-1%, 3%); }
  80% { transform: translate(3%, -1%); }
  100% { transform: translate(0, 0); }
}

/* ---------- scroll blur (images & video only) ---------- */
.fx { filter: blur(var(--blur)); transform: skewY(var(--skew)) scale(1.04); transform-origin: center; }
body.is-moving .fx { will-change: filter, transform; }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: env(safe-area-inset-top, 0px); left: 0; right: 0; z-index: 100; height: var(--nav-h);
  padding: 0 var(--pad); display: flex; align-items: center; justify-content: space-between;
  background: rgba(0, 0, 0, 0.82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent; transition: border-color .3s;
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 14px; }
.brand:hover { color: var(--text); }
.mk { font-weight: 900; font-style: italic; font-size: 34px; letter-spacing: -0.04em; line-height: 1; }
.mk span { color: var(--red); }
.brand__name { font-weight: 800; font-size: 13px; letter-spacing: 0.22em; }
.nav__links { display: flex; align-items: center; gap: 36px; font-weight: 700; font-size: 13px; letter-spacing: 0.16em; }
.nav__links a[aria-current="page"] { color: var(--red); }
.nav__cta { padding: 13px 20px; border: 1px solid var(--red); font-weight: 800; }
.nav__cta:hover { background: var(--red); color: #fff; }
.menu-btn { display: none; width: 48px; height: 48px; border: 1px solid var(--red); background: transparent; align-items: center; justify-content: center; cursor: pointer; }
.menu-btn svg { width: 22px; height: 22px; }
.menu-btn .close { display: none; }
body.menu-open .menu-btn .open { display: none; }
body.menu-open .menu-btn .close { display: block; }

.mobile-menu {
  position: fixed; inset: var(--nav-h) 0 0 0; z-index: 99; background: var(--bg);
  padding: 40px var(--pad); display: flex; flex-direction: column; gap: 8px;
  opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
}
body.menu-open .mobile-menu { opacity: 1; visibility: visible; }
body.menu-open { overflow: hidden; }
.mobile-menu a.big { font-weight: 900; font-style: italic; text-transform: uppercase; font-size: 56px; line-height: 1.05; padding: 6px 0; border-bottom: 1px solid var(--line); }
.mobile-menu .meta { margin-top: auto; display: flex; flex-direction: column; gap: 10px; color: var(--muted); font-size: 15px; }

main { padding-top: var(--nav-h); }

/* ---------- hero ---------- */
.hero { position: relative; height: calc(100svh - var(--nav-h)); min-height: 620px; max-height: 920px; overflow: hidden; background: var(--bg-2); }
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s ease; }
.slide.is-active { opacity: 1; }
.slide img, .slide video { width: 100%; height: 100%; object-fit: cover; }
.slide.is-active img { animation: kenburns 9s ease-out both; }
@keyframes kenburns { from { transform: scale(1.1); } to { transform: scale(1.0); } }
.hero::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.48); pointer-events: none; }
.hero__card {
  position: absolute; z-index: 2; left: var(--pad); bottom: clamp(24px, 7vh, 72px);
  width: min(640px, calc(100% - 2 * var(--pad)));
  padding: clamp(24px, 3vw, 36px) clamp(22px, 3.2vw, 44px) clamp(26px, 3vw, 40px);
  background: rgba(0, 0, 0, 0.78); border-left: 4px solid var(--red);
  display: flex; flex-direction: column; gap: 20px;
}
.hero__title { font-size: clamp(56px, 7.4vw, 108px); }
.hero__title .a { color: #D9D9D9; }
.round-btn {
  position: absolute; z-index: 3; width: 52px; height: 52px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: center; justify-content: center; cursor: pointer; transition: border-color .2s;
}
.round-btn:hover { border-color: var(--red); }
.round-btn svg { width: 18px; height: 18px; }
.hero .prev { right: calc(var(--pad) + 64px); bottom: clamp(24px, 7vh, 72px); }
.hero .next { right: var(--pad); bottom: clamp(24px, 7vh, 72px); }
.dots { position: absolute; z-index: 3; right: calc(var(--pad) + 136px); bottom: calc(clamp(24px, 7vh, 72px) + 12px); display: flex; gap: 6px; }
.dots button { width: 28px; height: 28px; border: 0; background: transparent; padding: 9px; cursor: pointer; }
.dots button span { display: block; width: 10px; height: 10px; border-radius: 999px; background: #6B6B6B; }
.dots button[aria-current="true"] span { background: var(--red); }

/* ---------- sections ---------- */
.section { padding: clamp(80px, 10vw, 140px) var(--pad); }
.section--alt { background: var(--bg-2); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: clamp(48px, 7vw, 100px); }
.section-head .display { font-size: clamp(56px, 8vw, 110px); margin-top: 14px; }

.story__title { font-size: clamp(64px, 11vw, 160px); color: var(--grey); }
.story__sub { font-weight: 800; font-style: italic; text-transform: uppercase; font-size: clamp(22px, 2.4vw, 32px); line-height: 1.05; color: #BFBFBF; margin: 28px 0; }
.story__intro { max-width: 900px; }
.story__intro .body { max-width: 640px; }
.pillars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px; margin-top: clamp(64px, 8vw, 100px); }
.pillar { display: flex; flex-direction: column; gap: 14px; }
.pillar__num { font-weight: 900; font-style: italic; font-size: 64px; line-height: 1; }
.pillar h3 { font-weight: 900; font-style: italic; text-transform: uppercase; font-size: 30px; line-height: 1.05; }
.pillar p { color: var(--muted); font-size: 17px; }

/* featured rows */
.rows { display: flex; flex-direction: column; gap: clamp(72px, 9vw, 110px); }
.row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 32px; align-items: center; }
.row__text { grid-column: span 5; display: flex; flex-direction: column; gap: 18px; border-left: 4px solid var(--red); padding: 36px 0 36px 32px; }
.row__media { grid-column: 6 / span 7; }
.row--flip .row__media { grid-column: 1 / span 7; grid-row: 1; }
.row--flip .row__text { grid-column: 8 / span 5; grid-row: 1; }
.row__num { font-weight: 900; font-style: italic; font-size: 14px; color: var(--grey); }
.row__title { font-size: clamp(52px, 5.4vw, 76px); line-height: 0.92; }
.row .btn { align-self: flex-start; }

.media { position: relative; overflow: hidden; background: var(--surface); aspect-ratio: 16 / 9; }
.media img { width: 100%; height: 100%; object-fit: cover; }
.tag { position: absolute; z-index: 2; top: 16px; left: 16px; padding: 7px 12px; background: var(--red); font-weight: 800; font-style: italic; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; line-height: 1.2; }

a.media { display: block; color: var(--text); }
.play {
  position: absolute; z-index: 2; left: 50%; top: 50%; width: 72px; height: 72px; margin: -36px 0 0 -36px;
  border-radius: 999px; background: var(--red); display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: scale(.85); transition: opacity .25s, transform .25s;
}
.play svg { width: 26px; height: 26px; margin-left: 3px; }
.media--play:hover .play, .media--play:focus-visible .play { opacity: 1; transform: scale(1); }
@media (hover: none) { .play { opacity: .9; transform: scale(.8); } }

/* logos */
.logos { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.logos li { list-style: none; height: clamp(96px, 10.4vw, 150px); padding: 0 clamp(12px, 2vw, 30px); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: center; }
.logos img { max-width: 100%; max-height: clamp(38px, 4.4vw, 64px); object-fit: contain; opacity: 0.8; transition: opacity .2s; }
.logos li:hover img { opacity: 1; }
ul.logos { margin: 0; padding: 0; }

/* awards */
.split { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 32px; }
.split__head { grid-column: span 4; }
.split__head .display { font-size: clamp(48px, 5vw, 72px); margin-top: 14px; }
.split__body { grid-column: 5 / span 8; }
.award { display: grid; grid-template-columns: 90px 1fr auto; gap: 24px; align-items: baseline; padding: 28px 0; border-top: 1px solid var(--line); }
.award:last-child { border-bottom: 1px solid var(--line); }
.award__year { font-weight: 900; font-style: italic; font-size: 18px; color: var(--red); }
.award__name { font-weight: 900; font-style: italic; text-transform: uppercase; font-size: clamp(20px, 2vw, 26px); line-height: 1.1; }
.award__for { color: var(--muted); font-size: 16px; text-align: right; }

/* contact */
.contact { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 30px; }
.contact .display { font-size: clamp(52px, 8.4vw, 124px); }
.contact__mail { font-weight: 800; font-style: italic; font-size: clamp(20px, 2.4vw, 30px); border-bottom: 3px solid var(--red); padding-bottom: 6px; word-break: break-all; }
.contact .btn-row { justify-content: center; }

/* footer */
.footer { padding: 72px var(--pad) 40px; border-top: 1px solid var(--line); }
.footer__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
.footer__grid > div { display: flex; flex-direction: column; gap: 10px; font-size: 16px; }
.footer__grid .mk { font-size: 40px; }
.footer__base { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--grey); }
.footer__cta { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; margin-bottom: 56px; }
.footer__cta .display { font-size: clamp(44px, 5vw, 72px); }

/* ---------- work page ---------- */
.page-head { padding: clamp(64px, 8vw, 110px) var(--pad) clamp(40px, 4vw, 64px); }
.page-head__row { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.page-head .display { font-size: clamp(76px, 12.5vw, 180px); margin-top: 16px; }
.count { font-weight: 900; font-style: italic; font-size: 22px; color: var(--grey); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 44px; padding-top: 32px; border-top: 1px solid var(--line); }
.filters button {
  min-height: 46px; padding: 0 22px; border: 1px solid var(--line-2); background: transparent; cursor: pointer;
  font-weight: 800; font-style: italic; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; transition: background .2s, border-color .2s;
}
.filters button:hover { border-color: var(--red); }
.filters button[aria-pressed="true"] { background: var(--red); border-color: var(--red); }
.grid { padding: 0 var(--pad) clamp(80px, 10vw, 140px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 64px 28px; }
.card { display: flex; flex-direction: column; gap: 20px; }
.card[hidden] { display: none; }
.card__text { display: flex; flex-direction: column; gap: 8px; border-left: 3px solid var(--red); padding-left: 18px; }
.card__role { font-weight: 800; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--red); }
.card__title { font-weight: 900; font-style: italic; font-size: 28px; line-height: 1; text-transform: uppercase; }
.card__ar { font-size: 16px; font-weight: 500; color: var(--muted); }
.card__meta { font-size: 15px; line-height: 1.45; color: var(--grey); }
.media__empty { position: absolute; left: 18px; bottom: 16px; font-weight: 800; font-size: 11px; letter-spacing: 0.2em; color: var(--grey); }

/* ---------- about page ---------- */
.about-hero { position: relative; height: min(78svh, 760px); min-height: 560px; overflow: hidden; background: var(--bg-2); }
.about-hero img { width: 100%; height: 100%; object-fit: cover; object-position: 70% 30%; }
.about-hero::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.35); }
.about-hero .hero__card { width: min(660px, calc(100% - 2 * var(--pad))); }
.about-hero .display { font-size: clamp(52px, 5.8vw, 84px); }
.intro { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 32px; }
.intro h2 { grid-column: span 5; font-size: clamp(44px, 4.4vw, 64px); line-height: 0.92; }
.intro__text { grid-column: 7 / span 6; display: flex; flex-direction: column; gap: 24px; }
.intro__text p { font-size: clamp(17px, 1.4vw, 20px); line-height: 1.65; color: var(--muted); }
.intro__text p:first-child { color: var(--soft); }
.job { display: grid; grid-template-columns: 180px 1fr; gap: 24px; padding: 30px 0; border-top: 1px solid var(--line); }
.job:last-child { border-bottom: 1px solid var(--line); }
.job__date { font-weight: 800; font-style: italic; font-size: 13px; letter-spacing: 0.08em; color: var(--grey); }
.job:first-child .job__date { color: var(--red); }
.job__co { display: block; font-weight: 900; font-style: italic; text-transform: uppercase; font-size: clamp(22px, 2vw, 26px); line-height: 1.1; }
.job__role { display: block; margin: 8px 0; font-weight: 800; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--red); }
.job p { color: var(--muted); font-size: 16px; line-height: 1.55; }
.skills { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 32px; }
.skills__exp { grid-column: span 6; }
.skills__soft { grid-column: 8 / span 5; display: flex; flex-direction: column; gap: 24px; }
.expertise { margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.expertise li { list-style: none; padding: 22px 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-weight: 800; font-style: italic; text-transform: uppercase; font-size: 16px; line-height: 1.25; }
.bar { display: flex; flex-direction: column; gap: 10px; }
.bar__label { display: flex; justify-content: space-between; font-weight: 800; font-style: italic; text-transform: uppercase; font-size: 16px; }
.bar__label span:last-child { color: var(--grey); }
.bar__track { height: 6px; background: var(--line); }
.bar__fill { height: 6px; background: var(--red); transform-origin: left; transition: transform 1.2s cubic-bezier(.2,.7,.2,1); }
.bar__fill { transform: none; }
.is-pending .bar__fill { transform: scaleX(0); }
.facts { display: flex; gap: 40px; flex-wrap: wrap; padding-top: 20px; border-top: 1px solid var(--line); }
.facts div { display: flex; flex-direction: column; gap: 6px; }
.facts strong { font-weight: 800; font-style: italic; text-transform: uppercase; font-size: 18px; }
.facts span:last-child { color: var(--muted); font-size: 15px; }

/* ---------- reveal ---------- */
.reveal { transition: opacity .9s ease, transform .9s cubic-bezier(.2,.7,.2,1); }
.reveal.is-pending { opacity: 0; transform: translateY(28px); }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 180; background: rgba(0,0,0,.92); display: none; align-items: center; justify-content: center; padding: var(--pad); }
.lightbox.is-open { display: flex; }
.lightbox__frame { width: min(1280px, 100%); aspect-ratio: 16/9; background: #000; }
.lightbox__frame iframe { width: 100%; height: 100%; border: 0; }
.lightbox .round-btn { top: 20px; right: 20px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .logos { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  :root { --nav-h: 68px; }
  .nav__links { display: none; }
  .menu-btn { display: inline-flex; }
  .brand__name { font-size: 11px; letter-spacing: 0.2em; }
  .mk { font-size: 28px; }
  .hero .prev, .hero .next { display: none; }
  .dots { bottom: auto; top: 16px; right: var(--pad); }
  .pillars { grid-template-columns: 1fr; gap: 44px; }
  .row, .row--flip { grid-template-columns: 1fr; gap: 22px; }
  .row .row__media, .row--flip .row__media { grid-column: 1; grid-row: 1; }
  .row .row__text, .row--flip .row__text { grid-column: 1; grid-row: 2; padding: 12px 0 12px 20px; }
  .split, .intro, .skills { grid-template-columns: 1fr; gap: 28px; }
  .split__head, .split__body, .intro h2, .intro__text, .skills__exp, .skills__soft { grid-column: 1; }
  .award { grid-template-columns: 1fr; gap: 6px; }
  .award__for { text-align: left; }
  .job { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .logos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid { grid-template-columns: 1fr; gap: 52px; }
  .footer__grid { grid-template-columns: 1fr; }
  .expertise { grid-template-columns: 1fr; }
  .hero { min-height: 600px; }
  .hero__card .btn-row .btn { flex: 1 1 auto; }
  .contact .btn-row { flex-direction: column; width: 100%; }
  .contact .btn { width: 100%; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grain { animation: none; }
  .slide.is-active img { animation: none; }
  .reveal, .reveal.is-pending { opacity: 1; transform: none; transition: none; }
  .fx { filter: none; transform: none; }
}
