:root {
  --primary: #6c7cff;
  --secondary: #8a5cff;
  --dark-bg: #050814;
  --card-bg: rgba(255, 255, 255, 0.08);
  --card-border: rgba(255, 255, 255, 0.15);
}

* { 
  box-sizing: border-box; 
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: white;
  overflow-x: hidden;
  cursor: none !important;
  background: var(--dark-bg);
  line-height: 1.6;
}

/* Fallback pour les appareils tactiles */
@media (hover: none) and (pointer: coarse) {
  body { cursor: auto !important; }
}

/* Loader */
#loader {
  position: fixed;
  inset: 0;
  background: var(--dark-bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loader-text { 
  font-family: 'Courier New', monospace; 
  color: var(--primary); 
  font-size: 1.8rem; 
  letter-spacing: 2px; 
  margin-bottom: 20px;
}

.loader-bar { 
  width: 300px; 
  height: 8px; 
  background: rgba(255, 255, 255, 0.1); 
  border-radius: 4px; 
  overflow: hidden;
}

.loader-progress { 
  width: 0%; 
  height: 100%; 
  background: linear-gradient(90deg, var(--primary), var(--secondary)); 
  transition: width 0.3s ease;
}

/* Vidéo & overlay */
.bg-video { 
  position: fixed; 
  inset: 0; 
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
  z-index: -3;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.bg-video.loaded {
  opacity: 1;
}

.video-overlay { 
  position: fixed; 
  inset: 0; 
  backdrop-filter: blur(4px); 
  background: rgba(5, 8, 20, 0.35); 
  z-index: -2;
}

/* Audio control */
.audio-control { 
  position: fixed; 
  top: 20px; 
  right: 20px; 
  background: rgba(0, 0, 0, 0.4); 
  padding: 10px; 
  border-radius: 12px; 
  backdrop-filter: blur(10px);
  z-index: 100;
}

.audio-control button { 
  display: flex; 
  align-items: center; 
  gap: 6px; 
  background: transparent; 
  border: none; 
  cursor: pointer; 
  color: white; 
  font-size: 0.9rem;
  transition: opacity 0.3s ease;
}

.audio-control button:hover {
  opacity: 0.7;
}

.audio-control button:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Share control */
.share-control {
  position: fixed;
  top: 70px;
  right: 20px;
  background: rgba(0, 0, 0, 0.4);
  padding: 10px;
  border-radius: 12px;
  backdrop-filter: blur(10px);
  z-index: 100;
}

.share-control button {
  background: transparent;
  border: none;
  cursor: pointer;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  transition: all 0.3s ease;
}

.share-control button:hover {
  transform: scale(1.1);
}

.share-control button:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Header */
header { 
  text-align: center; 
  padding: 90px 20px 40px;
  position: relative;
}

.avatar { 
  width: 120px; 
  height: 120px; 
  border-radius: 50%; 
  border: 3px solid rgba(108, 124, 255, 0.3); 
  margin-bottom: 15px; 
  object-fit: cover;
  box-shadow: 0 0 30px rgba(108, 124, 255, 0.3);
  transition: all 0.3s ease;
}

.avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 0 40px rgba(108, 124, 255, 0.5);
}

header h1 { 
  font-size: 3rem; 
  background: linear-gradient(90deg, var(--primary), var(--secondary)); 
  background-clip: text; 
  -webkit-background-clip: text; 
  color: transparent;
  margin-bottom: 10px;
  font-weight: 700;
}

.subtitle { 
  color: #cbd5f5; 
  max-width: 700px; 
  margin: 10px auto 25px; 
  white-space: pre-line;
  font-size: 1.1rem;
}

.discord-btn { 
  display: inline-block; 
  padding: 12px 26px; 
  border-radius: 999px; 
  background: linear-gradient(90deg, var(--primary), var(--secondary)); 
  color: white; 
  text-decoration: none; 
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(108, 124, 255, 0.3);
}

.discord-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(108, 124, 255, 0.5);
}

.discord-btn:focus {
  outline: 2px solid white;
  outline-offset: 3px;
}

/* Sections & cards */
main { 
  scroll-behavior: smooth;
  padding-bottom: 60px;
}

section {
  margin-bottom: 80px;
}

.section-title { 
  font-size: 2rem; 
  margin-bottom: 30px; 
  text-align: center; 
  background: linear-gradient(90deg, var(--primary), var(--secondary)); 
  background-clip: text; 
  -webkit-background-clip: text; 
  color: transparent;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.live-badge {
  font-size: 0.8rem;
  color: #ff5555;
  background: rgba(255, 85, 85, 0.1);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 85, 85, 0.3);
  font-weight: 600;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.container { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
  gap: 50px; 
  padding: 0 40px 40px; 
  justify-items: center;
}

.card { 
  background: var(--card-bg); 
  border-radius: 22px; 
  padding: 30px; 
  backdrop-filter: blur(12px); 
  border: 1px solid var(--card-border); 
  box-shadow: 0 0 40px rgba(108, 124, 255, 0.2); 
  white-space: pre-line; 
  min-height: 150px; 
  max-width: 600px; 
  transition: all 0.3s ease;
  width: 100%;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 50px rgba(108, 124, 255, 0.3);
}

/* ========================================
   SECTION STATISTIQUES DISCORD
   ======================================== */

.section-stats {
  margin-bottom: 100px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  padding: 0 40px 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.stat-card {
  background: rgba(40, 40, 60, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 30px 20px;
  text-align: center;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: 0 10px 40px rgba(108, 124, 255, 0.3);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-label {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #c084fc, #e879f9);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  line-height: 1;
}

/* Carte Profil Discord */
.discord-profile-card {
  background: rgba(40, 40, 60, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 30px;
  max-width: 900px;
  margin: 40px auto 0;
  backdrop-filter: blur(15px);
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--primary);
  box-shadow: 0 0 20px rgba(108, 124, 255, 0.4);
  object-fit: cover;
}

.profile-info {
  flex: 1;
  min-width: 200px;
}

.profile-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  margin-bottom: 5px;
}

.profile-tag {
  color: rgba(255, 255, 255, 0.5);
  font-weight: 400;
}

.profile-bio {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
  line-height: 1.4;
}

.add-friend-btn {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border: none;
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.add-friend-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(108, 124, 255, 0.5);
}

.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.9);
  transition: all 0.3s ease;
  cursor: default;
}

.badge:hover {
  background: rgba(108, 124, 255, 0.2);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.badge svg {
  width: 20px;
  height: 20px;
}

/* Projects Grid */
.projects-grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
  gap: 25px; 
  padding: 0 40px 40px; 
  justify-items: center;
}

.project-card { 
  background: rgba(0, 0, 0, 0.35); 
  border-radius: 16px; 
  padding: 25px; 
  backdrop-filter: blur(10px); 
  border: 1px solid rgba(255, 255, 255, 0.1); 
  box-shadow: 0 0 20px rgba(108, 124, 255, 0.2); 
  color: white; 
  text-align: center; 
  cursor: pointer; 
  transition: all 0.3s ease;
  width: 100%;
  max-width: 400px;
}

.project-card:hover { 
  transform: translateY(-8px); 
  box-shadow: 0 0 50px rgba(108, 124, 255, 0.5); 
  filter: brightness(1.1);
  border-color: var(--primary);
}

.project-card:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.project-card h3 { 
  margin-bottom: 15px; 
  font-size: 1.3rem; 
  color: var(--primary);
  font-weight: 600;
}

.project-card p { 
  font-size: 0.95rem; 
  line-height: 1.5; 
  min-height: 60px;
  margin-bottom: 15px;
  opacity: 0.9;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 15px;
}

.tag {
  background: rgba(108, 124, 255, 0.2);
  border: 1px solid rgba(108, 124, 255, 0.4);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  color: #cbd5f5;
}

/* Skills Grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  padding: 0 40px 40px;
  justify-items: center;
}

.skill-card {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 16px;
  padding: 25px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 20px rgba(108, 124, 255, 0.2);
  text-align: center;
  transition: all 0.3s ease;
  width: 100%;
  max-width: 400px;
}

.skill-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0 35px rgba(108, 124, 255, 0.4);
  border-color: var(--primary);
}

.skill-icon {
  font-size: 2.5rem;
  margin-bottom: 15px;
}

.skill-card h3 {
  color: var(--primary);
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.skill-card p {
  font-size: 0.95rem;
  opacity: 0.9;
  line-height: 1.5;
}

/* Contact */
.contact-info {
  white-space: normal;
}

.contact-item {
  margin-bottom: 15px;
  font-size: 1rem;
}

.contact-item:last-child {
  margin-bottom: 0;
}

.contact-item a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.3s ease;
  margin-left: 8px;
}

.contact-item a:hover {
  color: var(--secondary);
  text-decoration: underline;
}

.contact-item a:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Footer */
footer { 
  text-align: center; 
  font-size: 0.9rem; 
  opacity: 0.7; 
  padding: 40px 20px;
  white-space: pre-line;
}

.visitor-counter { 
  position: fixed; 
  bottom: 20px; 
  right: 20px; 
  background: rgba(0, 0, 0, 0.4); 
  padding: 8px 14px; 
  border-radius: 12px; 
  font-size: 0.9rem; 
  color: white; 
  backdrop-filter: blur(8px); 
  z-index: 50;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
}

.modal-content {
  background: linear-gradient(135deg, rgba(20, 20, 40, 0.95), rgba(40, 20, 60, 0.95));
  margin: 10% auto;
  padding: 30px;
  border: 1px solid var(--card-border);
  border-radius: 20px;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 10px 50px rgba(108, 124, 255, 0.3);
  backdrop-filter: blur(20px);
}

.modal-close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease;
}

.modal-close:hover,
.modal-close:focus {
  color: var(--primary);
}

#modalTitle {
  color: var(--primary);
  margin-bottom: 15px;
  font-size: 1.8rem;
}

#modalDescription {
  margin-bottom: 20px;
  line-height: 1.6;
  opacity: 0.9;
}

#modalLinks a {
  display: inline-block;
  margin: 5px 10px 5px 0;
  padding: 10px 20px;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
}

#modalLinks a:hover {
  background: var(--secondary);
  transform: translateY(-2px);
}

/* ========================================
   CURSEUR PERSONNALISÉ
   ======================================== */

#custom-cursor {
  position: fixed;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease;
  mix-blend-mode: screen;
}

#custom-cursor::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
  box-shadow: 
    0 0 10px rgba(255, 255, 255, 0.8),
    0 0 20px rgba(108, 124, 255, 0.6),
    0 0 30px rgba(108, 124, 255, 0.4);
}

#custom-cursor::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 2px solid rgba(108, 124, 255, 0.5);
  border-radius: 50%;
  box-shadow: 
    0 0 20px rgba(108, 124, 255, 0.6),
    0 0 40px rgba(108, 124, 255, 0.3),
    inset 0 0 20px rgba(108, 124, 255, 0.2);
  transition: all 0.2s ease;
}

body.cursor-hover #custom-cursor {
  width: 30px;
  height: 30px;
}

body.cursor-hover #custom-cursor::before {
  width: 12px;
  height: 12px;
  background: #6c7cff;
  box-shadow: 
    0 0 15px rgba(108, 124, 255, 1),
    0 0 30px rgba(108, 124, 255, 0.8),
    0 0 45px rgba(108, 124, 255, 0.6);
}

body.cursor-hover #custom-cursor::after {
  width: 60px;
  height: 60px;
  border-color: rgba(108, 124, 255, 0.8);
  box-shadow: 
    0 0 30px rgba(108, 124, 255, 0.8),
    0 0 60px rgba(108, 124, 255, 0.5);
}

.cursor-trail {
  position: fixed;
  width: 6px;
  height: 6px;
  background: rgba(108, 124, 255, 0.4);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  animation: trailFade 0.5s ease-out forwards;
}

@keyframes trailFade {
  to {
    opacity: 0;
    transform: scale(0.5);
  }
}

.cursor-particle {
  position: fixed;
  width: 4px;
  height: 4px;
  background: rgba(108, 124, 255, 0.8);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  animation: particleFloat 1s ease-out forwards;
  box-shadow: 0 0 10px rgba(108, 124, 255, 0.6);
}

@keyframes particleFloat {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--tx), var(--ty)) scale(0);
  }
}

/* Animations */
.reveal { 
  opacity: 0; 
  transform: translateY(60px) scale(0.92); 
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(.2, .8, .2, 1), filter 0.9s; 
  filter: blur(6px);
}

.reveal.active { 
  opacity: 1; 
  transform: translateY(0) scale(1); 
  filter: blur(0);
}

.delay-1 { transition-delay: 0.2s; }
.delay-2 { transition-delay: 0.4s; }
.delay-3 { transition-delay: 0.6s; }
.delay-4 { transition-delay: 0.8s; }
.delay-5 { transition-delay: 1s; }

.parallax { 
  transform: translateY(0); 
  transition: transform 0.9s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    cursor: auto !important;
  }
  
  #custom-cursor {
    display: none;
  }
  
  header {
    padding: 60px 20px 30px;
  }
  
  header h1 {
    font-size: 2rem;
  }
  
  .subtitle {
    font-size: 0.95rem;
    padding: 0 10px;
  }
  
  .avatar {
    width: 90px;
    height: 90px;
  }
  
  .section-title {
    font-size: 1.6rem;
    flex-direction: column;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 20px 40px;
    gap: 15px;
  }
  
  .stat-value {
    font-size: 2rem;
  }
  
  .discord-profile-card {
    padding: 20px;
    margin: 30px 20px 0;
  }
  
  .profile-header {
    flex-direction: column;
    text-align: center;
  }
  
  .profile-avatar {
    width: 70px;
    height: 70px;
  }
  
  .profile-badges {
    justify-content: center;
  }
  
  .projects-grid,
  .skills-grid,
  .container {
    padding: 0 20px 40px;
    gap: 20px;
  }
  
  .project-card,
  .skill-card,
  .card {
    padding: 20px;
  }
  
  .audio-control,
  .share-control {
    top: 10px;
    right: 10px;
    padding: 8px;
  }
  
  .share-control {
    top: 60px;
  }
  
  .visitor-counter {
    bottom: 10px;
    right: 10px;
    font-size: 0.8rem;
    padding: 6px 10px;
  }
  
  .loader-text {
    font-size: 1.2rem;
  }
  
  .loader-bar {
    width: 250px;
  }
  
  .modal-content {
    margin: 20% auto;
    padding: 20px;
    width: 95%;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.6rem;
  }
  
  .subtitle {
    font-size: 0.85rem;
  }
  
  .discord-btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }
  
  .section-title {
    font-size: 1.4rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .stat-card {
    padding: 20px 15px;
  }
  
  .project-card h3,
  .skill-card h3 {
    font-size: 1.1rem;
  }
  
  .project-card p,
  .skill-card p {
    font-size: 0.85rem;
  }
}

/* Amélioration de l'accessibilité */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus visible pour clavier */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

/* Print styles */
@media print {
  .audio-control,
  .share-control,
  .visitor-counter,
  #loader,
  #custom-cursor,
  .bg-video,
  .video-overlay {
    display: none !important;
  }
  
  body {
    background: white;
    color: black;
  }
}