@font-face {
  font-family: 'Coolvetica';
  src: url('fonts/coolveticaRG.ttf') format('truetype');
}

@font-face {
  font-family: 'NeueHaasDisplayLight';
  src: url('fonts/NeueHaasDisplayLight.ttf') format('truetype');
}

@font-face {
  font-family: 'Urbanist';
  src: url('fonts/Urbanist-Medium.ttf') format('truetype');
}

/* Styles de base */
body {
  margin: 0;
  min-height: 100vh;
  position: relative;
  z-index: 1;
  overflow: hidden;
  font-family: 'Urbanist', Arial, sans-serif;
}

/* Vidéo de fond */
#bg-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  z-index: -1;
  pointer-events: none;
}

/* Dégradé de fallback pour iOS avec animation blob */
.bg-gradient {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  --color-1: #4562e4;
  --color-2: #7aacf2;
  --color-3: #142e62;
  --color-4: #203c8c;
  --color-5: #081931;
  background: linear-gradient(135deg, var(--color-5) 0%, var(--color-3) 25%, var(--color-4) 50%, var(--color-1) 75%, var(--color-2) 100%);
  display: none;
}

.bg-gradient::before {
  content: '';
  position: absolute;
  top: 10%;
  left: 20%;
  width: 60%;
  height: 70%;
  background: radial-gradient(circle, var(--color-1) 0%, var(--color-2) 50%, transparent 70%);
  border-radius: 50% 40% 60% 30%;
  filter: blur(60px) brightness(1.3);
  animation: blob-float 8s ease-in-out infinite;
  transform-origin: 50% 50%;
}

.bg-gradient::after {
  content: '';
  position: absolute;
  top: 30%;
  right: 15%;
  width: 50%;
  height: 80%;
  background: radial-gradient(ellipse, var(--color-2) 0%, var(--color-4) 40%, transparent 70%);
  border-radius: 40% 60% 30% 70%;
  filter: blur(80px) brightness(1.4);
  animation: blob-float-reverse 10s ease-in-out infinite;
  transform-origin: 50% 50%;
}

/* Animation blob principale */
@keyframes blob-float {
  0%, 100% {
    transform: translate(0%, 0%) rotate(0deg) scale(1);
    border-radius: 50% 40% 60% 30%;
  }
  25% {
    transform: translate(20%, -30%) rotate(90deg) scale(1.1);
    border-radius: 30% 60% 40% 70%;
  }
  50% {
    transform: translate(-20%, 20%) rotate(180deg) scale(0.9);
    border-radius: 60% 30% 70% 40%;
  }
  75% {
    transform: translate(30%, 10%) rotate(270deg) scale(1.2);
    border-radius: 40% 70% 30% 60%;
  }
}

/* Animation blob secondaire (inversée) */
@keyframes blob-float-reverse {
  0%, 100% {
    transform: translate(0%, 0%) rotate(180deg) scale(1);
    border-radius: 40% 60% 30% 70%;
  }
  25% {
    transform: translate(-30%, 20%) rotate(270deg) scale(1.3);
    border-radius: 70% 30% 60% 40%;
  }
  50% {
    transform: translate(15%, -25%) rotate(360deg) scale(0.8);
    border-radius: 30% 70% 40% 60%;
  }
  75% {
    transform: translate(-10%, 30%) rotate(90deg) scale(1.1);
    border-radius: 60% 40% 70% 30%;
  }
}

/* Classes pour contrôler l'affichage selon la plateforme */
.ios #bg-video {
  display: none !important;
}

.ios .bg-gradient {
  display: block !important;
}

/* Conteneur principal */
.guardia-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  text-align: center;
  padding: 0 20px;
  width: calc(100% - 40px);
  max-width: 1200px;
}

/* Titre principal */
.guardia-title {
  color: #fff;
  font-family: 'Coolvetica', Arial, sans-serif;
  font-weight: normal;
  font-size: clamp(2.5rem, 8vw, 8em);
  margin: 0;
  line-height: 1.1;
  word-wrap: break-word;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Animation des mots qui tournent */
.word-rotate {
  display: inline-block;
  overflow: hidden;
  height: 1.3em;
  vertical-align: middle;
  margin-left: 8px;
  position: relative;
  top: -0.1em;
}

.word-rotate span {
  display: block;
  animation: wordSwitch 6s infinite;
  line-height: 1.3em;
}

/* Description */
.guardia-description {
  color: #fff;
  font-family: 'NeueHaasDisplayLight', Arial, sans-serif;
  font-size: clamp(1rem, 2.5vw, 1.8rem);
  font-weight: lighter;
  margin-top: 1.5em;
  line-height: 1.5;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  text-shadow: 4px 4px 18px rgba(0,0,0,0.6);
}

/* Navigation Desktop */
.guardia-nav.desktop-nav {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10;
  display: flex;
  gap: 1.5em;
  font-size: 1.1rem;
  color: #fff;
  letter-spacing: 0.08em;
  user-select: none;
}

.guardia-nav.desktop-nav span {
  position: relative;
  cursor: pointer;
  padding: 8px 12px;
  transition: all 0.3s ease;
}

.guardia-nav.desktop-nav span::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background-color: #fff;
  transition: width 0.3s ease;
}

.guardia-nav.desktop-nav span:hover::after {
  width: 100%;
}

/* Menu Mobile */
.mobile-nav {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 15;
  display: none;
}

.hamburger-menu {
  width: 40px;               /* largeur fixe */
  height: 40px;              /* même hauteur que largeur */
  display: flex;
  align-items: center;       /* centrage vertical */
  justify-content: center;   /* centrage horizontal */
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 8px;        /* arrondi du carré */
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  padding: 0;                /* supprimer padding pour éviter l’étirement */
}

.hamburger-menu:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.hamburger-menu img {
  width: 24px;
  height: 24px;
  filter: brightness(0) invert(1);
  display: block;
}


/* Overlay du menu mobile */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Contenu du menu mobile */
.mobile-menu-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2em;
  padding: 3em 2.5em;
  transform: scale(0.8);
  transition: transform 0.3s ease;
}

.mobile-menu-overlay.active .mobile-menu-content {
  transform: scale(1);
}

.mobile-menu-content span {
  color: #fff;
  font-family: 'Urbanist', Arial, sans-serif;
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  cursor: pointer;
  padding: 0.8em 1.5em;
  border-radius: 8px;
  transition: all 0.3s ease;
  text-align: center;
  min-width: 150px;
}

.mobile-menu-content span:hover {
  transform: translateY(-2px);
}

/* Animation des mots */
@keyframes wordSwitch {
  0%   { transform: translateY(0%); }
  33%  { transform: translateY(-100%); }
  66%  { transform: translateY(-200%); }
  100% { transform: translateY(0%); }
}

/* === MEDIA QUERIES === */

/* Tablettes */
@media (max-width: 1024px) {
  .guardia-container {
    padding: 0 30px;
    width: calc(100% - 60px);
  }
  
  .guardia-title {
    font-size: clamp(2.2rem, 9vw, 6rem);
  }
  
  .guardia-description {
    font-size: clamp(0.95rem, 2.8vw, 1.6rem);
    margin-top: 1.2em;
  }
}

/* Mobile */
@media (max-width: 768px) {
  body {
    overflow-x: hidden;
  }
  
  /* Cacher le menu desktop sur mobile */
  .guardia-nav.desktop-nav {
    display: none;
  }
  
  /* Afficher le menu hamburger sur mobile */
  .mobile-nav {
    display: block;
  }
  
  .guardia-container {
    padding: 0 15px;
    width: calc(100% - 30px);
    top: 45%;
  }
  
  .guardia-title {
    font-size: clamp(1.6rem, 10vw, 4rem);
    line-height: 1.2;
    margin-bottom: 0.5em;
    white-space: nowrap;
    overflow: visible;
  }
  
  .word-rotate {
    margin-left: 6px;
    height: 1.2em;
  }
  
  .word-rotate span {
    line-height: 1.2em;
  }
  
  .guardia-description {
    font-size: clamp(0.9rem, 4vw, 1.3rem);
    margin-top: 1em;
    line-height: 1.6;
  }
}

/* Très petits écrans */
@media (max-width: 480px) {
  .mobile-nav {
    top: 15px;
    right: 15px;
  }
  
  .hamburger-menu img {
    width: 20px;
    height: 20px;
  }
  
  .mobile-menu-content {
    padding: 2.5em 2em;
    gap: 1.8em;
  }
  
  .mobile-menu-content span {
    font-size: 1.2rem;
    min-width: 120px;
  }
  
  .guardia-container {
    padding: 0 10px;
    width: calc(100% - 20px);
    top: 42%;
  }
  
  .guardia-title {
    font-size: clamp(1.4rem, 12vw, 3.5rem);
    margin-bottom: 0.8em;
    white-space: nowrap;
    overflow: visible;
  }
  
  .word-rotate {
    margin-left: 4px;
  }
  
  .guardia-description {
    font-size: clamp(0.85rem, 4.5vw, 1.1rem);
    margin-top: 1.2em;
  }
}

/* Mode paysage mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .guardia-container {
    top: 50%;
    padding: 0 15px;
  }
  
  .guardia-title {
    font-size: clamp(1.5rem, 8vw, 3rem);
    margin-bottom: 0.3em;
  }
  
  .guardia-description {
    font-size: clamp(0.8rem, 3vw, 1rem);
    margin-top: 0.5em;
    line-height: 1.4;
  }
  
  .guardia-nav {
    flex-direction: row;
    gap: 1em;
    top: 8px;
    right: 8px;
    font-size: 0.8rem;
  }
}
