:root {
  --bg-gradient-onyx: linear-gradient(to bottom right,
      hsl(240, 1%, 25%) 3%,
      hsl(0, 0%, 19%) 97%);
  --bg-gradient-jet: linear-gradient(to bottom right,
      hsla(240, 1%, 18%, 0.251) 0%,
      hsla(240, 2%, 11%, 0) 100%), hsl(240, 2%, 13%);
  /* Dégradés jaunes affinés */
  --bg-gradient-yellow-1: linear-gradient(to bottom right,
      #FFD700 0%,
      hsla(45, 100%, 50%, 0) 50%);
  --bg-gradient-yellow-2: linear-gradient(135deg,
      hsla(45, 85%, 68%, 0.251) 0%,
      hsla(40, 85%, 65%, 0) 59.86%), hsl(240, 2%, 13%);
  --border-gradient-onyx: linear-gradient(to bottom right,
      hsl(0, 0%, 25%) 0%,
      hsla(0, 0%, 25%, 0) 50%);
  /* Dégradé de texte jaune affiné */
  --text-gradient-yellow: linear-gradient(to right,
      #FFD700,
      #FFC700);

  --jet: hsl(0, 0%, 22%);
  --onyx: hsl(240, 1%, 17%);
  --eerie-black-1: hsl(240, 2%, 13%);
  --eerie-black-2: hsl(240, 2%, 12%);
  --smoky-black: hsl(0, 0%, 7%);
  --white-1: hsl(0, 0%, 100%);
  --white-2: hsl(0, 0%, 98%);
  /* Accents jaunes affinés - plus professionnel */
  --orange-yellow-crayola: #FFD700;
  --vegas-gold: #FFC700;
  --light-gray: hsl(0, 0%, 84%);
  --light-gray-70: hsla(0, 0%, 84%, 0.7);
  --bittersweet-shimmer: hsl(0, 43%, 51%);

  --ff-poppins: 'Poppins', sans-serif;
  --ff-montserrat: 'Montserrat', sans-serif;
  --ff-lato: 'Lato', sans-serif;

  /* Assignation des polices du thème par défaut (sombre) */
  --ff-heading: var(--ff-poppins);
  --ff-body: var(--ff-poppins);

  --fs-1: 24px;
  --fs-2: 18px;
  --fs-3: 17px;
  --fs-4: 16px;
  --fs-5: 15px;
  --fs-6: 14px;
  --fs-7: 13px;
  --fs-8: 11px;

  --fw-300: 300;
  --fw-400: 400;
  --fw-500: 500;
  --fw-600: 600;

  --shadow-1: 0 2px 4px hsla(0, 0%, 0%, 0.08), 0 4px 8px hsla(0, 0%, 0%, 0.04);
  --shadow-2: 0 4px 8px hsla(0, 0%, 0%, 0.12), 0 8px 16px hsla(0, 0%, 0%, 0.08);
  --shadow-3: 0 8px 16px hsla(0, 0%, 0%, 0.15), 0 12px 24px hsla(0, 0%, 0%, 0.1);
  --shadow-4: 0 12px 24px hsla(0, 0%, 0%, 0.18), 0 16px 32px hsla(0, 0%, 0%, 0.12);
  --shadow-5: 0 20px 40px hsla(0, 0%, 0%, 0.25), 0 24px 48px hsla(0, 0%, 0%, 0.15);
  --shadow-hover: 0 10px 20px hsla(0, 0%, 0%, 0.15), 0 6px 10px hsla(0, 0%, 0%, 0.1);

  --transition-1: 0.25s ease;
  --transition-std: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-2: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);

  /* Couleurs d'animation de fond (Thème sombre) */
  --anim-bg-color-1: hsl(240, 5%, 15%);
  --anim-bg-color-2: hsl(220, 5%, 18%);
  --anim-bg-color-3: hsl(240, 3%, 12%);
  --anim-bg-color-4: hsl(210, 5%, 16%);
}

/* Variables du thème clair */
html[data-theme="light"] {
  --primary-bg: #F8F9FA;
  --secondary-bg: #FFFFFF;
  --primary-text: #212529;
  --secondary-text: #495057;
  --primary-accent: #007BFF;
  --secondary-accent: #6C757D;
  --border-color: #DEE2E6;
  --shadow-color-light: hsla(0, 0%, 0%, 0.1);

  /* Surcharges pour le thème clair */
  --bg-gradient-onyx: linear-gradient(to bottom right, #E9ECEF 3%, #F8F9FA 97%);
  --bg-gradient-jet: linear-gradient(to bottom right, hsla(210, 16%, 80%, 0.1) 0%, hsla(210, 16%, 90%, 0) 100%), var(--secondary-bg);
  --border-gradient-onyx: linear-gradient(to bottom right, #DEE2E6 0%, hsla(210, 16%, 87%, 0) 50%);
  --text-gradient-yellow: linear-gradient(to right, var(--primary-accent), #0056b3);

  --jet: var(--border-color);
  --onyx: #E9ECEF;
  --eerie-black-1: var(--secondary-bg);
  --eerie-black-2: var(--secondary-bg);
  --smoky-black: var(--primary-bg);
  --white-1: var(--primary-text);
  --white-2: var(--primary-text);
  --orange-yellow-crayola: var(--primary-accent);
  --vegas-gold: #0056b3;
  /* Bleu plus foncé pour l'accent secondaire si nécessaire */
  --light-gray: var(--secondary-text);
  --light-gray-70: hsla(210, 14%, 31%, 0.7);
  /* Ajusté pour le contraste */

  --shadow-1: -2px 4px 12px var(--shadow-color-light);
  --shadow-2: 0 8px 16px var(--shadow-color-light);
  --shadow-3: 0 10px 20px var(--shadow-color-light);
  --shadow-4: 0 15px 25px var(--shadow-color-light);
  --shadow-5: 0 20px 40px var(--shadow-color-light);

  /* Assignation des polices du thème clair - Utiliser les mêmes polices que le thème sombre pour maintenir la cohérence du layout */

  /* Couleurs d'animation de fond (Thème clair) */
  --anim-bg-color-1: hsl(210, 20%, 95%);
  --anim-bg-color-2: hsl(220, 15%, 97%);
  --anim-bg-color-3: hsl(210, 25%, 92%);
  --anim-bg-color-4: hsl(200, 18%, 96%);
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

a {
  text-decoration: none;
}

li {
  list-style: none;
}

img,
ion-icon,
a,
button,
time,
span {
  display: block;
}

button {
  font: inherit;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
}

input,
textarea {
  display: block;
  width: 100%;
  background: none;
  font: inherit;
}

::selection {
  background: var(--orange-yellow-crayola);
  color: var(--smoky-black);
}

:focus {
  outline-color: var(--orange-yellow-crayola);
}

html {
  font-family: var(--ff-body);
  /* Propriété 'overflow: hidden;' supprimée pour autoriser le défilement global */
  overflow-y: scroll;
  /* Toujours afficher la barre de défilement pour éviter le décalage du layout */
}

body {
  background: var(--smoky-black);
  color: var(--light-gray);
  background: linear-gradient(-45deg, var(--anim-bg-color-1), var(--anim-bg-color-2), var(--anim-bg-color-3), var(--anim-bg-color-4));
  background-size: 400% 400%;
  animation: animatedBackground 30s ease infinite;
  transition: color var(--transition-std);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

@keyframes animatedBackground {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

html[data-theme="light"] body {
  color: var(--primary-text);
}

.sidebar,
article {
  background: var(--eerie-black-2);
  border: 1px solid var(--jet);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow-2);
  z-index: 1;
  backdrop-filter: blur(10px);
  /* transition: all var(--transition-std); Removed to prevent flicker */
}

.separator {
  width: 100%;
  height: 1px;
  background: var(--jet);
  transition: background var(--transition-std);
  margin: 16px 0;
}

.icon-box {
  position: relative;
  background: var(--border-gradient-onyx);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  color: var(--orange-yellow-crayola);
  box-shadow: var(--shadow-1);
  z-index: 1;
  transition: all var(--transition-std);
}

.icon-box::before {
  content: "";
  position: absolute;
  inset: 1px;
  background: var(--eerie-black-1);
  transition: background var(--transition-std);
  border-radius: inherit;
  z-index: -1;
}

.icon-box ion-icon {
  --ionicon-stroke-width: 35px;
}

article {
  display: none;
}

article.active {
  display: block;
  animation: none !important;
  transition: none !important;
}

/* Fix Mobile Width for Projects and Contact */
@media (max-width: 580px) {

  article.projets,
  article.contact {
    padding: 15px 10px !important;
    /* Reduced horizontal padding, forced */
  }
}


@keyframes fadeInUp {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

/* Assurer une hauteur minimale cohérente pour toutes les sections de contenu principales */
article[data-page] {
  min-height: 85vh;
  /* Assurer une hauteur cohérente entre toutes les sections */
}

.h2,
.h3,
.h4,
.h5 {
  color: var(--white-2);
  font-family: var(--ff-heading);
  text-transform: capitalize;
  transition: color var(--transition-std);
}

.h2 {
  font-size: var(--fs-1);
}

.h3 {
  font-size: var(--fs-2);
}

.h4 {
  font-size: var(--fs-4);
}

.h5 {
  font-size: var(--fs-7);
  font-weight: var(--fw-500);
}

.article-title {
  position: relative;
  padding-bottom: 7px;
}

.article-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 30px;
  height: 3px;
  background: var(--text-gradient-yellow);
  transition: background var(--transition-std);
  border-radius: 3px;
}

/* Styles spécifiques mobiles (max-width: 767px) */
@media (max-width: 767px) {
  .skills-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 15px 0;
  }
}


.content-card {
  position: relative;
  background: var(--border-gradient-onyx);
  padding: 15px;
  padding-top: 45px;
  border-radius: 14px;
  box-shadow: var(--shadow-2);
  cursor: pointer;
  z-index: 1;
  transition: background var(--transition-std), box-shadow var(--transition-std);
}

.content-card::before {
  content: "";
  position: absolute;
  inset: 1px;
  background: var(--bg-gradient-jet);
  transition: background var(--transition-std);
  border-radius: inherit;
  z-index: -1;
}

main {
  margin: 15px 12px;
  margin-bottom: 75px;
  min-width: 259px;
}


.sidebar {
  margin-bottom: 15px;
  max-height: 160px;
  /* Adjusted for larger avatar */
  overflow: hidden;
  transition: max-height var(--transition-2), background var(--transition-std), border-color var(--transition-std), box-shadow var(--transition-std);
  /* Conserver la transition plus lente pour la hauteur */
}

.sidebar.active {
  max-height: 600px;
}

.sidebar-info {
  position: relative;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 15px;
}

.avatar-box {
  background: var(--bg-gradient-onyx);
  transition: background var(--transition-std), padding var(--transition-std);
  border-radius: 50%;
  padding: 5px;
}

.avatar-box img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 50%;
}

.info-content .name {
  color: var(--white-2);
  transition: color var(--transition-std);
  font-size: var(--fs-3);
  font-weight: var(--fw-500);
  letter-spacing: -0.25px;
  margin-bottom: 10px;
}

.info-content .title {
  color: var(--white-1);
  background: var(--onyx);
  font-size: var(--fs-8);
  font-weight: var(--fw-300);
  width: max-content;
  padding: 3px 12px;
  border-radius: 8px;
  transition: background var(--transition-std), color var(--transition-std);
}

.info_more-btn {
  position: absolute;
  top: -15px;
  right: -15px;
  border-radius: 0 15px;
  font-size: 13px;
  color: var(--orange-yellow-crayola);
  background: var(--border-gradient-onyx);
  padding: 10px;
  box-shadow: var(--shadow-2);
  transition: background var(--transition-std), color var(--transition-std), box-shadow var(--transition-std);
  z-index: 1;
}

.info_more-btn::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: var(--bg-gradient-jet);
  transition: background var(--transition-std);
  z-index: -1;
}

.info_more-btn:hover,
.info_more-btn:focus {
  background: var(--bg-gradient-yellow-1);
}

.info_more-btn:hover::before,
.info_more-btn:focus::before {
  background: var(--bg-gradient-yellow-2);
}

.info_more-btn span {
  display: none;
}

.sidebar-info_more {
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-2), visibility var(--transition-2);
  /* Conserver la transition plus lente */
}

.sidebar.active .sidebar-info_more {
  opacity: 1;
  visibility: visible;
}

.contacts-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.contact-item {
  min-width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
}

a.contact-link-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.contact-info {
  flex-grow: 1;
  min-width: 0;
  /* Empêcher les problèmes de débordement avec du texte long */
}

.contact-title {
  color: var(--light-gray);
  transition: color var(--transition-std);
  font-size: var(--fs-8);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.contact-info :is(.contact-link, time, address) {
  color: var(--white-2);
  transition: color var(--transition-std);
  font-size: var(--fs-7);
}

.contact-info address {
  font-style: normal;
}

.social-list {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 15px;
  padding-bottom: 4px;
  padding-left: 7px;
}

.social-item .social-link {
  color: var(--light-gray);
  font-size: 18px;
  transition: all var(--transition-std);
  display: inline-block;
}

.social-item .social-link:hover {
  color: var(--orange-yellow-crayola);
  transform: translateY(-3px) scale(1.2);
}

.contact-item:has(a[href="cv.pdf"]),
.contact-item:has(.contact-link[href^="mailto"]),
.contact-item:has(.contact-link[href^="tel"]) {
  padding: 8px 10px;
  border-radius: 8px;
  transition: background-color var(--transition-std), transform var(--transition-std);
  cursor: pointer;
  margin: -8px -10px;
  /* Compenser le padding pour maintenir l'alignement */
}

.contact-item:has(a[href="cv.pdf"]):hover,
.contact-item:has(a[href="cv.pdf"]):focus-within,
.contact-item:has(.contact-link[href^="mailto"]):hover,
.contact-item:has(.contact-link[href^="tel"]):hover,
.contact-item:has(.contact-link[href^="mailto"]):focus-within,
.contact-item:has(.contact-link[href^="tel"]):focus-within {
  background-color: var(--onyx);
  transform: scale(1.02);
}

html[data-theme="light"] .contact-item:has(a[href="cv.pdf"]):hover,
html[data-theme="light"] .contact-item:has(a[href="cv.pdf"]):focus-within,
html[data-theme="light"] .contact-item:has(.contact-link[href^="mailto"]):hover,
html[data-theme="light"] .contact-item:has(.contact-link[href^="tel"]):hover,
html[data-theme="light"] .contact-item:has(.contact-link[href^="mailto"]):focus-within,
html[data-theme="light"] .contact-item:has(.contact-link[href^="tel"]):focus-within {
  background-color: hsl(0, 0%, 95%);
}


.cv-button-link {
  padding: 10px 20px;
  border-radius: 8px;
  background: var(--onyx);
  border: 1px solid var(--jet);
  box-shadow: var(--shadow-1);
  transition: background var(--transition-std), color var(--transition-std), border-color var(--transition-std), transform var(--transition-std), box-shadow var(--transition-std);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: auto;
  margin-top: 10px;
}

.cv-button-link .icon-box {
  background: transparent;
  box-shadow: none;
  width: auto;
  height: auto;
  color: var(--orange-yellow-crayola);
  font-size: 18px;
}

.cv-button-link .icon-box::before {
  display: none;
}

.cv-button-link .contact-info {
  flex-grow: 0;
  min-width: auto;
}

.cv-button-link .contact-title {
  color: var(--white-1);
  font-size: var(--fs-6);
  font-weight: var(--fw-500);
  text-transform: none;
  margin-bottom: 0;
}

.cv-button-link address {
  display: none;
}

.cv-button-link:hover {
  background: var(--border-gradient-onyx);
  border-color: var(--orange-yellow-crayola);
  color: var(--orange-yellow-crayola);
  transform: translateY(-2px);
  box-shadow: var(--shadow-3);
}

.cv-button-link:hover .icon-box {
  color: inherit;
}

.cv-button-link:hover .contact-title {
  color: inherit;
}

.cv-button-link:active {
  transform: translateY(0px) scale(0.98);
  box-shadow: var(--shadow-1);
  background: var(--eerie-black-1);
}

html[data-theme="light"] .cv-button-link {
  background: var(--secondary-bg);
  border-color: var(--border-color);
  box-shadow: var(--shadow-1);
}

html[data-theme="light"] .cv-button-link .icon-box {
  color: var(--primary-accent);
}

html[data-theme="light"] .cv-button-link .contact-title {
  color: var(--primary-text);
}

html[data-theme="light"] .cv-button-link:hover {
  background: #e9ecef;
  border-color: var(--primary-accent);
  color: var(--primary-accent);
}

html[data-theme="light"] .cv-button-link:active {
  background: #dee2e6;
  box-shadow: var(--shadow-1);
}


/* Note : Le lien du bouton CV gère désormais son propre survol/focus */
.contact-item:not(:has(.cv-button-link)) .contact-link:hover,
.contact-item:not(:has(.cv-button-link)) .contact-link:focus {
  color: var(--orange-yellow-crayola);
}

html[data-theme="light"] .contact-item:not(:has(.cv-button-link)) .contact-link:hover,
html[data-theme="light"] .contact-item:not(:has(.cv-button-link)) .contact-link:focus {
  color: var(--primary-accent);
}

.contact-item:not(:has(.cv-button-link)) .contact-link:hover,
.contact-item .contact-link:focus {
  color: var(--orange-yellow-crayola);
  text-decoration: underline;
}

.contact-info .contact-link,
.contacts-list>a .contact-info address {
  transition: color var(--transition-std), text-decoration var(--transition-std);
}


.navbar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: hsla(240, 1%, 17%, 0.75);
  backdrop-filter: blur(10px);
  border: 1px solid var(--jet);
  border-radius: 12px 12px 0 0;
  box-shadow: var(--shadow-2);
  z-index: 5;
  transition: background var(--transition-std), border-color var(--transition-std), box-shadow var(--transition-std);
}

html[data-theme="light"] .navbar {
  background: var(--secondary-bg);
  border-color: var(--border-color);
}

.navbar-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  padding: 0 10px;
}

.navbar-link {
  color: var(--light-gray);
  font-size: var(--fs-8);
  padding: 20px 7px;
  transition: all var(--transition-std);
  position: relative;
}

.navbar-link::after {
  content: '';
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 30px;
  height: 2px;
  background: var(--orange-yellow-crayola);
  transition: transform var(--transition-std);
}

.navbar-link:hover,
.navbar-link:focus {
  color: var(--white-1);
  transform: translateY(-2px);
}

.navbar-link:hover::after,
.navbar-link:focus::after {
  transform: translateX(-50%) scaleX(1);
}

.navbar-link.active {
  color: var(--orange-yellow-crayola);
}

.navbar-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 2px;
  background: var(--orange-yellow-crayola);
}



.about .article-title {
  margin-bottom: 15px;
}

.about-text {
  color: var(--light-gray);
  font-size: var(--fs-6);
  font-weight: var(--fw-300);
  line-height: 1.6;
  transition: color var(--transition-std);
}

.about-text p {
  margin-bottom: 15px;
}



.service {
  margin-bottom: 35px;
}

.service-title {
  margin-bottom: 20px;
}

.service-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.service-item {
  position: relative;
  background: var(--border-gradient-onyx);
  padding: 20px;
  border-radius: 14px;
  box-shadow: var(--shadow-2);
  z-index: 1;
  transition: background var(--transition-std), box-shadow var(--transition-std);
}

.service-item::before {
  content: "";
  position: absolute;
  inset: 1px;
  background: var(--bg-gradient-jet);
  transition: background var(--transition-std);
  border-radius: inherit;
  z-index: -1;
}

.service-icon-box {
  margin-bottom: 10px;
}

.service-icon-box img {
  margin: auto;
}

.service-content-box {
  text-align: center;
}

.service-item-title {
  margin-bottom: 7px;
}

.service-item-text {
  color: var(--light-gray);
  font-size: var(--fs-6);
  line-height: 1.6;
  transition: color var(--transition-std);
}


.testimonials {
  margin-bottom: 30px;
}

.testimonials-title {
  margin-bottom: 20px;
}

.testimonials-list {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 15px;
  margin: 0 -15px;
  padding: 25px 15px;
  padding-bottom: 35px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: inline mandatory;
}

.testimonials-item {
  min-width: 100%;
  scroll-snap-align: center;
}

.testimonials-avatar-box {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(15px, -25px);
  background: var(--bg-gradient-onyx);
  border-radius: 14px;
  box-shadow: var(--shadow-1);
}

.testimonials-item-title {
  margin-bottom: 7px;
}

.testimonials-text {
  color: var(--light-gray);
  font-size: var(--fs-6);
  font-weight: var(--fw-300);
  line-height: 1.6;
  display: -webkit-box;
  line-clamp: 4;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


.modal-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 20;
  pointer-events: none;
  visibility: hidden;
}


.modal-container.active {
  pointer-events: all;
  visibility: visible;
}

/* Prevent body scroll when modal is open */
body:has(.modal-container.active) {
  overflow: hidden;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: hsl(0, 0%, 5%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 1;
  transition: opacity var(--transition-std), visibility var(--transition-std);
}

.overlay.active {
  opacity: 0.8;
  visibility: visible;
  pointer-events: all;
}

.testimonials-modal {
  background: var(--eerie-black-2);
  position: relative;
  padding: 15px;
  margin: 15px 12px;
  border: 1px solid var(--jet);
  border-radius: 14px;
  box-shadow: var(--shadow-5);
  transform: scale(1.2);
  opacity: 0;
  transition: transform var(--transition-std), opacity var(--transition-std);
  z-index: 2;
}

.modal-container.active .testimonials-modal {
  transform: scale(1);
  opacity: 1;
}

.modal-close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: var(--onyx);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--white-2);
  font-size: 18px;
  opacity: 0.7;
}

.modal-close-btn:hover,
.modal-close-btn:focus {
  opacity: 1;
}

.modal-close-btn ion-icon {
  --ionicon-stroke-width: 50px;
}

.modal-avatar-box {
  background: var(--bg-gradient-onyx);
  width: max-content;
  border-radius: 14px;
  margin-bottom: 15px;
  box-shadow: var(--shadow-2);
}

.modal-img-wrapper>img {
  display: none;
}

.modal-title {
  margin-bottom: 4px;
}

.modal-content time {
  font-size: var(--fs-6);
  color: var(--light-gray);
  /* Increased contrast */
  font-weight: var(--fw-300);
  margin-bottom: 10px;
}

.modal-content p {
  color: var(--light-gray);
  font-size: var(--fs-6);
  font-weight: var(--fw-300);
  line-height: 1.6;
}


.clients {
  margin-bottom: 15px;
}

.clients-list {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 15px;
  margin: 0 -15px;
  padding: 25px;
  padding-bottom: 25px;
  overflow-x: auto;
  scroll-behavior: smooth;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline mandatory;
  scroll-padding-inline: 25px;
}

.clients-item {
  min-width: 50%;
  scroll-snap-align: start;
}

.clients-item img {
  width: 100%;
  filter: grayscale(1);
  transition: filter var(--transition-std);
}

/* .clients-item img:hover { filter: grayscale(0); } */


.article-title {
  margin-bottom: 30px;
}

.timeline {
  margin-bottom: 30px;
}

.timeline .title-wrapper {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 25px;
}

.timeline-list {
  font-size: var(--fs-6);
  margin-left: 45px;
}

.timeline-item {
  position: relative;
  transition: all var(--transition-std);
  padding: 10px;
  margin-left: -10px;
  border-radius: 12px;
  border: 1px solid transparent;
}

.timeline-item:hover {
  transform: translateX(5px);
  background-color: var(--onyx);
  border-color: var(--orange-yellow-crayola);
  box-shadow: var(--shadow-2);
}

html[data-theme="light"] .timeline-item:hover {
  background-color: hsl(0, 0%, 95%);
}

.timeline-item:not(:last-child) {
  margin-bottom: 20px;
}

.timeline-item-title {
  font-size: var(--fs-6);
  line-height: 1.3;
  margin-bottom: 7px;
}

.timeline-item-title span {
  color: inherit;
}

.timeline-list span {
  color: var(--vegas-gold);
  font-weight: var(--fw-400);
  line-height: 1.6;
}

.timeline-item:not(:last-child)::before {
  content: "";
  position: absolute;
  top: -25px;
  left: -30px;
  width: 2px;
  height: calc(100% + 50px);
  background: var(--jet);
}

.timeline-item::after {
  content: "";
  position: absolute;
  top: 5px;
  left: -33px;
  height: 6px;
  width: 6px;
  background: var(--text-gradient-yellow);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--jet);
}

.timeline-text {
  color: var(--light-gray);
  font-weight: var(--fw-300);
  line-height: 1.6;
}


.skills-title {
  margin-bottom: 20px;
}

.skills-list {
  padding: 20px;
}


.skills-item:not(:last-child) {
  margin-bottom: 15px;
}

.skill .title-wrapper {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}



.skill .title-wrapper data {
  color: var(--light-gray);
  font-size: var(--fs-7);
  font-weight: var(--fw-300);
}

.skill-progress-bg {
  background: var(--jet);
  width: 100%;
  height: 8px;
  border-radius: 10px;
}

.skill-progress-fill {
  background: var(--text-gradient-yellow);
  height: 100%;
  border-radius: inherit;
}


.filter-list {
  display: none;
}

.filter-select-box {
  position: relative;
  margin-bottom: 25px;
}

.filter-select {
  background: var(--eerie-black-2);
  color: var(--light-gray);
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--jet);
  border-radius: 14px;
  font-size: var(--fs-6);
  font-weight: var(--fw-300);
}

.filter-select.active .select-icon {
  transform: rotate(0.5turn);
}

.select-list {
  background: var(--eerie-black-2);
  position: absolute;
  top: calc(100% + 6px);
  width: 100%;
  padding: 6px;
  border: 1px solid var(--jet);
  border-radius: 14px;
  z-index: 2;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease-in-out, visibility 0.15s ease-in-out;
  /* Conserver la transition rapide pour le menu déroulant */
}

.filter-select.active+.select-list {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.select-item button {
  background: var(--eerie-black-2);
  color: var(--light-gray);
  font-size: var(--fs-6);
  font-weight: var(--fw-300);
  text-transform: capitalize;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
}

.select-item button:hover {
  --eerie-black-2: hsl(240, 2%, 20%);
}

.project-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  margin-bottom: 10px;
  margin-left: 0;
  padding-left: 0 !important;
  /* Fix mobile width indentation */
  padding-right: 0;
  /* Remove right padding as scrollbar is gone */
  padding-bottom: 25px;
  /* Ajouter de l'espace en bas pour la visibilité du dernier élément */
}

.project-item {
  display: none;
}

.project-item.active {
  display: block;
  /* animation: fadeInUp 0.5s ease-out forwards; */
}


.project-item>a {
  width: 100%;
  display: block;
  transition: all var(--transition-std);
  border-radius: 16px;
}

.project-img {
  position: relative;
  width: 100%;
  height: 200px;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 15px;
}

.project-img::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  z-index: 1;
  transition: background-color var(--transition-std);
}

.project-item>a:hover .project-img::before {
  background: hsla(0, 0%, 0%, 0.5);
}

.project-hover-text {
  content: 'Voir détails';
  /* Fallback */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #FFFFFF !important;
  /* Ensure white text regardless of theme */
  font-size: var(--fs-6);
  font-weight: var(--fw-500);
  opacity: 0;
  z-index: 2;
  transition: opacity var(--transition-std);
  pointer-events: none;
  width: 100%;
  text-align: center;
}

.project-item>a:hover .project-hover-text {
  opacity: 1;
}


.project-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-std);
}

.project-item>a:hover img {
  transform: scale(1.1);
}

.project-item>a:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.project-title,
.project-category {
  margin-left: 10px;
}

.project-title {
  color: var(--white-2);
  font-size: var(--fs-5);
  font-weight: var(--fw-400);
  text-transform: capitalize;
  line-height: 1.3;
}

.project-category {
  color: var(--light-gray);
  font-size: var(--fs-6);
  font-weight: var(--fw-300);
  margin-bottom: 10px;
}

.project-details-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--orange-yellow-crayola);
  font-size: var(--fs-7);
  margin-left: 10px;
  padding: 5px 0;
  transition: color var(--transition-std);
}

.project-details-btn ion-icon {
  font-size: 16px;
  --ionicon-stroke-width: 40px;
}

.project-details-btn:hover,
.project-details-btn:focus {
  color: var(--vegas-gold);
}



.project-modal {
  background: var(--eerie-black-2);
  position: relative;
  padding: 5px;
  /* Aggressively reduced for '0 écart' request */
  margin: 15px 12px;
  border: 1px solid var(--jet);
  border-radius: 14px;
  box-shadow: var(--shadow-5);
  transform: scale(1.2);
  opacity: 0;
  transition: background-color var(--transition-std), border-color var(--transition-std), transform var(--transition-std), opacity var(--transition-std);
  z-index: 2;
  max-width: 1000px;
  width: 95%;
  /* max-height and overflow removed - content fits in 2-column layout */
}

.project-modal-container.active .project-modal {
  transform: scale(1);
  opacity: 1;
}

.project-modal .modal-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.5);
  /* Make it visible/clickable if overlapping image */
  border-radius: 50%;
  padding: 5px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-std);
}

.project-modal .modal-close-btn:hover {
  background: var(--orange-yellow-crayola);
  color: var(--onyx);
}

.project-modal .modal-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.project-modal .modal-img-wrapper {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 0;
}

.project-modal .modal-img-wrapper img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.project-modal .modal-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.project-modal .modal-title {
  margin-bottom: 0;
  margin-top: 10px;
  /* Minimal space */
}

.project-modal .project-modal-category {
  color: var(--light-gray-70);
  font-size: var(--fs-7);
  margin-bottom: 15px;
}

.project-modal h4 {
  color: var(--white-2);
  font-size: var(--fs-5);
  margin-bottom: 5px;
  border-bottom: 1px solid var(--jet);
  padding-bottom: 5px;
}

.project-modal p {
  color: var(--light-gray);
  font-size: var(--fs-6);
  line-height: 1.6;
}

.project-modal .project-link-btn {
  margin-top: 15px;
  width: max-content;
}

html[data-theme="light"] .project-modal {
  background: var(--secondary-bg);
  border-color: var(--border-color);
}

html[data-theme="light"] .project-modal h4 {
  color: var(--primary-text);
  border-color: var(--border-color);
}

html[data-theme="light"] .project-modal p,
html[data-theme="light"] .project-modal .project-modal-category {
  color: var(--secondary-text);
}

@media (min-width: 768px) {
  .project-modal {
    padding: 30px;
  }

  .project-modal .modal-content {
    flex-direction: row;
    align-items: flex-start;
    gap: 30px;
  }

  .project-modal .modal-img-wrapper {
    width: 40%;
    flex-shrink: 0;
  }

  .project-modal .modal-info {
    width: 60%;
  }
}


section.contact-form {
  width: 100%;
  box-sizing: border-box;
  padding: 0;
}

.form-title {
  margin-bottom: 20px;
}

/* Contact Form Enhancements */
.contact-form {
  /* Mobile: Minimal styling to maximize width */
  margin-bottom: 0;
}

@media (min-width: 580px) {
  .contact-form {
    background: var(--eerie-black-1);
    padding: 30px;
    border-radius: 20px;
    box-shadow: var(--shadow-2);
  }
}

.input-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 25px;
  margin-bottom: 25px;
}

.form-input {
  color: var(--white-2);
  font-size: var(--fs-6);
  font-weight: var(--fw-400);
  padding: 16px 20px;
  padding-left: 45px;
  min-height: 55px;
  border: 2px solid transparent;
  border-radius: 14px;
  outline: none;
  background: var(--eerie-black-2);
  transition: all var(--transition-std);
  position: relative;
}

.form-input::placeholder {
  font-weight: var(--fw-400);
  opacity: 0.7;
  transition: opacity var(--transition-std);
}

.form-input:focus::placeholder {
  opacity: 0.4;
}

.form-input:focus {
  border-color: var(--orange-yellow-crayola);
  background: var(--onyx);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px hsla(45, 100%, 50%, 0.2);
}

textarea.form-input {
  min-height: 150px;
  height: 180px;
  max-height: 300px;
  resize: vertical;
  margin-bottom: 25px;
}

textarea.form-input::-webkit-resizer {
  display: none;
}

.form-input:focus:invalid,
.form-input.invalid,
.form-input.error {
  border-color: var(--bittersweet-shimmer);
}

.error-message {
  display: none;
  color: var(--bittersweet-shimmer);
  font-size: var(--fs-8);
  margin-top: 5px;
  margin-left: 20px;
}

.form-input.invalid+.error-message {
  display: block;
}

.form-btn {
  position: relative;
  width: 100%;
  background: var(--orange-yellow-crayola);
  color: var(--smoky-black);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 16px 24px;
  border-radius: 14px;
  font-size: var(--fs-5);
  font-weight: var(--fw-600);
  text-transform: capitalize;
  box-shadow: var(--shadow-3);
  z-index: 1;
  transition: all var(--transition-std);
  border: none;
  cursor: pointer;
}


.form-btn ion-icon {
  font-size: 16px;
}

.form-btn:hover {
  background: var(--vegas-gold);
  transform: translateY(-3px);
  box-shadow: var(--shadow-4);
}


.form-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--border-gradient-onyx);
}

.form-btn:disabled:hover {
  background: var(--border-gradient-onyx);
  color: var(--light-gray);
}

.form-btn:disabled:hover::before {
  background: var(--bg-gradient-jet);
}

html[data-theme="light"] .form-input {
  background-color: var(--secondary-bg);
  border-color: var(--border-color);
  color: var(--primary-text);
}

html[data-theme="light"] .form-input:focus {
  border-color: var(--primary-accent);
}

html[data-theme="light"] .form-input:focus:invalid {
  border-color: var(--bittersweet-shimmer);
}

html[data-theme="light"] .form-btn {
  background: var(--primary-accent);
  color: var(--secondary-bg);
}

html[data-theme="light"] .form-btn::before {
  background: transparent;
}

html[data-theme="light"] .form-btn:hover {
  background: var(--vegas-gold);
}

html[data-theme="light"] .form-btn:disabled {
  background: var(--border-color);
  color: var(--light-gray);
  opacity: 0.7;
}

html[data-theme="light"] .form-btn:disabled:hover {
  background: var(--border-color);
  color: var(--light-gray);
}

html[data-theme="light"] .form-btn:disabled::before {
  background: transparent;
}

/* Formulaire de contact refait */
.form-group {
  margin-bottom: 20px;
  position: relative;
}

.form-group .form-input {
  width: 100%;
  margin-bottom: 0;
}

.error-message {
  font-size: 12px;
  color: #ff4444;
  margin-top: 5px;
  display: block;
  min-height: 18px;
}

html[data-theme="light"] .error-message {
  color: #d32f2f;
}

.form-status {
  margin-top: 15px;
  /* Déjà défini en ligne, mais bon pour la cohérence */
  font-size: var(--fs-6);
  font-weight: var(--fw-500);
  /* La couleur est définie dynamiquement via JS, mais une valeur par défaut pourrait être ajoutée */
  text-align: center;
  padding: 10px;
  border-radius: 8px;
  background-color: rgba(var(--orange-yellow-crayola-rgb, 250, 213, 95), 0.1);
  /* Utiliser RGB pour l'opacité */
}

html[data-theme="light"] .form-status {
  background-color: rgba(var(--primary-accent-rgb, 0, 123, 255), 0.1);
}



@media (min-width: 450px) {


  .clients-item {
    min-width: calc(33.33% - 10px);
  }

  .project-img {
    height: auto;
  }
}


@media (min-width: 580px) {


  :root {


    --fs-1: 32px;
    --fs-2: 24px;
    --fs-3: 26px;
    --fs-4: 18px;
    --fs-6: 15px;
    --fs-7: 15px;
    --fs-8: 12px;

  }



  .sidebar {
    /* Keep sidebar separate */
    width: 520px;
    margin-inline: auto;
    padding: 30px;
  }

  article[data-page] {
    /* Ensure all articles take full defined width */
    width: 520px;
    margin-inline: auto;
    padding: 30px;
    box-sizing: border-box;
    /* Include padding in width calculation */
  }

  .article-title {
    font-weight: var(--fw-600);
    padding-bottom: 15px;
  }

  .article-title::after {
    width: 40px;
    height: 5px;
  }

  .icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    font-size: 18px;
  }


  main {
    margin-top: 60px;
    margin-bottom: 100px;
  }



  .sidebar {
    max-height: 180px;
    margin-bottom: 30px;
  }

  .sidebar.active {
    max-height: 700px;
  }

  .sidebar-info {
    gap: 25px;
  }

  .avatar-box {
    border-radius: 50%;
  }

  .avatar-box img {
    width: 120px;
  }

  .info-content .name {
    margin-bottom: 15px;
  }

  .info-content .title {
    padding: 5px 18px;
  }

  .info_more-btn {
    top: -30px;
    right: -30px;
    padding: 10px 15px;
  }

  .info_more-btn span {
    display: block;
    font-size: var(--fs-8);
  }

  .info_more-btn ion-icon {
    display: none;
  }

  .separator {
    margin: 32px 0;
  }

  .contacts-list {
    gap: 20px;
  }

  .contact-info {
    max-width: calc(100%);
    width: calc(100%);
  }



  .navbar {
    border-radius: 20px 20px 0 0;
  }

  .navbar-list {
    gap: 20px;
  }

  .navbar-link {
    --fs-8: 14px;
  }



  .about .article-title {
    margin-bottom: 20px;
  }

  .about-text {
    margin-bottom: 40px;
  }


  .service-item {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 18px;
    padding: 30px;
  }

  .service-icon-box {
    margin-bottom: 0;
    margin-top: 5px;
  }

  .service-content-box {
    text-align: left;
  }


  .testimonials-title {
    margin-bottom: 25px;
  }

  .testimonials-list {
    gap: 30px;
    margin: 0 -30px;
    padding: 30px;
    padding-bottom: 35px;
  }

  .content-card {
    padding: 30px;
    padding-top: 25px;
  }

  .testimonials-avatar-box {
    transform: translate(30px, -30px);
    border-radius: 20px;
  }

  .testimonials-avatar-box img {
    width: 80px;
  }

  .testimonials-item-title {
    margin-bottom: 10px;
    margin-left: 95px;
  }

  .testimonials-text {
    line-clamp: 2;
    -webkit-line-clamp: 2;
  }


  .modal-container {
    padding: 20px;
  }

  .testimonials-modal {
    display: flex;
    justify-content: flex-start;
    align-items: stretch;
    gap: 25px;
    padding: 30px;
    border-radius: 20px;
  }

  .modal-img-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .modal-avatar-box {
    border-radius: 18px;
    margin-bottom: 0;
  }

  .modal-avatar-box img {
    width: 65px;
  }

  .modal-img-wrapper>img {
    display: block;
    flex-grow: 1;
    width: 35px;
  }


  .clients-list {
    gap: 50px;
    margin: 0 -30px;
    padding: 45px;
    scroll-padding-inline: 45px;
  }

  .clients-item {
    min-width: calc(33.33% - 35px);
  }


  .timeline-list {
    margin-left: 65px;
  }

  .timeline-item:not(:last-child)::before {
    left: -40px;
  }

  .timeline-item::after {
    height: 8px;
    width: 8px;
    left: -43px;
  }

  .skills-item:not(:last-child) {
    margin-bottom: 25px;
  }


  .project-img {
    border-radius: 16px;
  }


  .input-wrapper {
    gap: 30px;
    margin-bottom: 30px;
  }

  .form-input {
    padding: 15px 20px;
  }

  textarea.form-input {
    margin-bottom: 30px;
  }

  .form-btn {
    --fs-6: 16px;
    padding: 16px 20px;
  }

  .form-btn ion-icon {
    font-size: 18px;
  }

}


@media (min-width: 768px) {

  .sidebar {
    width: 700px;
  }

  /* Keep sidebar separate */
  article[data-page] {
    width: 700px;
  }

  /* Ensure all articles take full defined width */



  .contacts-list {
    grid-template-columns: 1fr 1fr;
    gap: 30px 15px;
  }

  .navbar-link {
    --fs-8: 15px;
  }


  .testimonials-modal {
    gap: 35px;
    max-width: 680px;
  }

  .modal-avatar-box img {
    width: 80px;
  }


  .article-title {
    padding-bottom: 20px;
  }

  .filter-select-box {
    display: none;
  }

  .filter-list {
    display: flex;
    flex-wrap: wrap;
    /* Allow wrapping on slightly smaller screens */
    justify-content: flex-start;
    align-items: center;
    gap: 15px 25px;
    /* Row and column gap */
    padding-left: 5px;
    margin-bottom: 30px;
  }

  .filter-item button {
    color: var(--light-gray);
    font-size: var(--fs-5);
    font-weight: var(--fw-300);
    background: transparent;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all var(--transition-std);
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }

  .filter-item button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--bg-gradient-yellow-1);
    transform: translate(-50%, -50%);
    transition: width var(--transition-std), height var(--transition-std);
    z-index: -1;
  }

  .filter-item button:hover {
    color: var(--white-1);
    transform: translateY(-2px);
  }

  .filter-item button:hover::before {
    width: 120%;
    height: 120%;
  }

  /* Light theme hover - FIX: Ensure text is white against the colored background (primary accent) */
  html[data-theme="light"] .filter-item button:hover {
    color: var(--white-1);
    /* background-color handled by ::before expansion */
  }

  /* Ensure ::before is primary-accent (Blue) in light mode instead of Yellow - Use Gradient like dark mode */
  html[data-theme="light"] .filter-item button:hover::before {
    background: linear-gradient(to bottom right, var(--primary-accent) 0%, transparent 50%);
  }

  .filter-item button.active {
    color: var(--orange-yellow-crayola);
    font-weight: var(--fw-500);
    /* Make active button bolder */
  }

  /* Light theme active */
  html[data-theme="light"] .filter-item button.active {
    color: var(--primary-accent);
    background: transparent;
    /* Ensure no solid background */
  }

  /* Ensure ::before (which creates the circle) uses the correct color but doesn't cover text if z-index is issue */
  html[data-theme="light"] .filter-item button.active::before {
    background: rgba(0, 123, 255, 0.1);
    /* Subtle background instead of full solid if that was the case */
  }

  .project-list {
    grid-template-columns: 1fr 1fr;
  }


  .input-wrapper {
    grid-template-columns: 1fr 1fr;
  }

  .form-btn {
    width: max-content;
    margin-left: auto;
  }

}



@media (min-width: 1024px) {


  :root {

    --shadow-1: -4px 8px 24px hsla(0, 0%, 0%, 0.125);
    --shadow-2: 0 16px 30px hsla(0, 0%, 0%, 0.125);
    --shadow-3: 0 16px 40px hsla(0, 0%, 0%, 0.125);

  }


  .sidebar {
    /* Keep sidebar separate */
    width: 950px;
    box-shadow: var(--shadow-5);
  }

  article[data-page] {
    /* Ensure all articles take full defined width */
    width: 950px;
    box-shadow: var(--shadow-5);
    box-sizing: border-box;
    /* Include padding in width calculation */
    padding-right: 0 !important;
    /* Remove right padding to align navbar */
  }



  main {
    margin-bottom: 60px;
  }

  .main-content {
    position: relative;
    width: max-content;
    margin: auto;
  }

  .navbar {
    position: absolute;
    bottom: auto;
    top: 0;
    left: auto;
    right: 0;
    width: max-content;
    border-radius: 0 0 20px 0;
    /* Adjusted for sharp top-right corner */
    padding: 0 0 0 20px;
    /* Removed right padding */
    box-shadow: none;
  }

  .navbar-list {
    gap: 30px;
    padding: 0 0 0 20px;
    /* Removed right padding */
  }

  .navbar-link {
    font-weight: var(--fw-500);
  }



  .service-list {
    grid-template-columns: 1fr 1fr;
    gap: 20px 25px;
  }


  .testimonials-item {
    min-width: calc(50% - 15px);
  }


  .clients-item {
    min-width: calc(25% - 38px);
  }



  .project-list {
    grid-template-columns: repeat(3, 1fr);
  }

}


@media (min-width: 1250px) {





  .sidebar,
  article {
    width: auto;
  }

  article {
    min-height: 100%;
    padding-right: 0 !important;
    /* Remove right padding to align navbar */
  }

  main {
    max-width: 1200px;
    margin-inline: auto;
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 25px;
  }

  .main-content {
    min-width: 73%;
    /* Adjusted from 75% to widen sidebar */
    width: 73%;
    /* Adjusted from 75% to widen sidebar */
    margin: 0;
  }

  .sidebar {
    position: sticky;
    top: 60px;
    max-height: max-content;
    height: 100%;
    margin-bottom: 0;
    padding-top: 60px;
    z-index: 1;
  }

  .sidebar-info {
    flex-direction: column;
  }

  .avatar-box img {
    width: 150px;
  }

  .info-content .name {
    white-space: nowrap;
    text-align: center;
  }

  .info-content .title {
    margin: auto;
  }

  .info_more-btn {
    display: none;
  }

  .sidebar-info_more {
    opacity: 1;
    visibility: visible;
  }

  .contacts-list {
    grid-template-columns: 1fr;
  }

  .contact-info :is(.contact-link) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .contact-info :is(.contact-link, time, address) {
    --fs-7: 14px;
    font-weight: var(--fw-300);
  }

  .separator:last-of-type {
    margin: 15px 0;
    opacity: 0;
  }

  .social-list {
    justify-content: center;
  }

  .timeline-text {
    max-width: 700px;
  }

}





.sidebar,
article {
  transition: background var(--transition-std), border-color var(--transition-std), box-shadow var(--transition-std);
}

.h2,
.h3,
.h4,
.h5,
.contact-info :is(.contact-link, time, address),
.about-text,
.service-item-text,
.testimonials-text,
.timeline-text,
.project-title,
.project-category,
.form-input {
  transition: color var(--transition-std);
}

.about-text p {
  padding-right: 30px;
  /* Add spacing to match contact form aesthetic */
}

.icon-box {
  transition: background var(--transition-std), color var(--transition-std), box-shadow var(--transition-std);
}

.icon-box::before {
  transition: background var(--transition-std);
}

.content-card {
  transition: background var(--transition-std), box-shadow var(--transition-std);
}

.content-card::before {
  transition: background var(--transition-std);
}

.testimonials-modal {
  transition: background-color var(--transition-std), border-color var(--transition-std), transform var(--transition-std), opacity var(--transition-std);
}

.modal-close-btn {
  transition: background-color var(--transition-std), color var(--transition-std), opacity var(--transition-std);
}

.theme-toggle-btn {
  position: relative;
  background: var(--border-gradient-onyx);
  color: var(--orange-yellow-crayola);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  box-shadow: var(--shadow-2);
  transition: background var(--transition-std), color var(--transition-std), box-shadow var(--transition-std);
  margin: 0 7px;
}

.theme-toggle-btn::before {
  content: "";
  position: absolute;
  inset: 1px;
  background: var(--bg-gradient-jet);
  border-radius: inherit;
  z-index: -1;
  transition: background var(--transition-std);
}

.theme-toggle-btn:hover {
  background: var(--bg-gradient-yellow-1);
}

.theme-toggle-btn:hover::before {
  background: var(--bg-gradient-yellow-2);
}

/* L'état focus utilisera le contour par défaut ou la règle :focus */

.theme-toggle-btn .theme-icon {
  position: absolute;
  transition: transform var(--transition-std);
  pointer-events: none;
  /* Empêcher l'icône de capturer les clics */
}

.theme-toggle-btn .sun {
  display: none;
  transform: scale(0.5) rotate(-90deg);
}

.theme-toggle-btn .moon {
  display: block;
  transform: scale(1) rotate(0deg);
}

html[data-theme="light"] .theme-toggle-btn .moon {
  display: none;
  transform: scale(0.5) rotate(90deg);
}

html[data-theme="light"] .theme-toggle-btn .sun {
  display: block;
  transform: scale(1) rotate(0deg);
}

html[data-theme="light"] .theme-toggle-btn {
  color: var(--primary-accent);
}

html[data-theme="light"] .theme-toggle-btn:hover {
  background: var(--onyx);
}

html[data-theme="light"] .theme-toggle-btn:hover::before {
  background: var(--secondary-bg);
}

html[data-theme="light"] .navbar-link {
  color: var(--secondary-text);
}

html[data-theme="light"] .navbar-link:hover,
html[data-theme="light"] .navbar-link:focus {
  color: var(--primary-text);
}

html[data-theme="light"] .navbar-link.active {
  color: var(--primary-accent);
}



article.active .animated-item {
  opacity: 0;
}

article.biographie.active header h2 {
  /*   animation: fadeInUp 0.5s 0.2s ease-out forwards;
 */
}

/* Cibler les enfants directs de la section dans le conteneur principal about-text */
article.biographie.active section.about-text>section:nth-of-type(1) {
  /*   animation: fadeInUp 0.5s 0.4s ease-out forwards;
 */
}

article.biographie.active section.about-text>section:nth-of-type(2) {
  /*   animation: fadeInUp 0.5s 0.6s ease-out forwards;
 */
}

article.biographie.active section.about-text>section:nth-of-type(3) {
  /*   animation: fadeInUp 0.5s 0.8s ease-out forwards;
 */
}


article.resume.active header h2 {
  /*   animation: fadeInUp 0.5s 0.2s ease-out forwards;
 */
}

article.resume.active .timeline .title-wrapper {
  /*   animation: fadeInUp 0.5s 0.4s ease-out forwards;
 */
}

/* Décaler les éléments de la timeline - Affiné */
article.resume.active .timeline-list .timeline-item {
  opacity: 0;
  /*   animation: fadeInUp 0.5s ease-out forwards;
 */
}

article.resume.active .timeline-list .timeline-item:nth-child(1) {
  animation-delay: 0.6s;
}

article.resume.active .timeline-list .timeline-item:nth-child(2) {
  animation-delay: 0.7s;
}

article.resume.active .timeline-list .timeline-item:nth-child(3) {
  animation-delay: 0.8s;
}

article.resume.active .timeline-list .timeline-item:nth-child(4) {
  animation-delay: 0.9s;
}

article.resume.active .skill h3.skills-title {
  /*   animation: fadeInUp 0.5s 0.9s ease-out forwards;
 */
}

article.resume.active .skill ul.skills-list {
  /*   animation: fadeInUp 0.5s 1.1s ease-out forwards;
 */
}

/* Note : Les éléments de compétence individuels dans la liste ne sont pas animés ici, mais pourraient être ajoutés */

article.projets.active header h2 {
  /*   animation: fadeInUp 0.5s 0.2s ease-out forwards;
 */
}

article.projets.active .filter-list {
  /*   animation: fadeInUp 0.5s 0.4s ease-out forwards;
 */
}

article.projets.active .project-list .project-item {
  /* L'animation de base est déjà appliquée via .project-item.active */
  animation-name: fadeInUp;
  animation-duration: 0.5s;
  animation-timing-function: ease-out;
  animation-fill-mode: forwards;
  animation-delay: calc(0.5s + var(--stagger-delay, 0s));
}

article.projets.active .project-list .project-item:nth-child(1) {
  --stagger-delay: 0.1s;
}

article.projets.active .project-list .project-item:nth-child(2) {
  --stagger-delay: 0.2s;
}

article.projets.active .project-list .project-item:nth-child(3) {
  --stagger-delay: 0.3s;
}

article.projets.active .project-list .project-item:nth-child(4) {
  --stagger-delay: 0.4s;
}

article.projets.active .project-list .project-item:nth-child(5) {
  --stagger-delay: 0.5s;
}

article.projets.active .project-list .project-item:nth-child(6) {
  --stagger-delay: 0.6s;
}

article.projets.active .filter-select-box {
  /*   animation: fadeInUp 0.5s 0.4s ease-out forwards;
 */
}

;

@media (max-width: 768px) {
  main {
    /* Réinitialiser les marges horizontales sur le conteneur principal pour une vraie pleine largeur */
    margin-left: 0;
    margin-right: 0;
  }

  .sidebar,
  article {
    padding: 20px;
    width: 100%;
    /* Ensure full width */
    max-width: none;
    /* Surcharger le max-width potentiel des points d'arrêt plus grands */
    margin-left: 0;
    /* Surcharger margin-inline: auto */
    margin-right: 0;
    /* Surcharger margin-inline: auto */
  }

  /* Ensure contact article width and layout are consistent on mobile */
  article.contact {
    padding: 20px;
    /* Match general article padding */
    width: 100%;
    /* Explicitly set width */
    max-width: none;
    /* Explicitly remove max-width */
    margin-left: 0;
    /* Explicitly remove margin */
    margin-right: 0;
    /* Explicitly remove margin */
    box-sizing: border-box;
    /* Ensure padding is included in width */
  }

  .contacts-list {
    grid-template-columns: 1fr;
  }

  .project-list,
  .blog-posts-list {
    grid-template-columns: 1fr;
  }

  .input-wrapper {
    grid-template-columns: 1fr;
  }

  .navbar {
    padding: 0 10px;
  }

  .navbar-list {
    justify-content: space-around;
  }

  .navbar-link {
    padding: 15px 5px;
    font-size: var(--fs-7);
  }

  /* Rule removed for consistent article padding */

  /* Rule removed for consistent article padding */

  /* Rule removed - Handled by general article[data-page] width rules */

}

@media (max-width: 576px) {
  /* Empiler la barre latérale et le contenu principal - géré par le flux de bloc par défaut */
  /* Pas besoin de définir explicitement width: 100% s'ils sont des éléments de bloc */

  main {
    /* Reset horizontal margins on the main container for true full-width */
    margin: 10px 0;
    /* Conserver la marge supérieure, supprimer l'horizontale */
    margin-bottom: 60px;
  }

  .sidebar,
  article {
    padding: 15px;
    border-radius: 15px;
  }

  .sidebar {
    max-height: 150px;
    /* Hauteur repliée augmentée pour la vue mobile empilée */
  }

  .sidebar.active {
    max-height: 550px;
  }

  .sidebar-info {
    position: relative;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .avatar-box {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 10px;
    border-radius: 50%;
  }

  .avatar-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
  }

  .info-content .name {
    font-size: var(--fs-2);
  }

  .info-content .title {
    margin: 0 auto;
    font-size: var(--fs-7);
  }

  .info_more-btn {
    position: fixed;
    top: 15px;
    right: 15px;
    padding: 8px;
    z-index: 10;

    /* Surcharge hover/focus thème clair pour mobile */
    html[data-theme="light"] .info_more-btn:hover,
    html[data-theme="light"] .info_more-btn:focus {
      background: var(--onyx);
      color: var(--primary-accent);
      box-shadow: var(--shadow-3);
    }

    html[data-theme="light"] .info_more-btn:hover::before,
    html[data-theme="light"] .info_more-btn:focus::before {
      background: var(--secondary-bg);
    }
  }

  .icon-box {
    width: 35px;
    height: 35px;
    font-size: 14px;
  }

  .article-title {
    font-size: var(--fs-2);
  }

  .navbar {
    position: fixed;
    /* Keep fixed at bottom */
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    border-radius: 0;
    border-width: 1px 0 0 0;
    padding: 0 5px;
    background: hsla(240, 2%, 12%, 0.85);
    backdrop-filter: blur(8px);
  }

  .navbar-list {
    justify-content: space-around;
    padding: 5px 0;
  }

  .navbar-link {
    padding: 10px 5px;
    font-size: var(--fs-8);
    text-align: center;
  }

  .navbar-link ion-icon {
    margin: 0 auto 3px;
  }

  .project-details-btn {
    font-size: var(--fs-8);
    margin-left: 0;
    padding: 5px 8px;
  }

  .project-details-btn ion-icon {
    font-size: 14px;
  }

  :root {
    --fs-1: 22px;
    --fs-2: 17px;
    --fs-3: 16px;
    --fs-4: 15px;
    --fs-5: 14px;
    --fs-6: 13px;
    --fs-7: 12px;
    --fs-8: 10px;
  }

  img {
    max-width: 100%;
    height: auto;
  }



  .contact-form button {
    width: 100%;
    text-align: center;
    padding: 12px 20px;
  }

  .input-field,
  textarea.input-field {
    font-size: var(--fs-6);
  }

  .timeline-list {
    margin-left: 0;
  }

  .timeline-item:not(:last-child)::before {
    display: none;
  }

  .timeline-item-title {
    margin-left: 0;
  }

  .timeline-list .icon-box {
    display: none;
  }

  .timeline-text {
    margin-top: 10px;
  }

  /* Ajustements pour la bulle flottante sur mobile */
  #fab-portfolio {
    width: 45px;
    height: 45px;
    bottom: 15px;
    right: 15px;
  }

  #fab-portfolio ion-icon {
    font-size: 2.5rem;
  }
}

@media (max-width: 400px) {
  .navbar-link {
    font-size: var(--fs-8);
    padding: 8px 3px;
  }

  .info-content .name {
    font-size: var(--fs-3);
  }

  ;
}

.portfolio-list {
  overflow: hidden;
}

.skill-logo {
  display: inline-block;
  height: 32px;
  width: 32px;
  vertical-align: middle;
  object-fit: contain;
  margin: 5px;
}



.skills {
  margin-bottom: 30px;
}

.skills .article-title {
  margin-bottom: 20px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  /* Cases plus grandes */
  gap: 25px;
  padding: 30px;
  background: var(--eerie-black-2);
  border: 1px solid var(--jet);
  border-radius: 14px;
  box-shadow: var(--shadow-1);
  transition: background var(--transition-std), border-color var(--transition-std), box-shadow var(--transition-std);
}

.skill-item {
  background: var(--eerie-black-1);
  border: 1px solid var(--jet);
  border-radius: 12px;
  padding: 25px 20px;
  text-align: center;
  box-shadow: var(--shadow-2);
  transition: transform var(--transition-std), box-shadow var(--transition-std), background var(--transition-std), border-color var(--transition-std);
  cursor: default;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.skill-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 0 20px rgba(255, 219, 112, 0.15);
  /* Glow effect */
  border-color: var(--orange-yellow-crayola);
}

.skill-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(255, 215, 0, 0.05) 0%, transparent 70%);
  opacity: 0;
  transition: opacity var(--transition-std);
  z-index: 0;
}

.skill-item:hover::before {
  opacity: 1;
}

.skill-item>* {
  position: relative;
  /* Ensure content stays above glow */
  z-index: 1;
}

.skill-icon {
  margin: 0 auto 15px;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.skill-icon img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: grayscale(1);
  transition: filter var(--transition-std);
}

.skill-item:hover .skill-icon img {
  filter: grayscale(0);
}


.skill-name {
  color: var(--white-2);
  font-size: var(--fs-5);
  font-weight: var(--fw-500);
  transition: color var(--transition-std);
  margin: 0;
  line-height: 1.3;
}

@media (min-width: 580px) {
  .skills-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 30px;
  }

  .skill-icon {
    width: 48px;
    height: 48px;
  }
}

@media (min-width: 1024px) {
  .skills-grid {
    padding: 35px;
    grid-template-columns: repeat(4, 1fr);
    gap: 35px;
  }

  .skill-item {
    padding: 35px 30px;
    min-height: 150px;
  }

  .skill-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 20px;
  }

  .skill-name {
    font-size: var(--fs-4);
  }
}

/* Light theme styles for skills */
html[data-theme="light"] .skills-grid {
  background: var(--secondary-bg);
  border-color: var(--border-color);
}

html[data-theme="light"] .skill-item {
  background: var(--primary-bg);
  border-color: var(--border-color);
}

html[data-theme="light"] .skill-item:hover {
  border-color: var(--primary-accent);
}

html[data-theme="light"] .skill-name {
  color: var(--primary-text);
}

/* Styles pour les compétences en taille réduite dans la biographie */
.skills-grid-small {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
  gap: 8px;
  padding: 15px;
  background: var(--eerie-black-2);
  border: 1px solid var(--jet);
  border-radius: 8px;
  box-shadow: var(--shadow-1);
  transition: background var(--transition-std), border-color var(--transition-std), box-shadow var(--transition-std);
}

.skill-item-small {
  background: var(--eerie-black-1);
  border: 1px solid var(--jet);
  border-radius: 6px;
  padding: 8px 6px;
  text-align: center;
  box-shadow: var(--shadow-2);
  transition: transform var(--transition-std), box-shadow var(--transition-std), background var(--transition-std), border-color var(--transition-std);
  cursor: default;
  min-height: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.skill-item-small:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-3);
  border-color: var(--orange-yellow-crayola);
}

.skill-icon-small {
  margin: 0 auto 4px !important;
  width: 16px !important;
  height: 16px !important;
  display: flex;
  justify-content: center;
  align-items: center;
}

.skill-icon-small img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: grayscale(1);
  transition: filter var(--transition-std);
}

.skill-item-small:hover .skill-icon-small img {
  filter: grayscale(0);
}

.skill-name-small {
  color: var(--white-2);
  font-size: var(--fs-8);
  font-weight: var(--fw-400);
  transition: color var(--transition-std);
  margin: 0;
  line-height: 1.1;
}

@media (min-width: 580px) {
  .skills-grid-small {
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 10px;
  }

  .skill-icon-small {
    width: 18px !important;
    height: 18px !important;
  }
}

@media (min-width: 1024px) {
  .skills-grid-small {
    padding: 18px;
    grid-template-columns: repeat(8, 1fr);
    gap: 12px;
  }

  .skill-item-small {
    padding: 10px 8px;
    min-height: 60px;
  }

  .skill-icon-small {
    width: 20px !important;
    height: 20px !important;
    margin-bottom: 6px;
  }

  .skill-name-small {
    font-size: var(--fs-7);
  }
}

/* Light theme styles for small skills */
html[data-theme="light"] .skills-grid-small {
  background: var(--secondary-bg);
  border-color: var(--border-color);
}

html[data-theme="light"] .skill-item-small {
  background: var(--primary-bg);
  border-color: var(--border-color);
}

html[data-theme="light"] .skill-item-small:hover {
  border-color: var(--primary-accent);
}

html[data-theme="light"] .skill-name-small {
  color: var(--primary-text);
}

.about-text {
  margin-bottom: 30px;
  background: var(--eerie-black-1);
  border-radius: 12px;
  box-shadow: inset 0 2px 4px hsla(0, 0%, 0%, 0.15), var(--shadow-1);
  transition: background var(--transition-std), box-shadow var(--transition-std);
}

.about-text:last-of-type {
  margin-bottom: 0;
}

.about-text h3 {
  margin-bottom: 18px;
  font-size: var(--fs-2);
  color: var(--white-2);
  font-weight: var(--fw-600);
  position: relative;
  padding-left: 15px;
}

.about-text h3::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 20px;
  background: var(--text-gradient-yellow);
  border-radius: 3px;
}

.about-text p {
  line-height: 1.7;
  margin-bottom: 15px;
  color: var(--light-gray);
}

.about-text p:last-child {
  margin-bottom: 0;
}



/* L'article conteneur a déjà une animation fadeInUp */
.biographie.active .article-title {
  /*   animation: fadeInUp 0.5s ease-out 0.3s forwards;
 */
  /* opacity: 0; REMOVED - was hiding content */
}

.biographie.active .about-text {
  /*   animation: fadeInUp 0.5s ease-out 0.5s forwards;
 */
  /* opacity: 0; REMOVED - was hiding content */
}

.about-text strong {
  color: var(--orange-yellow-crayola);
  font-weight: var(--fw-500);
}

/* Note : Cette règle pourrait nécessiter un ajustement si la structure HTML change */
.biographie>.about-text+.about-text {
  border-top: 1px solid var(--jet);
  padding-top: 25px;
  margin-top: 25px;
  background: none;
  box-shadow: var(--shadow-1);
  border-radius: 0;
  padding-left: 0;
  padding-right: 0;
}



/* Style pour la photo de profil circulaire */
.sidebar .avatar-box img {
  border-radius: 50%;
  width: 80px;
  /* Assurer la largeur */
  height: 80px;
  /* Assurer la hauteur pour le cercle */
  object-fit: cover;
  /* Empêcher la distorsion */
}

/*-----------------------------------*\
 * #FAB - Floating Action Button
\*-----------------------------------*/

#fab-portfolio {
  display: inline-flex;
  /* Use flex to align icon and text */
  align-items: center;
  /* Vertically center the icon and text */
  margin-top: 30px;
  padding: 10px 20px;
  background-color: var(--orange-yellow-crayola);
  color: var(--smoky-black);
  text-decoration: none;
  border-radius: 5px;
  font-weight: 500;
  transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  /* Add transition for box-shadow and transform */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  /* Add a subtle shadow */
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

#fab-portfolio:hover {
  background-color: var(--vegas-gold);
  /* Dark background for contrast */
  color: var(--white-1);
  transform: translateY(-2px);
  /* Slight lift on hover */
  box-shadow: 0 4px 7px rgba(0, 0, 0, 0.3);
  /* Darken shadow on hover */
}

#fab-portfolio span {
  display: none;
  /* Hide text by default */
}

@media (min-width: 768px) {
  #fab-portfolio span {
    display: inline;
    /* Show text on larger screens */
    margin-left: 5px;
    /* Add some spacing between the icon and text */
  }
}

#fab-portfolio:hover {
  background-color: var(--jet);
  /* Dark background for contrast */
  color: var(--orange-yellow-crayola);
  /* Yellow text for accent */
  transform: translateY(-2px);
  /* Slight lift on hover */
  box-shadow: 0 4px 7px rgba(0, 0, 0, 0.3);
  /* Darken shadow on hover */
}

@media (max-width: 767px) {
  #fab-portfolio {
    bottom: 80px;
    /* Increase bottom margin to move it up */
    width: 60px;
    /* Make the button wider */
    height: 60px;
    /* Make the button taller */
    display: flex;
    justify-content: center;
    align-items: center;
  }
}

/* ========================================== */
/* Styles for portfolio-apprentissage.html  */
/* ========================================== */

/* Style pour le lien de retour */
.lien-retour {
  display: inline-block;
  /* Permet la marge et le padding */
  margin-bottom: 20px;
  /* Espace sous le lien */
  padding: 8px 15px;
  background-color: var(--onyx);
  /* Utiliser un fond subtil */
  color: var(--orange-yellow-crayola);
  /* Utiliser la couleur d'accentuation */
  border: 1px solid var(--jet);
  border-radius: 8px;
  font-weight: var(--fw-500);
  transition: background-color var(--transition-std), color var(--transition-std), border-color var(--transition-std);
}

.lien-retour:hover,
.lien-retour:focus {
  background-color: var(--orange-yellow-crayola);
  color: var(--eerie-black-2);
  border-color: var(--orange-yellow-crayola);
}

#portfolio-apprentissage .lien-retour {
  display: block;
  /* Bloc pour faciliter le centrage/clic */
  width: max-content;
  margin: 20px auto 30px auto;
  /* Centrage et espacement pour mobile */
  color: var(--orange-yellow-crayola);
  text-decoration: none;
  padding: 10px 20px;
  border: 1px solid var(--vegas-gold);
  border-radius: 8px;
  transition: background-color var(--transition-std), color var(--transition-std), box-shadow var(--transition-std);
  text-align: center;
}

#portfolio-apprentissage .lien-retour:hover {
  background-color: var(--vegas-gold);
  color: var(--onyx);
  box-shadow: var(--shadow-2);
}

#portfolio-apprentissage h1 {
  color: var(--white-2);
  margin-bottom: 10px;
  text-align: center;
  font-family: var(--ff-heading);
  font-size: calc(var(--fs-1) * 1.3);
  /* Taille du titre mobile */
  font-weight: var(--fw-600);
}

#portfolio-apprentissage .sous-titre {
  text-align: center;
  color: var(--light-gray-70);
  font-size: var(--fs-4);
  /* Taille du sous-titre mobile */
  margin-bottom: 30px;
  font-weight: var(--fw-300);
}

/* Utiliser .competence-bloc pour les sections de manière cohérente */
.competence-bloc {
  background-color: var(--onyx);
  /* Fond de base */
  padding: 20px;
  /* Padding mobile */
  margin-bottom: 30px;
  /* Espacement mobile */
  border-radius: 16px;
  border: 1px solid var(--jet);
  box-shadow: var(--shadow-3);
  transition: transform var(--transition-std), box-shadow var(--transition-std);
}

.competence-bloc:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-4);
}

.competence-bloc h2 {
  color: var(--orange-yellow-crayola);
  font-family: var(--ff-heading);
  font-size: calc(var(--fs-2) * 0.95);
  /* Taille H2 mobile */
  font-weight: var(--fw-600);
  margin-bottom: 15px;
  border-bottom: 2px solid var(--jet);
  padding-bottom: 10px;
}

.competence-bloc .niveau2-description {
  font-size: var(--fs-5);
  color: var(--light-gray-70);
  margin-bottom: 25px;
  font-style: italic;
  line-height: 1.5;
}

.competence-bloc h3 {
  color: var(--white-1);
  font-family: var(--ff-heading);
  font-size: var(--fs-3);
  /* Taille H3 mobile */
  font-weight: var(--fw-500);
  margin-top: 20px;
  margin-bottom: 10px;
}

.competence-bloc .description-ac {
  /* Utilisation de .description-ac basée sur le HTML */
  font-size: var(--fs-6);
  line-height: 1.7;
  color: var(--light-gray);
  margin-bottom: 15px;
}

.competence-bloc .description-ac strong {
  color: var(--vegas-gold);
  font-weight: var(--fw-600);
}

/* Conserver les styles du bouton projet */
.bouton-projet-ac {
  display: inline-block;
  padding: 8px 15px;
  margin-top: 10px;
  background-color: var(--onyx);
  color: var(--orange-yellow-crayola);
  border: 1px solid var(--jet);
  border-radius: 8px;
  text-decoration: none;
  font-size: var(--fs-7);
  font-weight: var(--fw-500);
  transition: background-color var(--transition-std), color var(--transition-std), transform var(--transition-std);
  cursor: pointer;
  text-align: center;
}

.bouton-projet-ac:hover,
.bouton-projet-ac:focus {
  background-color: var(--orange-yellow-crayola);
  color: var(--eerie-black-2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}

html[data-theme="light"] .bouton-projet-ac {
  background-color: var(--secondary-bg);
  color: var(--primary-accent);
  border-color: var(--border-color);
}

html[data-theme="light"] .bouton-projet-ac:hover,
html[data-theme="light"] .bouton-projet-ac:focus {
  background-color: var(--primary-accent);
  color: var(--secondary-bg);
  border-color: var(--primary-accent);
}

/* ============================================================ */
/* == Desktop Styles for portfolio-apprentissage.html (>= 768px) == */
/* ============================================================ */
@media (min-width: 768px) {

  #portfolio-apprentissage .lien-retour {
    display: inline-block;
    /* Aligner avec le flux du contenu */
    margin: 0 0 40px 0;
    /* Marge inférieure augmentée */
    padding: 12px 20px;
    /* Padding légèrement plus grand */
    /* Hériter des couleurs/bordures de base, surcharger le survol */
  }

  #portfolio-apprentissage .lien-retour:hover {
    background-color: var(--orange-yellow-crayola);
    color: var(--eerie-black-2);
    border-color: var(--orange-yellow-crayola);
    /* Correspondre au fond */
  }

  html[data-theme="light"] #portfolio-apprentissage .lien-retour {
    background-color: var(--secondary-bg);
    color: var(--primary-accent);
    border-color: var(--border-color);
  }



  /* Achievement Badges */
  .achievement-badges {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
  }

  .badge {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: var(--border-gradient-onyx);
    border-radius: 12px;
    transition: transform var(--transition-std), box-shadow var(--transition-std);
    position: relative;
    z-index: 1;
  }

  .badge::before {
    content: "";
    position: absolute;
    inset: 1px;
    background: var(--bg-gradient-jet);
    border-radius: inherit;
    z-index: -1;
    transition: background var(--transition-std);
  }

  .badge:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
  }

  .badge ion-icon {
    font-size: 32px;
    color: var(--orange-yellow-crayola);
    flex-shrink: 0;
  }

  .badge-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }

  .badge-number {
    font-size: var(--fs-1);
    font-weight: var(--fw-600);
    color: var(--white-1);
    line-height: 1;
  }

  .badge-label {
    font-size: var(--fs-7);
    color: var(--light-gray-70);
    line-height: 1.4;
  }

  @media (max-width: 767px) {
    .achievement-badges {
      grid-template-columns: 1fr;
    }
  }

  /* Reading Progress Indicator */
  #reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--border-gradient-onyx);
    z-index: 9999;
  }

  #reading-progress-bar {
    height: 100%;
    background: linear-gradient(to right, var(--orange-yellow-crayola), var(--vegas-gold));
    width: 0%;
    transition: width 0.1s ease;
  }

  /* Share Buttons in Modal */
  .modal-share-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
  }

  .share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--border-gradient-onyx);
    color: var(--white-1);
    border-radius: 8px;
    font-size: var(--fs-7);
    font-weight: var(--fw-500);
    transition: all var(--transition-std);
    position: relative;
    z-index: 1;
  }

  .share-btn::before {
    content: "";
    position: absolute;
    inset: 1px;
    background: var(--bg-gradient-jet);
    border-radius: inherit;
    z-index: -1;
    transition: background var(--transition-std);
  }

  .share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-2);
  }

  .share-btn ion-icon {
    font-size: 18px;
  }

  .share-btn.twitter:hover {
    color: #1DA1F2;
  }

  .share-btn.linkedin:hover {
    color: #0A66C2;
  }

  .share-btn.copy:hover {
    color: var(--orange-yellow-crayola);
  }


  /* Modifications pour l'extraction de styles en ligne */

  .timeline-item-title-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
  }

  .company-logo {
    height: 50px;
    border-radius: 8px;
    object-fit: contain;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
    background: white;
    padding: 8px;
  }

  /* Performance Optimization */
  body {
    will-change: background-position;
  }

  /* Back to Top Button */
  .back-to-top {
    position: fixed;
    bottom: 80px;
    /* Above navbar on mobile */
    right: 20px;
    background: var(--border-gradient-onyx);
    color: var(--orange-yellow-crayola);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    box-shadow: var(--shadow-2);
    z-index: 4;
    /* Below navbar (z-index 5) but above content */
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-std);
    border: 1px solid var(--jet);
  }

  .back-to-top.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(-10px);
  }

  .back-to-top:hover {
    background: var(--onyx);
    color: var(--orange-yellow-crayola);
    transform: translateY(-15px);
  }

  @media (min-width: 1024px) {
    .back-to-top {
      bottom: 30px;
      right: 30px;
      width: 50px;
      height: 50px;
      font-size: 24px;
    }
  }

  /* --- Visual Enhancements (Phase 3) --- */

  /* Project Card Hover Effect */
  .project-item {
    transition: transform var(--transition-std), box-shadow var(--transition-std);
  }

  .project-item:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1;
  }

  .project-img img {
    transform: scale(1);
    transition: transform 0.5s ease;
  }

  .project-item:hover .project-img img {
    transform: scale(1.1);
  }

  /* Skill Icons Glow */
  .skill-item-small {
    transition: transform var(--transition-std), background-color var(--transition-std);
    position: relative;
    overflow: hidden;
  }

  .skill-item-small:hover {
    transform: translateY(-3px);
    background: var(--border-gradient-onyx);
    box-shadow: 0 0 15px rgba(255, 219, 112, 0.1);
  }

  .skill-item-small::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-std);
  }

  .skill-item-small:hover::before {
    opacity: 1;
  }

  /* Button Micro-interactions */
  .form-btn,
  .project-details-btn {
    position: relative;
    overflow: hidden;
    z-index: 1;
  }

  .form-btn::after,
  .project-details-btn::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--orange-yellow-crayola);
    border-radius: inherit;
    z-index: -2;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease-in-out;
  }

  .form-btn:hover::after,
  .project-details-btn:hover::after {
    transform: scaleX(1);
  }

  .form-btn:hover,
  .project-details-btn:hover {
    color: var(--eerie-black-1);
    transition: color 0.3s ease-in-out;
  }

  /* Navbar Link Indicator Animation handled earlier in the file */

  /* Language Toggle Button */
  .lang-toggle-btn {
    background: var(--border-gradient-onyx);
    color: var(--orange-yellow-crayola);
    display: flex;
    justify-content: center;
    align-items: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    box-shadow: var(--shadow-1);
    transition: var(--transition-1);
    z-index: 1;
    position: relative;
    font-weight: var(--fw-600);
    font-size: var(--fs-5);
  }

  .lang-toggle-btn::before {
    content: "";
    position: absolute;
    inset: 1px;
    background: var(--eerie-black-1);
    border-radius: inherit;
    z-index: -1;
    transition: var(--transition-1);
  }

  .lang-toggle-btn:hover {
    background: linear-gradient(to bottom right, var(--orange-yellow-crayola) 0%, hsla(0, 0%, 0%, 0) 50%);
    color: var(--white-2);
    transform: translateY(-2px);
  }

  .lang-toggle-btn:active {
    transform: translateY(1px);
  }

  /* --- Premium Contact Form Redesign --- */

  .input-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    /* Increased gap for labels */
    margin-bottom: 30px;
  }

  @media (min-width: 768px) {
    .input-wrapper {
      grid-template-columns: 1fr 1fr;
      gap: 30px;
    }
  }

  .input-group {
    position: relative;
  }

  /* Input Fields */
  .form-input {
    width: 100%;
    padding: 15px 15px 15px 50px;
    /* Space for icon */
    background: var(--eerie-black-2);
    border: 1px solid var(--jet);
    border-radius: 12px;
    color: var(--white-1);
    font-size: var(--fs-6);
    font-weight: var(--fw-400);
    transition: all 0.3s ease;
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
  }

  textarea.form-input {
    min-height: 120px;
    resize: vertical;
  }

  /* States */
  .form-input:focus,
  .form-input:not(:placeholder-shown) {
    background: var(--onyx);
    border-color: var(--orange-yellow-crayola);
    box-shadow: 0 0 0 4px rgba(255, 219, 112, 0.1);
  }

  /* Floating Labels */
  .form-label {
    position: absolute;
    top: 15px;
    left: 50px;
    color: var(--light-gray-70);
    font-size: var(--fs-6);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
  }

  /* Float Label Up */
  /* Better Floating Label approach that doesn't rely on calc guessing */
  .input-group:focus-within .form-label,
  .form-input:not(:placeholder-shown)+.form-label {
    top: -24px;
    left: 0;
    font-size: var(--fs-7);
    color: var(--orange-yellow-crayola);
    font-weight: var(--fw-500);
    letter-spacing: 0.5px;
  }

  /* Icons */
  .input-icon {
    position: absolute;
    top: 50%;
    left: 18px;
    transform: translateY(-50%);
    font-size: 20px;
    color: var(--light-gray-70);
    pointer-events: none;
    transition: all 0.3s ease;
  }

  .textarea-icon {
    top: 20px;
    transform: none;
  }

  .form-input:focus~.input-icon,
  .form-input:not(:placeholder-shown)~.input-icon {
    color: var(--orange-yellow-crayola);
    filter: drop-shadow(0 0 2px rgba(255, 219, 112, 0.4));
  }

  /* Error Message */
  .error-message {
    position: absolute;
    bottom: -22px;
    left: 0;
    font-size: 11px;
    color: #ff6b6b;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
  }

  .form-input.error~.error-message {
    opacity: 1;
    transform: translateY(0);
  }

  .form-input.error {
    border-color: #ff6b6b;
  }

  /* Light Theme Overrides */
  html[data-theme="light"] .form-input {
    background: var(--white-2);
    border-color: var(--border-color);
    color: var(--eerie-black-1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
  }

  html[data-theme="light"] .form-input:focus,
  html[data-theme="light"] .form-input:not(:placeholder-shown) {
    background: var(--white-1);
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.1);
  }

  html[data-theme="light"] .input-group:focus-within .form-label,
  html[data-theme="light"] .form-input:not(:placeholder-shown)+.form-label {
    color: var(--primary-accent);
  }

  html[data-theme="light"] .form-input:focus~.input-icon,
  html[data-theme="light"] .form-input:not(:placeholder-shown)~.input-icon {
    color: var(--primary-accent);
    filter: drop-shadow(0 0 2px rgba(0, 123, 255, 0.3));
  }

  /* --- Navbar Toggles Adjustment --- */
  /* Ensure toggles fit in the navbar */
  .navbar-item .theme-toggle-btn,
  .navbar-item .lang-toggle-btn {
    box-shadow: none;
    /* Remove heavy shadow in navbar */
    background: transparent;
    /* Cleaner look */
    border: 1px solid transparent;
  }

  .navbar-item .theme-toggle-btn:hover,
  .navbar-item .lang-toggle-btn:hover {
    background: var(--border-gradient-onyx);
    border-color: var(--jet);
  }

  html[data-theme="light"] .navbar-item .theme-toggle-btn:hover,
  html[data-theme="light"] .navbar-item .lang-toggle-btn:hover {
    background: var(--secondary-bg);
    border-color: var(--border-color);
  }

  /* Mobile Navbar Tweaks */
  @media (max-width: 576px) {
    .navbar-list {
      flex-wrap: wrap;
      justify-content: center;
      gap: 15px;
      /* Increased gap for better touch targets */
      padding-bottom: 0;
      overflow-x: visible;
    }

    /* Hide specific elements on very small screens if needed */
    .lang-toggle-btn .lang-text {
      display: none;
    }

    .lang-toggle-btn .chevron {
      display: none;
    }

    .lang-toggle-btn {
      width: 38px;
      padding: 0;
    }

    .theme-toggle-btn {
      width: 38px;
    }
  }
}

/* FIX: Ensure Projects and Contact take full width on mobile */
@media (max-width: 768px) {

  article.projets,
  article.contact {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    border-radius: 0 !important;
    max-width: 100% !important;
  }

  .project-list {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .contact-form {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}