/* Youssef Ben Rajeb, Director of Photography
   Dark, minimal, cinematic, stills-first. */

:root {
  --bg: #0b0b0b;
  --bg-raised: #141414;
  --text: #e9e7e3;
  --muted: #8a8780;
  --line: #262626;
  --accent: #e9e7e3;
  --gutter: clamp(16px, 4vw, 48px);
  --font: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration: none; }

:focus-visible { outline: 1px solid var(--text); outline-offset: 4px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 22px var(--gutter);
  background: linear-gradient(var(--bg) 60%, rgba(11, 11, 11, 0));
}

.brand { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-size: 15px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; }
.brand-role { font-size: 12px; color: var(--muted); letter-spacing: .08em; }

.nav { display: flex; gap: 28px; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
.nav a { color: var(--muted); transition: color .2s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }

/* ---------- Category filter ---------- */

.filters {
  display: flex; flex-wrap: wrap; gap: 8px 26px;
  padding: 8px var(--gutter) 28px;
  font-size: 13px; letter-spacing: .1em; text-transform: uppercase;
}

.filters button {
  background: none; border: 0; padding: 4px 0; cursor: pointer;
  font: inherit; letter-spacing: inherit; text-transform: inherit;
  color: var(--muted); border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}
.filters button:hover { color: var(--text); }
.filters button[aria-pressed="true"] { color: var(--text); border-bottom-color: var(--text); }

/* ---------- Work grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 24px);
  padding: 0 var(--gutter) 80px;
}

.tile { position: relative; display: block; overflow: hidden; background: var(--bg-raised); }
.tile.is-hidden { display: none; }

.tile-media { aspect-ratio: 16 / 9; overflow: hidden; }
.tile-media img {
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.01);
  transition: opacity .8s var(--ease), transform 1.2s var(--ease), filter .6s var(--ease);
}
.tile-media img.is-loaded { opacity: 1; }

.tile-caption {
  position: absolute; inset: auto 0 0 0;
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 40px 18px 14px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .65));
  font-size: 13px; letter-spacing: .06em;
  opacity: 0; transition: opacity .4s var(--ease);
}
.tile-title { text-transform: uppercase; letter-spacing: .14em; }
.tile-meta { color: #c9c6c0; font-size: 12px; }

.tile:hover .tile-media img, .tile:focus-visible .tile-media img { transform: scale(1.04); }
.tile:hover .tile-caption, .tile:focus-visible .tile-caption { opacity: 1; }

/* Touch screens have no hover: always show captions */
@media (hover: none) {
  .tile-caption { opacity: 1; }
}

/* ---------- Project page ---------- */

.project-head {
  display: grid; grid-template-columns: 1fr auto; gap: 8px 32px; align-items: end;
  padding: 24px var(--gutter) 36px;
}
.project-title {
  margin: 0; font-weight: 400; font-size: clamp(26px, 4vw, 44px);
  letter-spacing: .12em; text-transform: uppercase; line-height: 1.1;
}
.project-meta { margin: 0; color: var(--muted); font-size: 13px; letter-spacing: .06em; text-align: right; }
.project-meta span { display: block; }

.stills { display: grid; gap: clamp(12px, 2vw, 24px); padding: 0 var(--gutter); }
.still { margin: 0; padding: 0; border: 0; background: var(--bg-raised); cursor: zoom-in; width: 100%; }
.still img { width: 100%; aspect-ratio: 2.39 / 1; object-fit: cover; opacity: 0; transition: opacity .8s var(--ease); }
.still img.is-loaded { opacity: 1; }

.project-nav {
  display: flex; justify-content: space-between; gap: 24px;
  padding: 56px var(--gutter) 80px;
  font-size: 13px; letter-spacing: .1em; text-transform: uppercase;
}
.project-nav a { color: var(--muted); transition: color .2s; }
.project-nav a:hover { color: var(--text); }

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5, 5, 5, .97);
  opacity: 0; visibility: hidden; transition: opacity .3s var(--ease), visibility .3s;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox img { max-width: calc(100vw - 2 * var(--gutter)); max-height: calc(100vh - 140px); object-fit: contain; }

.lightbox button {
  position: absolute; background: none; border: 0; color: var(--muted); cursor: pointer;
  font: inherit; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; padding: 16px;
  transition: color .2s;
}
.lightbox button:hover { color: var(--text); }
.lb-close { top: 10px; right: calc(var(--gutter) - 16px); }
.lb-prev { left: calc(var(--gutter) - 16px); top: 50%; transform: translateY(-50%); }
.lb-next { right: calc(var(--gutter) - 16px); top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 24px; left: 0; right: 0; text-align: center; color: var(--muted); font-size: 12px; letter-spacing: .12em; }

/* ---------- About / Contact ---------- */

.page {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 6vw, 96px);
  padding: 32px var(--gutter) 96px; align-items: start;
}
.page-media img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.page-body { max-width: 560px; }
.page-body h1 {
  margin: 0 0 28px; font-weight: 400; font-size: clamp(22px, 3vw, 32px);
  letter-spacing: .12em; text-transform: uppercase; line-height: 1.2;
}
.page-body h2 {
  margin: 40px 0 12px; font-weight: 400; font-size: 12px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.page-body p { margin: 0 0 16px; color: #cfccc6; }
.page-body ul { list-style: none; margin: 0; padding: 0; }
.page-body li { padding: 6px 0; border-bottom: 1px solid var(--line); color: #cfccc6; }
.page-body a { border-bottom: 1px solid var(--line); transition: border-color .2s; }
.page-body a:hover { border-color: var(--text); }

.form { display: grid; gap: 20px; margin-top: 8px; }
.form label { display: grid; gap: 6px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.form input, .form textarea {
  width: 100%; padding: 10px 0; background: transparent; color: var(--text);
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  font: inherit; font-size: 16px; letter-spacing: normal; text-transform: none;
  transition: border-color .2s;
}
.form input:focus, .form textarea:focus { outline: none; border-bottom-color: var(--text); }
.form textarea { min-height: 140px; resize: vertical; }
.form .honeypot { display: none; }
.form button {
  justify-self: start; margin-top: 8px; padding: 12px 28px; cursor: pointer;
  background: transparent; color: var(--text); border: 1px solid var(--text);
  font: inherit; font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  transition: background .2s, color .2s;
}
.form button:hover { background: var(--text); color: var(--bg); }
.form-status { min-height: 1.6em; font-size: 13px; color: var(--muted); }

/* ---------- Footer ---------- */

.site-footer {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 28px var(--gutter); border-top: 1px solid var(--line);
  color: var(--muted); font-size: 12px; letter-spacing: .08em;
}
.site-footer a:hover { color: var(--text); }

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
  .site-header { flex-direction: column; align-items: flex-start; gap: 14px; padding-top: 18px; }
  .nav { gap: 22px; }
  .grid { grid-template-columns: 1fr; }
  .project-head { grid-template-columns: 1fr; }
  .project-meta { text-align: left; }
  .page { grid-template-columns: 1fr; }
  .page--contact .page-media { order: 2; }
  .lb-prev, .lb-next { top: auto; bottom: 8px; transform: none; }
  .lightbox img { max-height: calc(100vh - 160px); }
}

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