/* =========================
   VARIABLES DE COULEURS
   ========================= */
:root {
  --primary-color: #161515;        /* Bleu nuit très foncé (fond principal) */
  --secondary-color: #13294b;      /* Orange vif pour accents et CTA */
  --btn-shadow-color: #b47a2296;
  --btn-secondary-shadow: #584014;
  --text-color: #050505;           /* Gris clair, très lisible sur fond sombre */
  --background-light: #13294b;     /* Bleu nuit moyen pour sections légères */
  --background-medium: #13294b;    /* Bleu nuit foncé pour contenu principal */
  --background-dark: #0a0d11;      /* Fond très sombre pour footer ou sections accentuées */
  --shadow-light: rgba(255, 255, 255, 0.05);
  --shadow-medium: rgba(0, 0, 0, 0.5);
}

html {
  /* Remplace 80px par la hauteur réelle de ta navbar */
  scroll-padding-top: 60px; 
  scroll-behavior: smooth;
}

/* =========================
   RESET & BASE
   ========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: #f4f4f4;
}

/* =========================
   PAGE LOADER
   ========================= */
#page-loader {
  position: fixed;
  inset: 0;
  background: var(--primary-color);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
}
.loader {
  width: 60px;
  height: 60px;
  border: 6px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================
   UTILITAIRES
   ========================= */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 20px;
}
h1,h2,h3,h4 { line-height: 1.2; }
section:nth-of-type(odd) { background-color: #ffffff; }
section:nth-of-type(even) { background-color: var(--background-light); }

/* =========================
   TITRES DE SECTION
   ========================= */
section h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 50px;
  color: var(--btn-shadow-color) ;
  font-weight: 800;
  position: relative;
}
section h2::after {
  content: '';
  width: 80px;
  height: 4px;
  background: var(--btn-shadow-color);
  display: block;
  margin: 15px auto 0;
  border-radius: 4px;
}

/* =========================
   ABOUT
   ========================= */
#about .text {
  max-width: 900px;
  margin: 0 auto;
  text-align: left;
}
#about p { margin-bottom: 25px; font-size: 1.15rem; }
#about ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 40px;
  padding: 0;
}
#about li {
  background: var(--background-medium);
  padding: 10px 20px;
  border-radius: 8px;
  box-shadow: 0 2px 5px var(--shadow-light);
  font-weight: 600;
  color: rgb(243, 243, 243);
  font-size: 1rem;
}

/* =========================
   SERVICES
   ========================= */
.service-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}
.service {
  background: #fff;
  border-radius: 20px;
  padding: 40px 30px;
  text-align: center;
  box-shadow: 0 15px 30px var(--shadow-medium);
  border-top: 5px solid var(--secondary-color);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.service:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 35px rgba(0,0,0,0.2);
}
.service h3 { color: var(--primary-color); margin-bottom: 15px; font-size: 1.6rem; }
.service p { flex-grow: 1; }

/* =========================
   PORTFOLIO - DESIGN IMMERSIF (COULEURS ORIGINALES)
   ========================= */

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.project {
  position: relative;
  height: 400px;
  border-radius: 20px;
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow-medium);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.4s ease;
}

/* --- IMAGE --- */
.project img {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  z-index: 1;
  transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1), filter 0.6s ease;
}

/* Effet Hover image */
.project:hover img {
  transform: scale(0.96);
  filter: brightness(0.6);
}

/* Texte "DÉCOUVRIR" */
.project::after {
  content: "DÉCOUVRIR";
  position: absolute;
  bottom: 33px;
  right: 75px;
  color: #ffffff;
  font-size: 10px;
  letter-spacing: 4px;
  font-weight: 500;
  opacity: 0;
  transform: translateX(10px);
  transition: all 0.4s ease;
  z-index: 10;
  pointer-events: none;
}

.project:hover::after {
  opacity: 1;
  transform: translateX(0);
}

/* --- LE CONTENU (TES COULEURS D'ORIGINE) --- */
.project .content {
  position: absolute;
  inset: 0; 
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end; 
  /* TON DÉGRADÉ ORIGINAL */
  background: linear-gradient(
    to top, 
    rgba(0, 0, 0, 0.95) 5%, 
    rgba(0, 0, 0, 0.4) 50%, 
    transparent 100%
  );
  backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.5s ease;
  z-index: 20;
  pointer-events: none;
}

.project.is-tapped .content {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* TYPOGRAPHIES ORIGINALES */
.project h3 { 
  font-size: 1.5rem; 
  margin-bottom: 10px; 
  font-weight: 800; 
  color: #ffffff;
}

.project p { 
  font-size: 0.95rem; 
  margin-bottom: 8px; 
  line-height: 1.4; 
  color: rgba(255, 255, 255, 0.9) !important; 
}

.project strong { 
  color: var(--btn-shadow-color); 
}

.project .project-note { 
  font-style: italic; 
  font-size: 0.8rem; 
  margin-top: 5px; 
  color: var(--btn-shadow-color) !important; 
  opacity: 0.8; 
}

/* ANIMATION DES TEXTES */
.project .content h3, 
.project .content p, 
.project .content a {
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.5s ease;
}

.project.is-tapped .content h3, 
.project.is-tapped .content p, 
.project.is-tapped .content a {
  transform: translateY(0);
  opacity: 1;
}

/* --- BOUTON + --- */
.project-hint {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 46px;
  height: 46px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  cursor: pointer;
  pointer-events: auto !important;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.project-hint span { 
  color: white; 
  font-size: 24px; 
  pointer-events: none;
  line-height: 1;
}

.project:hover .project-hint {
  background: var(--btn-shadow-color);
  transform: scale(1.1);
}

/* Etat ouvert */
.project.is-tapped .project-hint {
  transform: rotate(45deg) !important;
  background: var(--btn-shadow-color) !important;
  border-color: var(--btn-shadow-color) !important;
}

.project.is-tapped img {
  transform: scale(1.1) !important;
  filter: brightness(0.7) !important;
}

.project.is-tapped:hover::after {
  opacity: 0;
}

/* TON BOUTON "VOIR LE PROJET" ORIGINAL */
.project a {
  align-self: flex-start;
  margin-top: 15px;
  padding: 10px 22px;
  background: var(--btn-shadow-color);
  color: #fff !important;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.85rem;
  transition: 0.3s;
}

.project a:hover {
  filter: brightness(1.2);
  transform: translateY(-2px);
}

/* --- MOBILE --- */
@media (max-width: 768px) {
  .project { height: 380px; }
  .projects { grid-template-columns: 1fr; }
  .project::after { display: none; }
}
/* =========================
   FORMATION
   ========================= */
#formation ul {
  list-style: none;
  max-width: 900px;
  margin: 0 auto;
  padding: 0;
  display: grid;
  gap: 30px;
}
#formation li {
  background: #fff;
  padding: 35px 40px;
  border-radius: 18px;
  box-shadow: 0 15px 30px var(--shadow-light);
  border-left: 6px solid var(--secondary-color);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
#formation li:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px var(--shadow-medium);
}
#formation li strong {
  display: block;
  font-size: 1.4rem;
  color: var(--primary-color);
  margin-bottom: 10px;
}
#formation li { font-size: 1.05rem; line-height: 1.6; }

/* =========================
   CONTACT
   ========================= */
.contact-form {
  max-width: 600px;
  margin: 0 auto;
  background: #fff;
  padding: 50px;
  border-radius: 25px;
  box-shadow: 0 25px 50px var(--shadow-medium);
  border: 1px solid var(--background-medium);
}
.contact-heading {
  font-size: 1.8rem;
  color: var(--primary-color);
  margin-bottom: 10px;
  text-align: center;
  font-weight: 700;
}
.intro { font-size: 1.1rem; text-align: center; margin-bottom: 30px; }
input, textarea {
  width: 100%;
  padding: 16px 20px;
  border-radius: 10px;
  border: 1px solid var(--background-medium);
  font-size: 1.05rem;
  margin-bottom: 15px;
  font-family: 'Inter', sans-serif;
  transition: 0.2s;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(26,77,140,0.2);
}
textarea { resize: vertical; min-height: 150px; }
button {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 999px;
  background: var(--primary-color);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 1px;
  transition: 0.3s;
  box-shadow: 0 10px 20px var(--btn-shadow-color);
}
button:hover { background: var(--btn-secondary-shadow); transform: translateY(-3px); box-shadow: 0 12px 25px var(--btn-shadow-color); }
button:active { transform: translateY(-1px); box-shadow: 0 5px 10px var(--btn-secondary-shadow); }
.rgpd { font-size: 0.9rem; color: #6c757d; margin-top: 15px; text-align: center; }

/* =========================
   FOOTER
   ========================= */
footer {
  background: var(--primary-color);
  color: #f8f9fa;
  text-align: center;
  padding: 30px 15px;
  font-size: 1rem;
  border-top: 3px solid var(--secondary-color);
}
footer p:first-child { margin-bottom: 8px; }
footer a { color: var(--secondary-color); text-decoration: none; margin: 0 10px; font-weight: 600; transition: color 0.2s; }
footer a:hover { color: #fff; text-decoration: underline; }

/* =========================
   HEADER / HERO
   ========================= */
header.hero {
  text-align: center;
  padding: 100px 20px 120px;
  background: linear-gradient(135deg,var(--secondary-color), var(--primary-color));
  color: #fff;
  box-shadow: 0 10px 30px var(--shadow-medium);
}

header.hero img {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 7px solid #fff;
  box-shadow: 0 15px 30px rgba(0,0,0,0.3);
  margin-bottom: 30px;
}

header.hero h1 {
  font-size: 3.8rem;
  font-weight: 800;
  margin-bottom: 10px;
  text-shadow: 2px 2px 5px rgba(0,0,0,0.15);
}

header.hero h2 {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 35px;
}

header.hero p {
  max-width: 800px;
  margin: 0 auto 50px;
  font-size: 1.3rem;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

/* =========================
   NAVBAR PRINCIPALE
   ========================= */
.main-nav {
  position: sticky;       /* devient sticky uniquement après le header */
  top: 0;
  z-index: 1000;
  background: var(--primary-color);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  padding: 12px 0;
  transition: background 0.3s ease, padding 0.3s ease;
}

.main-nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 10px;
  transition: background 0.3s ease, transform 0.3s ease;
}

.main-nav a:hover {
  background: var(--secondary-color);
  color: #fff;
  transform: translateY(-3px);
}

/* =========================
   BURGER BUTTON - RESET COMPLET
   ========================= */
#burgerBtn {
  display: none; /* Caché par défaut */
  position: fixed;
  top: 25px;
  right: 25px;
  width: 32px;
  height: 24px;
  
  /* Reset des styles de bouton par défaut */
  background: none !important;
  background-color: transparent !important;
  border: none !important;
  padding: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  appearance: none;
  -webkit-appearance: none;
  
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  z-index: 2100; /* Toujours au dessus de la nav */
}

#burgerBtn span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: var(--btn-shadow-color); /* Ta couleur rose */
  border-radius: 10px;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-origin: center;
}

/* Éviter le highlight bleu dégueulasse sur mobile */
#burgerBtn {
  -webkit-tap-highlight-color: transparent;
}

/* ANIMATION X (Propre et centrée) */
#burgerBtn.active span:nth-child(1) {
  transform: translateY(10.5px) rotate(45deg);
}
#burgerBtn.active span:nth-child(2) {
  opacity: 0;
  transform: translateX(-10px);
}
#burgerBtn.active span:nth-child(3) {
  transform: translateY(-10.5px) rotate(-45deg);
}

/* =========================
   PAGE MENTIONS LÉGALES
   ========================= */

.legal {
    max-width: 800px;
    margin: 120px auto 60px; /* 120px en haut pour laisser la place à la navbar */
    padding: 40px;
    background: var(--background-light);
    border-radius: 20px;
    box-shadow: var(--shadow-medium);
    line-height: 1.8;
    color: var(--text-color);
}

.legal h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 40px;
    position: relative;
    padding-bottom: 15px;
}

/* Petit trait décoratif sous le titre */
.legal h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--secondary-color);
    border-radius: 2px;
}

.legal p {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.legal strong {
    color: var(--primary-color);
    font-weight: 700;
    display: inline-block;
    min-width: 150px; /* Aligne les intitulés */
}

.legal a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.legal a:hover {
    border-bottom-color: var(--secondary-color);
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
    .legal {
        margin: 100px 20px 40px;
        padding: 25px;
    }
    
    .legal h1 {
        font-size: 1.8rem;
    }
    
    .legal strong {
        display: block; /* Passe à la ligne sur mobile pour gagner de la place */
        margin-bottom: 5px;
    }
}

/* NAVBAR MOBILE */
@media (max-width: 768px) {
  .main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 250px;
    background: var(--primary-color);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 30px;
    transition: right 0.3s ease;
    z-index: 1500; /* inférieur au burger pour qu'il reste cliquable */
    display: flex;
  }

  .main-nav.open {
    right: 0;
  }

  .main-nav a {
    color: #fff;
    font-size: 1.2rem;
    background: none;
    padding: 10px 20px;
    border-radius: 10px;
    box-shadow: none;
  }

  .main-nav a:hover { background: var(--secondary-color); }

  #burgerBtn { display: flex; }
}



/* =========================
   RESPONSIVE
   ========================= */
@media (max-width: 992px) { .container { padding: 60px 20px; } }
@media (max-width: 768px) {
  header h1 { font-size: 3rem; }
  header h2 { font-size: 1.6rem; }
  header p { font-size: 1.15rem; }
  section h2 { font-size: 2.2rem; }
  .contact-form { padding: 30px; }
  nav a { margin: 5px; padding: 12px 25px; font-size: 0.95rem; }
  #about ul { gap: 10px; }
  footer p a { display: flex; flex-direction: column;}
}
@media (max-width: 576px) {
  header { padding: 80px 20px 100px; }
  header h1 { font-size: 2.5rem; }
  header h2 { font-size: 1.3rem; }
  section h2 { font-size: 2rem; }
  nav a { display: block; margin: 10px auto; max-width: 250px; }
  #about .text { text-align: left; }
  .project img { height: 250px; }
}

/* Intégration des animations de scroll */
[data-animate] {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Fix Navbar Mobile */
@media (max-width: 768px) {
  .main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 70%; /* Plus naturel que 250px sur certains écrans */
    background: var(--primary-color);
    flex-direction: column;
    padding-top: 80px; /* Laisser de la place pour le bouton fermer */
    justify-content: flex-start;
    box-shadow: -5px 0 15px rgba(0,0,0,0.3);
  }
  
  /* Empêcher le scroll quand le menu est ouvert */
  body.menu-open {
    overflow: hidden;
  }
}

/* Style des Toasts (manquant dans ton code) */
#toast-container {
  position: fixed;
  top: 70px;
  right: 30px;
  z-index: 10000;
}

.toast {
  padding: 15px 25px;
  border-radius: 8px;
  color: white;
  margin-top: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  animation: slideIn 0.3s ease-out;
}

.toast.success { background: var(--primary-color); }
.toast.error { background: var(--secondary-color); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}