/* Hassan Radwany design versions: shared base. Each version file below this one sets the look. */

:root {
  --bg: #ffffff;
  --ink: #111111;
  --contact-bg: #b61f24;
  --contact-ink: #e6b753;
  --pad: 4px;
  --head-x: 20px;
  --head-h: 76px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --ui: 'Work Sans', system-ui, sans-serif;
  --sign: 'Mrs Saint Delafield', cursive;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--ui); font-weight: 400; overflow-x: hidden; }
body.locked { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; }
[hidden] { display: none !important; }

/* ---------- Views ---------- */
body:not([data-view="home"]) .stage { display: none; }
body[data-view="home"] .top, body[data-view="home"] .work, body[data-view="home"] .contact, body[data-view="home"] .switcher { display: none; }
body:not([data-view="work"]) #workGrid,
body:not([data-view="selected"]) #selectedGrid,
body:not([data-view="editorial"]) #editorialGrid,
body:not([data-view="contact"]) .contact { display: none; }
body[data-view="contact"] { background: var(--contact-bg); color: var(--contact-ink); }

/* ---------- Home stage ---------- */
.stage { position: fixed; inset: 0; cursor: pointer; display: grid; place-items: center; background: #111; overflow: hidden; }
.stage__media, .stage__media > div { position: absolute; inset: 0; }
.stage__media > div { background-size: cover; background-position: center; opacity: 0; }
.stage__media > div.is-on { opacity: 1; }
/* the stamp is white ink in "difference", so it flips with every photo behind it, same as القاهرة (works on iPhone too) */
.stage__logo {
  position: relative; width: min(92vw, 84vh); aspect-ratio: 1;
  background: #fff; mix-blend-mode: difference;
  -webkit-mask: url("assets/logo-mask-bold.png") center / contain no-repeat;
          mask: url("assets/logo-mask-bold.png") center / contain no-repeat;
}
.stage__city {
  position: absolute; left: 0; right: 0; bottom: calc(26px + env(safe-area-inset-bottom));
  text-align: center; color: #fff; mix-blend-mode: difference;
  font-family: 'Aref Ruqaa', serif; font-weight: 700; font-size: 20px; line-height: 1;
}

/* ---------- Header: floats over the work and inverts with whatever passes under it, like القاهرة on the opener ---------- */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  height: var(--head-h); padding: env(safe-area-inset-top) var(--head-x) 0;
  color: #fff; mix-blend-mode: difference; pointer-events: none;
}
.top > * { pointer-events: auto; }
body[data-view="contact"] .top { mix-blend-mode: normal; color: var(--contact-ink); }
.wordmark {
  font-family: 'Oswald', sans-serif; font-weight: 600; white-space: nowrap;
  font-size: 22px; line-height: 1; letter-spacing: -.01em; text-transform: uppercase;
}
.top__links { display: none; }
/* Studio sits in the menu as a word only, it opens nothing */
.soon { cursor: default; user-select: none; }
.top__links a, .drawer a, .top__links .soon, .drawer .soon { font-size: 10.5px; line-height: 1; letter-spacing: .22em; text-transform: uppercase; font-weight: 400; transition: opacity .2s; }
.top__links a:hover, .drawer a:hover { opacity: .55; }
body[data-view="work"] .top__links a[href="#work"],
body[data-view="selected"] .top__links a[href="#selected"],
body[data-view="editorial"] .top__links a[href="#editorial"],
body[data-view="contact"] .top__links a[href="#contact"] { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }

.burger { width: 28px; height: 28px; position: relative; }
.burger span, .burger span::before, .burger span::after {
  position: absolute; left: 4px; right: 4px; height: 1px; background: currentColor; content: "";
  transition: transform .3s var(--ease), opacity .2s;
}
.burger span { top: 50%; }
.burger span::before { left: 0; right: 0; top: -6px; }
.burger span::after { left: 0; right: 0; top: 6px; }
.burger[aria-expanded="true"] span { background: transparent; }
.burger[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.burger[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 40; width: min(78vw, 320px); padding: 110px 28px;
  background: var(--bg); color: var(--ink); display: flex; flex-direction: column; justify-content: center; gap: 4px;
  animation: slideIn .35s var(--ease) both;
}
.drawer a, .drawer .soon { font-size: 12.5px; padding: 10px 0; }
.drawer-scrim { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .25); }
@keyframes slideIn { from { transform: translateX(100%); } }

/* ---------- Masonry ---------- */
.work { display: flex; gap: var(--pad); padding: var(--head-h) var(--pad) var(--pad); }
.col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--pad); }
.item { margin: 0; position: relative; cursor: zoom-in; }
.item__frame { position: relative; overflow: hidden; background: #eeece8; }
.item img, .item video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.item img.is-loaded { opacity: 1; }
.item video { opacity: 1; } /* the poster shows straight away, the loop takes over when it starts */
.work--titled .item { cursor: pointer; }

/* ---------- Contact / Info ---------- */
.contact { padding: calc(var(--head-h) + 30px) var(--head-x) 80px; max-width: 620px; font-size: 14px; line-height: 1.85; letter-spacing: .02em; }
.contact h1 { margin: 0 0 26px; font: inherit; font-weight: 500; text-transform: uppercase; letter-spacing: .12em; }
.contact p { margin: 0 0 22px; }
.contact a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.contact__bio { margin-bottom: 44px; text-transform: uppercase; letter-spacing: .06em; }
.contact__c { margin-top: 40px !important; }
.contact__ig { margin-top: 40px !important; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 80; background: var(--bg); display: grid; place-items: center; overflow: hidden; }
.lightbox__wall { display: none; }
.lightbox__hang { position: relative; z-index: 1; }
.lightbox__img {
  display: block; width: auto; height: auto; object-fit: contain;
  max-width: calc(100vw - 24px); max-height: calc(100vh - 130px); max-height: calc(100dvh - 130px);
}
/* long pencil arrows at the bottom corners, nothing else on the screen reacts to a tap */
.lightbox__nav {
  position: absolute; z-index: 2; bottom: calc(10px + env(safe-area-inset-bottom)); width: 104px; height: 40px;
  display: grid; place-items: center; color: #2b2a27; opacity: .85; transition: opacity .2s, transform .3s var(--ease);
}
.lightbox__nav svg {
  width: 92px; height: 18px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round; filter: url(#pencil);
}
.lightbox__nav--prev svg { transform: scaleX(-1); }
.lightbox__nav:hover { opacity: 1; }
.lightbox__nav--prev { left: calc(var(--head-x) - 16px); }
.lightbox__nav--next { right: calc(var(--head-x) - 16px); }
.lightbox__nav--prev:hover { transform: translateX(-4px); }
.lightbox__nav--next:hover { transform: translateX(4px); }
.lightbox__close { z-index: 2; }

/* the collage wall (play mode): softened artwork with the plaster texture baked in, a light wash over it, the photo hung on top */
.lightbox.has-wall .lightbox__wall {
  display: block; position: absolute; inset: -2%; background: center / cover no-repeat;
  opacity: 0; transition: opacity .6s var(--ease);
}
.lightbox.has-wall .lightbox__wall.is-on { opacity: 1; }
.lightbox.has-wall::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 45%, rgba(242, 238, 230, .22), rgba(60, 50, 40, .22));
  mix-blend-mode: soft-light;
}
.lightbox.has-wall .lightbox__img { box-shadow: 0 2px 3px rgba(0, 0, 0, .18), 0 22px 44px -18px rgba(0, 0, 0, .6); }
.lightbox.has-wall .lightbox__nav { color: #1f1e1b; filter: drop-shadow(0 0 4px rgba(255, 255, 255, .55)); }
.lightbox.has-wall.on-dark .lightbox__nav, .lightbox.has-wall.on-dark .lightbox__close { color: #f2ede3; }
.lightbox.has-wall.on-dark .lightbox__nav { filter: drop-shadow(0 0 4px rgba(0, 0, 0, .45)); }
.lightbox__close { position: absolute; right: 20px; top: calc(20px + env(safe-area-inset-top)); font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; }

/* ---------- Info block ---------- */
.info__kicker { display: block; margin-bottom: 14px; font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; opacity: .7; }
.info__title { display: block; font-size: 24px; line-height: 1.15; letter-spacing: .08em; text-transform: uppercase; font-weight: 400; }
.info__sub { display: block; margin-top: 10px; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; }
.info__credits { list-style: none; margin: 22px 0 0; padding: 0; font-size: 13.5px; line-height: 1.9; }
.info__credits strong { font-weight: 500; margin-right: 6px; }

/* ---------- Viewer (standard) ---------- */
.viewer { position: fixed; inset: 0; z-index: 80; background: #000; color: #fff; }
.viewer__spread { position: absolute; inset: 0; display: flex; }
.viewer__spread img, .viewer__spread video { flex: 1; min-width: 0; height: 100%; object-fit: contain; }
.viewer__spread.is-pair img { object-fit: cover; }
.viewer__nav { position: absolute; top: 0; bottom: 0; width: 50%; z-index: 1; }
.viewer__nav--prev { left: 0; cursor: w-resize; }
.viewer__nav--next { right: 0; cursor: e-resize; }
.viewer__close, .viewer__count, .viewer__info { position: absolute; z-index: 2; }
.viewer__count { right: var(--head-x); bottom: calc(22px + env(safe-area-inset-bottom)); font-size: 12px; letter-spacing: .08em; text-shadow: 0 0 10px rgba(0, 0, 0, .5); }
.viewer__info {
  left: 0; right: 0; bottom: 0; padding: 70px var(--head-x) calc(52px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(0, 0, 0, .55)); pointer-events: none; text-shadow: 0 1px 12px rgba(0, 0, 0, .35);
}

/* sound label on opened videos; on a video page the side arrows narrow so a tap on the picture reaches the video */
.sound {
  position: absolute; z-index: 3; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  padding: 6px 8px; font-size: 10.5px; line-height: 1; letter-spacing: .22em; text-transform: uppercase; white-space: nowrap;
}
.lightbox.on-dark .sound { color: #f2ede3; }
.viewer .sound { text-shadow: 0 0 10px rgba(0, 0, 0, .5); }
.viewer.has-video .viewer__nav { width: 18%; }
#lbVid { cursor: pointer; }

/* close cross, used by viewer and info screen */
.viewer__close, .sheet__close { right: calc(var(--head-x) - 6px); top: calc(20px + env(safe-area-inset-top)); width: 34px; height: 34px; }
.viewer__close::before, .viewer__close::after, .sheet__close::before, .sheet__close::after {
  content: ""; position: absolute; left: 8px; right: 8px; top: 50%; height: 1px; background: currentColor;
}
.viewer__close::before, .sheet__close::before { transform: rotate(45deg); }
.viewer__close::after, .sheet__close::after { transform: rotate(-45deg); }
.viewer__close { filter: drop-shadow(0 0 6px rgba(0, 0, 0, .5)); }

/* ---------- Info screen (play / mine) ---------- */
.sheet {
  position: fixed; inset: 0; z-index: 80; overflow-y: auto;
  display: grid; grid-template-rows: auto 1fr; gap: 26px;
  padding: calc(64px + env(safe-area-inset-top)) var(--head-x) 40px;
  animation: fadeIn .35s var(--ease) both;
}
.sheet__close { position: fixed; z-index: 2; }
.sheet__media { justify-self: center; width: min(100%, calc(56vh / var(--ratio, 1.25))); }
.sheet__media img { width: 100%; height: auto; }
@keyframes fadeIn { from { opacity: 0; } }

/* ---------- Version switcher (for review only) ---------- */
.switcher {
  position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60;
  padding: 9px 14px; border-radius: 99px; background: #111; color: #fff;
  font: 500 10px/1 var(--ui); letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .2);
}
body:has(.sheet:not([hidden])) .switcher, body:has(.viewer:not([hidden])) .switcher, body:has(.lightbox:not([hidden])) .switcher { display: none; }

/* ---------- Desktop ---------- */
@media (min-width: 900px) {
  :root { --pad: 9.6px; --head-x: 59px; --head-h: 88px; }
  .wordmark { font-size: 28px; }
  .top__links { display: flex; align-items: center; gap: 26px; }
  .burger { display: none; }
  .drawer, .drawer-scrim { display: none !important; }
  .contact { padding: calc(var(--head-h) + 60px) 0 100px 20%; max-width: none; width: 80%; font-size: 15px; }
  .contact > * { max-width: 760px; }
  .lightbox__img { max-width: calc(100vw - 260px); max-height: calc(100vh - 170px); }
  .lightbox__nav { width: 150px; bottom: 24px; }
  .lightbox__nav svg { width: 130px; height: 24px; }
  .viewer__info { right: auto; width: 50%; padding: 0 0 70px 34px; background: none; }
  .info__title { font-size: 28px; }
  .sheet { grid-template-columns: minmax(0, 1.3fr) minmax(280px, 1fr); grid-template-rows: none; gap: 70px; align-items: center; padding: 70px var(--head-x); }
  .sheet__media { width: min(100%, calc(78vh / var(--ratio, 1.25))); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ===== V2 Playful: old film prints on a paper table, editorials loop in place, info screens ===== */
:root {
  --bg: #f1eee8; --pad: 12px;
}

/* plain photographs on the paper ground, no frame; the editorial covers change at an easy pace */
.print { cursor: pointer; }
.print img { transition: none; }
.print figcaption { padding: 10px 2px 6px; font-size: 9.5px; line-height: 1.5; letter-spacing: .22em; text-transform: uppercase; }
#workGrid .print { cursor: zoom-in; }

/* info screen: the print laid on the same paper, text beside it */
.sheet { background: var(--bg); color: var(--ink); }
.sheet__media { align-self: center; }
.sheet__media img { display: block; }
.sheet .info__title { font-family: 'Work Sans', sans-serif; font-weight: 300; }

.lightbox { background: var(--bg); }

/* info page: the original type (Work Sans, a touch bold), in plain sentence case */
.contact { font-size: 15px; line-height: 1.75; letter-spacing: 0; font-weight: 600; }
.contact__bio { text-transform: none; letter-spacing: 0; }

@media (min-width: 900px) {
  :root { --pad: 26px; }
  .contact { font-size: 16.8px; }
  .work { padding-left: 40px; padding-right: 40px; padding-top: calc(var(--head-h) + 10px); }
}

/* Work: a plain white strip holds the name at the top, then the photographs sit side by side
   with only a hairline of white between them */
body[data-view="work"] { background: #fff; }
/* at the top of the page the name sits on the white strip; once you scroll the strip goes
   and the name floats over the photos again, inverting with them */
body[data-view="work"]:not(.scrolled) .top { background: #fff; color: #111; mix-blend-mode: normal; }
#workGrid, #workGrid .col { gap: 2px; }
#workGrid { padding: var(--head-h) 0 0; }
#workGrid .item__frame { background: transparent; }
@media (min-width: 900px) { #workGrid, #workGrid .col { gap: 3px; } }

/* edit mode (?edit): tap a photo, tap another and they swap places; the × marks a photo for removal */
.pickbar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 90; display: flex; gap: 8px; align-items: center; white-space: nowrap;
  padding: 8px 10px; background: #111; color: #fff; font: 600 10.5px/1 'Work Sans', sans-serif; letter-spacing: .12em; text-transform: uppercase; }
.pickbar button { font: inherit; letter-spacing: inherit; text-transform: inherit; color: #111; background: #fff; border: 0; padding: 8px 9px; cursor: pointer; }
body.picking .item { cursor: pointer; }
body.picking .item__frame { position: relative; }
.pick-x { position: absolute; right: 6px; top: 6px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(17,17,17,.75); color: #fff;
  font: 400 20px/34px 'Work Sans', sans-serif; text-align: center; padding: 0; cursor: pointer; z-index: 2; }
.item.is-chosen .item__frame { outline: 4px solid #1f6fff; outline-offset: -4px; }
.item.is-picked .item__frame { outline: 4px solid #e0201b; outline-offset: -4px; }
.item.is-picked .pick-x { background: #e0201b; }
.item.is-picked .item__frame::after { content: 'REMOVE'; position: absolute; left: 8px; top: 8px; padding: 5px 7px; background: #e0201b; color: #fff;
  font: 600 10px/1 'Work Sans', sans-serif; letter-spacing: .16em; }
.item.is-picked img, .item.is-picked video { opacity: .4; }