:root {
  --display-font: "Chewy", system-ui, -apple-system, Segoe UI, Roboto,
    sans-serif;
  --font-subtitle: "Chewy", cursive;
  --font-fun: "Nunito", sans-serif;
  --font-soft: "Quicksand", sans-serif;
  --font-clean: "Poppins", sans-serif;
  --font-pro: "Montserrat", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: linear-gradient(135deg, #0f0f23 0%, #2d2d4f 50%, #233462 100%);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Voile au-dessus de la page (floutage desktop uniquement) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  background: rgba(52, 98, 189, 0.189);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
}

/* Affiche le voile au survol / focus (desktop) */
body:has(.navbar:hover)::before,
body:has(.navbar:focus-within)::before,
body:has(.navbar-trigger:hover)::before {
  opacity: 1;
}

/* === Fond animé fiable (iOS) === */
.background-dots {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0; /* au lieu de -1 */
  pointer-events: none;
}

.dot {
  position: absolute;
  border-radius: 50%;
  filter: blur(0.5px);
  animation: moveAndColor 15s infinite linear, pulse 3s infinite ease-in-out;
}

@keyframes moveAndColor {
  0% {
    transform: translate(0, 0) scale(1);
    background: #ff6b6b;
    box-shadow: 0 0 20px #ff6b6b;
  }
  14% {
    background: #4ecdc4;
    box-shadow: 0 0 20px #4ecdc4;
  }
  28% {
    background: #45b7d1;
    box-shadow: 0 0 20px #45b7d1;
  }
  42% {
    background: #96ceb4;
    box-shadow: 0 0 20px #96ceb4;
  }
  57% {
    background: #feca57;
    box-shadow: 0 0 20px #feca57;
  }
  71% {
    background: #ff9ff3;
    box-shadow: 0 0 20px #ff9ff3;
  }
  85% {
    background: #54a0ff;
    box-shadow: 0 0 20px #54a0ff;
  }
  100% {
    transform: translate(100px, 100px) scale(1.2);
    background: #ff6b6b;
    box-shadow: 0 0 20px #ff6b6b;
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.5);
    opacity: 1;
  }
}

/* === Dots positions === */
.dot-1 {
  top: 10%;
  left: 10%;
  width: 8px;
  height: 8px;
  animation-delay: 0s;
  animation-duration: 12s, 2.5s;
}
.dot-2 {
  top: 20%;
  left: 80%;
  width: 6px;
  height: 6px;
  animation-delay: 0.2s;
  animation-duration: 18s, 3s;
}
.dot-3 {
  top: 50%;
  left: 5%;
  width: 10px;
  height: 10px;
  animation-delay: 0.4s;
  animation-duration: 14s, 2.8s;
}
.dot-4 {
  top: 70%;
  left: 90%;
  width: 7px;
  height: 7px;
  animation-delay: 0.8s;
  animation-duration: 16s, 3.2s;
}
.dot-5 {
  top: 30%;
  left: 50%;
  width: 9px;
  height: 9px;
  animation-delay: 1.5s;
  animation-duration: 13s, 2.7s;
}
.dot-6 {
  top: 80%;
  left: 20%;
  width: 5px;
  height: 5px;
  animation-delay: 2s;
  animation-duration: 20s, 3.5s;
}
.dot-7 {
  top: 15%;
  left: 70%;
  width: 8px;
  height: 8px;
  animation-delay: 2.6s;
  animation-duration: 15s, 2.2s;
}
.dot-8 {
  top: 90%;
  left: 60%;
  width: 6px;
  height: 6px;
  animation-delay: 3s;
  animation-duration: 17s, 4s;
}
.dot-9 {
  top: 40%;
  left: 15%;
  width: 11px;
  height: 11px;
  animation-delay: 4s;
  animation-duration: 19s, 2.9s;
}
.dot-10 {
  top: 60%;
  left: 85%;
  width: 7px;
  height: 7px;
  animation-delay: 5s;
  animation-duration: 11s, 3.1s;
}
.dot-11 {
  top: 5%;
  left: 40%;
  width: 9px;
  height: 9px;
  animation-delay: 7s;
  animation-duration: 16s, 2.4s;
}
.dot-12 {
  top: 85%;
  left: 10%;
  width: 8px;
  height: 8px;
  animation-delay: 9s;
  animation-duration: 14s, 3.6s;
}
.dot-13 {
  top: 25%;
  left: 25%;
  width: 6px;
  height: 6px;
  animation-delay: 10s;
  animation-duration: 18s, 2.6s;
}
.dot-14 {
  top: 75%;
  left: 75%;
  width: 10px;
  height: 10px;
  animation-delay: 11s;
  animation-duration: 12s, 3.8s;
}
.dot-15 {
  top: 35%;
  left: 95%;
  width: 7px;
  height: 7px;
  animation-delay: 13s;
  animation-duration: 15s, 2.3s;
}
.dot-16 {
  top: 95%;
  left: 45%;
  width: 9px;
  height: 9px;
  animation-delay: 15s;
  animation-duration: 13s, 3.3s;
}
.dot-17 {
  top: 45%;
  left: 65%;
  width: 8px;
  height: 8px;
  animation-delay: 16s;
  animation-duration: 17s, 2.8s;
}
.dot-18 {
  top: 65%;
  left: 35%;
  width: 6px;
  height: 6px;
  animation-delay: 17s;
  animation-duration: 19s, 3.4s;
}
.dot-19 {
  top: 55%;
  left: 55%;
  width: 11px;
  height: 11px;
  animation-delay: 18s;
  animation-duration: 14s, 2.1s;
}
.dot-20 {
  top: 12%;
  left: 88%;
  width: 7px;
  height: 7px;
  animation-delay: 19s;
  animation-duration: 16s, 3.7s;
}

.content {
  position: relative;
  z-index: 1;
  padding: 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: white;
}

.title {
  font-family: var(--display-font);
  font-size: 3rem;
  font-weight: 300;
  margin-bottom: 1rem;
  opacity: 0.9;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
  animation: fadeInUp 1s ease-out 0.2s both;
}

.subtitle {
  font-family: var(--font-clean);
  font-size: 1.4rem;
  opacity: 0.7;
  max-width: 600px;
  line-height: 1.6;
  margin-bottom: 2rem;
  animation: fadeInUp 1s ease-out 0.4s both;
}

.btn {
  font-family: var(--font-pro);
  padding: 1rem 2rem;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  text-decoration: none;
  border-radius: 50px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  animation: fadeInUp 1s ease-out 0.6s both;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(255, 255, 255, 0.1);
}

/* === Navbar === */
.navbar {
  position: fixed;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-top: none;
  border-radius: 0 0 20px 20px;
  padding: 1rem 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.navbar:hover {
  top: 0;
}

.navbar::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 4px;
  background: linear-gradient(90deg, #4ecdc4, #45b7d1);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 2px 8px rgba(78, 205, 196, 0.3);
  opacity: 0.8;
}

/* La zone cliquable en haut (doit être un <a href="#menu"> côté HTML) */
.navbar-trigger {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  z-index: 99;
  pointer-events: auto;
}
.navbar-trigger:hover + .navbar {
  top: 0;
}

.navbar-content {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  color: white;
}
.navbar-logo {
  font-family: var(--display-font);
  font-size: 1.2rem;
  color: #4ecdc4;
  text-shadow: 0 0 10px rgba(78, 205, 196, 0.3);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.navbar-links {
  display: flex;
  gap: 1rem;
  list-style: none;
}
.navbar-links a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 500;
  transition: all 0.3s ease;
  padding: 0.5rem 1rem;
  border-radius: 15px;
}
.navbar-links a:hover {
  color: #4ecdc4;
  background: rgba(255, 255, 255, 0.1);
  text-shadow: 0 0 5px rgba(78, 205, 196, 0.3);
}

/* Anim de contenu */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Desktop : hover fonctionne */
@media (hover: hover) and (pointer: fine) {
  .navbar:hover {
    top: 0;
  }
  body:has(.navbar:hover)::before {
    opacity: 1;
  }
}

/* Mobile : on force target pour ouvrir/fermer */
@media (hover: none) and (pointer: coarse) {
  #menu:target {
    top: 0;
  }
  #menu:target + .navbar-overlay {
    display: block;
  }
  body:has(#menu:target)::before {
    opacity: 1;
  }
}

body:has(#menu:target)::before {
  opacity: 1;
}
#menu:target {
  top: 0;
}
#menu {
  scroll-margin-top: 0;
}

.navbar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 80;
}

#menu:target + .navbar-overlay {
  display: block;
}

/* Responsive */
@media (max-width: 1024px) {
  .navbar {
    padding: 1rem 1.5rem;
    top: -50px;
  }
  .navbar-content {
    gap: 1.2rem;
  }
  .navbar-links {
    gap: 0.9rem;
  }
  .navbar-links a {
    font-size: 1.1rem;
    padding: 0.45rem 0.9rem;
  }
  .navbar-logo {
    font-size: 1.15rem;
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: 0.8rem 1rem;
    top: -35px;
  }
  .navbar-content {
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  .navbar-links {
    gap: 0.8rem;
  }
  .navbar-links a {
    font-size: 1rem;
    padding: 0.4rem 0.8rem;
  }
  .navbar-logo {
    display: none;
  }
  .title {
    font-size: 2rem;
  }
  .subtitle {
    font-size: 1rem;
  }
  .btn {
    padding: 0.8rem 1.5rem;
  }
  .dot-11,
  .dot-12,
  .dot-13,
  .dot-14,
  .dot-15,
  .dot-16,
  .dot-17,
  .dot-18,
  .dot-19,
  .dot-20 {
    display: none;
  }
}

@media (max-width: 480px) {
  .navbar {
    padding: 0.6rem 0.8rem;
    top: -60px;
    width: 95%;
    left: 50%;
    transform: translateX(-50%);
  }
  .navbar-content {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
  .navbar-links {
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  .navbar-links a {
    font-size: 0.9rem;
    padding: 0.3rem 0.6rem;
  }
  .navbar-logo {
    display: none;
  }
  .title {
    font-size: 1.5rem;
  }
  .subtitle {
    font-size: 0.9rem;
  }
  .dot-11,
  .dot-12,
  .dot-13,
  .dot-14,
  .dot-15,
  .dot-16,
  .dot-17,
  .dot-18,
  .dot-19,
  .dot-20 {
    display: none;
  }
}
