/* ========= Reset léger ========= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

@font-face {
  font-family: "Hershey Futura Simplex";
  src: url("../fonts/Hershey-Noailles-Futura-Simplex-Regular.otf")
    format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Hershey OldFrench";
  src: url("../fonts/Hershey-Noailles-OldFrench-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

html,
body {
  height: 100%;
}
html,
body,
h1,
h2,
h3,
p,
figure {
  margin: 0;
}
img,
video {
  max-width: 100%;
  display: block;
}

/* ========= Variables + base ========= */
:root {
  --gap: 24px;
  --bg: #e9e9e9;
  --fg: #111;
  --muted: #777;
  --header-h: 74px;
  --overlay-offset-top: var(--header-h);
}

body {
  font-family:
    ui-sans-serif,
    -apple-system,
    Segoe UI,
    Roboto,
    Helvetica,
    Arial;
  line-height: 1.35;
  color: var(--fg);
  background: var(--bg);
  overflow: hidden; /* colonnes à scroll parallèles */
}

/* ========= Header fixed (4 colonnes) ========= */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  z-index: 50;
  mix-blend-mode: difference;
  color: #fff;
  background: transparent;
  pointer-events: none; /* on remet les events à l’intérieur */
}

/* grille du header : 4 colonnes PACKÉES au contenu */
.header-grid {
  height: 100%;
  display: grid;
  /* brand / catégories / contact / logo */
  grid-template-columns: max-content max-content max-content 40px;
  align-items: center;
  background: transparent;
  column-gap: 36px;
  row-gap: 0;
  padding: 16px 16px;
  pointer-events: auto;
  font-family: "Hershey Futura Simplex", system-ui, sans-serif;
  font-size: 24px;
  line-height: 1;
}

.h-left {
  display: grid;
  align-content: center;
  justify-items: start;
  row-gap: 2px;
  margin-right: 26px;
}
.brand-line {
  font-size: 24px;
  line-height: 1;
}

.h-cats {
  display: grid;
  justify-items: end;
  text-align: right;
  row-gap: 2px;
  color: rgba(255, 255, 255, 0.4) !important;
}
.h-cats a {
  color: inherit;
  text-decoration: none;
}
.h-cats span {
  opacity: 0.5;
  margin: 0 0.35em;
}

.h-cats a.filter.is-active {
  opacity: 1;
}
.h-cats a.filter {
  opacity: 0.7;
}

.h-contact {
  justify-self: start;
  margin-bottom: 30px;
}
.h-contact a {
  color: inherit;
  text-decoration: none;
}

/* ===== LOGO FIXE EN HAUT À DROITE ===== */
.h-logo {
  position: fixed;
  top: 8.5px; /* même marge que le header */
  right: 12px; /* distance depuis le bord droit */
  z-index: 80; /* au-dessus du contenu */
  mix-blend-mode: difference;
}

.h-logo img {
  display: block;
  width: 68px; /* taille confortable */
  height: 68px;
  object-fit: contain;
}

/* ========= Colonnes à scroll indépendants (0 marge) ========= */
.columns {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  height: 100vh;
  padding: 0;
}

.column {
  overflow-y: auto;
  padding: calc(var(--overlay-offset-top) + 10px) 0 80px 0;
  scrollbar-gutter: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.column::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
}
.column::-webkit-scrollbar-thumb {
  background: transparent;
}

/* ========= Projet & slider ========= */
.project {
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
}

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

.project-title {
  font-size: 16px;
  letter-spacing: 0.2px;
}

.slider {
  position: relative;
  width: 100%;
  min-height: 240px;
}
.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: none;
  pointer-events: none;
}
.slide.is-active {
  position: relative;
  opacity: 1;
  pointer-events: auto;
}
.slide img,
.slide video {
  width: 100%;
  height: auto;
}

/* ========= Meta sous le slider (2 colonnes) ========= */
.project-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: baseline;
  padding: 0 8px;
}

.site-header,
.project-meta .caption {
  font-family: "Hershey Futura Simplex", system-ui, sans-serif;
}
.project-meta .description {
  font-family: "Hershey OldFrench", serif;
}

.left .project .project-meta {
  grid-template-columns: 1fr 2fr;
}
.right .project .project-meta {
  grid-template-columns: 1fr 2fr;
  column-gap: 16px;
}

.left .project .project-meta .caption,
.right .project .project-meta .caption {
  grid-column: 1;
  text-align: left;
  justify-self: start;
}
.left .project .project-meta .description,
.right .project .project-meta .description {
  grid-column: 2;
  text-align: left;
  justify-self: start;
}

.project-meta .caption {
  font-size: 18px;
  line-height: 1;
  color: var(--muted);
}
.project-meta .description {
  font-size: 22px;
  line-height: 1;
  letter-spacing: 1px;
  color: var(--fg);
  opacity: 0.95;
}

/* ===== INDEX button ===== */
.index-toggle {
  position: fixed;
  left: 16px;
  right: auto;
  bottom: 16px;
  z-index: 60;
  mix-blend-mode: difference;
  color: #fff;
  background: transparent;
  border: 0px solid currentColor;
  padding: 0px 0px;
  font-family: "Hershey Futura Simplex";
  font-size: 1.5em;
  letter-spacing: 0.04em;
  cursor: pointer;
  opacity: 0.95;
  transition: opacity 0.2s ease;
}
.index-toggle:hover {
  opacity: 0.55;
}

/* ===== Overlay INDEX ===== */
.index-overlay {
  position: fixed;
  margin-top: 10px;
  inset: var(--overlay-offset-top) 0 0 0;
  z-index: 70;
  background: #000;
  color: #929292;
  display: none;
  grid-template-rows: 1fr auto;
  padding-top: 0;
}
.index-overlay[aria-hidden="false"] {
  display: grid;
}

.index-overlay[aria-hidden="false"] ~ .index-toggle,
.index-overlay[aria-hidden="false"] + .index-toggle {
  display: none;
}
/* ===== Croix de fermeture (INDEX + CONTACT) ===== */
.index-close,
.contact-close {
  position: absolute;
  top: 8px;
  right: 16px;
  width: 80px;
  height: 80px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  line-height: 0;
  z-index: 2;
}

.index-close img,
.contact-close img {
  width: 100%;
  height: 100%;
  display: block;
}

/* ===== Liste INDEX ===== */
.index-list {
  overflow-y: auto;
  padding: 16px 24px 24px;
}
.index-row {
  display: block;
  padding: 10px 0;
  line-height: 1.05;
  transition: opacity 0.2s ease;
}

.index-row .i-title {
  display: inline;
  font-family: "Hershey Futura Simplex", serif;
  font-size: 3em;
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: 0.5px;
}

.index-row .i-legend {
  display: inline;
  margin-left: 10px;
  vertical-align: baseline;
  font-family: "Hershey Futura Simplex", system-ui, sans-serif;
  font-size: 1.3em;
  color: #929292;
  white-space: normal;
}

/* ===== Slider INDEX (défilement fluide CSS only) ===== */
.index-slider {
  position: relative;
  overflow: hidden;
  --marquee-duration: 30s;
}

.index-slider .i-rail {
  display: flex;
  width: max-content;
  will-change: transform;
  animation: marquee var(--marquee-duration) linear infinite;
}

.index-slider:hover .i-rail {
  animation-play-state: paused;
}

.index-slider .i-seq {
  display: flex;
  align-items: center;
  gap: 0px;
  padding: 12px 0px;
}

/* carte = simple conteneur flex, hauteur auto */
.index-slider .i-card {
  width: 260px; /* largeur maxi de chaque vignette */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
}

/* toutes les images ont la même HAUTEUR,
   mais on ne coupe jamais (object-fit: contain) */
.index-slider .i-card img {
  height: 150px; /* hauteur uniforme */
  width: auto;
  max-width: 100%;
  object-fit: contain; /* pas de crop */
  display: block;
}
.index-slider figcaption {
  display: none;
}
.index-slider .i-card-title {
  font-weight: 600;
}

.index-row:hover,
.index-slider .i-card:hover {
  opacity: 0.7;
}

/* Quand l'index est ouvert, on met un fond gris uniquement sous le header */
body.index-open::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 85px; /* même hauteur que le header */
  background: #e9e9e9; /* le gris que tu veux */
  z-index: 40; /* < header (50), > contenu (0) */
  pointer-events: none; /* pour ne pas bloquer les clics */
}
/* ===== Panneau CONTACT ===== */
.h-contact-btn {
  color: inherit;
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.contact-panel {
  position: fixed;
  inset: var(--overlay-offset-top) 0 0 auto;
  margin-top: 10px;
  width: 50vw;
  right: 0;
  z-index: 70;
  background: #000;
  color: #e5e5e5;
  transform: translateX(100%);
  will-change: transform;
  pointer-events: none;
}
.contact-panel[aria-hidden="false"] {
  transform: translateX(0);
  pointer-events: auto;
}

.contact-content {
  padding: 24px 28px 32px;
}

.contact-title {
  font-family: "Hershey Futura Simplex";
  font-size: 3em;
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  color: #929292;
}
.contact-content p {
  font-family: "Hershey Futura Simplex", system-ui, sans-serif;
  font-size: 3em;
  line-height: 0.9;
  margin: 10px 0 0;
  color: #929292;
}
.contact-content a {
  color: inherit;
  text-decoration: none;
}
.contact-content a:hover {
  color: rgba(229, 229, 229, 0.86);
}

.contact-panel[aria-hidden="false"] ~ .index-toggle {
  display: none;
}

/* ===== Animation ===== */
@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .index-slider .i-rail {
    animation: none;
    transform: translateX(0);
  }
}

/* =========================
   MOBILE (<= 820px)
   ========================= */
@media (max-width: 820px) {
  :root {
    /* header un peu plus haut sur iOS */
    --header-h: 90px;
    --overlay-offset-top: var(--header-h);
  }

  /* Masquer la scrollbar sur mobile (iOS + Android + Chrome) */
  html,
  body,
  .column,
  .index-list {
    -ms-overflow-style: none; /* IE / Edge */
    scrollbar-width: none; /* Firefox */
  }

  html::-webkit-scrollbar,
  body::-webkit-scrollbar,
  .column::-webkit-scrollbar,
  .index-list::-webkit-scrollbar {
    display: none; /* Chrome / Safari */
  }
  /* 1) Page scrollable (pas de colonnes parallèles) */
  body {
    overflow: auto;
  }

  /* 2) Header : seulement le nom + sous-titre + logo à droite */
  .header-grid {
    grid-template-columns: 1fr 68px; /* texte à gauche, logo à droite */
    column-gap: 12px;
  }
  .h-cats {
    display: none;
  } /* on cache les filtres */
  .h-contact {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 90;
    display: block; /* annule un éventuel display:none; */
    margin: 0; /* pas de marge parasite */
    pointer-events: auto;
  }

  /* Logo fixe en haut-droite (déjà fixé, on ajuste un peu) */
  .h-logo {
    top: 8px;
    right: 12px;
  }
  .h-logo img {
    width: 64px;
    height: 64px;
  }

  .slider {
    min-height: 0;
  }

  /* Close icon plus petit en mobile */
  .index-close,
  .contact-close {
    width: 44px;
    height: 44px;
    top: 4px;
    right: 8px;
  }

  /* 3) Grille projets → une seule colonne + scroll normal */
  .columns {
    display: block; /* plus de 2 colonnes */
    height: auto;
    padding: 0;
  }

  /* par défaut : aucun padding */
  .column {
    overflow: visible;
    padding: 0;
  }

  /* espace sous le header UNIQUEMENT pour la 1re colonne */
  .column:first-of-type {
    padding-top: calc(var(--header-h) + 8px);
  }

  /* marge en bas UNIQUEMENT pour la dernière colonne
     (pour que Index/Contact ne collent pas le dernier projet) */
  .column:last-of-type {
    padding-bottom: 96px;
  }

  /* 4) Boutons fixes en bas : Index (gauche) et Contact (droite) */
  .index-toggle {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 90;
    font-size: 1.4rem;
  }

  /* On réutilise le même bouton #contact-toggle, mais on le place en bas à droite */
  #contact-toggle.h-contact-btn {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 90;
    mix-blend-mode: difference;
    color: #fff;
    background: transparent;
    border: 0;
    padding: 0;
    font-family: "Hershey Futura Simplex";
    font-size: 1.4rem;
    letter-spacing: 0.04em;
    cursor: pointer;
  }

  /* 5) Panneau CONTACT : plein écran (sous le header) et collé en bas.
        Pas d'animation : juste un translateY sans transition. */
  .contact-panel {
    top: 30vh;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    margin-top: 0;
    transform: translateY(100%); /* caché en bas */
    pointer-events: none;
    overflow: hidden; /* le contenu scrolle, pas l’arrière-plan */
  }
  .contact-panel[aria-hidden="false"] {
    transform: translateY(0); /* visible */
    pointer-events: auto;
  }
  .contact-content {
    height: 100%;
    overflow-y: auto; /* scroll interne si le texte est long */
    padding: 20px 24px 28px;
  }
  .contact-title,
  .contact-content p {
    font-size: 2.2rem; /* taille confortable en mobile */
    line-height: 1.05;
  }

  /* 6) Overlay INDEX : plein écran (déjà OK) + légende sous le titre */
  .index-overlay {
    inset: var(--header-h) 0 0 0; /* occupe tout l’écran sous le header */
    margin-top: -5px; /* ← annule les 10px sur mobile */
  }
  .index-list {
    padding: 16px 18px 20px;
  }
  .index-row .i-title {
    display: block; /* titre sur sa ligne */
    font-size: 2.4rem;
    line-height: 1;
  }
  .index-row .i-legend {
    display: block; /* légende en dessous */
    margin: 8px 0 0 0;
    font-size: 1.2rem;
  }
  .index-slider {
    /* height: 100px; */
  } /* bandeau d’images un peu plus compact */

  /* 7) Petites retouches typographiques des métas projets */
  .project-meta {
    grid-template-columns: 1fr 1fr; /* tu peux passer à 1fr si tu veux tout empiler */
    gap: 12px;
    padding: 0 6px;
  }
  .project-meta .caption {
    font-size: 16px;
  }
  .project-meta .description {
    font-size: 18px;
  }
}

/* --- Blur-up images --- */
.blur-up {
  filter: blur(8px);
  transform: scale(1.02);
  transition:
    filter 0.35s ease,
    transform 0.35s ease,
    opacity 0.2s;
  will-change: filter, transform;
}
.blur-up.is-loaded {
  filter: blur(0);
  transform: none;
}

/* --- Vidéos : squelette jusqu'au "can play" --- */
.lazy-video {
  width: 100%;
  height: auto;
  background: #111; /* squelette sobre */
  min-height: 240px; /* garde la place du média */
}
.lazy-video.has-poster {
  background-size: cover;
  background-position: center;
}
.lazy-video.is-loaded {
  background: transparent;
}
