html.lenis,
html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}
.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}
.lenis.lenis-stopped {
  overflow: hidden;
}

@media (max-width: 1024px) {
  body {
    cursor: auto !important;
  }
  .cursor-dot,
  .cursor-outline {
    display: none !important;
  }
}

.cursor-dot {
  width: 8px;
  height: 8px;
  background-color: #000000;
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 50%;
  z-index: 20000 !important;
  pointer-events: none;
  transform: translate(-50%, -50%);

  transition:
    background-color 0.2s ease,
    transform 0.1s;
}

.cursor-outline {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(0, 0, 0, 0.5);
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 50%;
  z-index: 20000 !important;
  pointer-events: none;
  transform: translate(-50%, -50%);

  transition:
    width 0.2s,
    height 0.3s,
    border-color 0.3s ease,
    background-color 0.3s ease;
}

body.on-dark-bg .cursor-dot {
  background-color: #ffffff !important;
}

body.on-dark-bg .cursor-outline {
  border-color: rgba(255, 255, 255, 0.8) !important;
}

.scroll-content,
#skill-modal-card,
.nav-glass-pill {
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.is-animating #modal-content-wrapper {
  display: none;
}
.skill-card,
button,
a,
.nav-glass-pill {
  pointer-events: auto !important;
  cursor: pointer !important;
  transform: translateZ(0); 
  -webkit-transform: translateZ(0);
}

.skill-card .fa-arrow-right {
  pointer-events: none;
}

body .cursor-outline.hovered {
  width: 65px;
  height: 65px;

  background-color: rgba(230, 69, 168, 0.1) !important;
  border-color: #e645a8 !important;
  mix-blend-mode: normal !important;
}

.text-outline {
  -webkit-text-stroke: 1px #000;
  color: transparent;
  transition: color 0.5s ease;
}
.text-outline:hover {
  color: #000;
}

.img-mask {
  border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
  transition: border-radius 1s ease-in-out;
}
.img-mask:hover {
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

#main-nav {
  position: fixed;
  top: 25px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  width: 90%;
  max-width: 1400px;
}

.nav-glass-pill {
  position: relative;

  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.6) 0%,
    rgba(255, 255, 255, 0.3) 40%,
    rgba(255, 255, 255, 0.1) 100%
  );
  backdrop-filter: blur(40px) saturate(220%);
  -webkit-backdrop-filter: blur(40px) saturate(220%);

  border-radius: 9999px;
  padding: 15px 35px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;

  border: 1px solid rgba(255, 255, 255, 0.4);

  box-shadow:
    0 15px 35px -5px rgba(0, 0, 0, 0.08),
    0 8px 15px -5px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.9),
    inset 0 10px 20px -5px rgba(255, 255, 255, 0.7),
    inset 0 -8px 20px -5px rgba(255, 255, 255, 0.2),
    inset 0 -20px 30px -10px rgba(230, 69, 168, 0.08);
  transition:
    transform 0.5s cubic-bezier(0.25, 1, 0.5, 1),
    box-shadow 0.5s ease,
    background 0.5s ease;

  transform-origin: center center;
  will-change: transform;
}

.nav-glass-pill:hover {
  transform: scale(1.03);

  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.15),
    0 12px 20px -5px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 0 rgba(255, 255, 255, 1),
    inset 0 10px 20px -5px rgba(255, 255, 255, 0.9),
    inset 0 -8px 20px -5px rgba(255, 255, 255, 0.2),
    inset 0 -20px 30px -10px rgba(230, 69, 168, 0.15);

  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.75) 0%,
    rgba(255, 255, 255, 0.35) 40%,
    rgba(255, 255, 255, 0.15) 100%
  );

  cursor: pointer;
}

.nav-glass-pill::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4%;
  width: 92%;
  height: 35%;

  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.7) 0%,
    rgba(255, 255, 255, 0.1) 60%,
    transparent 100%
  );

  border-radius: 9999px;
  filter: blur(1px);
  pointer-events: none;
  opacity: 0.9;
}

.nav-glass-pill::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  padding: 1px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.8),
    rgba(255, 255, 255, 0)
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.5;
}

.nav-link-custom {
  position: relative;
  color: #000;
  text-decoration: none;
  transition: color 0.3s ease;
}

html {
  scrollbar-width: thin;
  scrollbar-color: #0e0e0e transparent;
}

::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-thumb {
  background-color: #e645a8;
  border-radius: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}

#page-overlay {
  will-change: opacity;
}

.nav-link-custom::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0%;
  height: 2px;
  background-color: #e645a8;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link-custom:hover::after {
  width: 100%;
}

#main-nav.nav-dark-mode .nav-link-custom {
  color: #fff !important;
}
#main-nav.nav-dark-mode #nav-logo {
  color: #fff !important;
}
#main-nav.nav-dark-mode #nav-toggle {
  color: #fff !important;
}

#main-nav.nav-dark-mode #nav-cta {
  background-color: #fff;
  color: #000;
}
#main-nav.nav-dark-mode #nav-cta:hover {
  background-color: #e645a8;
  color: #fff;
}

.pointer-events-none {
  pointer-events: none !important;
}
.pointer-events-auto {
  pointer-events: auto !important;
}

#skill-modal-card {
  will-change: width, height, top, left, border-radius;
}

#modal-content-wrapper {
  transition: transform 0.1s ease-out;
}

#modal-text-1 strong,
#modal-text-2 strong {
  font-weight: 700;
  color: inherit;
  opacity: 1;
}

#modal-text-1 br + br,
#modal-text-2 br + br {
  display: block;
  content: "";
  margin-bottom: 10px;
  line-height: 0;
}

#skill-modal-card .overflow-y-auto {
  overflow-y: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;

  touch-action: pan-y;

  cursor: auto !important;
  pointer-events: auto !important;
}

#skill-modal-card .overflow-y-auto::-webkit-scrollbar {
  width: 6px;
}

#skill-modal-card .overflow-y-auto::-webkit-scrollbar-track {
  background: transparent;
}

#skill-modal-card .overflow-y-auto::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

body.on-dark-bg #skill-modal-card .overflow-y-auto::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.3);
}

#back-to-top {
  position: fixed;
  bottom: 40px;
  right: 40px;
  width: 58px;
  height: 58px;
  z-index: 1000;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.4) 0%,
    rgba(230, 69, 168, 0.15) 50%,
    rgba(255, 255, 255, 0.1) 100%
  );
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e645a8;
  font-size: 1.1rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(30px) scale(0.7);
  transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.08),
    inset 0 0 12px rgba(255, 255, 255, 0.3);
}
#back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
#back-to-top::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  height: 35%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.4), transparent);
  border-radius: 50% 50% 40% 40% / 100% 100% 20% 20%;
  pointer-events: none;
}

.form-input {
  background: transparent;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  transition:
    border-color 0.3s,
    transform 0.3s;
}
.form-input:focus {
  outline: none;
  border-bottom-color: #e645a8;
  transform: translateY(-2px);
}

.section-reveal {
  will-change: transform;
  transform-style: preserve-3d;
}

body.modal-open {
  overflow: hidden;
  height: 100vh;
}

#skill-modal {
  pointer-events: none;
}
#skill-modal.active {
  pointer-events: auto;
}

.scroll-content {
  transition:
    filter 0.5s ease,
    transform 0.5s ease;
  will-change: transform, filter;
}

@media (max-width: 768px) {
  #skill-modal-card {
    border-radius: 0 !important;
    height: 100% !important;
    width: 100% !important;
    top: 0 !important;
    left: 0 !important;
  }

  #close-skill-modal {
    top: 1.5rem;
    right: 1.5rem;
    background-color: rgba(0, 0, 0, 0.05);
  }

  #modal-title {
    font-size: 2.5rem;
  }
}

@media (max-width: 768px) {
  input,
  textarea,
  select {
    font-size: 16px !important;
  }
}

@media (pointer: coarse) {
  .cursor-dot,
  .cursor-outline {
    display: none !important;
  }
  body {
    cursor: auto !important;
  }
}

.nav-glass-pill.nav-expanded {
  border-radius: 30px !important;
  gap: 20px !important;
}

.nav-expanded #mobile-menu-list {
  max-height: 500px;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  margin-bottom: 10px;
}

#mobile-menu-list {
  transform: translateY(-10px);
  transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

@media (max-width: 768px) {
  .nav-glass-pill {
    padding: 12px 25px !important;
    align-items: stretch !important;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1) !important;
  }
}

#main-nav.nav-dark-mode .mobile-link {
  color: #ffffff !important;
}

#main-nav.nav-dark-mode .mobile-link:hover {
  color: #e645a8 !important;
}

#main-nav.nav-dark-mode .mobile-link.bg-black {
  background-color: #ffffff !important;
  color: #000000 !important;
  box-shadow: 0 10px 20px rgba(255, 255, 255, 0.15);
}

#main-nav.nav-dark-mode .mobile-link.bg-black:hover {
  background-color: #e645a8 !important;
  color: #ffffff !important;
}

.nav-glass-pill.nav-expanded::after {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nav-glass-pill.nav-expanded::before {
  opacity: 0.3;
}

/* --- CORRECTIF LAPTOP & ÉCRANS INTERMÉDIAIRES (1024px - 1440px) --- */

@media screen and (min-width: 1024px) and (max-width: 1440px) {
    
    /* 1. Réduire la taille du Titre H1 dans le Header */
    /* On écrase le text-[7rem] de Tailwind qui est trop grand ici */
    header#top h1 {
        font-size: 4.5rem !important; /* Plus raisonnable que 7rem */
        line-height: 1.1 !important;
        margin-bottom: 1.5rem !important;
    }

    /* 2. Ajuster le sous-titre */
    header#top h2 {
        font-size: 1.5rem !important;
    }

    /* 3. Gagner de l'espace vertical (Le header prenait trop de place en haut) */
    header#top {
        padding-top: 7rem !important; /* Au lieu de pt-32 (8rem) */
        padding-bottom: 3rem !important;
    }

    /* 4. Réduire l'espacement dans le Menu de navigation */
    /* Ton script JS réduit la nav à 800px, il faut donc réduire les espaces pour que ça rentre */
    #main-nav .hidden.md\:flex {
        gap: 1.5rem !important; /* Au lieu de gap-10 (2.5rem) */
    }
    
    /* Optionnel : Réduire légèrement la taille de police du menu */
    #main-nav .nav-link-custom {
        font-size: 10px !important;
    }

    /* 5. Ajuster l'image pour qu'elle ne soit pas coupée */
    .hero-img-container {
        display: flex;
        align-items: center; /* Centre verticalement par rapport au texte */
    }
    
    .hero-img-container .aspect-\[3\/4\] {
        max-width: 85%; /* Réduit un peu l'image pour qu'elle respire */
    }
}

/* --- CORRECTIF POUR LES ÉCRANS PEU HAUTS (Ex: MacBook Air 13") --- */
@media screen and (min-width: 1024px) and (max-height: 800px) {
    header#top {
        min-height: auto !important; /* Évite de forcer une hauteur d'écran trop grande */
        height: auto !important;
        padding-top: 8rem !important;
        padding-bottom: 8rem !important;
    }
    
    /* Cache le scroll "Marquee" du bas si l'écran est vraiment trop petit en hauteur */
    .marquee-container {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }
    
    .marquee-content {
        font-size: 2rem !important; /* Texte défilant plus petit */
    }
}

.nav-glass-pill, 
.section-reveal {
  will-change: transform; 
  transform: translateZ(0); 
}