/* ---------------------------------------------------
   De Bon Air — feuille de style
   Palette et échelle typographique volontairement
   restreintes : le travail (les images) porte la couleur.
--------------------------------------------------- */

:root {
  --bg: #faf9f6;
  --fg: #17160f13;      /* overridden below with real value */
  --fg: #1a1812;
  --muted: #726d61;
  --line: #e4e1d8;
  --media-bg: #eae7de;

  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --title-font: 'Rowan', var(--serif);

  --nav-h: 100px;
  --edge: clamp(20px, 5vw, 56px);
  --gallery-edge: clamp(40px, 12vw, 160px);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

ul { margin: 0; padding: 0; list-style: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- Écran d'ouverture ---------- */

.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #0a0908;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.6s ease;
}

.intro-overlay.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.intro-overlay-gif {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- Nav ---------- */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  background: transparent;
}

.nav::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.35), rgba(0,0,0,0));
  pointer-events: none;
  z-index: -1;
}

.nav-inner {
  height: 100%;
  padding: 6px var(--edge) 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.logo {
  position: relative;
  display: block;
  height: 64px;
}

.logo-img {
  height: 64px;
  width: auto;
  display: block;
  margin-top: 10px;
  transition: opacity 0.35s ease;
}

.logo-img--dark {
  display: none;
}

.nav-links {
  display: flex;
  gap: 2.2rem;
  font-size: 0.92rem;
  color: #fff;
  padding-top: 2px;
}

.nav-links a {
  position: relative;
  padding-bottom: 2px;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.nav-links a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-toggle {
  display: none;
  width: 32px; height: 22px;
  border: none; background: none;
  position: relative;
  cursor: pointer;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: #fff;
}
.nav-toggle span { top: 50%; }
.nav-toggle span::before { top: -7px; }
.nav-toggle span::after { top: 7px; }

/* ---------- Feed ---------- */

.feed {
  display: flex;
  flex-direction: column;
}

.project {
  padding-bottom: 0;
  margin-bottom: 0;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.project.in-view {
  opacity: 1;
  transform: translateY(0);
}

.project:last-child {
  border-bottom: none;
}

.project-media {
  width: 100%;
  height: 88vh;
  overflow: hidden;
  background: var(--media-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.project-media img,
.project-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Placeholder shown until a real image/video is supplied */
.project-media.is-placeholder {
  height: auto;
  aspect-ratio: 16 / 10;
  max-height: 70vh;
}

.placeholder-label {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  padding: 0 1.5rem;
}

.project-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.6rem var(--edge) 1.8rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem 2rem;
  color: #fff;
  pointer-events: none;
}

.project-overlay.theme-dark {
  color: #17160f;
}

.project-title {
  font-family: var(--title-font);
  font-style: normal;
  font-weight: 400;
  font-size: clamp(1.8rem, 3.6vw, 3.1rem);
  margin: 0;
  color: inherit;
}

.project-tags {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.74rem;
  color: inherit;
  opacity: 0.8;
  min-width: 140px;
}

/* ---------- About / Studio ---------- */

.about,
.studio {
  padding: 9vh var(--edge);
  max-width: 640px;
  border-top: 1px solid var(--line);
}

.about p,
.studio p {
  font-size: 1.05rem;
  color: var(--fg);
  margin: 0 0 1.2em;
}

.about p:last-child,
.studio p:last-child {
  margin-bottom: 0;
}

.studio-contact-link {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--fg);
  padding-bottom: 2px;
  transition: opacity 0.2s ease;
}

.studio-contact-link:hover {
  opacity: 0.6;
}

/* ---------- Crédits (agences / clients) ---------- */

.credits {
  padding: 7vh var(--edge);
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem 4rem;
}

.credits-label {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  min-width: 140px;
  flex-shrink: 0;
}

.credits-columns {
  display: flex;
  flex-wrap: wrap;
  flex: 1;
  justify-content: space-between;
  gap: 3rem 8vw;
}

.credits-column {
  min-width: 160px;
}

.credits-category {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 0.6rem;
}

.credits-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-family: var(--sans);
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--fg);
}

/* ---------- Footer ---------- */

.footer {
  padding: 7vh var(--edge) 5vh;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.footer-col a:hover {
  color: var(--fg);
}

.footer-copy {
  align-items: flex-end;
  text-align: right;
}

/* ---------- Visuels supplémentaires (dépli sous l'image principale) ---------- */

.project-media.is-expandable {
  cursor: pointer;
  position: relative;
}

.project-extra {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.5s ease;
}

.project-extra-inner {
  display: flex;
  flex-direction: column;
  gap: var(--gallery-edge);
  padding-top: 28px;
}

.project-extra-inner img,
.project-extra-inner video {
  display: block;
}

.project-carousel {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: grab;
  user-select: none;
}

.project-carousel::-webkit-scrollbar {
  display: none;
}

.project-carousel.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

.project-carousel-cell {
  flex: 0 0 auto;
  height: 88vh;
  scroll-snap-align: start;
}

.project-carousel-cell:first-child {
  margin-left: var(--gallery-edge);
}

.project-carousel-cell:last-child {
  margin-right: var(--gallery-edge);
}

.project-carousel-cell img,
.project-carousel-cell video {
  height: 100%;
  width: auto;
  display: block;
  object-fit: cover;
}

.project-description {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--fg);
  max-width: 680px;
  padding: 0 var(--gallery-edge);
  margin: 0;
  text-align: left;
}

.project-description-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.project-description-link:hover {
  opacity: 0.7;
}

.project-caption {
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  padding: 0 var(--gallery-edge);
  margin: 0 0 calc(-1 * var(--gallery-edge) + 12px);
}

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
  :root {
    --gallery-edge: 20px;
  }

  /* Le gif d'ouverture est au format paysage : en plein cadre (cover)
     sur un écran de mobile, très vertical, ça coupe trop. On préfère
     l'afficher en entier, centré sur le fond noir. */
  .intro-overlay-gif {
    width: 90vw;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
  }

  .logo,
  .logo-img {
    height: 44px;
  }
  .logo-img {
    margin-top: 6px;
  }

  /* Toutes les cellules du carrousel gardent la même hauteur sur mobile,
     qu'elles soient "full frame" ou calées sur la hauteur par défaut,
     pour que l'alignement reste propre d'une image à l'autre. */
  .project-carousel-cell {
    height: 66vh;
  }

  /* Par défaut, les images du carrousel restent calées sur la hauteur
     (comme sur desktop) : la largeur suit librement le ratio de l'image,
     rien n'est recadré. Pour certaines images (marquées `fullFrame: true`
     dans script.js), on préfère au contraire qu'elles remplissent tout
     l'écran en largeur, quitte à recadrer (object-fit: cover). */
  .project-carousel-cell.is-full-frame {
    flex: 0 0 100vw;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .project-carousel-cell.is-full-frame img,
  .project-carousel-cell.is-full-frame video {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .nav-links {
    gap: 0.9rem;
    font-size: 0.68rem;
    letter-spacing: 0.01em;
    white-space: nowrap;
  }

  .nav-toggle { display: none; }

  .project-tags {
    display: none;
  }

  .project-overlay {
    flex-direction: column;
    align-items: flex-start;
    padding-top: 2.5rem;
  }

  .footer {
    flex-direction: column;
  }
  .footer-copy {
    align-items: flex-start;
    text-align: left;
  }
}
