:root {
  --bg: #050505;
  --primary: #00f2ff;
  --accent: #7000ff;
  --text: #ffffff;
  --text-dim: #a0a0a0;
  --glass: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.1);
}

/* Neutraliser les pseudos décoratifs pour éviter qu'ils bloquent les clics */
.loader-logo::before,
.progress-container::before,
.project-card::before,
.skill-category::before,
.timeline::before,
.modal-content::before {
  pointer-events: none;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Montserrat", sans-serif;
  overflow-x: hidden;
}

/* ========================================
   ACCESSIBILITÉ
   ======================================== */

/* Skip Link pour navigation clavier */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--primary);
  color: var(--bg);
  padding: 12px 20px;
  text-decoration: none;
  font-weight: 700;
  z-index: 10000;
  border-radius: 0 0 8px 0;
  transition: top 0.3s ease;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Focus visible pour tous les éléments interactifs */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus,
[tabindex]:focus {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Focus visible pour navigation */
.nav-link:focus {
  outline: 3px solid var(--primary);
  outline-offset: 5px;
  background: rgba(0, 242, 255, 0.1);
}

/* Amélioration du contraste des boutons */
.btn:focus {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
  box-shadow: 0 0 0 6px rgba(112, 0, 255, 0.2);
}

/* Focus pour les cartes cliquables */
.project-card:focus-within,
.competence-table td.my-level:focus {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}

/* Préférence pour réduire les animations (accessibilité) */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .matrix-grid,
  .glow-point,
  .loader-particle {
    display: none;
  }
}

/* Amélioration contraste pour mode sombre */
@media (prefers-contrast: high) {
  :root {
    --text: #ffffff;
    --text-dim: #cccccc;
    --border: rgba(255, 255, 255, 0.3);
  }
  
  .btn-outline {
    border-width: 3px;
  }
}

/* ========================================
   FIN ACCESSIBILITÉ
   ======================================== */

/* ========================================
   BOUTON & PANNEAU ACCESSIBILITÉ
   ======================================== */

.accessibility-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9999;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--bg);
  border: none;
  border-radius: 50px;
  padding: 15px 25px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(0, 242, 255, 0.4);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
}

.accessibility-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 242, 255, 0.6);
}

.accessibility-btn i {
  font-size: 1.3rem;
}

.accessibility-btn-text {
  font-size: 1rem;
}

.accessibility-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 380px;
  height: 100vh;
  background: linear-gradient(180deg, rgba(5, 5, 5, 0.98), rgba(10, 10, 10, 0.98));
  backdrop-filter: blur(20px);
  border-left: 2px solid var(--primary);
  z-index: 10000;
  transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  overflow-y: auto;
  box-shadow: -10px 0 50px rgba(0, 0, 0, 0.8);
}

.accessibility-panel.open {
  right: 0;
}

.accessibility-header {
  position: sticky;
  top: 0;
  background: linear-gradient(135deg, rgba(0, 242, 255, 0.1), rgba(112, 0, 255, 0.1));
  border-bottom: 2px solid var(--primary);
  padding: 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.accessibility-header h2 {
  color: var(--primary);
  font-size: 1.5rem;
  margin: 0;
}

.close-accessibility {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.close-accessibility:hover {
  background: var(--primary);
  color: var(--bg);
  transform: rotate(90deg);
}

.accessibility-content {
  padding: 25px;
}

.accessibility-group {
  margin-bottom: 30px;
  padding-bottom: 25px;
  border-bottom: 1px solid var(--border);
}

.accessibility-group:last-of-type {
  border-bottom: none;
}

.accessibility-group h3 {
  color: var(--text);
  font-size: 1.1rem;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.accessibility-controls {
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.accessibility-control-btn {
  flex: 1;
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.accessibility-control-btn:hover {
  background: linear-gradient(135deg, rgba(0, 242, 255, 0.2), rgba(112, 0, 255, 0.2));
  border-color: var(--primary);
  transform: translateY(-2px);
}

.accessibility-control-btn:active {
  transform: translateY(0);
}

.accessibility-toggle {
  display: flex;
  align-items: center;
  gap: 15px;
  cursor: pointer;
  padding: 10px;
  border-radius: 8px;
  transition: background 0.3s ease;
}

.accessibility-toggle:hover {
  background: rgba(0, 242, 255, 0.05);
}

.accessibility-toggle input[type="checkbox"] {
  display: none;
}

.toggle-slider {
  position: relative;
  width: 50px;
  height: 26px;
  background: var(--glass);
  border: 2px solid var(--border);
  border-radius: 50px;
  transition: all 0.3s ease;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-dim);
  top: 2px;
  left: 2px;
  transition: all 0.3s ease;
}

.accessibility-toggle input[type="checkbox"]:checked + .toggle-slider {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-color: var(--primary);
}

.accessibility-toggle input[type="checkbox"]:checked + .toggle-slider::before {
  left: 26px;
  background: white;
}

.toggle-label {
  color: var(--text);
  font-size: 1rem;
  flex: 1;
}

.reset-accessibility-btn {
  width: 100%;
  background: linear-gradient(135deg, rgba(255, 69, 87, 0.2), rgba(255, 69, 87, 0.1));
  border: 2px solid #ff4557;
  color: #ff4557;
  padding: 15px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  margin-top: 20px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.reset-accessibility-btn:hover {
  background: linear-gradient(135deg, rgba(255, 69, 87, 0.3), rgba(255, 69, 87, 0.2));
  transform: scale(1.02);
}

/* États d'accessibilité appliqués */
body.high-contrast {
  --bg: #000000;
  --text: #ffffff;
  --text-dim: #ffffff;
  --border: rgba(255, 255, 255, 0.5);
  --glass: rgba(255, 255, 255, 0.1);
}

body.high-contrast .btn-outline {
  border-width: 3px;
}

body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
  animation-duration: 0.01ms !important;
  transition-duration: 0.01ms !important;
}

body.reduce-motion .matrix-grid,
body.reduce-motion .glow-point,
body.reduce-motion .loader-particle,
body.reduce-motion #matrixCanvas {
  display: none !important;
}

body.reduce-motion .hero-badge,
body.reduce-motion .chevrons i {
  animation: none !important;
}

body.keyboard-navigation *:focus {
  outline: 4px solid var(--primary) !important;
  outline-offset: 4px !important;
}

body.reading-mode-light {
  background: #ffffff;
  color: #2d2d2d;
}

body.reading-mode-light .matrix-grid,
body.reading-mode-light .glow-point,
body.reading-mode-light #matrixCanvas {
  display: none;
}

body.reading-mode-light nav {
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid #e0e0e0;
}

body.reading-mode-light .glass-card,
body.reading-mode-light .competence-block,
body.reading-mode-light .project-card {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

body.reading-mode-light .section-header,
body.reading-mode-light h1,
body.reading-mode-light h2,
body.reading-mode-light h3 {
  color: #1a1a1a;
}

body.reading-mode-light .section-header,
body.reading-mode-light p,
body.reading-mode-light li {
  font-size: 1.2rem;
  line-height: 1.8;
  color: #2d2d2d;
}

body.reading-mode-dark {
  background: #0d0d0d;
  color: #e8e8e8;
}

body.reading-mode-dark .matrix-grid,
body.reading-mode-dark .glow-point,
body.reading-mode-dark #matrixCanvas {
  display: none;
}

body.reading-mode-dark nav {
  background: rgba(20, 20, 20, 0.95);
  border-bottom: 1px solid #2a2a2a;
}

body.reading-mode-dark .glass-card,
body.reading-mode-dark .competence-block,
body.reading-mode-dark .project-card {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.reading-mode-dark .section-header,
body.reading-mode-dark h1,
body.reading-mode-dark h2,
body.reading-mode-dark h3 {
  color: #ffffff;
}

body.reading-mode-dark .section-header,
body.reading-mode-dark p,
body.reading-mode-dark li {
  font-size: 1.2rem;
  line-height: 1.8;
  color: #e8e8e8;
}

body.underline-links a {
  text-decoration: underline !important;
}

/* Responsive */
@media (max-width: 768px) {
  .accessibility-btn {
    bottom: 20px;
    right: 20px;
    padding: 12px 18px;
    font-size: 0.9rem;
  }

  .accessibility-btn-text {
    display: none;
  }

  .accessibility-panel {
    width: 100%;
    right: -100%;
  }
}

/* ========================================
   FIN BOUTON & PANNEAU ACCESSIBILITÉ
   ======================================== */


/* Bloquer le scroll pendant le chargement */
body.no-scroll {
  overflow: hidden;
  height: 100vh;
}

/* Prevent horizontal overflow on mobile */
html {
  overflow-x: hidden;
}

/* Background Grille */
.matrix-grid {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 50px 50px;
  z-index: -2;
  mask-image: radial-gradient(circle at center, black, transparent 80%);
  transition: background-image 0.3s ease;
}

.glow-point {
  position: fixed;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 242, 255, 0.15), transparent 70%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s;
}

/* Loader Ultra Moderne */
.loader {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #000000, #0a0a0a, #050505);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.loader-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.loader-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--primary);
  animation: particleFloat 3s infinite;
}

.loader-particle:nth-child(1) {
  top: 20%;
  left: 10%;
  animation-delay: 0s;
  animation-duration: 4s;
}

.loader-particle:nth-child(2) {
  top: 60%;
  left: 80%;
  animation-delay: 0.5s;
  animation-duration: 3.5s;
}

.loader-particle:nth-child(3) {
  top: 80%;
  left: 20%;
  animation-delay: 1s;
  animation-duration: 3s;
}

.loader-particle:nth-child(4) {
  top: 40%;
  left: 90%;
  animation-delay: 1.5s;
  animation-duration: 4.5s;
}

.loader-particle:nth-child(5) {
  top: 10%;
  left: 50%;
  animation-delay: 2s;
  animation-duration: 3.2s;
}

.loader-particle:nth-child(6) {
  top: 30%;
  left: 15%;
  animation-delay: 0.3s;
  animation-duration: 3.8s;
}

.loader-particle:nth-child(7) {
  top: 70%;
  left: 85%;
  animation-delay: 0.8s;
  animation-duration: 3.4s;
}

.loader-particle:nth-child(8) {
  top: 50%;
  left: 30%;
  animation-delay: 1.2s;
  animation-duration: 4s;
}

.loader-particle:nth-child(9) {
  top: 25%;
  left: 75%;
  animation-delay: 1.8s;
  animation-duration: 3.6s;
}

.loader-particle:nth-child(10) {
  top: 65%;
  left: 50%;
  animation-delay: 2.3s;
  animation-duration: 3.3s;
}

.loader-particle:nth-child(11) {
  top: 15%;
  left: 60%;
  animation-delay: 0.6s;
  animation-duration: 3.9s;
}

.loader-particle:nth-child(12) {
  top: 55%;
  left: 12%;
  animation-delay: 1.1s;
  animation-duration: 4.2s;
}

.loader-particle:nth-child(13) {
  top: 75%;
  left: 65%;
  animation-delay: 1.7s;
  animation-duration: 3.5s;
}

.loader-particle:nth-child(14) {
  top: 35%;
  left: 88%;
  animation-delay: 2.1s;
  animation-duration: 3.7s;
}

.loader-particle:nth-child(15) {
  top: 45%;
  left: 42%;
  animation-delay: 2.5s;
  animation-duration: 3.1s;
}

@keyframes particleFloat {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  50% {
    transform: translate(50px, -100px) scale(1.5);
    opacity: 0.8;
  }
  90% {
    opacity: 0.3;
  }
}

.loader-content {
  text-align: center;
  position: relative;
  z-index: 1;
}

.loader-logo {
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 900;
  letter-spacing: 0.1em;
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
  gap: 5px;
  position: relative;
}

.loader-logo::before,
.loader-logo::after {
  content: "TIBO.TESSIER";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0;
}

.loader-logo::before {
  animation: glitch1 2s infinite;
}

.loader-logo::after {
  animation: glitch2 2s infinite;
}

@keyframes glitch1 {
  0%,
  90%,
  100% {
    opacity: 0;
  }
  92% {
    opacity: 0.8;
    transform: translateX(-50%) translate(-2px, -2px);
    filter: hue-rotate(90deg);
  }
}

@keyframes glitch2 {
  0%,
  85%,
  100% {
    opacity: 0;
  }
  87% {
    opacity: 0.8;
    transform: translateX(-50%) translate(2px, 2px);
    filter: hue-rotate(-90deg);
  }
}

.loader-logo .letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(30px) rotateX(-90deg);
  animation: letterDrop 0.6s forwards;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 20px rgba(0, 242, 255, 0.5);
}

.loader-logo .letter:nth-child(1) {
  animation-delay: 0.1s;
}
.loader-logo .letter:nth-child(2) {
  animation-delay: 0.2s;
}
.loader-logo .letter:nth-child(3) {
  animation-delay: 0.3s;
}
.loader-logo .letter:nth-child(4) {
  animation-delay: 0.4s;
}
.loader-logo .dot {
  animation-delay: 0.5s;
  color: var(--primary);
  opacity: 0;
  animation: letterDrop 0.6s forwards;
}
.loader-logo .letter:nth-child(6) {
  animation-delay: 0.6s;
}
.loader-logo .letter:nth-child(7) {
  animation-delay: 0.7s;
}
.loader-logo .letter:nth-child(8) {
  animation-delay: 0.8s;
}
.loader-logo .letter:nth-child(9) {
  animation-delay: 0.9s;
}
.loader-logo .letter:nth-child(10) {
  animation-delay: 1s;
}
.loader-logo .letter:nth-child(11) {
  animation-delay: 1.1s;
}
.loader-logo .letter:nth-child(12) {
  animation-delay: 1.2s;
}

@keyframes letterDrop {
  to {
    opacity: 1;
    transform: translateY(0) rotateX(0);
  }
}

.loader-subtitle {
  font-size: 1.2rem;
  color: var(--text-dim);
  margin-bottom: 40px;
  opacity: 0;
  animation: fadeInUp 0.8s forwards 1.3s;
}

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

.progress-container {
  width: 300px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  margin: 0 auto 15px;
  position: relative;
  opacity: 1;
  animation: fadeInUp 0.8s forwards 1.5s;
}

.progress-container::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 242, 255, 0.3),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 10px;
  transition: width 0.3s ease;
  box-shadow: 0 0 20px var(--primary);
  position: relative;
}

.progress-bar::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 10px #fff;
}

.loader-percentage {
  font-size: 2rem;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 10px;
  opacity: 1;
  animation: pulse 2s infinite;
  text-shadow: 0 0 20px rgba(0, 242, 255, 0.5);
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    text-shadow: 0 0 20px rgba(0, 242, 255, 0.5);
  }
  50% {
    transform: scale(1.05);
    text-shadow: 0 0 30px rgba(0, 242, 255, 0.8);
  }
}

.loader-status {
  font-size: 0.9rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 1;
}

/* Navbar */
.glass-nav {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 1000px;
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(15px);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 15px 30px;
  z-index: 1000;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}
.logo {
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: -1px;
}
.logo span {
  color: var(--primary);
}
.nav-links {
  display: flex;
  gap: 2rem;
}

/* Toggle (hamburger) */
.nav-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.6),
    rgba(20, 20, 20, 0.9)
  );
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 242, 255, 0.12);
}
.nav-toggle i {
  color: var(--primary);
  font-size: 1rem;
  transition: transform 0.25s ease, color 0.25s ease;
}
.nav-toggle:hover {
  border-color: var(--primary);
}

.nav-toggle[aria-expanded="true"] i {
  transform: rotate(90deg);
  color: var(--accent);
}

@media (max-width: 768px) {
  /* Compact, properly centered nav on mobile */
  .glass-nav {
    top: 12px;
    left: 12px;
    right: 12px;
    transform: none;
    width: auto;
    padding: 10px 16px;
    border-radius: 16px;
  }

  .logo {
    font-size: 1.2rem;
  }
  .nav-toggle {
    display: flex;
    width: 32px;
    height: 32px;
  }
  .nav-toggle {
    display: flex;
  }
  .nav-links {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    left: 0;
    background: rgba(10, 10, 10, 0.92);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px 12px;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    z-index: 1001;
    box-sizing: border-box;
    max-width: none;
    max-height: 0;
    opacity: 0;
    transform: translateY(-8px);
    overflow: hidden;
    pointer-events: none;
    transition: max-height 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
  }
  .nav-links.open {
    max-height: 350px;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .nav-link {
    font-size: 0.95rem;
    display: inline-block;
    padding: 8px 12px;
    border-radius: 10px;
    width: 100%;
  }
  .nav-link.active::after {
    bottom: 0;
  }
}
.nav-link {
  text-decoration: none;
  color: var(--text-dim);
  font-size: 0.9rem;
  transition: 0.3s;
  position: relative;
}
.nav-link:hover {
  color: var(--primary);
}
.nav-link.active {
  color: var(--primary);
  font-weight: bold;
}
.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: var(--primary);
}

/* Hero */
.hero {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  text-align: center;
}

#matrixCanvas {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  z-index: -1;
}

.hero-content {
  max-width: 900px;
  padding: 0 20px;
}

.hero-badge {
  display: inline-block;
  padding: 10px 25px;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: bold;
  margin-bottom: 30px;
  box-shadow: 0 5px 20px rgba(0, 242, 255, 0.3);
  animation: pulse 2s infinite;
}

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

.hero-content h1 {
  font-size: clamp(3rem, 10vw, 7rem);
  font-weight: 900;
  margin-bottom: 20px;
  letter-spacing: -3px;
  line-height: 1.1;
  background: linear-gradient(135deg, #fff, var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--text-dim);
  font-size: 1.8rem;
  margin-bottom: 20px;
  font-weight: 300;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

.hero-description {
  color: var(--text-dim);
  font-size: 1.1rem;
  margin-bottom: 40px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.hero-cta {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.scroll-down {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: 0.3s;
}

.scroll-down:hover {
  color: var(--accent);
}

.chevrons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.chevrons i {
  font-size: 1.8rem;
  animation: bounce 2s infinite;
}

.chevrons i:nth-child(2) {
  animation-delay: 0.2s;
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

.btn {
  padding: 15px 35px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: bold;
  transition: 0.4s;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
}
.btn[disabled],
.btn:disabled {
  cursor: not-allowed;
  opacity: 0.75;
  box-shadow: none;
  transform: none;
}
.btn-primary {
  background: var(--primary);
  color: #000;
  box-shadow: 0 5px 25px rgba(0, 242, 255, 0.4);
}
.btn-primary:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 35px rgba(0, 242, 255, 0.6);
}
.btn-outline {
  border: 2px solid var(--primary);
  color: var(--primary);
  background: transparent;
}
.btn-outline:hover {
  background: var(--primary);
  color: #000;
  transform: translateY(-5px);
}
.btn-soon {
  background: linear-gradient(135deg, rgba(0, 242, 255, 0.15), rgba(112, 0, 255, 0.15));
  border: 1px dashed var(--primary);
  color: var(--text);
}

.btn-unavailable {
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.3);
  color: var(--text-dim);
}
.btn-detail {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
  font-size: 0.9rem;
  margin-top: 15px;
  padding: 10px 25px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.btn-detail::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #00f2ff, #00d9ff);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
  border-radius: 8px;
}

.btn-detail:hover {
  color: #000;
  border-color: #00d9ff;
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 242, 255, 0.5),
    0 0 20px rgba(0, 217, 255, 0.4);
}

.btn-detail:hover::before {
  opacity: 1;
}

/* Projets */
.projects {
  padding: 100px 5%;
}
.section-header {
  text-align: center;
  margin-bottom: 60px;
}
.pre-title {
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 0.8rem;
}
.section-header h2 {
  font-size: 3rem;
  margin-top: 10px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  max-width: 1200px;
  margin: 0 auto;
}

.project-card {
  background: var(--glass);
  border: 1px solid var(--border);
  padding: 40px 30px;
  border-radius: 30px;
  transition: 0.4s ease;
  position: relative;
  overflow: hidden;
  cursor: auto;
  display: flex;
  flex-direction: column;
  min-height: 350px;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    transparent,
    rgba(0, 242, 255, 0.1),
    transparent
  );
  opacity: 0;
  transition: 0.4s;
  pointer-events: none;
}

.project-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--primary);
  transform: translateY(-10px);
}

.project-card:hover::before {
  opacity: 1;
}

.card-icon {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 20px;
}

.project-card .btn-detail {
  margin-top: auto;
}
.tech-tags {
  color: var(--accent);
  font-weight: bold;
  font-size: 0.8rem;
  margin: 10px 0;
}
.project-hours {
  color: var(--primary);
  font-weight: bold;
  font-size: 0.8rem;
  margin: 10px 0;
}

/* Compétences */
.skills {
  padding: 100px 5%;
  background: linear-gradient(180deg, rgba(112, 0, 255, 0.05), transparent);
}
.skills .section-header {
  margin-bottom: 60px;
}
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
}

.skill-category {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 25px;
  padding: 35px;
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}

.skill-category::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 242, 255, 0.1),
    transparent
  );
  transition: 0.5s;
}

.skill-category:hover::before {
  left: 100%;
}

.skill-category:hover {
  border-color: var(--primary);
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 242, 255, 0.2);
}

.category-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.category-header i {
  font-size: 2rem;
  color: var(--primary);
}

.category-header h3 {
  font-size: 1.3rem;
  color: var(--text);
  font-weight: 700;
}

.tech-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.tech-item {
  background: rgba(0, 242, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 15px;
  font-size: 0.9rem;
  color: var(--text-dim);
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: default;
}

.tech-item i {
  color: var(--primary);
  font-size: 1.1rem;
}

.tech-item:hover {
  background: rgba(0, 242, 255, 0.15);
  border-color: var(--primary);
  color: var(--primary);
  transform: scale(1.05);
}

/* À Propos */
.about {
  padding: 100px 5%;
}
.about-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  max-width: 1200px;
  margin: 0 auto;
  align-items: center;
}
.about-text {
  line-height: 1.8;
  color: var(--text-dim);
}
.about-text p {
  margin-bottom: 20px;
}
.about-text strong {
  color: var(--primary);
}

/* Offset pour que les ancres scrollent sans recouvrir le contenu sous la nav */
[id] {
  scroll-margin-top: 60px;
}

/* Parcours Section */
.parcours {
  padding: 100px 5%;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(0, 242, 255, 0.02),
    transparent
  );
}

.parcours-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  max-width: 1400px;
  margin: 50px auto 0;
}

.parcours-section {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.parcours-section:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: 0 20px 40px rgba(0, 242, 255, 0.1);
}

.parcours-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--border);
}

.parcours-header i {
  font-size: 2rem;
  color: var(--primary);
}

.parcours-header h3 {
  font-size: 1.8rem;
  color: var(--text);
  font-weight: 700;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 30px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
}

.timeline-item {
  position: relative;
  margin-bottom: 30px;
  padding-bottom: 30px;
}

.timeline-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -36px;
  top: 5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--bg);
  box-shadow: 0 0 15px var(--primary);
  z-index: 2;
}

.timeline-content {
  background: rgba(255, 255, 255, 0.02);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}

.timeline-content:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--primary);
  transform: translateX(5px);
}

.timeline-date {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 10px;
  padding: 5px 12px;
  background: rgba(0, 242, 255, 0.1);
  border-radius: 20px;
}

.timeline-content h4 {
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 10px;
  font-weight: 600;
}

.timeline-location {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline-location i {
  color: var(--accent);
}

.timeline-details {
  list-style: none;
  padding-left: 0;
}

.timeline-details li {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 8px;
  padding-left: 20px;
  position: relative;
  line-height: 1.6;
}

.timeline-details li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: bold;
}

/* Experience Card */
.experience-card {
  background: rgba(255, 255, 255, 0.02);
  padding: 30px;
  border-radius: 15px;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.experience-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--primary);
}

.experience-icon {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.experience-icon i {
  font-size: 2rem;
  color: var(--bg);
}

.experience-card h4 {
  font-size: 1.5rem;
  color: var(--text);
  margin-bottom: 15px;
  font-weight: 600;
}

.experience-card p {
  color: var(--text-dim);
  line-height: 1.8;
  margin-bottom: 20px;
}

.stage-details {
  background: rgba(0, 242, 255, 0.05);
  padding: 20px;
  border-radius: 12px;
  border-left: 3px solid var(--primary);
  margin: 25px 0;
}

.stage-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--text-dim);
  font-size: 0.95rem;
}

.stage-info:last-child {
  margin-bottom: 0;
}

.stage-info i {
  color: var(--primary);
  font-size: 1.1rem;
  min-width: 20px;
}

.stage-info strong {
  color: var(--text);
}

.skills-highlight {
  margin: 25px 0;
  padding: 20px;
  background: rgba(112, 0, 255, 0.05);
  border-radius: 12px;
  border-left: 3px solid var(--accent);
}

.skills-highlight p {
  margin-bottom: 15px;
  color: var(--text);
  font-weight: 600;
}

.skills-highlight ul {
  list-style: none;
  padding-left: 0;
}

.skills-highlight li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-dim);
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.skills-highlight li:last-child {
  margin-bottom: 0;
}

.skills-highlight i {
  color: var(--accent);
  font-size: 0.9rem;
}

.experience-card .btn {
  margin-top: 25px;
  width: 100%;
  justify-content: center;
}

/* Terminal Amélioré */
.terminal-container {
  background: #000;
  border-radius: 15px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.terminal-header {
  background: #1a1a1a;
  padding: 15px 20px;
  display: flex;
  align-items: center;
}
.dots {
  display: flex;
  gap: 8px;
}
.dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dots span:nth-child(1) {
  background: #ff5f56;
}
.dots span:nth-child(2) {
  background: #ffbd2e;
}
.dots span:nth-child(3) {
  background: #27c93f;
}
.t-title {
  margin-left: 20px;
  font-size: 0.85rem;
  color: #666;
  font-family: monospace;
}
.terminal-body {
  padding: 25px;
  font-family: "Courier New", monospace;
  line-height: 1.8;
  font-size: 0.9rem;
  position: relative;
  min-height: 220px;
}
.terminal-body p {
  margin: 5px 0;
}
.p-green {
  color: #27c93f;
  font-weight: bold;
}

.term-line {
  display: block;
  margin: 4px 0;
  color: var(--text);
}

.cursor {
  display: inline-block;
  width: 10px;
  height: 16px;
  background: var(--primary);
  margin-left: 6px;
  animation: blink 1s steps(2, end) infinite;
}

@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }
  50.1%,
  100% {
    opacity: 0;
  }
}

/* Footer / Contact */
.footer {
  padding: 120px 5% 40px;
  background: linear-gradient(180deg, transparent, rgba(0, 242, 255, 0.05));
  border-top: 1px solid var(--border);
  scroll-margin-top: 140px;
}
.footer-content {
  max-width: 1000px;
  margin: 0 auto;
}
.footer .section-header {
  margin-bottom: 40px;
}
.footer-subtitle {
  text-align: center;
  font-size: 1.1rem;
  color: var(--text-dim);
  margin-bottom: 50px;
}
.contact-methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
.contact-item {
  text-align: center;
  padding: 20px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 15px;
  transition: 0.3s;
}
.contact-item:hover {
  background: rgba(0, 242, 255, 0.1);
  border-color: var(--primary);
}
.contact-item i {
  font-size: 1.8rem;
  color: var(--primary);
  display: block;
  margin-bottom: 10px;
}
.contact-item a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
}
.contact-item a:hover {
  color: var(--primary);
}
.social-links {
  display: flex;
  justify-content: center;
  gap: 25px;
  margin-bottom: 30px;
}
.social-links a {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: #fff;
  font-size: 1.2rem;
  transition: 0.3s;
}
.social-links a:hover {
  background: var(--primary);
  color: #000;
  transform: scale(1.1) translateY(-5px);
  border-color: var(--primary);
}
.footer-bottom {
  text-align: center;
  color: #666;
  font-size: 0.9rem;
  padding-top: 30px;
  border-top: 1px solid var(--border);
}

/* Modal Amélioré */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: linear-gradient(
        135deg,
        rgba(10, 10, 10, 0.95),
        rgba(20, 20, 30, 0.95)
      )
      padding-box,
    linear-gradient(135deg, var(--primary), var(--accent)) border-box;
  padding: 36px 32px 32px 32px;
  border-radius: 24px;
  max-width: 900px;
  width: min(92vw, 900px);
  max-height: 92vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 242, 255, 0.6) rgba(255, 255, 255, 0.04);
  width: 100%;
  position: relative;
  border: 2px solid transparent;
  box-shadow: 0 14px 40px rgba(0, 242, 255, 0.25);
}

.modal-content::-webkit-scrollbar {
  width: 6px;
}

.modal-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    rgba(0, 242, 255, 0.8),
    rgba(0, 170, 255, 0.7)
  );
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(0, 242, 255, 0.25);
}

.modal-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    180deg,
    rgba(0, 242, 255, 1),
    rgba(0, 170, 255, 0.9)
  );
}

/* ========================================
   SECTION COMPÉTENCES BUT
   ======================================== */

.competences-but {
  padding: 80px 20px;
  position: relative;
}

.competences-but .section-description {
  color: var(--text-dim);
  font-size: 1rem;
  margin-top: 15px;
  text-align: center;
}

.competence-legend {
  background: linear-gradient(135deg, rgba(0, 170, 255, 0.1), rgba(0, 242, 255, 0.05));
  border: 1px solid var(--primary);
  border-radius: 12px;
  padding: 25px;
  margin: 30px 0 40px 0;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 1rem;
  color: var(--text);
}

.legend-item i {
  font-size: 1.5rem;
  color: var(--primary);
}

.legend-badge {
  background: linear-gradient(135deg, rgba(0, 170, 255, 0.3), rgba(0, 242, 255, 0.3));
  border: 1px solid var(--primary);
  padding: 8px 15px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
}

.legend-text {
  color: var(--text-dim);
  line-height: 1.6;
}

.competence-block {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 35px;
  margin-bottom: 40px;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.competence-block:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 32px rgba(0, 242, 255, 0.1);
}

.competence-header {
  margin-bottom: 30px;
  text-align: center;
}

.competence-header i {
  font-size: 3rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 15px;
  display: block;
}

.competence-header h3 {
  font-size: 1.8rem;
  margin-bottom: 10px;
  color: var(--text);
}

.competence-subtitle {
  color: var(--text-dim);
  font-size: 1.1rem;
  font-style: italic;
}

.table-responsive {
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.competence-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.95rem;
  line-height: 1.6;
}

.competence-table thead {
  background: linear-gradient(135deg, rgba(0, 242, 255, 0.1), rgba(112, 0, 255, 0.1));
  border-bottom: 2px solid var(--primary);
}

.competence-table th {
  padding: 20px 15px;
  text-align: left;
  font-weight: 700;
  color: var(--text);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.competence-table th:first-child {
  min-width: 250px;
}

.competence-table .status-col {
  min-width: 280px;
  text-align: center;
}

.competence-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: all 0.3s ease;
}

.competence-table tbody tr:hover {
  background: rgba(0, 242, 255, 0.03);
  transform: scale(1.005);
}

.competence-table td {
  padding: 20px 15px;
  color: var(--text-dim);
  vertical-align: top;
}

.competence-table .ac-label {
  font-weight: 600;
  color: var(--primary);
  font-size: 1rem;
}

.competence-table tbody tr:last-child {
  border-bottom: none;
}

/* Status column colors */
.competence-table .non-acquis {
  color: #ff4757;
}

.competence-table .en-cours {
  color: #ffa502;
}

.competence-table .acquis {
  color: #2ed573;
}

/* Highlight current level */
.competence-table td.my-level {
  background: linear-gradient(135deg, rgba(0, 170, 255, 0.15), rgba(0, 242, 255, 0.15));
  border-left: 3px solid var(--primary);
  font-weight: 600;
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
}

.competence-table td.my-level:hover {
  background: linear-gradient(135deg, rgba(0, 170, 255, 0.25), rgba(0, 242, 255, 0.25));
  transform: scale(1.02);
}

.competence-table td.my-level::after {
  content: "📍";
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 1.2rem;
}

/* Responsive table */
@media (max-width: 1200px) {
  .competence-table {
    font-size: 0.9rem;
  }
  
  .competence-table th,
  .competence-table td {
    padding: 15px 10px;
  }
}

@media (max-width: 768px) {
  .competences-but {
    padding: 60px 15px;
  }

  .competence-block {
    padding: 25px 15px;
    margin-bottom: 30px;
  }

  .competence-header h3 {
    font-size: 1.4rem;
  }

  .competence-subtitle {
    font-size: 0.95rem;
  }

  /* Transformer le tableau en cartes sur mobile */
  .competence-table,
  .competence-table thead,
  .competence-table tbody,
  .competence-table th,
  .competence-table td,
  .competence-table tr {
    display: block;
  }

  .competence-table thead {
    display: none;
  }

  .competence-table tbody tr {
    margin-bottom: 25px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
  }

  .competence-table td {
    padding: 10px 0;
    border: none;
    position: relative;
    padding-left: 0;
  }

  .competence-table .ac-label {
    font-size: 1.05rem;
    display: block;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
  }

  .competence-table td:not(.ac-label)::before {
    content: attr(data-label);
    font-weight: 700;
    display: block;
    margin-bottom: 5px;
    color: var(--primary);
    font-size: 0.9rem;
  }

  .competence-table td:nth-child(2)::before {
    content: "🔴 Non Acquis";
    color: #ff4757;
  }

  .competence-table td:nth-child(3)::before {
    content: "🟠 En cours d'acquisition";
    color: #ffa502;
  }

  .competence-table td:nth-child(4)::before {
    content: "🟢 Acquis";
    color: #2ed573;
  }

  .competence-table td.my-level {
    border-left: none;
    border-top: 3px solid var(--primary);
    padding-top: 15px;
  }

  .competence-table td.my-level::after {
    position: static;
    display: inline;
    margin-left: 5px;
  }

  .legend-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .legend-badge {
    align-self: flex-start;
  }
}

.close-modal {
  position: absolute;
  top: 20px;
  right: 25px;
  font-size: 2rem;
  cursor: pointer;
  color: var(--text-dim);
  transition: 0.3s;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
}

.close-modal:hover {
  color: var(--primary);
  background: rgba(0, 242, 255, 0.1);
  transform: rotate(90deg);
}

.modal-content h2 {
  font-size: 2rem;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Carousel Styles */
.carousel-container {
  margin-bottom: 16px;
  border-radius: 16px;
  overflow: hidden;
}

.carousel {
  position: relative;
  width: 100%;
  height: auto;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}

.carousel-image {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  max-height: 420px;
  opacity: 1;
}

@media (max-width: 600px) {
  .carousel-image {
    max-height: 50vh;
  }
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background: rgba(0, 242, 255, 0.4);
  border: none;
  max-height: 200px;
  color: #000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  z-index: 10;
}

.carousel-btn:hover {
  background: var(--primary);
  transform: translateY(-50%) scale(1.1);
}

.carousel-prev {
  left: 12px;
}

.carousel-next {
  right: 12px;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  padding: 0 10px;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.carousel-dot.active {
  background: var(--primary);
  width: 28px;
  border-radius: 5px;
}

.carousel-dot:hover {
  background: rgba(0, 242, 255, 0.6);
}

.modal-content p {
  color: var(--text-dim);
  line-height: 1.8;
  font-size: 1.05rem;
}

.modal-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 10px 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 242, 255, 0.12);
  border: 1px solid var(--border);
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
}

.modal-points {
  margin: 10px 0 20px 0;
  padding-left: 20px;
  color: var(--text-dim);
  line-height: 1.6;
}

.modal-points li {
  margin-bottom: 6px;
}

.modal-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* Responsive */
@media (max-width: 768px) {
  /* Remove legacy hidden state; visibility is controlled via animated dropdown rules above */
  .hero-content h1 {
    font-size: 3.5rem;
  }
  .hero-description {
    font-size: 1rem;
  }
  .hero-cta {
    flex-direction: column;
  }
  .btn {
    width: 100%;
    justify-content: center;
  }
  .about-wrapper {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .skills-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .tech-items {
    grid-template-columns: repeat(2, 1fr);
  }
  .contact-methods {
    grid-template-columns: 1fr;
  }
  .footer {
    padding: 80px 5% 40px;
  }
  .section-header h2 {
    font-size: 2rem;
  }
  .modal-content {
    padding: 40px 25px;
  }
  .parcours-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  /* Loader responsive */
  .loader-logo {
    font-size: 2rem;
    gap: 3px;
  }
  .loader-subtitle {
    font-size: 1rem;
  }
  .progress-container {
    width: 250px;
  }
  .loader-percentage {
    font-size: 1.5rem;
  }
  .loader-status {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .hero-content h1 {
    font-size: 2.5rem;
  }
  .subtitle {
    font-size: 1.3rem;
  }
  .hero-description {
    font-size: 0.95rem;
  }
  .hero-badge {
    font-size: 0.75rem;
    padding: 8px 20px;
  }
  .btn {
    padding: 12px 25px;
    font-size: 0.9rem;
  }
  .projects-grid {
    gap: 15px;
  }
  .project-card {
    padding: 25px 20px;
  }
  .skills-grid {
    grid-template-columns: 1fr;
  }
  .tech-items {
    grid-template-columns: 1fr;
  }
  .section-header h2 {
    font-size: 1.5rem;
  }
  .social-links {
    gap: 15px;
  }
  .social-links a {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  .modal-content {
    padding: 30px 20px;
  }
  .modal-content h2 {
    font-size: 1.5rem;
  }

  /* Loader responsive mobile */
  .loader-logo {
    font-size: 1.5rem;
    gap: 2px;
    letter-spacing: 0.05em;
  }
  .loader-subtitle {
    font-size: 0.9rem;
  }
  .progress-container {
    width: 200px;
  }
  .loader-percentage {
    font-size: 1.3rem;
  }
  .loader-status {
    font-size: 0.7rem;
    letter-spacing: 1px;
  }
}

::-webkit-scrollbar {
  width: 9px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    rgba(0, 242, 255, 0.8),
    rgba(0, 170, 255, 0.7)
  );
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(0, 242, 255, 0.25);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    180deg,
    rgba(0, 242, 255, 1),
    rgba(0, 170, 255, 0.9)
  );
}