/* =========================================================
   SEIF ABDALLA — portfolio home
   One family (Archivo, variable width + weight): extra-condensed
   heavy caps for the big moments, normal width for reading.
   The page stays black and white; the films bring the colour.
   z-index scale: 1 media · 2 shade · 3 content · 50 nav · 60 grain
   ========================================================= */
:root {
  --ink: #0a0a0b;
  --ink-2: #131314;
  --bone: #efece6;
  --dim: rgba(239, 236, 230, .62);
  --line: rgba(239, 236, 230, .16);
  --f: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-ar: "Reem Kufi", "Geeza Pro", sans-serif;
  --gutter: clamp(16px, 3.2vw, 48px);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --nav-h: 60px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--ink); color: var(--bone);
  font-family: var(--f); font-size: clamp(15px, 1.05vw, 17px); line-height: 1.55;
  font-variation-settings: "wdth" 100; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p { margin: 0; text-wrap: pretty; }
h1, h2, h3 { margin: 0; font-weight: 800; }
::selection { background: var(--bone); color: var(--ink); }
:focus-visible { outline: 2px solid var(--bone); outline-offset: 4px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--bone); color: var(--ink); padding: 8px 14px; }
.skip:focus { left: 8px; }
.wrap { padding-inline: var(--gutter); }

.display {
  font-stretch: 62%; font-variation-settings: "wdth" 62; font-weight: 800;
  text-transform: uppercase; line-height: .86; letter-spacing: -.012em;
}
.btn {
  display: inline-flex; align-items: center; gap: .6em; white-space: nowrap;
  height: 44px; padding: 0 22px; border-radius: 999px; font-weight: 600; font-size: 14px;
  background: var(--bone); color: var(--ink); transition: transform .25s var(--ease), background .25s;
}
.btn:hover { background: #fff; }
.btn:active { transform: scale(.97); }
.btn--ghost { background: rgba(10, 10, 11, .35); color: var(--bone); box-shadow: inset 0 0 0 1px rgba(239, 236, 230, .5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.btn--ghost:hover { background: rgba(239, 236, 230, .16); }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; padding-inline: var(--gutter);
  transition: background .4s, backdrop-filter .4s;
}
.nav.is-solid { background: rgba(10, 10, 11, .72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.nav__brand { font-weight: 700; letter-spacing: .01em; }
.nav__links { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 34px); font-size: 14px; font-weight: 500; }
.nav__links a:not(.btn) { opacity: .82; transition: opacity .2s; }
.nav__links a:not(.btn):hover { opacity: 1; }
.nav .btn { height: 36px; padding: 0 16px; font-size: 13px; }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100dvh; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; }
.hero__media, .hero__media video, .hero__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.hero__shade { position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(180deg, rgba(10,10,11,.5) 0%, rgba(10,10,11,0) 22%, rgba(10,10,11,0) 46%, rgba(10,10,11,.78) 100%); }
.hero__body { position: relative; z-index: 3; padding: 0 var(--gutter) clamp(10px, 1.6vw, 22px); }
.hero__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: clamp(10px, 1.4vw, 20px); }
.hero__lede { max-width: 30ch; font-size: clamp(17px, 1.7vw, 26px); line-height: 1.22; font-weight: 500; }
.hero__cta { display: flex; gap: 10px; margin-top: 18px; }
.hero__now { text-align: right; font-size: 13px; line-height: 1.35; }
.hero__now span { display: block; color: var(--dim); }
.hero__now b { font-weight: 600; }
.hero__name { font-size: 19.6vw; white-space: nowrap; margin-left: -.035em; }
.hero__name .l { display: inline-block; overflow: hidden; vertical-align: bottom; padding-top: .04em; }
.hero__name .l > span { display: inline-block; }
/* entrance runs "backwards": if animation never runs, the text is simply there */
.js .hero__name .l > span { animation: rise 1.1s var(--ease) .15s backwards; }
.js .hero__name .l:nth-child(2) > span { animation-delay: .27s; }
.js .hero__row { animation: fade .9s ease .7s backwards; }
@keyframes rise { from { transform: translateY(105%); } }
@keyframes fade { from { opacity: 0; } }

/* ---------- section heads ---------- */
.sec { padding: clamp(72px, 10vw, 160px) 0 0; }
.sec__head { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; padding-inline: var(--gutter); margin-bottom: clamp(20px, 3vw, 44px); }
.sec__title { font-size: clamp(54px, 11vw, 190px); }
.sec__note { max-width: 34ch; color: var(--dim); text-align: right; }

/* ---------- commercials: asymmetric tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(10px, 1.2vw, 18px); padding-inline: var(--gutter); }
.tile { display: block; }
.tile { grid-column: span var(--span, 6); }
.tile__media { position: relative; overflow: hidden; background: var(--ink-2); height: clamp(240px, 34vw, 560px); }
.tile[style*="--span:4"] .tile__media { height: clamp(260px, 38vw, 620px); }
.tile[style*="--span:12"] .tile__media { height: clamp(260px, 42vw, 700px); }
.tile__media img, .tile__media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease), opacity .5s; }
.tile__media video { opacity: 0; }
.tile.is-playing video { opacity: 1; }
a.tile:hover img, a.tile:hover video { transform: scale(1.03); }
.tile__cap { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 0 clamp(10px, 1.6vw, 26px); }
.tile__cap h3 { font-size: clamp(22px, 2.5vw, 40px); }
.tile__cap p { color: var(--dim); font-size: 14px; text-align: right; max-width: 30ch; }

/* ---------- films: typographic index with a sticky preview ---------- */
.index { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(20px, 4vw, 72px); padding-inline: var(--gutter); align-items: start; }
.index__list { list-style: none; margin: 0; padding: 0; }
.row { display: block; padding: clamp(10px, 1.3vw, 20px) 0; border-top: 1px solid var(--line); transition: opacity .3s; }
.row__thumb { display: none; }
.row__title { display: block; font-size: clamp(34px, 5.4vw, 92px); transition: transform .5s var(--ease); }
.row__meta { display: block; margin-top: 8px; color: var(--dim); font-size: 14px; }
@media (hover: hover) {
  .index__list:hover .row { opacity: .38; }
  .index__list .row:hover { opacity: 1; }
  a.row:hover .row__title { transform: translateX(.12em); }
}
.index__stage { position: sticky; top: calc(var(--nav-h) + 16px); aspect-ratio: 4 / 5; max-height: calc(100dvh - var(--nav-h) - 32px); overflow: hidden; background: var(--ink-2); }
.index__stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.04); transition: opacity .6s ease, transform 1.4s var(--ease); }
.index__stage img.is-on { opacity: 1; transform: none; }

/* ---------- trilogy band ---------- */
.trilogy { display: block; position: relative; margin-top: clamp(72px, 10vw, 160px); }
.trilogy__panels { display: grid; grid-template-columns: repeat(3, 1fr); height: min(86dvh, 820px); }
.trilogy__panels img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); transition: transform 1.6s var(--ease); }
.trilogy__panels div { overflow: hidden; }
.trilogy:hover img { transform: scale(1.04); }
.trilogy__shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,10,11,.25), rgba(10,10,11,.1) 40%, rgba(10,10,11,.85)); }
.trilogy__body { position: absolute; inset: auto 0 0 0; padding: 0 var(--gutter) clamp(20px, 3vw, 44px); display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.trilogy__title { font-size: clamp(46px, 9.4vw, 160px); }
.trilogy__meta { text-align: right; max-width: 34ch; }
.trilogy__meta p { color: var(--dim); margin-bottom: 14px; }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(24px, 5vw, 88px); padding-inline: var(--gutter); align-items: start; }
.about__photo img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 50%; }
.about__photo .about__onset { aspect-ratio: 16 / 9; object-position: 30% 40%; margin-top: clamp(10px, 1.2vw, 18px); }
.about__ar { font-family: var(--f-ar); font-size: clamp(28px, 3.4vw, 54px); line-height: 1.2; margin-top: 14px; direction: rtl; text-align: left; }
.about__lead { font-size: clamp(22px, 2.5vw, 40px); line-height: 1.18; font-weight: 500; max-width: 24ch; letter-spacing: -.01em; }
.about__cols { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 3vw, 48px); font-size: clamp(16px, 1.25vw, 19px); }
.about__cols p + p { margin-top: 1em; }
.about__cols h3 { font-size: 13px; font-weight: 600; color: var(--dim); margin-bottom: 10px; }
.facts { list-style: none; margin: 0; padding: 0; }
.facts li { padding: 7px 0; }
.facts li + li { border-top: 1px solid var(--line); }
.facts b { font-weight: 600; }
.facts span { color: var(--dim); }

/* ---------- contact + footer ---------- */
.contact { padding: clamp(80px, 12vw, 200px) var(--gutter) clamp(24px, 3vw, 40px); }
.contact__big { display: block; font-size: 21.4vw; white-space: nowrap; margin-left: -.03em; transition: opacity .3s; }
.contact__big:hover { opacity: .78; }
.contact__row { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-top: clamp(14px, 2vw, 28px); }
.contact__row p { max-width: 36ch; font-size: clamp(16px, 1.5vw, 22px); line-height: 1.3; }
.links { display: flex; gap: clamp(14px, 2vw, 28px); font-size: 14px; }
.links a { border-bottom: 1px solid var(--line); padding-bottom: 2px; transition: border-color .2s; }
.links a:hover { border-color: var(--bone); }
.foot { padding: 20px var(--gutter) 28px; color: var(--dim); font-size: 13px; display: flex; justify-content: space-between; }

/* ---------- reveal ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity .9s ease, transform 1.1s var(--ease); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- phone ---------- */
@media (max-width: 767px) {
  .nav__links a:not(.btn) { display: none; }
  .hero__row { flex-direction: column; align-items: flex-start; }
  .hero__now { text-align: left; order: -1; }
  .hero__name { font-size: 28.4vw; white-space: normal; line-height: .84; }
  .hero__name .l { display: block; }
  .sec__head { flex-direction: column; gap: 10px; }
  .sec__note { text-align: left; }
  .tiles { grid-template-columns: 1fr; }
  .tiles .tile { grid-column: auto; }
  .tiles .tile .tile__media { height: auto; aspect-ratio: 16 / 10; }
  .tile__cap { flex-direction: column; gap: 4px; padding-bottom: 14px; }
  .tile__cap p { text-align: left; }
  .index { grid-template-columns: 1fr; }
  .index__stage { display: none; }
  .row { border-top: 0; padding: 0 0 26px; }
  .row__thumb { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; margin-bottom: 10px; background: var(--ink-2); }
  .row__title { font-size: 11.5vw; }
  .trilogy__panels { height: 78dvh; grid-template-columns: 1fr; grid-template-rows: repeat(3, 1fr); }
  .trilogy__body { flex-direction: column; align-items: flex-start; }
  .trilogy__title { font-size: 15vw; }
  .trilogy__meta { text-align: left; }
  .about { grid-template-columns: 1fr; }
  .about__photo { max-width: 62%; }
  .about__cols { grid-template-columns: 1fr; }
  .contact__big { font-size: 21vw; }
  .contact__row { flex-direction: column; align-items: flex-start; }
  .foot { flex-direction: column; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}

/* ---------- light sections of the home page: the stills carry the colour ---------- */
.light { --dim: rgba(10, 10, 11, .6); --line: rgba(10, 10, 11, .16); background: var(--bone); color: var(--ink); padding-bottom: 1px; }
.light .sec:last-of-type { padding-bottom: clamp(72px, 10vw, 160px); }
.light .btn { background: var(--ink); color: var(--bone); }
.light .tile__media { background: #d9d5cc; }
.light ::selection { background: var(--ink); color: var(--bone); }
.light :focus-visible { outline-color: var(--ink); }
.light .contact { padding-top: clamp(40px, 6vw, 100px); }
.home .trilogy { margin-top: 0; }
.home .nav.is-solid { background: rgba(239, 236, 230, .82); color: var(--ink); }
.home .nav.is-solid .btn { background: var(--ink); color: var(--bone); }
.home .nav.is-dark { background: rgba(10, 10, 11, .72); color: var(--bone); }
.home .nav.is-dark .btn { background: var(--bone); color: var(--ink); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
