@font-face {
  font-family: "BBBBaskervvol";
  src: url("../medias/types/BBBBaskervvol/BBBBaskervvol-Regular.woff")
    format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "BBBBaskervvol";
  src: url("../medias/types/BBBBaskervvol/BBBBaskervvol-Italic.woff")
    format("woff");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "BBBDMSans-Regular";
  src: url("../medias/types/BBBDMSans-Regular.woff")
    format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DuctusMonoRegular";
  src: url("../medias/types/DuctusMonoRegular.woff")
    format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}


/* ========================================================== BASE */

:root {
  --color-red: #ad0b31;
  --color-pink: #e46398;
  --color-white: #ffffff;
  --color-black: #000000;
  --color-light-grey: #f3f3f3;
  --color-muted: #c8c8c8;

  --page-padding: 30px;
  --left-width: 550px;

  --font-body: "BBBDMSans-Regular", sans-serif;
  --font-title: "DuctusMonoRegular", sans-serif;
  --font-serif: "BBBBaskervvol", serif;

  /* Courbe d'animation commune : démarre vite, termine en douceur */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: row;

  width: 100%;
  min-height: 100vh;
  margin: 0;

  color: var(--color-black);
  background: var(--color-white);

  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;

  /* Les polices n'ont qu'une graisse (Regular) : on interdit le faux gras
     du navigateur (flou) ; le gras est simulé par -webkit-text-stroke. */
  font-synthesis: style;
}

strong,
b {
  font-weight: inherit;
  -webkit-text-stroke: 0.05em;
}

img,
video {
  max-width: 100%;
}

button {
  font: inherit;
}

a {
  color: inherit;
  font-family: var(--font-serif);
  font-size: 18px;
  font-style: italic;
  font-weight: inherit;
  line-height: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--color-black);
  font-style: normal;
  text-decoration: none;
  -webkit-text-stroke: 0.05em;
}

.visually-hidden {
  position: absolute;

  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;

  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ========================================================== TITRES */

h1 {
  position: fixed;
  top: 15px;
  left: var(--page-padding);
  z-index: 1101;

  margin: 0;
  padding: 0;

  color: var(--color-red);

  font-family: var(--font-title);
  font-size: 36px;
  font-weight: 400;
  line-height: 1.6;

  cursor: pointer;
  transition: color 0.25s ease;
}

h1::before {
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1;

  width: min(540px, 100vw);
  height: 65px;

  background: var(--color-white);
  content: "";
  pointer-events: none;
}

h1:hover {
  font-style: italic;
  -webkit-text-stroke: 0.025em;
}

/* Le bouton est dans le h1 : il hérite de toute sa typographie
   et reste accessible au clavier. */
#homeButton {
  margin: 0;
  padding: 0;

  border: 0;
  background: transparent;

  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;

  cursor: pointer;
}

#homeButton:focus-visible {
  outline: 2px solid var(--color-pink);
  outline-offset: 4px;
}

.site-header .introduction {
  position: fixed;
  top: 50px;
  left: var(--page-padding);
  z-index: 100;

  width: min(490px, calc(var(--left-width) - 60px));
  margin: 0;
  /* Le haut remplace l'ancien <br> du HTML */
  padding: 36px 0 60px;

  background: linear-gradient(
    to bottom,
    #ffffff 0%,
    #ffffff 75%,
    rgba(255, 255, 255, 0.9) 85%,
    rgba(255, 255, 255, 0) 100%
  );
}

.no-wrap {
  white-space: nowrap;
}


/* ========================================================== FILTRE */

.filter-word {
  margin: 0;
  padding: 0;

  border: 0;
  background: transparent;

  color: var(--color-black);

  font-family: var(--font-body);
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  -webkit-text-stroke: 0.05em;

  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;

  cursor: pointer;
  transition: color 0.25s ease;
}

.filter-word:hover {
  color: var(--color-pink) !important;
  text-underline-offset: 3px;
}

.filter-word:not(.is-red) {
  color: var(--color-muted);
}

.filter-word.is-active {
  color: var(--color-pink);
  text-underline-offset: 3px;
}


/* ========================================================== COLONNES */

.left {
  position: relative;

  width: var(--left-width);
  height: 100vh;
  flex: 0 0 var(--left-width);

  overflow-y: auto;
  overscroll-behavior: contain;

  /* Même marge latérale que le titre et l'introduction (fixes) */
  padding: 2rem var(--page-padding);
}

.right {
  position: relative;

  min-width: 0;
  height: 100vh;
  flex: 1;

  overflow: hidden;

  background: linear-gradient(
    90deg,
    var(--color-white),
    var(--color-pink)
  );
}


/* ========================================================== PROJETS liste */

.projects {
  position: relative;
  z-index: 1;

  margin-top: 260px;
}

.project-list {
  margin: 1.5rem 0 0;
  padding: 0;

  list-style: none;
}

.project-list li {
  margin: 0;
  padding: 0;

  /* Se rejoue au chargement et à chaque fois qu'un filtre réaffiche l'élément */
  animation: list-in 0.55s var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 35ms);
}

@keyframes list-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.project-list li.is-hidden {
  display: none;
}

.project-item {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;

  width: 100%;
  padding: 7px 0;

  border: 0;
  background: transparent;

  color: var(--color-black);

  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  text-align: left;

  cursor: pointer;
}

.project-item .title {
  transition: transform 0.35s var(--ease-out);
}

.project-item:hover .title,
.project-item.is-open .title {
  transform: translateX(6px);
}

.project-item .date {
  flex: 0 0 3.5rem;

  color: var(--color-black);
  font-family: var(--font-body);
  font-size: 16px;
}

.project-item:hover,
.project-item.is-open {
  color: var(--color-black);
  font-family: var(--font-title);
}

.project-item.is-open {
  -webkit-text-stroke: 0.07em;
}

.project-item:focus-visible,
.filter-word:focus-visible,
.info-close:focus-visible {
  outline: 2px solid var(--color-pink);
  outline-offset: 4px;
}


/* ========================================================== PROJETS textes */

.project-text {
  /* Ouverture fluide : la hauteur passe de 0fr à 1fr, ce qui s'anime
     à la hauteur réelle du contenu (contrairement à max-height). */
  display: grid;
  grid-template-rows: 0fr;

  margin: 0;
  padding: 0;

  opacity: 0;
  visibility: hidden;

  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;

  transition:
    grid-template-rows 0.7s var(--ease-out),
    opacity 0.4s ease,
    padding 0.5s var(--ease-out),
    visibility 0s linear 0.7s;
}

.project-text.is-open {
  grid-template-rows: 1fr;
  padding: 5px 0 20px;

  opacity: 1;
  visibility: visible;

  transition:
    grid-template-rows 0.7s var(--ease-out),
    opacity 0.5s ease 0.1s,
    padding 0.5s var(--ease-out),
    visibility 0s;
}

.project-text-inner {
  min-height: 0;
  overflow: hidden;

  transform: translateY(10px);
  transition: transform 0.6s var(--ease-out);
}

.project-text.is-open .project-text-inner {
  transform: none;
}

.project-text h2 {
  position: static;

  margin: 0 0 18px;
  padding: 0;

  color: var(--color-black);

  font-family: var(--font-serif);
  font-size: 18px;
  font-style: italic;
  font-weight: 400;
  line-height: 1.4;
}

.project-text h3 {
  position: static;

  margin: 1.5em 0 0.5em;

  color: var(--color-red);

  font-family: var(--font-title);
  font-size: 16px;
}

.project-text p {
  margin: 0 0 1em;
  padding: 0;

  font-size: inherit;
}

.project-text ul,
.project-text ol {
  padding-left: 1.5em;
}

.project-text img,
.project-text video {
  display: block;

  width: 100%;
  max-width: 100%;
  height: auto;

  margin: 0 0 15px;
}

.project-text video {
  background: var(--color-black);
}

.project-text iframe {
  display: block;

  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;

  margin: 0 0 15px;
  border: 0;
}


/* ========================================================== GALERIE ET ÉLÉMENTS FLOTTANTS (ordinateur) */

/* Empilement (tout est sous la fenêtre d'infos, z-index 2000) :
   éléments flottants (1200) < galerie (1300) < prévisualisation (1400).

   - Le conteneur des éléments flottants est fixe et couvre TOUTE la page :
     les images se déplacent partout (colonne de gauche comprise) et passent
     au-dessus du texte, de l'introduction et du titre, pour ne jamais
     se retrouver cachées et impossibles à rattraper.
   - Dans la colonne de droite, la galerie est au-dessus : les images
     flottantes passent SOUS les images des projets.
   - La galerie ne capte pas la souris (pointer-events: none) ; seuls ses
     médias la captent, ce qui permet de scroller en les survolant. */

.floating-elements {
  position: fixed;
  inset: 0;
  z-index: 1200;

  overflow: hidden;
  pointer-events: none;
}

.gallery {
  position: absolute;
  inset: 0;
  z-index: 1300;

  overflow-y: auto;
  overscroll-behavior: contain;

  pointer-events: none;
}

.gallery img,
.gallery video,
.gallery iframe {
  pointer-events: auto;
}

/* Écran tactile : la galerie capte les touchers pour pouvoir être scrollée
   au doigt (les images flottantes restent déplaçables hors de la galerie). */
@media (pointer: coarse) {
  .gallery {
    pointer-events: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Les médias apparaissent en cascade (--i défini en JS) */
.gallery > * {
  animation: media-in 0.9s var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 90ms);
}

@keyframes media-in {
  from {
    opacity: 0;
    transform: translateY(28px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* Images et vidéos collées, sur toute la largeur de la colonne */
.gallery img,
.gallery video {
  display: block;

  width: 100%;
  height: auto;

  margin: 0;
  padding: 0;
}

.gallery video {
  background: var(--color-black);
}

.gallery iframe {
  display: block;

  width: 100%;
  aspect-ratio: 16 / 9;

  border: 0;
}

.floating-element {
  position: absolute;
  display: block;

  /* La largeur est définie en JS ; la hauteur suit les proportions de l'image. */
  width: 150px;
  max-width: none;
  height: auto;

  cursor: grab;
  pointer-events: auto;
  touch-action: none;

  user-select: none;
  -webkit-user-drag: none;

  /* "scale" est une propriété à part : elle se combine avec la rotation
     appliquée en JS (transform). "backwards" = pas de blocage de l'état final,
     donc la transition de déplacement ci-dessous fonctionne ensuite. */
  animation: float-in 0.8s var(--ease-out) backwards;
  transition:
    scale 0.3s var(--ease-out),
    filter 0.3s ease;
}

@keyframes float-in {
  from {
    opacity: 0;
    scale: 0.6;
  }

  to {
    opacity: 1;
    scale: 1;
  }
}


.floating-element:active,
.floating-element.is-dragging {
  cursor: grabbing;
}

.preview {
  position: absolute;
  inset: 0;
  z-index: 1400;

  background: var(--color-white);

  opacity: 0;
  pointer-events: none;
}

.preview.is-visible {
  opacity: 1;
}

.preview img {
  position: absolute;
  inset: 0;

  display: none;

  width: 100%;
  height: 100%;

  object-fit: cover;
  object-position: center;
}

.preview img.is-current {
  display: block;
}


/* ========================================================== INFOS */

.info-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 30px;

  background: rgba(183, 0, 79, 0.72);

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.info-overlay.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.info-window {
  position: relative;


  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
  column-gap: 48px;

  width: min(100%, 1040px);
  max-height: 85vh;

  overflow-y: auto;

  padding: 100px 67px 70px;

  background: var(--color-light-grey);
  color: #111111;

  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.35;
}

.info-close {
  position: absolute;
  top: 22px;
  right: 25px;

  padding: 0;
  border: 0;
  background: transparent;

  color: var(--color-black);

  font-family: var(--font-title);
  font-size: 90px;
  font-weight: 400;
  font-style: italic;
  line-height: 0.5;

  cursor: pointer;
}

.info-close:hover {
  font-style: normal;
}

.info-left,
.info-right {
  min-width: 0;
}

.info-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;

  margin-bottom: 22px;

  line-height: 1.35;
}

.info-links a {
  max-width: 100%;

  overflow-wrap: anywhere;

  font-size: 20px;
}

.info-collectifs {
  margin-bottom: 18px;

  font-size: 16px;
  line-height: 1.2;
}

.info-collectifs p {
  margin: 0;
}

.info-photo img {
  display: block;

  width: 100%;
  height: auto;

  object-fit: cover;
}

.info-right p {
  margin: 0 0 20px;
}

.info-credits {
  position: static;

  margin-top: 10px;
  font-size: 11px;
  line-height: 1.25;
}


/* ========================================================== RESPONSIVE Tablette */

@media (max-width: 1100px) {
  body {
    display: block;

    width: 100%;
    min-height: 100vh;
  }

  .left {
    width: 100%;
    height: auto;
    min-height: 100vh;

    padding: 70px 25px 35px;

    overflow: visible;
  }

  .right {
    display: none;
  }

  /* Pas d'éléments flottants sur tablette et mobile */
  .floating-elements {
    display: none;
  }

  h1 {
    top: 15px;
    left: 25px;

    font-size: 24px;
  }

  h1::before {
    width: 100%;
    height: 60px;
  }

  .site-header .introduction {
    position: relative;
    top: auto;
    left: auto;

    width: 100%;
    margin: 0;
    padding: 30px 0 15px;

    background: none;
  }

  .projects {
    margin-top: 20px;
  }

  .project-list {
    margin-top: 15px;
  }

  .project-text.is-open {
    padding: 10px 0 25px;
  }

  /* Les médias apparaissent sous le texte du projet. */

  .project-text img,
  .project-text video,
  .project-text iframe {
    width: 100%;
    max-width: 100%;
    height: auto;

    margin: 20px 0;
  }

  .project-text iframe {
    aspect-ratio: 16 / 9;
  }

  /* Galerie horizontale (tablette et mobile) */

  .gallery-mobile {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 15px;

    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;

    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
    scroll-snap-type: x proximity;
  }

  .gallery-mobile img,
  .gallery-mobile video {
    display: block;

    scroll-snap-align: start;

    flex: 0 0 85%;
    width: 85%;
    max-width: 85%;
    height: auto;

    margin: 15px 0;
    object-fit: contain;
  }

  /* Fenêtre d'informations sur tablette */

  .info-overlay {
    padding: 20px;
  }

  .info-window {
    column-gap: 30px;

    width: 100%;
    max-height: 90vh;

    padding: 85px 35px 65px;
  }

  .info-links a {
    font-size: 18px;
  }
}


/* ========================================================== RESPONSIVE Mobile */

@media (max-width: 700px) {
  .info-overlay {
    padding: 12px;
  }

  .info-window {
    display: flex;
    flex-direction: column;
    gap: 25px;

    width: 100%;
    max-height: 90vh;

    padding: 60px 22px 100px;

    font-size: 15px;
  }

  .info-close {
    top: 17px;
    right: 18px;
    font-size: 40px;
  }

  .info-left {
    display: flex;
    flex-direction: column;
  }

  .info-photo {
    max-width: 360px;
  }

  .info-links a,
  .info-collectifs {
    font-size: 17px;
  }

  .info-right p {
    margin-bottom: 16px;
  }

  .info-credits {
    margin-top: 10px;
    font-size: 9px;
    line-height: 1.25;
  }
}


/* ========================================================== ACCESSIBILITÉ : mouvement réduit */

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


/* Utilisation de l'IA */