/* Styles du site d'Edouard Mora. Noir et blanc, Helvetica. */
*, *::before, *::after { box-sizing: border-box; }
html { background: #fff; }
body {
  margin: 0;
  min-width: 320px;
  background: #fff;
  color: #000;
  font-family: Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
h1, h2, p { margin: 0; font-size: inherit; font-weight: inherit; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; cursor: pointer; outline-offset: 5px; }
::selection { background: #000; color: #fff; }

/* ---------- Bande d'identité : nom à gauche, menu à droite ----------
   Les deux blocs partagent la même ligne de base en bas
   et leurs tailles suivent la largeur de la fenêtre. */
.identity-band {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  align-items: last baseline;
  gap: 2rem;
  padding: clamp(1.25rem, 3.5vw, 2.5rem) clamp(1.25rem, 4vw, 4rem);
  background: #fff;
}

.identity-home {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  text-align: left;
}

.logo-mark {
  display: block;
  width: clamp(110px, 17vw, 230px);
  height: auto;
  aspect-ratio: 1400 / 671;
  flex: 0 0 auto;
  object-fit: contain;
}

.identity-copy {
  display: flex;
  flex-direction: column;
  font-size: clamp(0.62rem, 1.07vw, 1.03rem);
  line-height: 1.42;
  white-space: nowrap;
}

.identity-copy strong {
  margin-bottom: 0.65rem;
  font-size: clamp(0.85rem, 2.07vw, 2.1rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1;
  text-transform: uppercase;
}

/* Les deux lignes sous le nom sont sorties du flux : ainsi la ligne de base
   du bloc gauche est celle d'EDOUARD MORA, et CV se pose sur la même ligne. */
.identity-copy {
  position: relative;
  padding-bottom: 2.84em; /* 2 lignes x line-height 1.42 */
}

.identity-copy > span {
  position: absolute;
  left: 0;
}

.identity-copy > span:nth-of-type(1) { bottom: 1.42em; }
.identity-copy > span:nth-of-type(2) { bottom: 0; }

.identity-nav {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}

.identity-nav a {
  display: block;
  margin-right: -0.16em;
  padding: 0.15rem 0;
  font-size: clamp(0.75rem, 2.07vw, 2.1rem);
  font-weight: 400;
  letter-spacing: 0.16em;
  line-height: 1.1;
  text-align: right;
  text-transform: uppercase;
  white-space: nowrap;
  transition:
    color 250ms ease,
    background-color 250ms ease;
}

.identity-nav a:hover {
  background: #000;
  color: #fff;
}

/* ---------- Accueil : images des projets ---------- */
.project-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2.5rem);
  padding: clamp(1.5rem, 4vw, 4rem);
}

.project-tile {
  position: relative;
  display: block;
  width: 52%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #fff;
  text-align: left;
}

.project-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1);
  transition: transform 700ms cubic-bezier(0.2, 0.65, 0.25, 1);
}

.project-tile:hover img {
  transform: scale(1.025);
}

/* Titre du projet : affiché seul, par-dessus l'image, au survol (souris ou doigt) */
.project-caption {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(205, 205, 205, 0.62);
  color: #000;
  font-size: clamp(1.1rem, 2.6vw, 2.4rem);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-align: center;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
}

.project-tile:hover .project-caption,
.project-tile:focus-visible .project-caption,
.project-tile:active .project-caption {
  opacity: 1;
}

/* ---------- Page Présentation ---------- */
.presentation-page {
  min-height: calc(100vh - 175px);
  min-height: calc(100svh - 175px);
  padding: clamp(3rem, 8vw, 8rem) 1.5rem;
  text-align: center;
}

.presentation-page .logo-lien {
  display: block;
  width: min(430px, 72vw);
  margin: 0 auto;
}

.presentation-logo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1400 / 671;
}

.presentation-page h1 {
  margin-top: clamp(2.5rem, 5vw, 4.5rem);
  font-size: clamp(2.5rem, 5vw, 5rem);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 1;
  text-transform: uppercase;
}

.presentation-sous-titre {
  margin-top: 1.25rem;
  font-size: clamp(1rem, 1.5vw, 1.3rem);
  line-height: 1.4;
}

.presentation-sous-titre span {
  display: block;
}

.presentation-texte {
  max-width: 680px;
  margin-right: auto;
  margin-left: auto;
  margin-top: clamp(2rem, 4vw, 3.5rem);
  font-size: clamp(0.95rem, 1.2vw, 1.1rem);
  line-height: 1.7;
  text-align: justify;
  -webkit-hyphens: auto;
  hyphens: auto;
}

.presentation-texte p + p {
  margin-top: 1em;
}

/* ---------- Page projet : galerie (2/3) + texte (1/3) ---------- */
.projet-detail {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: start;
  padding: clamp(1rem, 3vw, 2.5rem) clamp(1.25rem, 4vw, 4rem) clamp(2.5rem, 5vw, 5rem);
}

.projet-galerie {
  min-width: 0;
}

/* Image principale : même cadre pour toutes les planches */
.galerie-scene {
  position: relative;
  aspect-ratio: 3308 / 2339;
  overflow: hidden;
  background: #fff;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.galerie-scene.glisse {
  cursor: grabbing;
}

.galerie-scene { cursor: zoom-in; }

.galerie-principale {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  -webkit-user-drag: none;
}

.galerie-compteur {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-align: right;
}

/* Petites images sous l'image principale : le nombre de colonnes s'adapte */
.galerie-vignettes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.5rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.vignette {
  display: block;
  width: 100%;
  aspect-ratio: 3308 / 2339;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  transition: border-color 200ms ease;
}

.vignette img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.vignette:hover,
.vignette:focus-visible {
  border-color: #777;
}

.vignette[aria-current="true"] {
  border-color: #000;
}

.projet-texte {
  min-width: 0;
}

.projet-texte h1 {
  font-size: clamp(1.1rem, 1.9vw, 1.9rem);
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
}

.projet-sous-titre {
  margin-top: 0.5rem;
  font-size: clamp(0.9rem, 1.2vw, 1.15rem);
  font-weight: 400;
  color: #555;
}

.projet-corps {
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
  font-size: clamp(0.85rem, 1vw, 1rem);
  line-height: 1.65;
  text-align: justify;
  -webkit-hyphens: auto;
  hyphens: auto;
}

.projet-corps p + p {
  margin-top: 1em;
}

/* Le texte reste visible pendant le défilement de la galerie,
   seulement si la fenêtre est assez haute pour l'afficher en entier */
@media (min-width: 1280px) and (min-height: 720px),
       (min-width: 880px) and (max-width: 1279px) and (min-height: 880px) {
  .projet-texte {
    position: sticky;
    top: 1.5rem;
  }
}

/* ---------- Page CV ---------- */
.cv-page {
  display: flex;
  justify-content: center;
  padding: clamp(1rem, 3vw, 2.5rem) clamp(1.25rem, 4vw, 4rem) clamp(2.5rem, 5vw, 5rem);
}

.cv-page a {
  display: block;
  width: min(860px, 100%);
}

.cv-page img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #e3e3e3;
}

/* ---------- Pied de page ---------- */
.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: clamp(2.5rem, 5vw, 5rem) clamp(1.25rem, 4vw, 4rem);
  background: #fff;
  font-size: clamp(0.8rem, 1vw, 0.95rem);
  line-height: 1.5;
  text-align: center;
}

.site-footer a {
  transition: opacity 200ms ease;
}

.site-footer a:hover {
  opacity: 0.5;
}

/* ---------- Écrans moyens ---------- */
@media (min-width: 761px) and (max-width: 1100px) {
  .project-tile {
    width: 60%;
  }
}

/* ---------- Petits écrans ---------- */
@media (max-width: 760px) {
  .project-grid {
    padding: 1rem;
  }

  .project-grid {
    gap: 0.75rem;
  }

  /* Sur téléphone : les 4 cases tiennent sous le bandeau, dans la hauteur de l'écran */
  .project-tile {
    width: clamp(50%, calc((100vh - 13rem) * 4 / 9), 72%);
    width: clamp(50%, calc((100svh - 13rem) * 4 / 9), 72%);
    aspect-ratio: 16 / 9;
  }

  .projet-detail {
    grid-template-columns: 1fr;
  }

  .projet-texte {
    order: -1;
  }

  .galerie-vignettes {
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  }
}

/* Très petit écran : le menu passe sous le bloc nom, aligné à gauche */
@media (max-width: 520px) {
  .identity-band {
    gap: 0.75rem;
    padding: 1.1rem 1rem 0.75rem;
  }

  .identity-home {
    gap: 0.35rem;
  }

  .logo-mark {
    width: 80px;
  }

  .identity-copy {
    font-size: 0.6rem;
  }

  .identity-copy strong {
    margin-bottom: 0.35rem;
    font-size: 0.8rem;
  }

  .identity-nav a {
    font-size: 0.62rem;
    letter-spacing: 0.12em;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Image en grand ---------- */
.grand-ecran {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(233, 233, 233, 0.82);
  cursor: zoom-out;
  touch-action: pan-y;
}

.grand-ecran img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #fff;
  user-select: none;
  -webkit-user-drag: none;
}

.grand-fermer {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  background: transparent;
  color: #000;
  font: 300 2rem/1 Helvetica, Arial, sans-serif;
  cursor: pointer;
}

.grand-fermer:focus-visible { outline: 2px solid #000; outline-offset: 2px; }


.grand-ecran:focus { outline: none; }

