@font-face {
  font-family: "Jet";
  src: url("../assets/fonts/JetBrainsMono-ExtraLight.woff2") format("woff2");
  font-display: swap; /* Améliore le chargement des polices */
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Jet", monospace;
  background: linear-gradient(20deg, rgb(237, 237, 237), transparent),
    url("../assets/images/noise.svg");
  line-height: 1.6;
  color: #000;
}

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

img {
  max-width: 100%;
  height: auto;
  loading: lazy; /* Force lazy loading pour toutes les images */
  will-change: transform; /* Optimise les animations */
}

main {
  width: 90%;
  max-width: 1800px;
  margin: 80px auto 0;
  padding: 20px;
}

section {
  width: 100%;
  margin: 0 auto;
}

p {
  margin: 1.5rem 0;
}

figure {
  display: block;
  margin: 1em auto;
  text-align: center;
  unicode-bidi: isolate;
}

figure img {
  max-width: 100%;
  height: auto;
}

/* Style pour les images de la galerie */
.post {
  opacity: 0;
  animation: fadeIn 0.5s ease-in-out forwards;
  contain: layout style paint; /* Améliore les performances de rendu */
}

.post img {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.post:hover img {
  transform: scale(1.02);
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* Façade pour les vidéos (lazy loading) */
.video-facade {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s;
}

.video-facade:hover {
  background: #111;
}

.play-button {
  width: 68px;
  height: 68px;
  background: rgba(255, 0, 212, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
  margin-bottom: 10px;
  transition: transform 0.3s;
}

.video-facade:hover .play-button {
  transform: scale(1.1);
}

.video-title {
  color: rgb(148, 255, 33);
  font-weight: 600;
  text-shadow: 0 0 7px #fff;
}

.pink-bold {
  color: rgb(255, 0, 212);
  font-weight: bold;
}

.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  margin: 2rem 0;
  background: #000; /* Couleur de fond pendant le chargement */
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.navbar {
  width: 100%;
  height: 4vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid silver;
  border-bottom: 1px solid silver;
  background: linear-gradient(60deg, #cc14ec8c, transparent),
    url("../assets/images/noise.svg");
  position: fixed;
  top: 0;
  transition: top 0.3s;
  z-index: 1000;
  will-change: top; /* Optimise les animations */
}

.navbar.hide {
  top: -300px;
}

.nav-brand {
  margin-left: 2vw;
  font-weight: 600;
  color: rgb(148, 255, 33);
}

.nav-links {
  display: flex;
  list-style: none;
  margin-right: 3vw;
}

.nav-link {
  color: rgb(148, 255, 33);
  font-weight: 600;
  margin-left: 3vw;
  text-shadow: 0 0 7px #fff, 0 0 10px #fff, 0 0 21px #fff,
    0 0 42px rgb(255, 0, 212), 0 0 82px rgb(255, 0, 212),
    0 0 92px rgb(255, 0, 212), 0 0 102px rgb(255, 0, 212),
    0 0 151px rgb(255, 0, 212);
  -webkit-text-stroke-width: 0.1px;
  -webkit-text-stroke-color: rgb(255, 0, 212);
}

.nav-toggle {
  display: none;
  cursor: pointer;
  padding: 1vw;
  position: absolute;
  top: 5px;
  right: 1vw;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 25px;
  height: 3px;
  background: rgb(148, 255, 33);
  position: relative;
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
}

.nav-toggle span::before {
  top: -8px;
}

.nav-toggle span::after {
  top: 8px;
}

.page { 
  display: none; 
}

.active { 
  display: block;
}

.separator {
  text-align: center;
  font-size: large;
  font-family: monospace;
  color: rgb(255, 0, 212); 
  margin: 20px 0; 
}

.emoji-center {
  display: block;
  margin: 20px auto;
  text-align: center;
}

button.video-facade {
  border: none;
  padding: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

button.video-facade:focus {
  outline: 2px solid rgb(148, 255, 33);
  outline-offset: 2px;
}



/* Optimisation pour le mobile */
@media (max-width: 768px) {
  .navbar {
    height: 6vh;
  }

  .nav-links {
    display: none;
    margin: 0;
  }

  .nav-brand {
    width: 75vw;
    margin-block: 1rem;
  }

  .nav-links.show {
    display: block;
    position: absolute;
    top: 5.8vh;
    right: 0.5;
    width: 100%;
    background: linear-gradient(60deg, #cc14ec8c, transparent),
      url("../assets/images/noise.svg");
    margin: 0;
  }

  .nav-item {
    display: flex;
    flex-direction: column;
    align-items: start;
  }

  .nav-link {
    display: block;
    padding: 10px;
    -webkit-text-stroke-width: none;
    -webkit-text-stroke-color: rgb(148, 255, 33);
    text-shadow: none;
  }

  .nav-toggle {
    display: block;
    margin-top: 10px;
  }

  main {
    width: 95%;
    margin-top: 6vh;
  }

  .video-container {
    margin: 1rem 0;
  }
  
  /* Réduire les animations sur mobile pour améliorer les performances */
  .nav-link {
    text-shadow: 0 0 7px #fff, 0 0 21px rgb(255, 0, 212);
  }
}

/* Préfère les animations réduites pour l'accessibilité */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
