/**
 * HIDOM - Site 3D immersif
 * Animations Three.js + CSS 3D transforms
 */

/* ============================================
   CANVAS 3D FIXED BACKGROUND
   ============================================ */

#scene-3d {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* ============================================
   SECTIONS AVEC PERSPECTIVE 3D
   ============================================ */

section {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1000px;
  transform-style: preserve-3d;
}

/* ============================================
   HERO 3D
   ============================================ */

.hero-3d {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 var(--space-6);
}

.hero-3d__content {
  transform-style: preserve-3d;
  animation: float-3d 6s ease-in-out infinite;
}

.hero-3d__title {
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: var(--font-weight-bold);
  color: var(--color-white);
  margin-bottom: var(--space-6);
  text-shadow:
    0 0 20px rgba(var(--color-primary-rgb), 0.6),
    0 0 40px rgba(var(--color-primary-rgb), 0.3),
    0 10px 30px rgba(0, 0, 0, 0.5);
  transform: translateZ(100px);
}

.hero-3d__subtitle {
  font-size: clamp(1.125rem, 2.5vw, 1.75rem);
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--space-10);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  transform: translateZ(80px);
}

.hero-3d__cta {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
  transform: translateZ(60px);
}

/* Indicateur scroll */
.scroll-indicator {
  position: absolute;
  bottom: var(--space-10);
  left: 50%;
  transform: translateX(-50%) translateZ(40px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  color: rgba(255, 255, 255, 0.7);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: bounce-3d 2s ease-in-out infinite;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 0.5px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  padding: var(--space-3) var(--space-4);
}

.scroll-indicator__line {
  width: 2px;
  height: 24px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(247, 168, 40, 0.8));
  animation: scroll-line 2s ease-in-out infinite;
  border-radius: 1px;
}

/* ============================================
   BOUTONS 3D
   ============================================ */

.btn-3d-primary,
.btn-3d-secondary {
  padding: var(--space-5) var(--space-10);
  border-radius: var(--radius-full);
  font-weight: var(--font-weight-semibold);
  font-size: var(--text-lg);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
}

.btn-3d-primary {
  background: linear-gradient(135deg, rgba(247, 168, 40, 0.8) 0%, rgba(251, 189, 64, 0.85) 100%);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  color: var(--color-white);
  border: 0.5px solid rgba(255, 255, 255, 0.3);
  box-shadow:
    0 8px 32px rgba(247, 168, 40, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15);
}

.btn-3d-primary:hover {
  transform: translateY(-3px) translateZ(20px) scale(1.03);
  background: linear-gradient(135deg, rgba(247, 168, 40, 0.95) 0%, rgba(251, 189, 64, 1) 100%);
  box-shadow:
    0 12px 40px rgba(247, 168, 40, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  opacity: 1;
}

.btn-3d-secondary {
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  color: var(--color-white);
  border: 0.5px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-3d-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-3px) translateZ(20px) scale(1.03);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  opacity: 1;
}

/* ============================================
   SECTIONS 3D
   ============================================ */

.pillars-3d,
.process-3d,
.realisations-3d,
.testimonials-3d,
.cta-3d {
  background: rgba(10, 10, 10, 0.5);
  backdrop-filter: blur(60px) saturate(200%);
  -webkit-backdrop-filter: blur(60px) saturate(200%);
  padding-left: 80px;
}

.section-header-3d {
  text-align: center;
  margin-bottom: var(--space-8);
  transform-style: preserve-3d;
}

.section-header-3d h2 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: var(--font-weight-bold);
  color: var(--color-white);
  margin-bottom: var(--space-4);
  text-shadow: 0 0 30px rgba(var(--color-primary-rgb), 0.4);
  transform: translateZ(50px);
}

.section-header-3d p {
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  color: rgba(255, 255, 255, 0.8);
  transform: translateZ(30px);
}

/* ============================================
   4 PILIERS 3D
   ============================================ */

.pillars-3d__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-8);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.pillar-3d-card {
  perspective: 1000px;
  transform-style: preserve-3d;
}

.pillar-3d-card__inner {
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0.03) 100%);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  padding: var(--space-10);
  text-align: center;
  transform-style: preserve-3d;
  transition: all var(--transition-slow);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.05);
}

.pillar-3d-card:hover .pillar-3d-card__inner {
  transform: translateZ(20px) rotateX(3deg) rotateY(3deg);
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.12) 0%,
    rgba(255, 255, 255, 0.05) 100%);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.2),
    0 0 0 0.5px rgba(247, 168, 40, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
}

.pillar-3d-card__icon {
  font-size: 4rem;
  margin-bottom: var(--space-6);
  filter: drop-shadow(0 0 20px rgba(var(--color-primary-rgb), 0.6));
  animation: float-icon 3s ease-in-out infinite;
}

.pillar-3d-card h3 {
  font-size: var(--text-2xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-white);
  margin-bottom: var(--space-4);
}

.pillar-3d-card p {
  font-size: var(--text-base);
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.8);
}

/* ============================================
   PROCESS 3D (TIMELINE)
   ============================================ */

.process-3d__timeline {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 var(--container-padding);
  position: relative;
}

.process-3d__timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom,
    rgba(247, 168, 40, 0.4),
    rgba(255, 255, 255, 0.06));
  transform: translateX(-50%);
  border-radius: 1px;
  box-shadow: 0 0 8px rgba(247, 168, 40, 0.1);
}

.process-3d__step {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  position: relative;
  transform-style: preserve-3d;
}

.process-3d__step:last-child {
  margin-bottom: 0;
}

.process-3d__step:nth-child(even) {
  flex-direction: row-reverse;
}

.process-3d__number {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(247, 168, 40, 0.8) 0%, rgba(251, 189, 64, 0.85) 100%);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  color: var(--color-white);
  font-size: var(--text-3xl);
  font-weight: var(--font-weight-bold);
  border-radius: 50%;
  border: 0.5px solid rgba(255, 255, 255, 0.3);
  box-shadow:
    0 8px 24px rgba(247, 168, 40, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15);
  transform-style: preserve-3d;
  transition: all var(--transition-base);
}

.process-3d__step:hover .process-3d__number {
  transform: translateZ(20px) scale(1.08);
  box-shadow:
    0 12px 32px rgba(247, 168, 40, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.process-3d__content {
  flex: 1;
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.06) 0%,
    rgba(255, 255, 255, 0.02) 100%);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 0.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: var(--space-5) var(--space-6);
  transform-style: preserve-3d;
  transition: all var(--transition-base);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.process-3d__step:hover .process-3d__content {
  transform: translateZ(10px);
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.09) 0%,
    rgba(255, 255, 255, 0.04) 100%);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}

.process-3d__content h3 {
  font-size: var(--text-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-white);
  margin-bottom: var(--space-2);
}

.process-3d__content p {
  font-size: var(--text-sm);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 0;
}

/* ============================================
   VIDÉOS 3D
   ============================================ */

.videos-3d__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-8);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.video-3d-card {
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.07) 0%,
    rgba(255, 255, 255, 0.03) 100%);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 0.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  padding: var(--space-6);
  transform-style: preserve-3d;
  transition: all var(--transition-slow);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.video-3d-card:hover {
  transform: translateZ(15px) rotateX(-1deg);
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.05) 100%);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
}

.video-3d-card__wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 20px;
  margin-bottom: var(--space-6);
  border: 0.5px solid rgba(255, 255, 255, 0.06);
}

.video-3d-card__wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 20px;
}

.video-3d-card h3 {
  font-size: var(--text-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-white);
  margin-bottom: var(--space-3);
}

.video-3d-card p {
  font-size: var(--text-sm);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.7);
}

/* ============================================
   TÉMOIGNAGES 3D
   ============================================ */

.testimonials-3d__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-8);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.testimonial-3d-card {
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0.03) 100%);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  padding: var(--space-10);
  transform-style: preserve-3d;
  transition: all var(--transition-slow);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.testimonial-3d-card:hover {
  transform: translateZ(12px) scale(1.01);
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.12) 0%,
    rgba(255, 255, 255, 0.05) 100%);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.testimonial-3d-card__quote {
  font-size: var(--text-lg);
  line-height: 1.7;
  color: var(--color-white);
  margin-bottom: var(--space-6);
  font-style: italic;
}

.testimonial-3d-card__author {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.testimonial-3d-card__author strong {
  color: var(--color-white);
  font-weight: var(--font-weight-semibold);
}

.testimonial-3d-card__author span {
  color: rgba(255, 255, 255, 0.7);
  font-size: var(--text-sm);
}

/* ============================================
   CTA 3D
   ============================================ */

.cta-3d__content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(247, 168, 40, 0.04) 50%,
    rgba(255, 255, 255, 0.03) 100%);
  backdrop-filter: blur(60px) saturate(200%);
  -webkit-backdrop-filter: blur(60px) saturate(200%);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 32px;
  padding: var(--space-16);
  transform-style: preserve-3d;
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.05);
}

.cta-3d__content h2 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: var(--font-weight-bold);
  color: var(--color-white);
  margin-bottom: var(--space-6);
  text-shadow: 0 0 30px rgba(var(--color-primary-rgb), 0.5);
}

.cta-3d__content p {
  font-size: var(--text-xl);
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--space-10);
}

.cta-3d__buttons {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================
   ANIMATIONS 3D
   ============================================ */

@keyframes float-3d {
  0%, 100% {
    transform: translateY(0) translateZ(0);
  }
  50% {
    transform: translateY(-20px) translateZ(20px);
  }
}

@keyframes glow-3d {
  0%, 100% {
    text-shadow:
      0 0 20px rgba(var(--color-primary-rgb), 0.6),
      0 0 40px rgba(var(--color-primary-rgb), 0.3),
      0 10px 30px rgba(0, 0, 0, 0.5);
  }
  50% {
    text-shadow:
      0 0 30px rgba(var(--color-primary-rgb), 0.8),
      0 0 60px rgba(var(--color-primary-rgb), 0.5),
      0 10px 30px rgba(0, 0, 0, 0.5);
  }
}

@keyframes bounce-3d {
  0%, 100% {
    transform: translateX(-50%) translateY(0) translateZ(40px);
  }
  50% {
    transform: translateX(-50%) translateY(-10px) translateZ(40px);
  }
}

@keyframes scroll-line {
  0% {
    height: 0;
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    height: 40px;
    opacity: 0;
  }
}

@keyframes float-icon {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(5deg);
  }
}

/* ============================================
   RESPONSIVE 3D
   ============================================ */

@media (max-width: 768px) {
  .process-3d__timeline::before {
    left: 20px;
  }

  .process-3d__step {
    flex-direction: column !important;
    align-items: flex-start;
    padding-left: var(--space-16);
  }

  .process-3d__number {
    position: absolute;
    left: 0;
  }

  .pillars-3d__grid,
  .videos-3d__grid,
  .testimonials-3d__grid {
    grid-template-columns: 1fr;
  }

  .hero-3d {
    padding: 0 var(--space-4);
  }

  .hero-3d__title {
    font-size: clamp(1.6rem, 5.5vw, 2.5rem);
    margin-bottom: var(--space-4);
  }

  .hero-3d__subtitle {
    font-size: clamp(0.875rem, 2vw, 1.125rem);
    margin-bottom: var(--space-6);
  }

  .hero-3d__cta,
  .cta-3d__buttons {
    flex-direction: column;
    width: 100%;
  }

  .btn-3d-primary,
  .btn-3d-secondary {
    width: auto;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base);
  }
}

/* ============================================
   EFFECTS DE PROFONDEUR
   ============================================ */

[data-3d] {
  transform-style: preserve-3d;
  transition: all var(--transition-slow);
}

[data-3d].in-view {
  animation: appear-3d 1s ease-out forwards;
}

@keyframes appear-3d {
  from {
    opacity: 0;
    transform: translateZ(-200px) translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateZ(0) translateY(0);
  }
}
