/* Variables CSS */
:root {
  /* Couleurs mode clair */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-card: rgba(255, 255, 255, 0.9);
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --accent-purple: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-orange: #f59e0b;
  --accent-pink: #ec4899;
  --border-color: rgba(148, 163, 184, 0.2);
  --shadow-color: rgba(0, 0, 0, 0.1);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
  --gradient-secondary: linear-gradient(135deg, var(--accent-emerald), var(--accent-orange));
  --gradient-bg: radial-gradient(ellipse at top, #f8fafc 0%, #e2e8f0 100%);
}

/* Mode sombre */
[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: rgba(15, 23, 42, 0.9);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --border-color: rgba(148, 163, 184, 0.1);
  --shadow-color: rgba(0, 0, 0, 0.5);
  --gradient-bg: radial-gradient(ellipse at top, #0f172a 0%, #1e293b 100%);
}

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

body {
  font-family: "Inter", sans-serif;
  background: var(--gradient-bg);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: all 0.3s ease;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Effets de fond complètement repensés */
.bg-effects {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

.grid-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(circle at 25% 25%, rgba(139, 92, 246, 0.1) 2px, transparent 2px),
    radial-gradient(circle at 75% 75%, rgba(6, 182, 212, 0.1) 2px, transparent 2px);
  background-size: 100px 100px, 150px 150px;
  animation: gridFloat 20s ease-in-out infinite;
}

@keyframes gridFloat {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  33% {
    transform: translate(30px, -20px) rotate(1deg);
  }
  66% {
    transform: translate(-20px, 30px) rotate(-1deg);
  }
}

/* Formes géométriques flottantes */
.floating-particles {
  position: absolute;
  width: 100%;
  height: 100%;
}

.floating-particles::before,
.floating-particles::after {
  content: "";
  position: absolute;
  background: linear-gradient(45deg, var(--accent-purple), var(--accent-cyan));
  animation: geometricFloat 8s ease-in-out infinite;
}

.floating-particles::before {
  width: 80px;
  height: 80px;
  top: 15%;
  left: 10%;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  animation-delay: 0s;
}

.floating-particles::after {
  width: 60px;
  height: 60px;
  top: 70%;
  right: 15%;
  clip-path: polygon(25% 0%, 100% 0%, 75% 100%, 0% 100%);
  animation-delay: 4s;
}

@keyframes geometricFloat {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
    opacity: 0.3;
  }
  50% {
    transform: translateY(-30px) rotate(180deg);
    opacity: 0.7;
  }
}

/* Blobs organiques améliorés */
.morphing-blobs {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.morphing-blobs::before,
.morphing-blobs::after {
  content: "";
  position: absolute;
  width: 400px;
  height: 400px;
  filter: blur(80px);
  opacity: 0.4;
  animation: organicMorph 20s ease-in-out infinite;
}

.morphing-blobs::before {
  background: radial-gradient(ellipse, var(--accent-purple), var(--accent-pink));
  top: -10%;
  left: -10%;
  animation-delay: 0s;
}

.morphing-blobs::after {
  background: radial-gradient(ellipse, var(--accent-emerald), var(--accent-cyan));
  bottom: -10%;
  right: -10%;
  animation-delay: 10s;
}

@keyframes organicMorph {
  0%,
  100% {
    transform: scale(1) rotate(0deg);
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  }
  20% {
    transform: scale(1.1) rotate(72deg);
    border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
  }
  40% {
    transform: scale(0.9) rotate(144deg);
    border-radius: 70% 30% 40% 60% / 40% 70% 60% 30%;
  }
  60% {
    transform: scale(1.2) rotate(216deg);
    border-radius: 40% 70% 60% 30% / 70% 40% 50% 60%;
  }
  80% {
    transform: scale(0.8) rotate(288deg);
    border-radius: 60% 40% 30% 70% / 30% 60% 40% 70%;
  }
}

/* Vagues liquides */
.wave-animation {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 300px;
  background: linear-gradient(
    180deg,
    rgba(139, 92, 246, 0.1) 0%,
    rgba(6, 182, 212, 0.2) 50%,
    rgba(16, 185, 129, 0.1) 100%
  );
  clip-path: polygon(0 60%, 15% 65%, 35% 55%, 50% 70%, 65% 50%, 85% 65%, 100% 55%, 100% 100%, 0% 100%);
  animation: liquidWave 12s ease-in-out infinite;
}

@keyframes liquidWave {
  0%,
  100% {
    clip-path: polygon(0 60%, 15% 65%, 35% 55%, 50% 70%, 65% 50%, 85% 65%, 100% 55%, 100% 100%, 0% 100%);
  }
  50% {
    clip-path: polygon(0 50%, 15% 55%, 35% 70%, 50% 45%, 65% 65%, 85% 50%, 100% 60%, 100% 100%, 0% 100%);
  }
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(30px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: all 0.3s ease;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  position: relative;
  width: 45px;
  height: 45px;
  background: var(--gradient-primary);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: logoMorph 8s ease-in-out infinite;
}

@keyframes logoMorph {
  0%,
  100% {
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    transform: rotate(0deg);
  }
  25% {
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
    transform: rotate(90deg);
  }
  50% {
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    transform: rotate(180deg);
  }
  75% {
    clip-path: polygon(20% 0%, 80% 0%, 100% 20%, 100% 80%, 80% 100%, 20% 100%, 0% 80%, 0% 20%);
    transform: rotate(270deg);
  }
}

.logo-core {
  width: 20px;
  height: 20px;
  background: var(--bg-primary);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  position: relative;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.theme-toggle {
  position: relative;
  width: 60px;
  height: 30px;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
}

.toggle-icon {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  background: var(--gradient-primary);
  border-radius: 50%;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

[data-theme="dark"] .toggle-icon {
  transform: translateX(28px);
}

.sun-icon,
.moon-icon {
  position: absolute;
  transition: all 0.3s ease;
}

.moon-icon {
  opacity: 0;
}

[data-theme="dark"] .sun-icon {
  opacity: 0;
}

[data-theme="dark"] .moon-icon {
  opacity: 1;
}

/* Main Content */
.main {
  margin-top: 80px;
  padding: 2rem 0;
}

/* Hero Section */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  min-height: 80vh;
  padding: 4rem 0;
}

.hero-content {
  animation: slideInLeft 1s ease-out;
  text-align: left;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.title-line {
  display: block;
  color: var(--text-secondary);
}

.title-highlight {
  display: block;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
}

.title-highlight::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--gradient-primary);
  border-radius: 2px;
  animation: expandWidth 2s ease-out 0.5s both;
}

@keyframes expandWidth {
  0% {
    width: 0;
  }
  100% {
    width: 100%;
  }
}

.hero-description {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 500px;
  text-align: left;
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  animation: slideInRight 1s ease-out;
}

.orbital-system {
  position: relative;
  width: 400px;
  height: 400px;
}

.orbit {
  position: absolute;
  border: 2px solid rgba(139, 92, 246, 0.2);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.orbit-1 {
  width: 200px;
  height: 200px;
  clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
  animation: rotate 20s linear infinite;
}

.orbit-2 {
  width: 280px;
  height: 280px;
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  animation: rotate 30s linear infinite reverse;
}

.orbit-3 {
  width: 360px;
  height: 360px;
  clip-path: polygon(25% 0%, 75% 0%, 100% 25%, 100% 75%, 75% 100%, 25% 100%, 0% 75%, 0% 25%);
  animation: rotate 40s linear infinite;
}

.planet {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
}

.planet-1 {
  width: 16px;
  height: 16px;
  background: var(--accent-cyan);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  box-shadow: 0 0 20px var(--accent-cyan);
}

.planet-2 {
  width: 12px;
  height: 12px;
  background: var(--accent-emerald);
  clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
  box-shadow: 0 0 15px var(--accent-emerald);
}

.planet-3 {
  width: 10px;
  height: 10px;
  background: var(--accent-orange);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent-orange);
}

.central-core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  background: var(--gradient-primary);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  box-shadow: 0 0 40px rgba(139, 92, 246, 0.5);
  animation: corePulse 3s ease-in-out infinite;
}

@keyframes corePulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.1);
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
  }
}

@keyframes rotate {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes slideInLeft {
  0% {
    transform: translateX(-100px);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideInRight {
  0% {
    transform: translateX(100px);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Navigation Cards - COMPLÈTEMENT REPENSÉES */
.nav-section {
  padding: 4rem 0;
}

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

.nav-card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(30px);
  border: 1px solid var(--border-color);
  padding: 3rem 2.5rem;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transform-style: preserve-3d;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);

  /* Formes organiques avec clip-path */
  clip-path: polygon(0% 15%, 15% 0%, 85% 0%, 100% 15%, 100% 85%, 85% 100%, 15% 100%, 0% 85%);
}

.nav-card::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: conic-gradient(
    from 0deg,
    var(--accent-purple),
    var(--accent-cyan),
    var(--accent-emerald),
    var(--accent-orange),
    var(--accent-pink),
    var(--accent-purple)
  );
  opacity: 0;
  transition: all 0.5s ease;
  z-index: -1;
  animation: borderRotate 8s linear infinite;
  clip-path: polygon(0% 15%, 15% 0%, 85% 0%, 100% 15%, 100% 85%, 85% 100%, 15% 100%, 0% 85%);
}

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

.nav-card:hover {
  transform: translateY(-20px) scale(1.02);
  box-shadow: 0 30px 60px rgba(139, 92, 246, 0.4);

  /* Forme plus arrondie au hover */
  clip-path: polygon(0% 20%, 20% 0%, 80% 0%, 100% 20%, 100% 80%, 80% 100%, 20% 100%, 0% 80%);
}

@keyframes borderRotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.card-icon {
  width: 80px;
  height: 80px;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 2rem auto;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;

  /* Forme géométrique pour l'icône */
  clip-path: polygon(25% 0%, 75% 0%, 100% 25%, 100% 75%, 75% 100%, 25% 100%, 0% 75%, 0% 25%);
}

.card-icon::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: iconShine 4s linear infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nav-card:hover .card-icon::before {
  opacity: 1;
}

.nav-card:hover .card-icon {
  transform: scale(1.2) rotate(15deg);
  box-shadow: 0 15px 40px rgba(139, 92, 246, 0.5);
  clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
}

@keyframes iconShine {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.card-title {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
  text-align: center;
}

.card-description {
  color: var(--text-secondary);
  line-height: 1.6;
  text-align: center;
  font-size: 1rem;
}

.card-arrow {
  position: absolute;
  top: 2rem;
  right: 2rem;
  width: 24px;
  height: 24px;
  opacity: 0;
  transition: all 0.3s ease;
  color: var(--accent-purple);
  font-size: 1.5rem;
}

.nav-card:hover .card-arrow {
  opacity: 1;
  transform: translate(5px, -5px) rotate(45deg);
}

/* Footer */
.footer {
  text-align: center;
  padding: 3rem 0;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
  margin-top: 4rem;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }

  .hero-content {
    text-align: center;
  }

  .hero-description {
    text-align: center;
    margin: 0 auto;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .orbital-system {
    width: 300px;
    height: 300px;
  }

  .orbit-1 {
    width: 150px;
    height: 150px;
  }
  .orbit-2 {
    width: 210px;
    height: 210px;
  }
  .orbit-3 {
    width: 270px;
    height: 270px;
  }

  .cards-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .header .container {
    padding: 1rem;
  }

  .nav-card {
    padding: 2rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }

  .orbital-system {
    width: 250px;
    height: 250px;
  }

  .nav-card {
    padding: 1.5rem;
  }

  .card-icon {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }
}
