:root {
  --bg: #0f1724;
  --card: #0b1220;
  --accent: #9be7ff;
  --muted: #9aa4b2;
  --font-sans: 'Inter', system-ui, Arial, sans-serif;

  /* Variables pour l'animation (adaptées de l'exemple) */
  --color: #e6eef6;
  /* --c1: #fbda61;
  --c2: #ff5acd;
  --c3: #2563eb; */
  --c1: #bfbfbf; /* gris clair */
  --c2: #808080; /* gris moyen */
  --c3: #404040; /* gris foncé */
  --gradient: linear-gradient(
    60deg,
    var(--c3),
    var(--c2),
    var(--c1),
    var(--c2),
    var(--c3),
    var(--c2),
    var(--c1),
    var(--c2),
    var(--c3)
  );
  --scale-start: 0.8;
  --scale-end: 1;
  --ease-elastic: linear(
    0, 0.186 2.1%, 0.778 7.2%, 1.027 9.7%, 1.133, 1.212, 1.264, 1.292 15.4%,
    1.296, 1.294, 1.285, 1.269 18.9%, 1.219 20.9%, 1.062 25.8%, 0.995 28.3%,
    0.944 31.1%, 0.93, 0.921, 0.92 35.7%, 0.926, 0.94 39.7%, 1.001 47%, 1.014,
    1.021 52.4%, 1.02 56.4%, 1 65.5%, 0.994 70.7%, 1.001 88.4%, 1
  );
  --ease-bounce-out: cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (prefers-reduced-motion) {
  :root {
    --ease-elastic: ease-out;
    --ease-bounce-out: ease-out;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  background-color: transparent; /* Rend le body transparent */
  color: #e6eef6;
  font-family: var(--font-sans);
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  scroll-snap-type: none;
}

.site-header {
  padding: 3rem 4rem;
  text-align: center;
  background: transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  border-radius: 0 0 16px 16px;
  position: relative; /* Assurez un contexte d'empilement pour le header */
  z-index: 2; /* S'assure qu'il est au-dessus du SVG */
}

@keyframes text-gradient {
  0% {
    background-position: 0% center;
  }
  100% {
    background-position: 100% center;
  }
}

.site-header h1 {
  margin: 0 0 0.3rem 0;
  font-weight: 800;
  font-size: 3.2rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  background-image: var(--gradient);
  background-size: 300% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: text-gradient 5s linear infinite;
  animation-fill-mode: forwards;
}

.site-header p {
  margin: 0;
  font-weight: 500;
  font-size: 1.25rem;
  font-style: italic;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.about {
  max-width: 700px;
  margin: 4rem auto;
  padding: 0 1.5rem;
  font-size: 1.4rem;
  text-align: center;
  color: var(--muted);
  line-height: 1.6;
  letter-spacing: 0.05em;
  background: transparent;
  position: relative; /* Assure un contexte d'empilement pour la section About */
  z-index: 1; /* S'assure qu'elle est au-dessus du SVG */
}

.about h3 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background-image: var(--gradient);
  background-size: 300% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: text-gradient 5s linear infinite;
  animation-fill-mode: forwards;
}


/* Styles pour la première galerie (toujours visible au chargement) */
.gallery:first-of-type {
  opacity: 1;
  transform: translateY(0) scale(var(--scale-end));
  transition: none; /* Désactiver l'animation de chargement */
}

/* Styles pour les autres galeries (animées au scroll) */
.gallery {
  max-width: 1200px;
  margin: 3rem auto 5rem auto;
  padding: 0 1.5rem;
  background: transparent;
  opacity: 0;
  transform: translateY(30px) scale(var(--scale-start));
  transition: opacity 0.6s var(--ease-bounce-out), transform 0.6s var(--ease-bounce-out);
  position: relative; /* Assure un contexte d'empilement pour les galeries */
  z-index: 1; /* S'assure qu'elles sont au-dessus du SVG */
}

.gallery.visible {
  opacity: 1;
  transform: translateY(0) scale(var(--scale-end));
}

/* Styles pour tous les textes de galerie */
/*
* Styles pour tous les textes de galerie
* Applique les animations de manière cohérente à tous les éléments
*/
.gallery-text {
    /* Styles de base */
    background: transparent;
    color: var(--muted);
    margin-inline: auto;
    padding-block: 0.2em;
    max-inline-size: 15ch;
    text-wrap: balance;
    font-size: 2rem;
    font-weight: 700;
    text-align: center;

    /* Applique le dégradé en continu pour tous les textes */
    background-image: var(--gradient);
    background-size: 300% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: text-gradient 5s linear infinite;

    /* Configuration de l'animation d'apparition au scroll */
    opacity: 0;
    transform: scale(var(--scale-start));
    transition: opacity 2s var(--ease-bounce-out), transform 2s var(--ease-bounce-out);
}

/*
* Règle de surcharge pour le premier texte
* Le texte de la première galerie doit être visible dès le chargement
*/
.gallery:first-of-type .gallery-text {
    opacity: 1;
    transform: scale(var(--scale-end));
    /* transition: none; /* Désactive la transition pour le premier élément */ */
}

/*
* Règle pour les textes qui apparaissent au scroll
* Applique l'état final de l'animation lorsque l'élément est visible
*/
.gallery.visible .gallery-text {
    opacity: 1;
    transform: scale(var(--scale-end));
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease;
  background: var(--card);
}

.item:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 20px var(--accent);
}

.item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.7s cubic-bezier(.16, .84, .52, 1), filter 0.5s ease;
  border-radius: 16px;
}

.item:hover img {
  transform: scale(1.1);
  filter: brightness(1.1) saturate(1.1);
}

/* Lightbox styles */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000; /* Valeur très élevée pour qu'elle soit toujours au-dessus */
  flex-direction: column;
  user-select: none;
}

.lightbox.hidden {
  display: none;
}

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 12px;
  box-shadow: 0 0 30px var(--accent);
  transition: opacity 0.3s ease;
}

.close,
.nav {
  position: fixed;
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 3rem;
  cursor: pointer;
  user-select: none;
  transition: color 0.3s ease;
  padding: 0 1rem;
  line-height: 1;
}

.close {
  top: 1.5rem;
  right: 2rem;
}

.close:hover,
.nav:hover {
  color: white;
}

.nav.left {
  top: 50%;
  left: 2rem;
  transform: translateY(-50%);
}

.nav.right {
  top: 50%;
  right: 2rem;
  transform: translateY(-50%);
}

.fixed-logo {
  position: fixed;
  top: 10px;
  left: 10px;
  width: 100px;
  height: auto;
  z-index: 1001; /* Doit être au-dessus de la lightbox et de tout */
}

.wip {
  position: fixed;
  top: 115px;
  left: 25px;
  width: 100px;
  height: auto;
  z-index: 1001; /* Doit être au-dessus de la lightbox et de tout */
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: translateY(30px) scale(var(--scale-start));
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(var(--scale-end));
  }
}

@keyframes pop {
  from {
    scale: var(--scale-start);
    opacity: 0;
  }
  to {
    scale: var(--scale-end);
    opacity: 1;
  }
}

@keyframes text-gradient {
  100% {
    background-position: 150% center;
  }
}

@media (max-width: 640px) {
  .site-header {
    padding: 2rem 2rem;
  }
  .site-header h1 {
    font-size: 2.4rem;
  }
  .site-header p {
    font-size: 1rem;
  }
  .about {
    font-size: 1.1rem;
  }
  .grid {
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
  .close,
  .nav {
    font-size: 2.5rem;
  }
}

/* Bouton retour en haut */
.back-to-top {
  position: fixed;
  bottom: 40px;
  right: 40px;
  z-index: 3; /* Doit être au-dessus des sections de contenu */

  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  cursor: pointer;

  transition: background 0.2s ease, color 0.2s ease;
}

/* Changement de couleur au survol */
.back-to-top:hover {
  background: white;
}

/* Supprimer contours au clic ou au focus */
a:active,
a:focus,
a:hover {
  outline: none;
  text-decoration: none;
}

/* Lien par défaut */
a {
  background: transparent;
  text-decoration: none;
  color: inherit;
}

/* Pour que tout le contenu ait une bonne gestion de dimensions */
* {
  box-sizing: border-box;
}

.icon-back-to-top {
  fill: #fff;        
  opacity: 0.7;     
  width: 24px;      
  height: 24px;     
  position: absolute;
  pointer-events: none;
  transition: fill 0.2s ease, opacity 0.2s ease;
}

.back-to-top:hover .icon-back-to-top {
  opacity: 1; 
  fill: #000;
}

/* Styles pour le SVG d'arrière-plan */
#background-svg {
    position: absolute; /* Il est positionné par rapport à son parent, .background-wrapper */
 /*    bottom: 0;
    left: 0; */
	top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
overflow: hidden;	
 transform: scale(0.75);
}

#background-svg path {
    stroke-dasharray:131727 /* 8085 */;
    stroke-dashoffset: 131727/* 8085 */;
    animation: dash 4s ease-in-out infinite alternate;
}

.background-wrapper {
    position: fixed;
    top: 0;
    left: 0; 
    width: 100%;
    height: 100vh;
    /* Le fond dégradé est appliqué ici */
    background-image: linear-gradient(180deg, var(--card) 0%, #05060a 30%, var(--card) 100%);
    z-index: -2; /* C'est la couche la plus en arrière */
}

@keyframes dash {
  from {
    stroke-dashoffset:131727/*  8085 */;
  }
  to {
    stroke-dashoffset: 0;
  }
}

.fixed-instagram-logo {
  position: fixed; 
  top: 15px; 
  right: 30px; 
  width: 50px; 
  height: auto;
  z-index: 1000; 
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  filter: grayscale(100%);
}


.instagram-link:hover .fixed-instagram-logo {
  transform: scale(1.15) rotate(5deg);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}


.more-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  color: white;
  font-size: 2em;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s;
}

.more-overlay:hover {
  background: rgba(0,0,0,0.8);
}

.item {
  position: relative; 
}

.header-textarea {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 1.4rem;
  line-height: 1.6;
  letter-spacing: 0.05em;
  padding: 1rem;
  resize: vertical;
  overflow-y: auto;
  white-space: pre-wrap; /* garde les retours à la ligne */
  outline: none;
  user-select: text;
}



em {
  font-style: italic;
  font-weight: bold;
  font-size: 1.6rem;
  color: var(--muted);
  display: block;
  margin-bottom: 1rem;
  text-align: center;
  letter-spacing: 0.02em;
}

#copyright {
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  font-family: var(--font-sans);
  text-align: center;
  padding: 1rem 0;
  user-select: none;
}

.heart {
  color: red;
}





