@font-face {
  font-family: 'Trench';
  src: url('./trench-font/TrenchThin-16R0.otf') format('opentype'),
       url('./trench-font/TrenchThin-aZ1J.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}
body {
  margin: 0;
  padding: 0;
  background: #111;
  color: #fff;
  font-family: 'Trench', Arial, sans-serif;
  overflow-x: hidden;
}

#loader {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #111;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.monolithe-loader {
  width: 120px;
  height: 400px;
  background: linear-gradient(180deg, #222 80%, #444 100%);
  box-shadow: 0 0 40px 10px #000, 0 0 80px 10px #00eaff44;
  border-radius: 8px;
  animation: monolitheAppear 2s cubic-bezier(.68,-0.55,.27,1.55) forwards, monolithePulse 1.5s infinite alternate 2s;
  opacity: 0;
}

@keyframes monolitheAppear {
  0% { transform: scaleY(0.1) translateY(100px); opacity: 0; }
  80% { opacity: 1; }
  100% { transform: scaleY(1) translateY(0); opacity: 1; }
}

@keyframes monolithePulse {
  0% { box-shadow: 0 0 40px 10px #000, 0 0 80px 10px #00eaff44; }
  100% { box-shadow: 0 0 60px 20px #00eaff88, 0 0 120px 20px #00eaff22; }
}

.loader-text {
  margin-top: 32px;
  font-size: 1.2em;
  letter-spacing: 1px;
  color: #fff;
  text-shadow: 0 2px 8px #00eaff44;
}

#main-content {
  position: relative;
  min-height: 100vh;
  overflow: visible;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 80px;
  z-index: 1;
}

header {
  text-align: center;
  margin-bottom: 60px;
}

.projects-masonry {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 80px;
  grid-auto-flow: dense;
  gap: 12px;
  width: 100vw;
  padding: 48px 0 64px 0;
  background: #111;
}

.project-tile {
  background-size: cover;
  background-position: center;
  border-radius: 16px;
  box-shadow: 0 2px 16px 0 #0006;
  width: 100%;
  min-height: 160px;
  transition: transform 0.35s cubic-bezier(.4,0,.2,1), box-shadow 0.25s, filter 0.25s, opacity 0.7s, transform 0.7s;
  filter: grayscale(0.15) brightness(0.85);
  opacity: 0;
  transform: translateY(40px) scale(0.97);
  aspect-ratio: 3/4;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}

.project-tile.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition-delay: 0s;
}

.project-title {
  width: 100%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 1.1em;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-align: center;
  padding: 12px 8px 10px 8px;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 2;
}

.project-meta {
  font-style: italic;
  font-weight: 400;
  opacity: 0.85;
  letter-spacing: 0.01em;
  display: block;
  margin-bottom: 1.2em;
}

.portrait-small {
  grid-row: span 3;
}
.portrait-medium {
  grid-row: span 4;
}
.portrait-large {
  grid-row: span 6;
}

.project-tile::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.55) 60%, rgba(0,0,0,0.15) 100%);
  z-index: 1;
  transition: background 0.25s;
}

.project-tile:hover, .project-tile:focus {
  transform: scale(1.045) translateY(-6px);
  box-shadow: 0 8px 32px 0 #000b;
  filter: grayscale(0) brightness(1);
}

.project-tile:hover::before, .project-tile:focus::before {
  background: linear-gradient(0deg, rgba(0,0,0,0.35) 40%, rgba(0,0,0,0.05) 100%);
}

.monolithe-interactive {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 60px;
  height: 200px;
  background: #000;
  box-shadow: 0 0 32px 4px #fff8, 0 0 0px 0px #000;
  border-radius: 0;
  transition: background 0.2s;
  will-change: transform, box-shadow, background;
  margin: 0;
  z-index: 2;
  pointer-events: none;
}

.monolithes-container {
  display: flex;
  flex-direction: row;
  width: 100vw;
  height: 100vh;
  position: fixed;
  top: 0; left: 0;
  z-index: 1;
}

.monolithe-col {
  flex: 1 1 33.33%;
  max-width: 33.33vw;
  min-width: 0;
  height: 100vh;
  position: relative;
  display: block;
  overflow: hidden;
}

.monolithe {
  width: 90vw;
  max-width: 100%;
  height: 60vh;
  background: #000;
  border-radius: 0;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 64px 12px #fff2, 0 0 0px 0px #000;
  opacity: 0.98;
}

@keyframes monolitheUp1 {
  0% { top: -140px; }
  100% { top: 100%; }
}
@keyframes monolitheUp2 {
  0% { top: -140px; }
  100% { top: 100%; }
}
@keyframes monolitheUp3 {
  0% { top: -140px; }
  100% { top: 100%; }
}

/* Responsive: mobile first */
@media (max-width: 600px) {
  .monolithes-container {
    width: 100vw;
    height: 100vh;
  }
  .monolithe-col {
    max-width: 33.33vw;
  }
  .monolithe {
    width: 30vw;
    height: 40vh;
  }
}

@media (min-width: 900px) {
  .monolithes-container {
    max-width: 100%;
    margin: 0 auto;
    flex-direction: row;
    justify-content: center;
    height: 100vh;
    position: relative;
  }
  .monolithe-col {
    max-width: 20vw;
    min-width: 0;
    height: 100vh;
    display: block;
  }
  .monolithe {
    width: 10vw;
    height: 60vh;
    min-width: 80px;
    max-width: 180px;
    min-height: 200px;
    max-height: 600px;
  }
  .vertical-text {
    font-size: 2.4em;
  }
  .project-detail-scroll {
    max-width: 600px;
    margin: 0 auto;
    font-size: 1.15em;
  }
  .menu-btn {
    position: absolute;
    left: 50%;
    bottom: 32px;
    transform: translateX(-50%);
  }
}

@media (max-width: 900px) {
  .monolithe-col:nth-child(4),
  .monolithe-col:nth-child(5) {
    display: none;
  }
}

.menu-btn {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  width: 52px;
  height: 52px;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  cursor: pointer;
  transition: background 0.2s;
}
.menu-btn:hover, .menu-btn:focus {
  background: rgba(30,30,30,0.85);
  box-shadow: 0 4px 24px #000a;
  border-radius: 12px;
}
.menu-btn .bar {
  display: block;
  width: 26px;
  height: 4px;
  margin: 3px 0;
  background: #fff;
  border-radius: 3px;
  transition: background 0.2s;
}

.flip-container {
  perspective: 1200px;
  width: 100vw;
  height: 100vh;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
}
.flip-inner {
  width: 100vw;
  height: 100vh;
  position: relative;
  transition: transform 0.8s cubic-bezier(.68,-0.55,.27,1.55);
  transform-style: preserve-3d;
}
.flip-front, .flip-back, .flip-recherche, .flip-recherche-back {
  width: 100vw;
  height: 100vh;
  position: absolute;
  top: 0; left: 0;
  backface-visibility: hidden;
  display: none;
}
.flip-front {
  z-index: 2;
}
.flip-back, .flip-recherche, .flip-recherche-back {
  width: 100vw;
  height: 100vh;
  position: absolute;
  top: 0; left: 0;
  backface-visibility: hidden;
  display: none;
}
.flip-back {
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotateY(180deg);
  z-index: 3;
  position: relative;
}
.flip-recherche {
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotateY(-180deg);
  z-index: 4;
  position: relative;
}
.flip-recherche-back {
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotateY(0deg) scaleX(-1);
  z-index: 5;
  position: relative;
}

.flip-container:not(.flipped):not(.flipped-recherche):not(.flipped-recherche-back) .flip-front {
  display: block;
}
.flip-container.flipped .flip-back {
  display: block;
}
.flip-container.flipped-recherche .flip-recherche {
  display: block;
}
.flip-container.flipped-recherche-back .flip-recherche-back {
  display: block;
}

.flip-container.flipped .flip-inner {
  transform: rotateY(180deg);
}

.flip-container.flipped-recherche .flip-inner {
  transform: rotateY(-180deg);
}
.flip-container.flipped-recherche-back .flip-inner {
  transform: rotateY(0deg) scaleX(-1);
}

.vertical-cols {
  display: flex;
  flex-direction: row;
  width: 100vw;
  height: 100vh;
  align-items: center;
  /* justify-content: space-evenly; */
}
.vertical-text {
  flex: 1 1 33.33%;
  max-width: 33.33vw;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  writing-mode: vertical-lr;
  text-orientation: upright;
  font-size: 2.2em;
  color: #fff;
  letter-spacing: 0.1em;
  font-weight: 400;
  font-family: 'Montserrat Light', 'Montserrat', Arial, sans-serif;
  text-shadow: 0 2px 12px #000a;
  user-select: none;
  height: 100%;
  margin-top: 20vh;
  text-transform: uppercase;
  font-family: 'IBM Plex Sans', Arial, sans-serif;
  font-weight: 300;
}

.back-btn {
  display: none;
  position: absolute;
  left: 24px;
  top: 24px;
  z-index: 20;
  background: rgba(20,20,20,0.95);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px #000a;
  transition: opacity 0.2s;
}
.back-btn span {
  display: block;
  width: 20px;
  height: 20px;
  border-left: 3px solid #fff;
  border-bottom: 3px solid #fff;
  transform: rotate(45deg);
  margin-left: 6px;
}
.flip-container.flipped.projet-active .back-btn {
  display: flex;
}

.recherche-content {
  max-width: 600px;
  width: 90vw;
  background: #181818;
  border-radius: 18px;
  box-shadow: 0 4px 32px #000a;
  padding: 2.5em 1.2em 1.2em 1.2em;
  color: #fff;
  text-align: left;
  overflow-y: auto;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.recherche-content img {
  max-width: 320px;
  width: 100%;
  border-radius: 10px;
  margin-bottom: 1.2em;
  box-shadow: 0 2px 16px #0008;
}
.recherche-content h2 {
  font-size: 2em;
  font-weight: 700;
  margin-bottom: 0.5em;
  text-align: center;
}
.recherche-content p {
  font-size: 1.1em;
  color: #fff;
  margin-bottom: 0.7em;
  text-align: center;
}

.monolithes-recherche-container {
  display: flex;
  flex-direction: row;
  width: 100vw;
  height: 100vh;
  justify-content: center;
  align-items: flex-end;
}
.monolithe-recherche-col {
  flex: 1 1 33.33%;
  max-width: 33.33vw;
  min-width: 0;
  height: 100vh;
  position: relative;
  display: block;
  overflow: hidden;
}
.monolithe-recherche {
  width: 90vw;
  max-width: 100%;
  height: 60vh;
  background: #000;
  border-radius: 0;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 64px 12px #fff2, 0 0 0px 0px #000;
  opacity: 0.98;
  background-size: cover;
  background-position: center;
  cursor: pointer;
}
@media (min-width: 900px) {
  .monolithes-recherche-container {
    max-width: 1200px;
    margin: 0 auto;
    flex-direction: row;
    justify-content: center;
    height: 100vh;
  }
  .monolithe-recherche-col {
    max-width: 20vw;
    min-width: 0;
    height: 100vh;
    display: block;
  }
  .monolithe-recherche {
    width: 10vw;
    height: 60vh;
    min-width: 80px;
    max-width: 180px;
    min-height: 200px;
    max-height: 600px;
  }
}

.flip-container.recto-recherche .back-btn {
  display: flex;
}

.apropos-recto-content {
  width: 100vw;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 700px) {
  .apropos-recto-content {
    height: 100vh;
    min-height: 100vh;
    overflow-y: auto;
    padding-bottom: 2em;
  }
  .apropos-content {
    max-width: 98vw;
    padding: 1.2em 0.5em 1.2em 0.5em;
  }
}

.project-detail-verso {
  width: 100%;
  background: #181818;
  color: #fff;
  padding-bottom: 2em;
  overflow-y: auto;
  max-height: 80vh;
}
.bandeau-haut {
  width: 100%;
  min-height: 320px;
  max-height: 70vh;
  overflow: hidden;
  border-radius: 18px 18px 0 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bandeau-media {
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  display: block;
}
.main-content-row {
  display: flex;
  gap: 2em;
  padding: 4em 1.5em 1em 1.5em;
}
.main-text {
  flex: 2;
  min-width: 0;
  padding-left: 2.5em;
  font-size: 1.22em;
  line-height: 1.7;
  letter-spacing: 0.02em;
}
.main-text h2 {
  margin-top: 0;
  line-height: 1.1;
}
.side-media {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  height: 100%;
}

.side-image, .side-media video {
  padding-top: 0.4em;
  max-width: 100%;
  max-height: 680px;
  min-width: 260px;
  min-height: 260px;
  border-radius: 0;
  object-fit: cover;
  align-self: flex-start;
  margin-top: 0 !important;
  margin-bottom: 0;
  display: block;
}
.gallery-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 680px;
  gap: 2em;
  padding: 5em 1.5em 0 1.5em;
  justify-items: center;
  max-height: calc(2 * 680px + 2em);
  overflow: hidden;
}
.gallery-img {
  width: 680px;
  height: 680px;
  border-radius: 0;
  object-fit: cover;
  display: block;
}

.project-detail-scroll img[src*="poster_workshop_2023_test1.jpg"],
.project-detail-verso img[src*="poster_workshop_2023_test1.jpg"] {
  max-width: 95vw;
  max-height: 70vh;
  width: auto;
  height: auto;
  border-radius: 0 !important;
  display: block;
  margin: 0 auto 1.2em auto;
  object-fit: contain;
}
.back-btn,
.menu-btn {
  border-radius: 10% !important;
}
.split-compare-container {
  position: relative;
  width: 420px;
  height: 600px;
  margin: 0 auto 3em auto;
  background: #111;
  overflow: hidden;
  border-radius: 0;
  box-shadow: 0 2px 24px #000a;
  user-select: none;
}
.split-compare-img {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.split-compare-img.split-compare-top {
  clip-path: inset(0 50% 0 0);
  transition: clip-path 0.2s;
  z-index: 2;
}
.split-compare-handle {
  position: absolute;
  top: 0; left: 50%;
  width: 6px;
  height: 100%;
  background: #fff;
  border-radius: 3px;
  z-index: 3;
  cursor: ew-resize;
  box-shadow: 0 0 12px #000a;
  transition: background 0.2s;
}
.split-compare-handle:hover {
  background: #00eaff;
}

.gallery-row.promptopia-gallery {
  display: flex;
  gap: 3em;
  justify-content: center;
  padding: 5em 1.5em 0 1.5em;
}
.gallery-row.promptopia-gallery .gallery-img {
  width: 1000px;
  height: 600px;
  border-radius: 0;
  object-fit: cover;
  display: block;
}

/* Organisation spécifique pour la galerie de Fiction d'une vie possible */
.gallery-row.fiction-vie-possible {
  display: flex;
  flex-direction: column;
  gap: 2em;
  justify-content: center;
  align-items: center;
  padding: 4em 1.5em 0 1.5em;
  padding-left: 0 !important;
}
.gallery-line-1 {
  display: flex;
  gap: 1.5em;
  width: 100%;
  justify-content: center;
}
.gallery-line-2 {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: stretch;
  gap: 1.5em;
  width: 100%;
  padding-top: 3em;
  margin-bottom: 2em;
}
.gallery-col-left {
  display: flex;
  flex-direction: row;
  gap: 2em;
  width: auto;
  justify-content: flex-start;
}
.gallery-col-left .img-portrait {
  width: 120px;
  height: 420px;
  object-fit: cover;
  border-radius: 0;
  background: #181818;
  box-shadow: 0 4px 24px #000a;
  display: block;
}
.gallery-col-right {
  display: flex;
  flex-direction: column;
  gap: 2em;
  justify-content: flex-start;
  align-items: flex-start;
}
.gallery-col-right .img-landscape {
  width: 220px;
  height: auto;
  max-width: 240px;
  max-height: 120px;
  object-fit: cover;
  border-radius: 12px;
  background: #181818;
  box-shadow: 0 4px 24px #000a;
  display: block;
  margin-bottom: 1.2em;
}
.gallery-col-right .img-portrait-right {
  width: 180px;
  height: auto;
  max-width: 220px;
  max-height: 220px;
  object-fit: cover;
  border-radius: 12px;
  background: #181818;
  box-shadow: 0 4px 24px #000a;
  display: block;
  align-self: flex-end;
}
@media (max-width: 1200px) {
  .gallery-col-left {
    max-width: 700px;
  }
  .gallery-col-left .img-portrait {
    width: 10vw;
    height: 32vw;
    min-width: 60px;
    max-width: 140px;
    max-height: 320px;
  }
  .gallery-col-right .img-landscape {
    width: 28vw;
    height: 14vw;
    min-width: 120px;
    max-width: 320px;
    max-height: 180px;
  }
  .gallery-col-right .img-portrait-right {
    width: 10vw;
    height: 18vw;
    min-width: 60px;
    max-width: 140px;
    max-height: 236px;
  }
}
@media (max-width: 700px) {
  .gallery-line-2 {
    flex-direction: column;
    gap: 1em;
    align-items: center;
  }
  .gallery-col-left, .gallery-col-right {
    max-width: 98vw;
    width: 98vw;
  }
  .gallery-col-left .img-portrait, .gallery-col-right .img-landscape, .gallery-col-right .img-portrait-right {
    width: 100%;
    max-width: 100vw;
    min-width: 0;
  }
  .gallery-col-left .img-portrait {
    height: 32vw;
    max-height: 40vw;
  }
  .gallery-col-right .img-landscape {
    height: 18vw;
    max-height: 24vw;
  }
  .gallery-col-right .img-portrait-right {
    height: 18vw;
    max-height: 24vw;
  }
}

.gallery-line-1 .img-line1 {
  width: 33vw;
  height: 420px;
  min-width: 280px;
  max-width: 700px;
  object-fit: cover;
  border-radius: 0;
  background: #181818;
  box-shadow: 0 4px 24px #000a;
  margin: 0;
  display: block;
}
@media (max-width: 1200px) {
  .gallery-line-1 .img-line1 {
    width: 48vw;
    height: 32vw;
    min-width: 180px;
    max-width: 400px;
  }
}
@media (max-width: 700px) {
  .gallery-line-1 .img-line1 {
    width: 98vw;
    min-width: 0;
    max-width: 100vw;
    height: 32vw;
    max-height: 40vw;
  }
}

.img-vie-virtuelle {
  flex: 1 1 0;
  width: 100%;
  height: 38vw;
  max-width: none;
  max-height: 60vh;
  min-width: 0;
  min-height: 320px;
  object-fit: cover;
  border-radius: 0;
  box-shadow: 0 4px 32px #000a;
  background: #181818;
}

/* Modale d'introduction (portfolio/CV) */
#intro-modal {
  position: fixed; z-index: 9999; top: 0; left: 0; width: 100vw; height: 100vh; display: flex; align-items: center; justify-content: center;
}
.intro-modal-backdrop {
  position: absolute; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(10,20,30,0.82); backdrop-filter: blur(2px);
}
.intro-modal-content {
  position: relative; z-index: 1; background: rgba(24,24,24,0.72); color: #fff; border-radius: 0; box-shadow: 0 4px 32px #000a; padding: 2.5em 2.2em 2em 2.2em; max-width: 420px; width: 90vw; text-align: center; font-family: inherit;
  animation: introModalAppear 0.5s cubic-bezier(.7,-0.2,.3,1.2);
}
@keyframes introModalAppear {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
#close-intro-modal:hover {
  background: #fff; color: #181818;
}

h1, h2, h3, h4, h5, h6, .titrage {
  font-family: 'Trench', Arial, sans-serif;
  font-weight: normal;
  letter-spacing: 0.01em;
}
body, p, li, .texte, .main-text, .side-media, .project-detail-scroll, .project-detail-verso, .recherche-detail-scroll, .apropos-content, .gallery-row, .gallery-line, .video-desc {
  font-family: 'IBM Plex Sans', Arial, sans-serif;
  font-weight: 300;
}
