/* Reset et base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px; /* ← remplace offset manuel de 100px */
  overflow-x: hidden; /* FIX: Empêche défilement horizontal */
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  overflow-x: hidden;
  background: #0a0a0f;
  color: #e5e5ea;
  width: 100%;
  max-width: 100vw; /* FIX: Force contrainte viewport */
}

/* Particles.js - Optimisé mobile */
#particles-js {
  position: fixed;
  width: 100vw; /* FIX: 100vw au lieu de 100% */
  height: 100vh;
  top: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden; /* FIX: Empêche débordement */
}

.content-wrapper {
  position: relative;
  z-index: 1;
}

.glow {
  filter: blur(80px);
  opacity: 0.4;
}

.glass {
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
}

/* Buttons */
.btn-cta {
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  box-shadow: 0 10px 40px rgba(59,130,246,0.3);
  transition: all 0.3s ease;
}

.btn-cta:hover {
  box-shadow: 0 20px 60px rgba(59,130,246,0.6);
  transform: translateY(-4px) scale(1.02);
}

.btn-secondary {
  transition: all 0.3s ease;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #e5e5ea;
}

.btn-secondary:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 10px 40px rgba(59,130,246,0.3);
}

/* Typography */
.futuristic-title {
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 0.02em;
}

.site-title {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* Cards */
.module-card,
.expertise-card {
  transition: all 0.3s ease;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
}

.module-card:hover,
.expertise-card:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
}

/* Navigation desktop */
.nav-link {
  transition: all 0.3s ease;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
}

.nav-link:hover {
  opacity: 1 !important;
}

.nav-link.active {
  opacity: 1 !important;
  box-shadow: 0 0 0 2px #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

.nav-link-external {
  transition: all 0.3s ease;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
}

.nav-link-external:hover {
  opacity: 1 !important;
}

/* Menu mobile - NOUVEAU */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(10, 10, 15, 0.98);
  backdrop-filter: blur(20px);
  z-index: 100;
  padding: 6rem 2rem 2rem;
  flex-direction: column;
  gap: 2rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-menu.active {
  display: flex;
  opacity: 1;
}

.mobile-nav-link,
.mobile-nav-link-external {
  font-size: 1.5rem;
  font-weight: 300;
  text-align: center;
  padding: 1rem;
  border-radius: 0.75rem;
  transition: all 0.3s ease;
  opacity: 0.8;
  text-decoration: none;
  color: inherit;
}

.mobile-nav-link:hover,
.mobile-nav-link-external:hover {
  opacity: 1;
  background: rgba(59, 130, 246, 0.1);
  transform: translateX(8px);
}

/* Quote carousel */
.quote-carousel {
  position: relative;
  perspective: 1500px;
}

.quote-box {
  position: relative;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.quote-content {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%) translateY(20px) scale(0.95);
  opacity: 0;
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.quote-content.active {
  opacity: 1;
  transform: translateY(-50%) scale(1);
  pointer-events: auto;
}

.quote-selector {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 10;
}

.quote-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
  position: relative;
  background: rgba(255,255,255,0.16);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.quote-dot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  pointer-events: auto;
}

.quote-dot:hover {
  transform: scale(1.4) translateZ(10px);
  background: rgba(59,130,246,0.8);
  box-shadow: 0 4px 16px rgba(59,130,246,0.6);
}

.quote-dot.active {
  background: rgba(59,130,246,0.8);
  transform: scale(1.3) translateZ(8px);
  box-shadow: 0 4px 16px rgba(59,130,246,0.8);
}

/* Footer links */
.footer-links a {
  transition: all 0.3s ease;
  text-decoration: underline;
  text-decoration-color: rgba(59, 130, 246, 0.3);
}

.footer-links a:hover {
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration-color: #6366f1 !important;
  transform: translateY(-1px);
  font-weight: 500;
  filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.8)) drop-shadow(0 0 20px rgba(59, 130, 246, 0.6));
}

.footer-subdomain-link {
  transition: all 0.3s ease;
}

.footer-subdomain-link:hover {
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.8)) drop-shadow(0 0 20px rgba(59, 130, 246, 0.6));
}

.cert-link {
  color: #3b82f6;
  transition: all 0.3s ease;
  text-decoration: underline;
  text-decoration-color: rgba(59, 130, 246, 0.4);
}

.cert-link:hover {
  color: #2563eb;
  text-decoration-color: #2563eb;
}

/* TI Tooltip */
.ti-abbr {
  text-decoration: underline;
  text-decoration-color: rgba(59, 130, 246, 0.3);
  cursor: pointer;
  position: relative;
  display: inline-block;
}

.ti-abbr:hover {
  text-decoration-color: rgba(59, 130, 246, 0.6);
}

.tooltip {
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  z-index: 1000;
  font-size: 0.875rem;
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  color: white;
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.4);
}

.tooltip.show {
  opacity: 1;
}

.tooltip.hide {
  transition: opacity 1.0s ease;
  opacity: 0;
}

.tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #6366f1 transparent transparent transparent;
}

/* Bio image */
.bio-image {
  float: left;
  margin-right: 1.5rem;
  margin-bottom: 1rem;
  border-radius: 0.75rem;
  max-width: 250px;
}

@media (max-width: 640px) {
  .bio-image {
    float: none;
    margin: 0 auto 1.5rem;
    display: block;
    max-width: 100%;
  }
}

/* Portfolio carousel */
.portfolio-container {
  perspective: 1500px;
  overflow: hidden;
  position: relative;
}

.portfolio-wrapper {
  display: flex;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-item {
  flex: 0 0 100%;
  padding: 0 0.75rem;
}

@media (min-width: 640px) {
  .portfolio-item {
    flex: 0 0 50%;
  }
}

@media (min-width: 1024px) {
  .portfolio-item {
    flex: 0 0 33.333%;
  }
}

.portfolio-card {
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 0.75rem;
  overflow: hidden;
}

.portfolio-card:hover {
  transform: translateY(-8px) rotateX(5deg) rotateY(5deg);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3), 0 0 12px rgba(59, 130, 246, 0.2);
}

.portfolio-card:active {
  transform: translateY(-4px) rotateX(10deg) scale(0.98);
}

.portfolio-text-bg {
  background: rgba(0, 0, 0, 0.4);
  padding: 1rem;
  border-bottom-left-radius: 0.75rem;
  border-bottom-right-radius: 0.75rem;
}

.portfolio-nav-btn {
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0.6;
}

.portfolio-nav-btn:hover {
  opacity: 1;
  transform: scale(1.15);
}

.portfolio-dots-container {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  align-items: center;
  margin-top: 1.5rem;
}

.portfolio-dots {
  display: flex;
  gap: 1rem;
  position: relative;
  align-items: center;
}

.portfolio-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(255,255,255,0.3);
  position: relative;
  z-index: 2;
}

.portfolio-dot.active {
  background: #60a5fa;
  transform: scale(1.3);
}

.portfolio-dot:hover {
  transform: scale(1.2);
}

.portfolio-progress-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255,255,255,0.1);
  transform: translateY(-50%);
  z-index: 1;
}

.portfolio-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 0%, #6366f1 100%);
  width: 0%;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
}

/* Code rain animation */
.code-rain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.code-char {
  position: absolute;
  font-family: 'Courier New', monospace;
  font-size: 16px;
  font-weight: bold;
  will-change: transform, opacity;
  color: rgba(59, 130, 246, 0.5);
  text-shadow: 0 0 5px rgba(59, 130, 246, 0.3);
}

/* Page loader */
.page-loader {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  pointer-events: none;
}

.loader-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(59, 130, 246, 0.2);
  border-top: 4px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

.page-loader.hidden {
  opacity: 0;
  transition: opacity 0.5s ease;
}

/* Animations */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-60px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Animation delays */
#header {
  animation: fadeInDown 1s ease-out;
}

#hero h1 {
  animation: fadeInUp 1.2s ease-out 0.3s backwards;
}

#hero > p {
  animation: fadeInUp 1s ease-out 0.5s backwards;
}

#hero blockquote {
  animation: fadeInUp 1s ease-out 0.7s backwards;
}

#hero .btn-cta,
#hero .btn-secondary {
  animation: fadeInUp 0.9s ease-out 0.9s backwards;
}

.glow {
  animation: pulse 4s ease-in-out infinite;
}

.module-card {
  animation: fadeInUp 1s ease-out backwards;
}

.module-card:nth-child(1) {
  animation-delay: 1.2s;
}

.module-card:nth-child(2) {
  animation-delay: 1.4s;
}

.module-card:nth-child(3) {
  animation-delay: 1.6s;
}

.expertise-card {
  animation: slideInLeft 1s ease-out backwards;
}

.expertise-card:nth-child(1) {
  animation-delay: 1.4s;
}

.expertise-card:nth-child(2) {
  animation-delay: 1.55s;
}

.expertise-card:nth-child(3) {
  animation-delay: 1.7s;
}

.expertise-card:nth-child(4) {
  animation-delay: 1.85s;
}


/* Feedback hover subtil + joli pour les liens du menu */
.nav-link {
  position: relative;
  transition: all 0.3s ease;
}

/* Ligne qui apparaît uniquement au hover */
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 0;
  height: 2px;
  background: #3b82f6;
  border-radius: 1px;
  transition: width 0.4s ease, box-shadow 0.4s ease;
  transform: translateX(-50%);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.8);
}

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

/* Le lien actif garde son style actuel (cadre + fond) mais SANS underline */
.nav-link.active {
  opacity: 1 !important;
  box-shadow: 0 0 0 2px #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

/* On désactive complètement l'underline sur le lien actif (même au hover) */
.nav-link.active::after,
.nav-link.active:hover::after {
  width: 0 !important;
  box-shadow: none !important;
}
