/* MAHFOUZ Sculpture Studio
   Dark gallery editorial. One theme, one accent, sharp geometry.
   Type: Archivo variable (weight 100-900, width 62-125). */

/* ---------- fonts ---------- */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url('../fonts/archivo-5.woff2') format('woff2');
}

/* ---------- tokens ---------- */
:root {
  --ink: #131110;          /* page ground, warm near-black */
  --ink-2: #1a1715;        /* raised surface */
  --bone: #e9e3d5;         /* primary text, plaster */
  --bone-dim: rgba(233, 227, 213, 0.56);
  --bone-faint: rgba(233, 227, 213, 0.28);
  --hairline: rgba(233, 227, 213, 0.14);
  --accent: #c8452c;       /* oxide red, from the studio's gradient pieces */
  --pad: clamp(1.25rem, 4vw, 4rem);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--ink);
  color: var(--bone);
  font-family: 'Archivo', system-ui, sans-serif;
  font-weight: 340;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--ink); }
h1, h2, h3 { font-weight: 480; line-height: 1.04; }

h2 {
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  font-stretch: 118%;
  letter-spacing: -0.015em;
  text-transform: uppercase;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.95rem 1.9rem;
  font-size: 0.78rem;
  font-weight: 560;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.15s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn--solid { background: var(--bone); color: var(--ink); }
.btn--solid:hover { background: var(--accent); color: var(--bone); }
.btn--ghost { border: 1px solid var(--bone-faint); color: var(--bone); }
.btn--ghost:hover { border-color: var(--bone); }

/* ---------- nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  padding: 0 var(--pad);
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(19, 17, 16, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--hairline);
}
.nav__mark {
  font-weight: 260;
  font-stretch: 125%;
  letter-spacing: 0.42em;
  font-size: 0.95rem;
  padding-left: 0.42em; /* optical balance for tracking */
}
.nav__links { display: flex; gap: clamp(1rem, 3vw, 2.6rem); }
.nav__links a {
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(233, 227, 213, 0.85);
  text-shadow: 0 1px 12px rgba(19, 17, 16, 0.6);
  transition: color 0.25s;
}
.nav__links a:hover { color: var(--bone); }

/* ---------- hero: asymmetric split, wordmark panel + portrait image ---------- */
.hero {
  position: relative;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 11fr) minmax(0, 9fr);
}
.hero__media {
  position: relative;
  overflow: hidden;
  min-height: 100dvh;
}
.hero__media img {
  width: 100%; height: 100%;
  position: absolute; inset: 0;
  object-fit: cover;
  object-position: 50% 32%;
  animation: heroSettle 6s var(--ease) both;
}
@keyframes heroSettle {
  from { transform: scale(1.06); }
  to   { transform: scale(1); }
}
.hero__veil {
  position: absolute; inset: 0;
  background:
    linear-gradient(to right, rgba(19,17,16,0.55) 0%, rgba(19,17,16,0) 24%),
    linear-gradient(to bottom, rgba(19,17,16,0.78) 0%, rgba(19,17,16,0) 26%),
    linear-gradient(to top, rgba(19,17,16,0.5) 0%, rgba(19,17,16,0) 16%);
}
.hero__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 6rem var(--pad) clamp(3rem, 9vh, 6rem);
}
.hero__eyebrow {
  font-size: 0.72rem;
  font-weight: 480;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--bone-dim);
  margin-bottom: 1.4rem;
  animation: riseIn 1s var(--ease) 0.15s both;
}
.hero__wordmark {
  align-self: flex-start;
  width: min(100%, 620px);
  margin-left: -0.6rem; /* optical: the M's flourish carries built-in side bearing */
}
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
/* the signature: fills bone; JS turns each glyph into a pen stroke that draws itself */
.sig { display: block; width: 100%; height: auto; overflow: visible; }
.sig__glyph {
  fill: var(--bone);
  stroke: var(--bone);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hero__line {
  margin-top: 1.6rem;
  max-width: 30ch;
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  color: var(--bone-dim);
  animation: riseIn 1s var(--ease) 0.5s both;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2.2rem;
  animation: riseIn 1s var(--ease) 0.65s both;
}
.hero__caption {
  position: absolute;
  right: 1.4rem;
  bottom: 1.3rem;
  z-index: 2;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: rgba(233, 227, 213, 0.75);
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- manifesto ---------- */
.manifesto {
  padding: clamp(7rem, 16vh, 12rem) var(--pad);
}
.manifesto__text {
  margin-left: clamp(0rem, 10vw, 12rem);
  max-width: 42ch;
  font-size: clamp(1.5rem, 3.2vw, 2.7rem);
  font-weight: 300;
  line-height: 1.32;
  letter-spacing: -0.01em;
}
/* words ink themselves in as the section scrolls into view */
.manifesto__text .w {
  opacity: 0.07;
  transition: opacity 0.55s var(--ease);
  transition-delay: var(--wd, 0s);
}
.manifesto__text.written .w { opacity: 1; }
@media (max-width: 768px) {
  .manifesto__text { margin-left: 0; max-width: 100%; }
}

/* ---------- works ---------- */
.works { padding: 0 var(--pad) clamp(5rem, 10vh, 8rem); }
.works__head { margin-bottom: clamp(2.5rem, 6vh, 4.5rem); }
.works__grid {
  column-count: 3;
  column-gap: clamp(1.5rem, 3vw, 3rem);
}
.work {
  break-inside: avoid;
  margin-bottom: clamp(2.5rem, 5vh, 4.5rem);
  cursor: zoom-in;
}
.work img {
  width: 100%;
  transition: opacity 0.4s var(--ease);
}
.work:hover img { opacity: 0.82; }
.work figcaption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-top: 0.8rem;
}
.work figcaption strong {
  font-size: 0.86rem;
  font-weight: 540;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.work figcaption span {
  font-size: 0.78rem;
  color: var(--bone-dim);
  text-align: right;
}

/* ---------- full-bleed feature: day / dusk diptych ---------- */
.feature { position: relative; }
.feature::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 34%;
  background: linear-gradient(to top, rgba(19, 17, 16, 0.55), rgba(19, 17, 16, 0));
  pointer-events: none;
}
.feature__line { z-index: 1; }
.feature__pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.feature__pair img {
  width: 100%;
  height: 96vh;
  object-fit: cover;
  object-position: 50% 55%;
}
.feature__line {
  position: absolute;
  left: var(--pad);
  bottom: clamp(2rem, 7vh, 5rem);
  font-size: clamp(1.6rem, 3.4vw, 3rem);
  font-weight: 330;
  max-width: 16ch;
  line-height: 1.2;
  text-shadow: 0 1px 30px rgba(19, 17, 16, 0.7);
}
@media (max-width: 768px) {
  .feature__pair { grid-template-columns: 1fr; }
  .feature__pair img { height: 72vh; }
}

/* ---------- practice ---------- */
.practice {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 6vw, 6rem);
  padding: clamp(6rem, 14vh, 10rem) var(--pad);
}
.practice__intro { position: sticky; top: 7rem; align-self: start; }
.practice__intro p {
  margin-top: 1.6rem;
  max-width: 34ch;
  color: var(--bone-dim);
  font-size: 0.98rem;
}
.practice__item {
  padding: clamp(1.8rem, 4vh, 2.8rem) 0;
  border-top: 1px solid var(--hairline);
}
.practice__item:last-child { border-bottom: 1px solid var(--hairline); }
.practice__item h3 {
  font-size: clamp(1.3rem, 2.2vw, 1.8rem);
  font-stretch: 112%;
  margin-bottom: 0.7rem;
}
.practice__item p {
  max-width: 46ch;
  color: var(--bone-dim);
  font-size: 0.95rem;
}

/* ---------- clients ---------- */
.clients {
  padding: clamp(3rem, 8vh, 5rem) var(--pad) clamp(4rem, 10vh, 7rem);
}
.clients__title {
  font-size: 0.78rem;
  font-weight: 500;
  font-stretch: 100%;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--bone-dim);
}
.clients__row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(2.5rem, 8vw, 7rem);
  margin-top: clamp(1.8rem, 4vh, 3rem);
}
.clients__row img {
  height: clamp(30px, 4vw, 46px);
  width: auto;
  opacity: 0.85;
  transition: opacity 0.3s var(--ease);
}
.clients__row img:first-child { height: clamp(52px, 6.5vw, 84px); } /* stacked bulls + wordmark lockup */
.clients__row img:hover { opacity: 1; }

/* ---------- film: studio triptych ---------- */
.film {
  padding: clamp(5rem, 12vh, 9rem) var(--pad) clamp(5rem, 10vh, 8rem);
}
.film__head { margin-bottom: clamp(2rem, 5vh, 3.5rem); }
.film__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 2vw, 2rem);
  max-width: 1250px;
  margin: 0 auto;
}
.film__item video {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  background: var(--ink-2);
}
.film__item figcaption {
  padding-top: 0.8rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--bone-dim);
}
@media (max-width: 768px) {
  /* keep the triptych side by side, like desktop */
  .film__grid { gap: 0.6rem; }
  .film__item figcaption { font-size: 0.6rem; letter-spacing: 0.04em; padding-top: 0.5rem; }
}

/* ---------- horizontal strip ---------- */
.strip-section {
  padding: clamp(5rem, 10vh, 8rem) 0;
  background: var(--ink-2);
}
.strip-section__head {
  padding: 0 var(--pad);
  margin-bottom: clamp(2rem, 5vh, 3.5rem);
}
.strip-section__head p {
  margin-top: 1rem;
  color: var(--bone-dim);
  max-width: 44ch;
  font-size: 0.98rem;
}
.strip {
  overflow: hidden;
  padding: 0 0 1.5rem;
}
.strip__track {
  display: flex;
  width: max-content;
  /* JS drives the drift; these keep the layer on the GPU and flicker-free */
  will-change: transform;
  backface-visibility: hidden;
  transform: translate3d(0, 0, 0);
}
.strip__track img { backface-visibility: hidden; }
.strip__item {
  flex: 0 0 auto;
  width: clamp(240px, 32vw, 420px);
  margin-right: clamp(1rem, 2vw, 2rem); /* margin, not gap: keeps the -50% loop seamless */
}
.strip__item img {
  width: 100%;
  height: clamp(320px, 52vh, 540px);
  object-fit: cover;
}
.strip__item figcaption {
  padding-top: 0.7rem;
  font-size: 0.78rem;
  color: var(--bone-dim);
}

/* ---------- editions ---------- */
.editions {
  padding: clamp(6rem, 14vh, 10rem) var(--pad);
}
.editions__text { margin-bottom: clamp(2.5rem, 6vh, 4rem); }
.editions__text p {
  margin-top: 1rem;
  color: var(--bone-dim);
  max-width: 44ch;
  font-size: 0.98rem;
}
.editions__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(0.8rem, 1.5vw, 1.5rem);
}
.editions__item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  transition: opacity 0.4s var(--ease);
}
.editions__item:hover img { opacity: 0.85; }

/* ---------- contact ---------- */
.contact {
  padding: clamp(7rem, 18vh, 13rem) var(--pad);
  border-top: 1px solid var(--hairline);
}
.contact__title {
  max-width: 20ch;
  font-size: clamp(2.4rem, 6.5vw, 5.4rem);
  font-weight: 300;
  font-stretch: 110%;
  text-transform: none;
  letter-spacing: -0.02em;
  line-height: 1.08;
}
.contact__body {
  margin-top: 1.8rem;
  color: var(--bone-dim);
  font-size: clamp(1rem, 1.5vw, 1.2rem);
}
.contact__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2.6rem;
}

/* ---------- footer ---------- */
.footer {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--hairline);
  padding: clamp(3rem, 8vh, 5rem) var(--pad) 2rem;
}
.footer__ghost {
  position: absolute;
  right: -0.05em;
  bottom: -0.32em;
  font-size: clamp(8rem, 24vw, 20rem);
  font-weight: 640;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(233, 227, 213, 0.09);
  pointer-events: none;
  user-select: none;
}
.footer__row {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--bone-dim);
}
.footer__row a { color: var(--bone); }
.footer__row a:hover { color: var(--accent); }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(15, 13, 12, 0.96);
}
.lightbox[hidden] { display: none; }
.lightbox__img { max-height: 82vh; max-width: 100%; object-fit: contain; }
.lightbox__caption { font-size: 0.85rem; color: var(--bone-dim); }
.lightbox__close {
  position: absolute;
  top: 1.2rem;
  right: var(--pad);
  background: none;
  border: 1px solid var(--bone-faint);
  color: var(--bone);
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.6rem 1.2rem;
  cursor: pointer;
}
.lightbox__close:hover { border-color: var(--bone); }

/* ---------- reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--d, 0s);
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .works__grid { column-count: 2; }
  .editions__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  /* hero collapses to full-bleed image behind the content */
  .hero { grid-template-columns: 1fr; }
  .hero__media {
    position: absolute;
    inset: 0;
    min-height: 0;
  }
  .hero__media img { object-position: 60% 30%; }
  .hero__veil {
    background:
      linear-gradient(to top, rgba(19,17,16,0.9) 0%, rgba(19,17,16,0.35) 55%, rgba(19,17,16,0.45) 100%);
  }
  .hero__content { min-height: 100dvh; }
  .hero__caption { display: none; }
}
@media (max-width: 768px) {
  .nav__links a:not([href="#contact"]):not([href="#works"]) { display: none; }
  .practice { grid-template-columns: 1fr; }
  .practice__intro { position: static; }
}
@media (max-width: 560px) {
  /* two works per row, tighter captions */
  .works__grid { column-count: 2; column-gap: 0.8rem; }
  .work { margin-bottom: 1.6rem; }
  .work figcaption { flex-direction: column; gap: 0.1rem; padding-top: 0.5rem; }
  .work figcaption strong { font-size: 0.7rem; }
  .work figcaption span { font-size: 0.64rem; text-align: left; }
  .strip__item { width: 78vw; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__media img,
  .hero__eyebrow, .hero__wordmark, .hero__line, .hero__actions { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .work img, .editions__item img { transition: none; }
  /* the strip stops drifting and becomes hand-scrollable */
  .strip { overflow-x: auto; }
  .strip__track { animation: none; }
}
