/* === Enregistrement de la propriété d'animation (Houdini) === */
@property --draw-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

:root {
  --primary: #6750a4;
  --primary-container: #eaddff;
  --on-primary: #fff;
  --surface: #fff;
  --surface-container: #f6f2fb;
  --outline: #d0cce0;
  --on-surface: #1d1b20;
  --tag-bg: #ece6f0;
  --chip-bg: #ebe0f5;
  --transition: 0.3s ease;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --ripple: rgba(103, 80, 164, 0.3);
}

body.dark {
  --primary: #d0bcff;
  --primary-container: #4f378b;
  --on-primary: #1c1b1f;
  --surface: #1c1b1f;
  --surface-container: #2b2930;
  --outline: #3b3942;
  --on-surface: #fff;
  --tag-bg: #3a2f53;
  --chip-bg: #4b3b6b;
  --ripple: rgba(208, 188, 255, 0.2);
}

body {
  font-family: "DM Sans", sans-serif;
  background: var(--surface-container);
  color: var(--on-surface);
  margin: 0;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
  max-width: 100vw;
}

html {
  overflow-x: hidden;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
}

.app-bar {
  position: fixed;
  top: 0;
  width: 100%;
  background: var(--surface);
  box-shadow: var(--shadow);
  z-index: 100;
  transition: transform 0.4s ease;
}

.app-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

/* === Toggle === */
.toggle {
  width: 36px;
  height: 36px;
  position: relative;
  cursor: pointer;
}

.toggle input {
  display: none;
}

.toggle:hover .slider {
  transform: scale(1.12);
  box-shadow: 0 4px 16px rgba(103, 80, 164, 0.12);
}

.slider {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--outline);
  background: var(--surface-container);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  overflow: hidden;
  position: relative;
}

body.dark .slider {
  background: var(--surface);
}

.icon {
  width: 20px;
  height: 20px;
  position: absolute;
  transition: all 0.3s ease;
  filter: brightness(0.3);
}

body.dark .icon {
  filter: brightness(1);
}

.sun {
  opacity: 0;
  transform: translateY(20px);
}

body.dark .sun {
  opacity: 1;
  transform: translateY(0);
}

body.dark .moon {
  opacity: 0;
  transform: translateY(-20px);
}

/* === Navigation === */
.burger-menu {
  display: none;
  /* Caché sur desktop */
  flex-direction: column;
  justify-content: space-between;
  width: 32px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 2000;
  -webkit-tap-highlight-color: transparent;
}

.burger-menu span {
  width: 100%;
  height: 3px;
  background: var(--on-surface);
  border-radius: 4px;
  transition: transform 0.3s cubic-bezier(0.68, -0.6, 0.32, 1.6), opacity 0.3s ease, background-color 0.3s ease;
  transform-origin: center;
}

/* Animation Burger -> X */
.burger-menu.active span:nth-child(1) {
  transform: translateY(10.5px) rotate(45deg);
}

.burger-menu.active span:nth-child(2) {
  opacity: 0;
  transform: scale(0);
}

.burger-menu.active span:nth-child(3) {
  transform: translateY(-10.5px) rotate(-45deg);
}

/* Wrapper pour les liens et le bouton sur Desktop */
.nav-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-links {
  display: flex;
  gap: 0.2rem;
  /* Réduire l'espace pour rapprocher les "boutons" */
}

/* --- Style "Liquid Fill" (Effet liquide) pour les liens de navigation --- */
.nav-links a {
  text-decoration: none;
  color: var(--on-surface);
  /* Couleur de texte par défaut */
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 999px;
  /* Garde la forme de gélule */
  position: relative;
  /* Crucial pour le pseudo-élément */
  overflow: hidden;
  /* Crucial pour "cacher" le liquide qui arrive */
  z-index: 1;
  /* S'assure que le texte est gérable */

  /* Transition pour le changement de couleur du texte */
  /* On la retarde légèrement (0.1s) pour que le liquide passe d'abord */
  transition: color 0.4s ease-out 0.1s;
  -webkit-tap-highlight-color: transparent;
}

/* 1. Le "Liquide" (le pseudo-élément ::before) */
.nav-links a::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  background: var(--primary);
  /* Le "liquide" violet */

  /* --- MODIFICATION 1 : État initial --- */
  /* On passe de scaleX (horizontal) à scaleY (vertical) */
  transform: scaleY(0);

  /* --- MODIFICATION 2 : Origine --- */
  /* On passe de 'left' (gauche) à 'bottom' (bas) */
  transform-origin: bottom;

  /* --- MODIFICATION 3 : L'animation "Splash" --- */
  /* On utilise une courbe d'animation "élastique" (cubic-bezier).
    Le '1.56' signifie que l'animation va "dépasser" (156%) 
    avant de revenir à 100%, créant un effet de rebond liquide. 
  */
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

  z-index: -1;
  /* Se place DERRIÈRE le contenu (le texte) */
}

/* 2. AU SURVOL (HOVER) : On anime ! */
.nav-links a:hover {
  /* Le texte devient blanc (ou la couleur définie dans --on-primary) */
  color: var(--on-primary);
  /* On enlève le délai au retour */
  transition-delay: 0s;
}

.nav-links a:hover::before {
  /* Le liquide remplit toute la gélule (hauteur 100%) */
  transform: scaleY(1);
  transform-origin: bottom;
}

/* Styles pour les icônes dans la navbar */
.nav-links a {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a img {
  width: 20px;
  height: 20px;
  filter: brightness(0.3);
  /* Sombre par défaut pour fond clair */
  transition: filter 0.3s ease;
}

body.dark .nav-links a img {
  filter: brightness(1);
  /* Clair pour fond sombre */
}

.nav-links a:hover img {
  filter: brightness(0) invert(1);
  /* Blanc au survol (sur fond violet) */
}

/* --- Fin du style "Liquid Fill" --- */


/* === Buttons === */


/* === Hero === */
.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 8rem 0 4rem;
  gap: 2rem;
}

.hero-text {
  flex: 1 1 400px;
}

.hero-text h1 {
  font-size: 2.5rem;
}

.hero-text span {
  color: var(--primary);
}

.subtext {
  margin: 1rem 0 2rem;
  opacity: 0.8;
}

.hero-img {
  max-width: 320px;
  border-radius: 16px;
}

.hero-skills-title {
  margin-top: 1.5rem;
  color: var(--primary);
}

/* === Projects === */
.projects {
  padding: 4rem 0;
  text-align: center;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--surface);
  border-radius: 16px;
  padding: 1.5rem;
  display: block;
  /* Ensure it behaves like a block even if it's an <a> tag */
  text-decoration: none;
  /* Remove underline */
  color: inherit;
  /* Inherit text color */
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  /* Add hover effect */
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.card-image {
  height: 140px;
  background: var(--outline);
  border-radius: 8px;
  margin-bottom: 1rem;
  background-size: cover;
  background-position: center;
}

.tags span {
  background: var(--tag-bg);
  color: var(--on-surface);
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  font-size: 0.8rem;
  margin-right: 0.4rem;
}

/* === Skills === */
.skills {
  padding: 4rem 0;
  text-align: center;
}

.chips span {
  background: var(--chip-bg);
  color: var(--on-surface);
  padding: 0.6rem 1rem;
  border-radius: 999px;
  margin: 0.4rem;
  display: inline-block;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.skills-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 2rem;
}

.skills-card h3 {
  color: var(--primary);
  margin-bottom: 1rem;
}

.skills-card .chips span {
  display: inline-block;
  background: var(--chip-bg);
  color: var(--on-surface);
  padding: 0.6rem 1rem;
  border-radius: 999px;
  margin: 0.3rem 0.4rem;
  font-size: 0.85rem;
}

/* === About === */
.about {
  text-align: center;
  padding: 4rem 0;
  background: var(--surface);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}



/* === NEW About Section (MD3 Card Layout) === */
.about-section {
  margin-top: 100px;
  padding: 0 1rem;
}

/* Hero Card - Introduction principale */
.about-hero-card {
  background: var(--surface);
  border-radius: 28px;
  padding: 2.5rem;
  border: 1px solid var(--outline);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  margin-bottom: 1.5rem;
}

.about-hero-content {
  display: flex;
  align-items: center;
  gap: 3rem;
}

.about-hero-text {
  flex: 1;
}

.about-hero-text h1 {
  font-size: 2.5rem;
  font-weight: 500;
  margin: 0 0 0.5rem 0;
  color: var(--on-surface);
}

.about-tagline {
  font-size: 1.1rem;
  color: var(--primary);
  font-weight: 500;
  margin: 0 0 1.5rem 0;
  letter-spacing: 0.02rem;
}

.about-intro {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--on-surface);
  opacity: 0.85;
  margin: 0;
}

.about-intro strong {
  color: var(--primary);
  font-weight: 500;
}

.about-hero-photo {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--primary);
  box-shadow: 0 8px 24px rgba(103, 80, 164, 0.2);
  flex-shrink: 0;
}

/* Grid des cartes thématiques */
.about-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

/* Carte générique */
.about-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 1.5rem;
  border: 1px solid var(--outline);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.about-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  border-color: var(--primary);
}

.about-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.about-card-icon {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  background: var(--primary-container);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.about-card-icon img {
  width: 24px;
  height: 24px;
  filter: brightness(0.3);
  transition: filter 0.3s ease;
}

body.dark .about-card-icon img {
  filter: brightness(1);
}

.about-card-header h3 {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--on-surface);
  margin: 0;
}

.about-card-content p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--on-surface);
  opacity: 0.85;
  margin: 0 0 1rem 0;
}

.about-card-content p:last-child {
  margin-bottom: 0;
}

.about-card-content strong {
  color: var(--primary);
  font-weight: 500;
}

/* Carte Expérience - Styles spécifiques */
.experience-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--surface-container);
  border-radius: 12px;
  margin-bottom: 1rem;
  border-left: 3px solid var(--primary);
}

.experience-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
  flex-shrink: 0;
}

.experience-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.experience-role {
  font-weight: 600;
  color: var(--on-surface);
  font-size: 0.95rem;
}

.experience-company {
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 500;
}

/* Carte Compétences - Styles spécifiques */
.skills-categories {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.skill-category {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.skill-category-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1rem;
  color: var(--primary);
  font-weight: 600;
}

.skills-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Carte Personnalité - Styles spécifiques */
.personality-interests {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.interest-tag {
  background: var(--primary-container);
  color: var(--primary);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Carte Objectif - Styles spécifiques */
.about-card-goal {
  grid-column: 1 / -1;
  text-align: center;
  background: linear-gradient(135deg, var(--primary-container) 0%, var(--surface) 100%);
}

.about-card-goal .about-card-header {
  justify-content: center;
}

.about-card-goal .about-card-content p {
  font-size: 1.1rem;
  opacity: 1;
}

.goal-statement {
  font-size: 1.1rem !important;
  margin: 0 !important;
}

/* === MD3 Assist Chips for Skills (Keep existing) === */
.skill-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px 0 8px;
  border-radius: 8px;
  border: 1px solid var(--outline);
  background-color: transparent;
  color: var(--on-surface);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: default;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.skill-chip:hover {
  background-color: var(--surface-container);
  border-color: var(--primary);
}

.skill-chip img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

/* Responsive About Section */
@media (max-width: 900px) {
  .about-hero-content {
    flex-direction: column-reverse;
    text-align: center;
    gap: 2rem;
  }

  .about-hero-text h1 {
    font-size: 2rem;
  }

  .about-hero-photo {
    width: 150px;
    height: 150px;
  }

  .about-cards-grid {
    grid-template-columns: 1fr;
  }

  .about-card-goal {
    grid-column: 1;
  }
}

/* === Footer === */
.footer {
  background: var(--surface);
  padding: 2rem 2rem;
  text-align: center;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 6rem;
  margin-bottom: 2rem;
  border: 1px solid var(--outline);
  border-radius: 24px;
}

.footer h2,
.footer p {
  margin: 0;
}

.footer-separator {
  width: 100%;
  max-width: 300px;
  border: none;
  height: 1px;
  background: var(--outline);
  margin: 0;
  opacity: 0.6;
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--on-surface);
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 999px;
  transition: background-color 0.3s ease;
}

.footer-link:hover {
  background-color: var(--surface-container);
}

.footer-link img {
  width: 24px;
  height: 24px;
  filter: brightness(0.3);
  transition: filter 0.3s ease;
}

body.dark .footer-link img {
  filter: brightness(1);
}

.footer-link:hover img {
  filter: brightness(0) saturate(100%) invert(35%) sepia(40%) saturate(2250%) hue-rotate(228deg) brightness(88%) contrast(84%);
  /* Primary color on hover */
}

body.dark .footer-link:hover img {
  filter: brightness(0) saturate(100%) invert(88%) sepia(19%) saturate(4155%) hue-rotate(192deg) brightness(103%) contrast(101%);
  /* Primary dark color on hover */
}

/* === Responsive === */
@media (max-width: 768px) {
  .app-bar-inner {
    height: 64px;
    /* Hauteur un peu réduite sur mobile */
  }

  .burger-menu {
    display: flex;
    /* Afficher le menu burger */
  }

  /* Le wrapper qui contient les liens et le bouton download devient le menu plein écran */
  .nav-content {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--surface);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 2rem;
    box-sizing: border-box;
    /* Important pour le padding */

    /* Animation d'entrée */
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1);
    z-index: 1500;
    /* Au-dessus de tout sauf du burger */

    /* Ombre interne subtile */
    box-shadow: inset 10px 0 20px -10px rgba(0, 0, 0, 0.1);
  }

  /* État ouvert */
  .nav-content.active {
    transform: translateX(0);
  }

  /* Ajustements des liens dans le menu mobile */
  .nav-links {
    flex-direction: column;
    align-items: center;
    gap: 0;
    width: 100%;
    max-width: 320px;
  }

  .nav-links a {
    font-size: 1.25rem;
    width: 100%;
    justify-content: center;
    padding: 1.25rem 1.5rem;
    background: var(--surface-container);
    border: 1px solid var(--outline);
    border-bottom: none;
    border-radius: 0;
    color: var(--on-surface);
    transition: background-color 0.3s ease, transform 0.2s ease, color 0.3s ease;
  }

  .nav-links a:first-child {
    border-radius: 20px 20px 0 0;
  }

  .nav-links a:last-child {
    border-bottom: 1px solid var(--outline);
    border-radius: 0 0 20px 20px;
  }

  .nav-links a:hover,
  .nav-links a:active {
    background: var(--primary-container);
    color: var(--primary);
    transform: scale(1.02);
  }

  .nav-links a::before {
    display: none;
    /* Désactiver l'effet liquide sur mobile pour un design plus clair */
  }

  /* Masquer les icônes dans le menu mobile pour plus de clarté, ou les garder, au choix.
     Ici on les garde mais on grossit le texte */

  .btn-download {
    margin-top: 1rem;
    width: 100%;
    justify-content: center;
    padding: 1rem;
    font-size: 1.1rem;
  }
}

/* === Fade-in & Ripple === */
@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* === Bouton Télécharger CV === */
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--primary-container);
  color: var(--primary);
  font-weight: 500;
  border: none;
  border-radius: 999px;
  padding: 0.7rem 1.4rem;
  text-decoration: none;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

.btn-download .icon-download {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
  filter: brightness(0.3);
}

body.dark .btn-download .icon-download {
  filter: brightness(1);
}

.btn-download:hover {
  background: color-mix(in srgb, var(--primary-container) 85%, var(--primary) 15%);
  box-shadow: 0 6px 20px rgba(103, 80, 164, 0.25);
  transform: translateY(-3px);
  color: var(--primary);
}

body.dark .btn-download:hover {
  background: color-mix(in srgb, var(--primary-container) 75%, var(--primary) 25%);
  color: var(--on-primary);
}

.btn-download:hover .icon-download {
  transform: translateY(-2px) rotate(-10deg);
}

.btn-download::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  width: 100px;
  height: 100px;
  background: var(--primary);
  opacity: 0;
  transform: scale(0);
  transition: transform 0.5s ease, opacity 0.6s ease;
  pointer-events: none;
}

.btn-download:active::after {
  transform: scale(3);
  opacity: 0.25;
  transition: 0s;
}

.btn-download:active {
  transform: scale(0.97);
}

/* === Bouton Contact (Similaire à Download mais sans icône) === */
.btn-contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: var(--primary-container);
  color: var(--primary);
  font-weight: 500;
  border: none;
  border-radius: 999px;
  padding: 0.7rem 2rem;
  text-decoration: none;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
  /* margin-top supprimé pour laisser le gap du parent gérer l'espacement */
  max-width: 180px;
  /* Largeur initiale approximative */
  white-space: nowrap;
}

.btn-contact:hover {
  background: color-mix(in srgb, var(--primary-container) 85%, var(--primary) 15%);
  box-shadow: 0 6px 20px rgba(103, 80, 164, 0.25);
  transform: translateY(-3px);
  color: var(--primary);
  max-width: 400px;
  /* Largeur étendue */
  padding-right: 1.5rem;
  /* Ajustement padding */
}

body.dark .btn-contact:hover {
  background: color-mix(in srgb, var(--primary-container) 75%, var(--primary) 25%);
  color: var(--on-primary);
}

.default-text {
  display: inline-block;
  transition: opacity 0.3s ease, transform 0.3s ease, max-width 0.3s ease;
  opacity: 1;
  transform: translateX(0);
  max-width: 200px;
}

.btn-contact:hover .default-text {
  opacity: 0;
  transform: translateX(-20px);
  max-width: 0;
  overflow: hidden;
}

.hover-content {
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateX(20px);
  max-width: 0;
  overflow: hidden;
  transition: opacity 0.4s ease 0.1s, transform 0.4s ease 0.1s, max-width 0.4s ease;
}

.btn-contact:hover .hover-content {
  opacity: 1;
  transform: translateX(0);
  max-width: 350px;
}

.icon-copy {
  width: 20px;
  height: 20px;
  cursor: pointer;
  filter: brightness(0.3);
  transition: transform 0.2s ease, background-color 0.2s ease;
  padding: 6px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.05);
  /* Légèrement visible pour inciter au clic */
}

.icon-copy:hover {
  background-color: rgba(0, 0, 0, 0.15);
  transform: scale(1.1);
}

body.dark .icon-copy {
  filter: brightness(1);
  background-color: rgba(255, 255, 255, 0.1);
}

body.dark .icon-copy:hover {
  background-color: rgba(255, 255, 255, 0.25);
}

.btn-contact::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  width: 100px;
  height: 100px;
  background: var(--primary);
  opacity: 0;
  transform: scale(0);
  transition: transform 0.5s ease, opacity 0.6s ease;
  pointer-events: none;
  left: 50%;
  top: 50%;
  transform-origin: center;
  margin-left: -50px;
  margin-top: -50px;
}

.btn-contact:active::after {
  transform: scale(4);
  opacity: 0.25;
  transition: 0s;
}

.btn-contact:active {
  transform: scale(0.97);
}

/* === Menu latéral === */
.side-menu {
  position: fixed;
  top: 50%;
  left: 1rem;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 200;
  opacity: 1;
  transition: opacity 0.5s ease, transform 0.4s ease;
}

.side-menu.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(-20px);
}

/* === Gélules === */
.pill {
  background: var(--surface);
  box-shadow: var(--shadow);
  border-radius: 999px;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: background var(--transition), transform var(--transition);
}

.pill:hover {
  transform: translateY(-2px);
}

.nav-pill {
  gap: 0.7rem;
}

.pill a img {
  width: 24px;
  height: 24px;
  filter: brightness(0.3);
  transition: filter 0.3s, transform 0.2s;
}

body.dark .pill a img {
  filter: brightness(1);
}

.pill a:hover img {
  transform: scale(1.1);
}

/* === Labels (tooltips) === */
.tooltip {
  position: relative;
}

/* === Correction des labels du menu latéral === */
.tooltip::after {
  content: attr(data-label);
  position: absolute;
  left: 130%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 0.5rem;
  /* 👈 ajoute un léger espace (8px environ) */
  background: none;
  color: var(--on-surface, #222);
  font-weight: 500;
  padding: 0;
  border-radius: 0;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  box-shadow: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}


/* Quand les labels sont visibles */
.tooltip.show-label::after {
  opacity: 1;
  transform: translateY(-50%) translateX(6px);
}

/* Thème sombre */
body.dark .tooltip::after {
  background: none;
  color: #f0f0f0;
}


/* Responsive : cacher sur mobile */
@media (max-width: 768px) {
  .side-menu {
    display: none;
  }
}

/* === Style pour l'icône active du menu latéral === */

/* En mode clair, l'icône active devient violette (#6750a4) */
.pill a.active img {
  /* Ce filtre complexe force une couleur.
    Il annule le brightness(0.3) et applique la couleur primaire.
  */
  filter: brightness(0) saturate(100%) invert(35%) sepia(40%) saturate(2250%) hue-rotate(228deg) brightness(88%) contrast(84%);
}

/* En mode sombre, l'icône active devient violet clair (#d0bcff) */
body.dark .pill a.active img {
  /* Ce filtre est différent car la couleur cible (primaire sombre) 
    est différente.
  */
  filter: brightness(0) saturate(100%) invert(88%) sepia(19%) saturate(4155%) hue-rotate(192deg) brightness(103%) contrast(101%);
}


/* === Effet 4 : Contour "Arc-en-ciel" (RETIRÉ) === */
/* ... (toutes les règles .nav-links a::before, ::after, :hover::before, :hover::after ont été supprimées) ... */

/* === Custom Scrollbar (Bubble Style) === */
::-webkit-scrollbar {
  width: 24px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: var(--primary);
  border-radius: 20px;
  border: 7px solid transparent;
  background-clip: content-box;
  transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  /* Subtle shadow for depth */
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--primary);
  border-width: 5px;
  /* Grows thicker on hover */
}

/* Firefox */
@supports (scrollbar-color: auto) {
  html {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
  }
}

/* === Back to Top Button (Standalone Bubble) === */
.btn-back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--surface);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--outline);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.3s ease, border-color 0.3s ease;
  text-decoration: none;
}

.btn-back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.btn-back-to-top img {
  width: 28px;
  height: 28px;
  filter: brightness(0.3);
  transition: filter 0.3s ease;
}

body.dark .btn-back-to-top {
  background: var(--surface-container);
  border-color: var(--outline);
}

body.dark .btn-back-to-top img {
  filter: brightness(1);
}

.btn-back-to-top:hover {
  background: var(--surface-container);
  transform: translateY(-5px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

body.dark .btn-back-to-top:hover {
  background: var(--surface);
}

.btn-back-to-top:hover img {
  filter: brightness(0) saturate(100%) invert(35%) sepia(40%) saturate(2250%) hue-rotate(228deg) brightness(88%) contrast(84%);
}

body.dark .btn-back-to-top:hover img {
  filter: brightness(0) saturate(100%) invert(88%) sepia(19%) saturate(4155%) hue-rotate(192deg) brightness(103%) contrast(101%);
}

/* === Integration Styles from Project Pages === */
.project-hero {
  padding: 8rem 0 4rem;
  text-align: center;
}

.project-hero h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.project-hero .subtitle {
  font-size: 1.5rem;
  opacity: 0.8;
  margin-bottom: 2rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.project-meta {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.meta-item {
  background: var(--surface-container);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--outline);
}

.meta-item h4 {
  margin: 0 0 0.5rem;
  color: var(--primary);
}

.meta-item p {
  margin: 0;
  font-size: 0.95rem;
}

.project-section {
  padding: 4rem 0;
}

.project-section h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--on-surface);
}

.project-section h3 {
  color: var(--primary);
  margin-top: 2rem;
}

.project-section p {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  color: var(--on-surface);
  opacity: 0.9;
}

.two-col {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
  margin-top: 2rem;
}

.col-content {
  flex: 1;
}

.col-visual {
  flex: 1;
}

.code-block {
  background: #2b2930;
  color: #eaddff;
  padding: 1.5rem;
  border-radius: 12px;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  overflow-x: auto;
  margin: 1rem 0;
  border: 1px solid var(--outline);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
}

.stat-card {
  background: var(--primary-container);
  color: var(--on-primary-container);
  padding: 1.5rem;
  border-radius: 16px;
  text-align: center;
  margin-top: 1rem;
  min-width: 120px;
}

.stat-score {
  font-size: 3rem;
  font-weight: 800;
  color: var(--primary);
}

/* Styles pour les placeholders d'images */
.visual-placeholder {
  background-color: var(--surface-container);
  width: 100%;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  color: var(--on-surface);
  font-weight: bold;
  margin-bottom: 1rem;
  border: 2px dashed var(--outline);
  padding: 1rem;
  text-align: center;
  transition: transform 0.3s ease;
}

.visual-placeholder:hover {
  border-color: var(--primary);
  background-color: var(--surface);
}

.visual-placeholder.tall {
  min-height: 500px;
}

@media (max-width: 768px) {
  .two-col {
    flex-direction: column;
  }

  .project-hero h1 {
    font-size: 2.2rem;
  }

  /* Fix pour le débordement horizontal causé par les stat-cards */
  .project-stat-container {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  .stat-card {
    min-width: unset;
    width: 100%;
    max-width: 200px;
  }

  .project-highlight-section {
    padding: 1.5rem;
  }

  /* Fix pour le bouton de retour aux projets */
  .project-footer-section {
    padding-left: 1rem;
    padding-right: 1rem;
    display: flex;
    justify-content: center;
  }

  .project-footer-section .btn-download {
    white-space: normal;
    text-align: center;
    max-width: calc(100% - 2rem);
    word-wrap: break-word;
  }
}

/* Styles extraits des attributs style="..." */
.project-tag-container {
  margin-bottom: 1rem;
}

.project-tag {
  background: var(--primary-container);
  color: var(--primary);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-weight: bold;
  font-size: 0.9rem;
}

.project-link-note {
  margin-bottom: 2rem;
  font-size: 1.1rem;
  color: var(--on-surface);
}

.project-external-link {
  color: var(--primary);
  font-weight: bold;
  text-decoration: underline;
  margin-top: 10px;
  display: inline-block;
}

.project-img-shadow {
  width: 100%;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.project-highlight-section {
  background: var(--surface-container);
  border-radius: 24px;
  padding: 3rem;
}

.project-stat-container {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.project-stat-caption {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.8rem;
  opacity: 0.7;
}

.project-footer-section {
  text-align: center;
  padding-bottom: 6rem;
}

.project-footer-text {
  max-width: 800px;
  margin: 0 auto 2rem;
}

/* === New Project Specifics (Decathlon/Oishi) === */
.stat-label {
  font-size: 0.9rem;
  font-weight: 500;
}

.challenge-levels {
  list-style: none;
  padding: 0;
}

.challenge-levels li {
  background: var(--surface);
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: 8px;
  border-left: 4px solid var(--primary);
}

.challenge-levels strong {
  color: var(--primary);
}

.project-img-caption {
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.7;
}