/* =============================================================
   Erphaneh Sadeghzadeh — feuille de style
   Esthétique inspirée d'amakmahmoodian.com :
   fond noir immersif, colonne centrée, titres serif italique,
   révélation au scroll, lightbox plein écran sur fond noir.
   ============================================================= */

:root {
  --bg: #000000;
  --fg: #ffffff;
  --fg-soft: rgba(252, 252, 252, 0.85);
  --fg-dim: rgba(255, 255, 255, 0.55);

  --serif: "Averia Serif Libre", Georgia, "Times New Roman", serif;
  --sans: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --maxw: 960px;          /* largeur max des images / colonne, comme Amak (~957px) */
  --nav-pad: 1.6rem;
  --gap-project: 14vh;    /* respiration verticale entre projets */
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

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

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

/* -------------------------------------------------------------
   NAVIGATION — barre fixe en haut, nom à gauche, liens à droite
   ------------------------------------------------------------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--nav-pad) clamp(1.2rem, 4vw, 3rem);
  font-size: clamp(0.95rem, 1.1vw, 1.05rem);
  letter-spacing: 0.02em;
  mix-blend-mode: difference;   /* le texte reste lisible sur noir comme sur blanc */
  color: #fff;
}

.nav__name {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
}

.nav__links { display: flex; gap: clamp(0.9rem, 2vw, 1.8rem); text-transform: uppercase; }
.nav__links a { position: relative; opacity: 0.9; transition: opacity 0.3s ease; }
.nav__links a:hover { opacity: 0.5; }
.nav__links a.is-active { opacity: 0.45; }

/* Bouton menu mobile */
.nav__toggle { display: none; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; text-transform: uppercase; letter-spacing: 0.05em; }

/* -------------------------------------------------------------
   FOND D'AMBIANCE — photo « A Love Note » (pages galerie)
   Voile plein écran N&B très sombre + vignettage ; reste derrière
   les titres (z-index 2) et l'image de survol (z-index 1).
   ------------------------------------------------------------- */
.site-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: url("../../images/a-love-note/cover.jpg") center / cover no-repeat;
  filter: grayscale(100%) brightness(0.34) contrast(1.05);
}
.site-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.25), rgba(0,0,0,0.7));
}

/* -------------------------------------------------------------
   GALERIE D'ACCUEIL (Work / Films) — colonne unique centrée
   ------------------------------------------------------------- */
.gallery {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  padding: 24vh 1.2rem 18vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Liste de titres compacte (resserrée), comme Amak */
.project {
  text-align: center;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.project + .project { margin-top: 0.35em; }

.project__titles { margin: 0; }

/* Quand on survole un titre, les autres s'estompent pour isoler l'image */
.gallery.is-hovering .project:not(:hover) .project__en { opacity: 0.3; }
.gallery.is-hovering .project:not(:hover) .project__fa,
.gallery.is-hovering .project:not(:hover) .project__years,
.gallery.is-hovering .project:not(:hover) .project__medium { opacity: 0.25; }

.project__fa {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.4vw, 2.4rem);
  font-weight: 400;
  margin: 0 0 0.3rem;
  direction: rtl;
}

.project__en {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--fg-soft);
  font-size: clamp(1.7rem, 3.2vw, 2.9rem);
  line-height: 1.18;
  margin: 0;
  transition: opacity 0.4s ease;
}

.project__years {
  display: block;
  margin-top: 0.7rem;
  font-size: clamp(0.85rem, 1.1vw, 1rem);
  color: var(--fg-dim);
  letter-spacing: 0.04em;
}

.project__medium {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* ---- Mécanique d'Amak : l'image n'apparaît qu'au survol du titre.
   Elle s'affiche CENTRÉE à l'écran, en superposition fixe (sans pousser
   la mise en page), pendant que les autres titres s'estompent. ---- */
.hover-stage {
  position: fixed;
  inset: 0;
  z-index: 1;            /* derrière la liste de titres (z-index 2) */
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.55s ease-in-out;
}
.hover-stage.is-visible { opacity: 1; }
.hover-stage img {
  max-width: min(58vw, var(--maxw));
  max-height: 78vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Image inline : utilisée uniquement sur écran tactile (pas de survol) */
.project__cover-inline { display: none; width: 100%; max-width: var(--maxw); margin: 1.5rem auto 0; }
.project__cover-inline img { width: 100%; }

@media (hover: none) {
  .hover-stage { display: none; }
  .project + .project { margin-top: 8vh; }
  .project__cover-inline { display: block; }
  .gallery { justify-content: flex-start; }
}
.project__play::after {
  content: ""; width: 0; height: 0;
  border-style: solid; border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent #fff;
  margin-left: 4px;
}

/* -------------------------------------------------------------
   RÉVÉLATION AU SCROLL (fade + slide), comme Amak
   ------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: transform 1s ease-in-out, opacity 0.8s ease-in-out;
  will-change: transform, opacity;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* -------------------------------------------------------------
   PAGE PROJET (détail) — images empilées, centrées, lightbox
   ------------------------------------------------------------- */
.project-detail {
  padding: 24vh 1.2rem 16vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.project-detail__head { margin-bottom: 8vh; max-width: 680px; }
.project-detail__fa {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  direction: rtl;
  margin: 0 0 0.4rem;
}
.project-detail__en {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(2.2rem, 5.5vw, 4.4rem);
  color: var(--fg-soft);
  margin: 0;
  line-height: 1.15;
}
.project-detail__meta {
  margin-top: 1rem;
  font-size: 0.95rem;
  color: var(--fg-dim);
  letter-spacing: 0.04em;
}
.project-detail__desc {
  margin-top: 2.2rem;
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
  white-space: pre-line;   /* préserve les sauts de paragraphe (\n\n) */
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--fg-soft);
}

.project-detail__images {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10vh;
}
.project-detail__images figure { margin: 0; width: 100%; max-width: var(--maxw); }
.project-detail__images img { width: 100%; cursor: zoom-in; }

.project-detail__video {
  width: 100%; max-width: var(--maxw);
  aspect-ratio: 16 / 9; margin-bottom: 8vh;
}
.project-detail__video iframe { width: 100%; height: 100%; border: 0; }

.back-link {
  margin-top: 14vh;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-dim);
  transition: color 0.3s ease;
}
.back-link:hover { color: var(--fg); }

/* -------------------------------------------------------------
   PAGE ABOUT — fond blanc, texte noir (contraste, comme Amak)
   ------------------------------------------------------------- */
body.light { background: #fff; color: #111; }
.about {
  max-width: 720px;
  margin: 0 auto;
  padding: 26vh 1.4rem 16vh;
}
.about__portrait { margin-bottom: 3rem; }
.about__portrait img { width: 100%; filter: grayscale(100%); }
.about__credit { font-size: 0.78rem; color: #888; margin-top: 0.5rem; letter-spacing: 0.04em; }
.about__bio p {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
  line-height: 1.75;
  margin: 0 0 1.4rem;
  color: #1a1a1a;
}
.about__contact {
  margin-top: 3rem;
  font-size: 1rem;
  letter-spacing: 0.02em;
}
.about__contact a { border-bottom: 1px solid #111; }
.about__contact a:hover { opacity: 0.6; }

/* -------------------------------------------------------------
   LIGHTBOX (PhotoSwipe-like, fond noir plein écran)
   ------------------------------------------------------------- */
.lb {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.97);
  display: none;
  align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.33s ease;
}
.lb.is-open { display: flex; opacity: 1; }
.lb__img {
  max-width: 92vw; max-height: 90vh;
  width: auto; height: auto; cursor: zoom-out;
  user-select: none;
}
.lb__btn {
  position: absolute; top: 0; bottom: 0;
  width: 18vw; min-width: 70px;
  background: none; border: 0; color: #fff;
  font-size: 2rem; cursor: pointer; opacity: 0.6;
  transition: opacity 0.3s ease;
}
.lb__btn:hover { opacity: 1; }
.lb__prev { left: 0; }
.lb__next { right: 0; }
.lb__close {
  position: absolute; top: 1.2rem; right: 1.6rem;
  width: auto; height: auto;
  font-size: 2.4rem; line-height: 1; font-weight: 200;
}
.lb__count {
  position: absolute; bottom: 1.4rem; left: 0; right: 0;
  text-align: center; color: rgba(255,255,255,0.6);
  font-size: 0.85rem; letter-spacing: 0.1em;
}

/* -------------------------------------------------------------
   RESPONSIVE
   ------------------------------------------------------------- */
@media (max-width: 720px) {
  :root { --gap-project: 9vh; }
  .gallery { padding-top: 18vh; }
  .project__cover, .project-detail__images figure, .project-detail__video { max-width: 100%; }

  .nav { mix-blend-mode: normal; }
  .nav__links { display: none; }
  .nav__links.is-open {
    display: flex; flex-direction: column;
    position: fixed; inset: 0; z-index: 60;
    background: rgba(10,10,10,0.97);
    align-items: center; justify-content: center;
    gap: 2rem; font-size: 1.6rem;
  }
  body.light .nav__links.is-open { background: rgba(255,255,255,0.97); }
  .nav__toggle { display: block; z-index: 61; }
  .lb__btn { width: 26vw; }
}
