/* Variables */
:root {
  /* Couleurs */
  --primary-color: #B4AEFF;
  --accent-color: #7d73ff;
  --accent-color-secondary: #F49F0A;
  --light-neutral: #EDEDF7;
  --dark-neutral: #1F1F25;
  --opacity-overlay: 0.4; 
  --opacity-scrolled: 0.95; /* Opacité du header lorsqu'on scroll */
  /* Typographie */
  --font-family: "Bricolage Grotesque", sans-serif;
  /* Tailles de police responsives */
  --h1-size: clamp(3rem, 10vw, 5.653rem);
  --h2-size: clamp(2.5rem, 7vw, 3.998rem);
  --h3-size: clamp(2rem, 5vw, 2.827rem);
  --h4-size: clamp(1.5rem, 3vw, 2rem);
  --h5-size: clamp(1.25rem, 2vw, 1.414rem);
  --p-size: clamp(1rem, 1vw + 0.5rem, 1.125rem);
  --small-size: 0.707rem;
  --line-height-titles: 1.1;
  --line-height-text: 1.6;
  /* Pour calculer la hauteur du header dynamiquement */
  --header-height: 0px;
}

/* Styles généraux */
h1, h2, h3, h4, h5, p, a, li, span, figcaption, dt, dd, label {
  font-family: var(--font-family);
  font-weight: 500;
  margin: 0;
}

h1 {
  font-size: var(--h1-size);
  line-height: var(--line-height-titles);
}

h2 {
  font-size: var(--h2-size);
  line-height: var(--line-height-titles);
}

h3 {
  font-size: var(--h3-size);
  line-height: var(--line-height-titles);
}

h4 {
  font-size: var(--h4-size);
  line-height: var(--line-height-titles);
}

h5 {
  font-size: var(--h5-size);
  line-height: var(--line-height-titles);
}

p {
  font-size: var(--p-size);
  line-height: var(--line-height-text);
}

a {
  font-size: var(--p-size);
  line-height: 1.2;
  color: var(--dark-neutral);
}

figcaption {
  font-size: var(--small-size);
  line-height: var(--line-height-text);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  background-color: var(--light-neutral);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Ajustements des sections */
.section-container {
  width: 80vw;
  max-width: 1200px;
  margin: 0 auto;
  padding: 50px 0;
}

.page-hero {
  width: 100%;
  padding-top: calc(var(--header-height) + 30px);
  padding-bottom: 50px;
}

/***** Styles du header *****/
template-header {
  position: fixed;
  top: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 50px;
  border-radius: 0 0 30px 30px;
  box-sizing: border-box;
  z-index: 999;
  
  background-color: rgb(from var(--dark-neutral) r g b / var(--opacity-overlay));
  backdrop-filter: blur(5px);
  transition: background-color 0.3s ease, backdrop-filter 0.3s ease;
}
template-header.scrolled {
  background-color: rgb(from var(--dark-neutral) r g b / var(--opacity-scrolled));
  backdrop-filter: blur(15px);
}

.logo-animation {
  height: 80px;
  width: 80px;
  margin: 0;
  user-select: none;
  outline: none;
  -webkit-tap-highlight-color: transparent; /* Supprimer le highlight (fond bleu lorsque cliqué) sur mobile */
}

.logo {
  height: 100px;
  width: 100px;
  margin: 0;
  user-select: none;
  outline: none;
  -webkit-tap-highlight-color: transparent; /* Supprimer le highlight (fond bleu lorsque cliqué) sur mobile */
}

.logo img {
  height: 100%;
  width: 100%;
  object-fit: contain;
}

nav {
  display: flex;
  column-gap: 20px;
}

nav a {
  padding: 0px 32px;
  align-self: center;
  border-radius: 24px;
  text-decoration: none;
}

.btn {
  margin: 0;
  padding: 0;
  width: auto;
  height: 40px;
  -webkit-tap-highlight-color: transparent; /* Supprimer le highlight (fond bleu lorsque cliqué) sur mobile */
  user-select: none;
}

/* Styles du conteneur du menu burger */
.menu-toggle {
  display: none; /* menu burger caché sur grands écrans */
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 36px;
  height: 36px;
  color: var(--light-neutral);
  z-index: 1001;
  -webkit-tap-highlight-color: transparent; /* Supprimer le highlight (fond bleu lorsque cliqué) sur mobile */
  user-select: none;
}

.menu-toggle .line {
  background-color: var(--light-neutral);
  display: block;
  width: 100%;
  height: 4px;
  margin: 8px 0;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}

/* Animation vers la croix (X) lorsque le menu est ouvert */
.menu-toggle.active .top {
  transform: translateY(12px) rotate(45deg);
}
.menu-toggle.active .middle {
  opacity: 0;
}
.menu-toggle.active .bottom {
  transform: translateY(-12px) rotate(-45deg);
}

/***** styles pour le footer *****/
template-footer {
  background-color: var(--dark-neutral);
  padding: 20px 50px;
  border-radius: 30px 30px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  row-gap: 20px;
  box-sizing: border-box;
  text-align: center;
}

.footer-contenu {
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 100%;
}

/* Forcer les éléments à occuper le même espace */
.footer-contenu > * {
  flex: 1; 
}

.footer-contenu .logo-container {
  display: flex;
  justify-content: flex-start;
}

#btn-connecte {
  height: 50px;
  -webkit-tap-highlight-color: transparent; /* Supprimer le highlight (fond bleu lorsque cliqué) sur mobile */
  user-select: none;
}

.reseaux-sociaux {
  display: flex;
  justify-content: flex-end;
  column-gap: 10px;
}

.reseaux-sociaux a {
  display: inline-block;
  width: 48px;
  height: 48px;
  -webkit-tap-highlight-color: transparent; /* Supprimer le highlight (fond bleu lorsque cliqué) sur mobile */
  user-select: none;
}

template-footer p {
  color: var(--light-neutral);
  font-weight: lighter;
}

/***** Styles pour le template de la liste de projets *****/
template-projets,
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 60px;
  justify-items: center;
  width: 100%;
}

/* Cartes "squelette" */
.skeleton-card {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1 / 1;
  background-color: rgb(from var(--dark-neutral) r g b / 0.1);
  border-radius: 30px;
  animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
  0% {
    background-color: rgb(from var(--dark-neutral) r g b / 0.1);
  }
  50% {
    background-color: rgb(from var(--dark-neutral) r g b / 0.2);
  }
  100% {
    background-color: rgb(from var(--dark-neutral) r g b / 0.1);
  }
}

/* Animation des cartes de projets */
.flip-card {
  background-color: transparent;
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1 / 1;
  perspective: 1000px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 30px;
  -webkit-backface-visibility: hidden; /* Safari */
  backface-visibility: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.flip-card-front img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 30px;
}

.flip-card-back {
  background-color: var(--dark-neutral);
  color: white;
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  padding: 20px;
}

.projet-desc {
  background-color: var(--primary-color);
  color: var(--dark-neutral);
  border-radius: 20px;
  padding: 10px;
}

.btn-projets {
  display: inline-block;
  padding: 5px 20px;
  color: var(--accent-color);
  text-decoration: none;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 60px;
  justify-items: center;
  width: 100%;
}

/* Boutons de navigation */
@keyframes gradient-aurora {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
 
.nav-btn {
  position: relative;
  color: var(--light-neutral);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  padding: 8px 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: color 0.2s ease;
}
 
.nav-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  /* Deux halos côte à côte : quand le 2e sort à droite, le 1er entre à gauche */
    background: linear-gradient(-45deg, var(--accent-color), var(--primary-color), var(--accent-color), var(--primary-color));
  background-size: 400% 400%;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.nav-btn.active {
  color: var(--dark-neutral);
}
 
.nav-btn:hover::after,
.nav-btn.active::after {
  opacity: 1;
  animation: gradient-aurora 6s linear infinite;
}

/* Éviter le scroll lorsque le menu est ouvert */
body.menu-ouvert {
  overflow: hidden;
}

/* Styles pour les appareils mobiles */
@media screen and (max-width: 768px) {
  /* menu mobile */
  nav {
    position: fixed;
    inset: 0;
    height: 100vh;
    width: 100%;
    background-color: rgba(31, 31, 37, 0.95);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 40px;

    opacity: 0;
    transform: translateY(-100%);
    transition: all 0.4s ease;
    z-index: 1000;
  }

  nav.active {
    opacity: 1;
    transform: translateY(0);
  }

  .menu-toggle {
    display: block; /* Afficher le menu burger sur petits écrans */
  }

  .section-container {
    width: 90vw;
    padding: 30px 0;
  }

  .page-hero {
    padding: calc(var(--header-height) + 30px) 20px 30px;
  }

  .flip-card:hover .flip-card-inner {
    transform: none; /* Désactiver l'effet hover sur mobile */
  }

  /* Toute la carte peut être cliquée pour afficher les détails */
  .flip-card:focus .flip-card-inner,
  .flip-card:focus-within .flip-card-inner {
    transform: rotateY(180deg);
  }

  template-footer .footer-contenu {
    flex-direction: column;
    row-gap: 20px;
  }

  .footer-contenu .logo-container {
    justify-content: center;
  }
}