/* ======================
   RESET
====================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ======================
   VARIABLES
====================== */
:root {
  --outer: clamp(0.9rem, 2vw, 1.25rem);
  --gutter: clamp(0.8rem, 1.6vw, 1.1rem);
  --col-pad: clamp(0.6rem, 1.6vw, 1rem);

  --about-top: clamp(6.5rem, 18vh, 10rem);
  --work-top: clamp(6.5rem, 16vh, 9rem);
  --cv-top: clamp(6.5rem, 18vh, 10rem);

  --active-opacity: 0.45;

  --preview-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --preview-open-ms: 620ms;
  --preview-fade-ms: 320ms;

  --project-title-size: clamp(2.5rem, 4.5vw, 4rem);
  --menu-band: clamp(5.5rem, 10vh, 7.5rem);

  --text-size: clamp(1rem, 1.3vw, 1.2rem);
  --text-line: 1.1;
  --menu-text-size: clamp(0.95rem, 1.1vw, 1.1rem); /* TAILLE SOMMAIRE */
  --menu-text-line: 1.3;

  --credits-gap: 1rem;
  --credits-between: 0.6rem; /* spacing between credit A and B */
  --page-bottom: 2rem; /* space after credits */
}

@font-face {
  font-family: "Poppins";
  src: url("./Poppins/Poppins-Regular.ttf") format("truetype");
  font-style: var(--text-size);
  line-height: var(--text-line);
}

@font-face {
  font-family: "Poppins";
  src: url("./Poppins/Poppins-ExtraLight.ttf") format("truetype");
  font-weight: 200;
  font-style: normal;
}

/* ======================
   BASE
====================== */
body {
  font-family: "Poppins", regular;
  font-size: var(--text-size);
  line-height: var(--text-line);
}

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

/* ======================
   LAYOUT
====================== */

.layout {
  position: relative;
  min-height: 100vh;
}

/* ======================
   GRID (BACKGROUND + MENUS)
====================== */
.grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--gutter);
  padding: var(--outer);
  min-height: 100vh;

  position: relative;
  z-index: 1; /* ✅ menus layer sits above overlay */
}

.col {
  position: relative;
  min-height: 100vh;
  padding: var(--col-pad);
  background: transparent;
}

.col::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #ffffff;
  z-index: 0;
}

/* menu/identity text above everything */
.col > * {
  position: relative;
  z-index: 60;
  pointer-events: auto;
}

/* remove the inner padding ONLY where you want perfect left alignment */
.col.col-menu {
  padding-left: 0;
  padding-right: 0;
  padding-top: 0;
}

/* ======================
   IDENTITY + NAV
====================== */
.identity {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.role {
  opacity: 0.8;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: flex-start;
}

.identity,
.nav {
  padding-left: 0;
  font-size: var(--menu-text-size);
  line-height: var(--menu-text-line);
}

.nav a {
  display: block;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.nav a:hover {
  opacity: 0.6;
}

.nav a.active {
  opacity: var(--active-opacity);
}

/* ======================
   OVERLAY (ALL CONTENT)
   Important:
   - overlay is BELOW the menus
   - overlay IS clickable
====================== */
.overlay {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--gutter);
  padding: var(--outer);

  position: absolute;
  inset: 0;

  z-index: 20; /* under menus */
  pointer-events: none; /* ✅ never blocks menus */
}

/* ======================
   CONTENT (ABOUT / WORK / CV)
====================== */
.content {
  display: none;
  pointer-events: auto;
  grid-column: 3 / 5;
  align-self: start;
  justify-self: stretch;
  width: 100%;
  line-height: 1.45;
}

.content.visible {
  display: block;
}

.about {
  margin-top: var(--about-top);
  max-width: 32rem;
  justify-self: start;
}

.work {
  margin-top: var(--work-top);
  max-width: none;
}

/* ======================
   WORK LIST
====================== */
.work-list {
  list-style: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.work-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: var(--gutter);
  cursor: pointer;
  user-select: none;
}

.work-item .year {
  text-align: right;
}

.work-item .meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.work-item .tag {
  opacity: 0.85;
}

.work-item:hover .title {
  opacity: 0.7;
}

/* Work list — fade entire row on hover */
.work-item:hover {
  opacity: 0.45; /* adjust to taste */
}

/* Preview row */
.work-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: var(--gutter);
}

/*
.work-preview .preview-spacer {
  grid-column: 2;  ✅ under meta column 
} */

/* container that holds the preview image: align content to the RIGHT */
.work-preview .preview-spacer {
  grid-column: 2;
}

.preview-spacer {
  overflow: hidden;
  height: 0;
  opacity: 0;
  transform: translateY(-10px);
  transition: height var(--preview-open-ms) var(--preview-ease),
    opacity var(--preview-fade-ms) ease,
    transform var(--preview-open-ms) var(--preview-ease);
}

.work-preview.is-open .preview-spacer {
  opacity: 1;
  transform: translateY(0);
  margin-top: 0.8rem;
  margin-bottom: 0.8rem;
}

/* default = PORTRAIT (narrower) */
.preview-inline-img {
  width: auto; /* 👈 important */
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  max-height: 45vh;
}

/* landscape = fill the column width */
.preview-inline-img.is-landscape {
  width: 100%; /* 👈 landscape stays big */
  max-height: 70vh;
}

/* élargit seulement le bloc Work */
.content.work {
  grid-column: 2 / 6;
}

/* ======================
   CV
====================== */
.content.cv {
  margin-top: var(--cv-top);
  grid-column: 1 / -1;
}

/* IMPORTANT: allow ALL CV grid items to shrink inside their columns */
.content.cv.visible > * {
  min-width: 0;
}

.content.cv.visible {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--gutter);
  align-items: start;
  min-height: calc(100vh - var(--cv-top) - (var(--outer) * 2));
  min-width: 0;
  overflow-wrap: anywhere;
  overflow-x: hidden;
}

.cv-title {
  font-size: 1.2rem;
  font-weight: 400;
  margin-bottom: 0.75rem;
}

.cv-title-spaced {
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
}

.cv-rows {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.cv-row {
  display: block;
}

.cv-year {
  display: block;
  white-space: nowrap;
}

.cv-text {
  display: block;
  min-width: 0;
}

.cv-list p + p {
  margin-top: 0.2rem;
}

.cv-cursus {
  grid-column: 1 / 2;
}

.cv-presence {
  grid-column: 3 / 4;
}

.cv-nominations {
  grid-column: 4 / 5;
  min-width: 0;
  max-width: 100%;
  overflow: hidden; /* last-resort clip instead of spilling */
}
.cv-nominations p {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Let flex children shrink + wrap properly */
.cv-nominations .cv-rows,
.cv-nominations .cv-row,
.cv-nominations .cv-text {
  min-width: 0;
  max-width: 100%;
}

.cv-skills {
  grid-column: 6 / 7;
}

/* ======================
   PROJECT PAGE
====================== */
.is-project .project {
  pointer-events: auto;
  grid-column: 1 / -1;

  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--gutter);

  width: 100%;
  margin-top: var(--menu-band);
}

/* HERO */
.is-project .project-hero {
  grid-column: 1 / -1;
}

.is-project .project-hero img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

/* TITLE */
.is-project .project-title {
  grid-column: 1 / 4;
  font-size: var(--project-title-size);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.03em; /* 👈 tighter, elegant */
}

/* META */

/* PROJECT TEXT in 2 columns 
.is-project .project-meta-right {
  column-count: 2;
  column-gap: var(--gutter);
  column-fill: balance; /* nicer distribution 
} */

/* keep paragraphs clean inside columns */
.is-project .project-meta-right p {
  break-inside: avoid;
  margin: 0 0 1rem;
}

.is-project .project-meta {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--gutter);
  margin-top: 0.25rem;
}

.is-project .project-meta-left {
  grid-column: 1 / 2;
}

.is-project .project-meta-right {
  grid-column: 2 / 5;
}

.is-project .project-meta-right p + p {
  margin-top: 1rem;
}

/* GALLERY */
.is-project .project-gallery {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--gutter);
  margin-top: 1.5rem;
}

/* GALLERY */
.is-project .project-gallery {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--gutter);
  --col-pad: 1rem;
  margin-top: 1.5rem;
}

.is-project .project-gallery > .gallery-left {
  grid-column: 1 / 4 !important;
}
.is-project .project-gallery > .gallery-right {
  grid-column: 4 / 7 !important;
}

/* images */
.is-project .project-gallery img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.is-project .project-gallery .project-video {
  grid-column: 1 / 4;
}

.project-video {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
}

.project-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ======================
   CREDITS (YOU REQUESTED: B UNDER A, SAME COLUMN)
====================== */
.is-project .project-credits {
  grid-column: 1 / -1;
  width: 100%;

  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: 0.4rem;

  margin-top: 1.2rem; /* small space after photos */
  margin-bottom: var(--page-bottom);

  align-items: start;

  font-size: var(--menu-text-size);
  line-height: var(--menu-text-line);
}

.is-project .project-credits > p {
  margin: 0;
}

/* label stays in col 1 */
.is-project .credits-label {
  grid-column: 1 / 2;
}

/* credit B UNDER A, same column */
.is-project .credits-b {
  grid-column: 2 / 3;
}

/* collaboration under the project text */
.is-project .project-collab {
  grid-column: 1 / 2; /* first column */
  margin-top: 0.75rem; /* small gap under text */
  margin-bottom: 0; /* no extra gap before gallery */
  opacity: 0.85;
}

/* ======================
   PROJECT NAV (NEXT)
====================== */
.is-project .project-nav {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  column-gap: var(--gutter);
  align-items: start;

  /* space from credits + bottom breathing room */
  margin-top: 2rem;
  padding-bottom: var(--page-bottom);
}

/* next = right side of col 6 */
.is-project .project-next {
  grid-column: 6 / 7;
  justify-self: end;
}

/* back = left side of col 6 */
.is-project .project-back-bottom {
  grid-column: 1/3;
  justify-self: start;
}

/* left meta (date + technique) */
.is-project .project-meta-left {
  font-size: var(--menu-text-size);
  line-height: var(--menu-text-line);
}

/* collaboration line under text */
.is-project .project-collab {
  font-size: var(--menu-text-size);
  line-height: var(--menu-text-line);
}

/* bottom credits */
.is-project .project-credits {
  font-size: var(--menu-text-size);
  line-height: var(--menu-text-line);
}

/* ======================
   LIGHTBOX
====================== */

/* make images feel clickable */
.project-hero img,
.project-gallery img {
  cursor: zoom-in;
}

/* overlay */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: none; /* hidden by default */
  align-items: center;
  justify-content: center;

  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  padding: 1rem;
}

/* open state */
.lightbox.is-open {
  display: flex;
}

/* image inside */
.lightbox-img {
  max-width: 80vw; /* BIG */
  max-height: 80vh; /* BIG */
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
  cursor: zoom-out;
}

/* close button (inherits your Poppins font) */
.lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;

  font-family: inherit;
  font-size: 2rem;
  line-height: 1;

  background: transparent;
  border: none;
  cursor: pointer;

  padding: 0.25rem 0.5rem;
  opacity: 0.9;
}

.lightbox-close:hover {
  opacity: 0.5;
}

/* prevent scroll when open */
body.lightbox-open {
  overflow: hidden;
}

/* ======================
   PROJECT NAV ARROWS
====================== */
.is-project .project-nav .arrow {
  font-size: 5rem; /* size of the arrows */
  line-height: 1;
  text-decoration: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.is-project .project-nav .arrow:hover {
  opacity: 0.5;
  transform: translateX(2px);
}

/* subtle directional nudge */
.is-project .project-nav .project-back-bottom:hover {
  transform: translateX(-2px);
}

.preview-inline-img {
  cursor: pointer;
}

.preview-inline-img {
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.preview-inline-img:hover {
  opacity: 0.8;
}

@media (max-width: 1100px) {
  /* give content a bit more room */
  .content {
    grid-column: 2 / 6;
  }

  /* project text spans a bit wider */
  .is-project .project-meta-right {
    grid-column: 2 / 6;
  }

  /* title spans wider too */
  .is-project .project-title {
    grid-column: 1 / 5;
  }
}
/* ======================
   MOBILE
====================== */
@media (max-width: 900px) {
  .content.cv.visible {
    grid-template-columns: repeat(2, 1fr);
    min-height: auto;
  }

  .cv-cursus,
  .cv-presence,
  .cv-nominations,
  .cv-skills {
    grid-column: 1 / -1;
  }

  .is-project .project {
    grid-template-columns: repeat(2, 1fr);
    margin-top: var(--menu-band);
  }

  .is-project .project-hero,
  .is-project .project-title,
  .is-project .project-meta,
  .is-project .project-gallery,
  .is-project .project-credits {
    grid-column: 1 / -1;
  }

  .is-project .project-meta {
    grid-template-columns: 1fr;
  }

  .is-project .project-meta-left,
  .is-project .project-meta-right {
    grid-column: 1;
  }

  .is-project .project-gallery {
    grid-template-columns: 1fr;
  }

  .is-project .project-gallery img:nth-child(1),
  .is-project .project-gallery img:nth-child(2) {
    grid-column: 1;
  }

  /* credits stack on mobile */
  .is-project .project-credits {
    grid-template-columns: 1fr;
    row-gap: 0.8rem;
  }

  .is-project .credits-label,
  .is-project .credits-a,
  .is-project .credits-b {
    grid-column: 1;
    text-align: left;
  }

  .is-project .project-nav {
    grid-template-columns: 1fr;
    padding-bottom: var(--page-bottom);
  }

  .is-project .project-next {
    grid-column: 1;
  }
}

/* ======================
   MOBILE BLOCK (ONLY on phone)
====================== */

/* Desktop/tablet: hide the message */
.mobile-block {
  display: none;
}

/* Mobile: hide site, show message */
@media (max-width: 900px) {
  .layout {
    display: none;
  }

  .mobile-block {
    display: flex;
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 999999;

    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
  }

  .mobile-block p {
    font-size: 1.2rem;
    line-height: 1.4;
    font-family: "Poppins", sans-serif;
    opacity: 0.9;
  }
}
