/* ============================================================
   VERIDIS ENERGIE — Section 3D Viewer
   Style : showroom designer (cinema produit)
   ============================================================ */

.three-d-section {
  background: var(--cream);
  padding-block: clamp(var(--space-8), 10vw, var(--space-9));
  position: relative;
  overflow: hidden;
}

.three-d-section::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -100px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(181, 115, 74, 0.12), transparent 60%);
  filter: blur(60px);
  pointer-events: none;
}

.three-d-head {
  text-align: center;
  margin-bottom: var(--space-7);
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  z-index: 1;
}

.three-d-head .eyebrow {
  margin-bottom: var(--space-3);
}

.three-d-head h2 {
  font-family: var(--font-display);
  font-size: var(--fs-3xl);
  font-weight: var(--fw-semi);
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: var(--space-3);
}

.three-d-head p {
  color: var(--ink-muted);
  font-size: var(--fs-md);
  line-height: var(--lh-relaxed);
}

.three-d-stage {
  position: relative;
  width: 100%;
  max-width: 1000px;
  margin-inline: auto;
  aspect-ratio: 16 / 10;
  max-height: 600px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.6), transparent 60%),
    linear-gradient(135deg, #ebe6db 0%, #d6cdb6 100%);
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}

@media (max-width: 720px) {
  .three-d-stage { aspect-ratio: 4 / 5; }
}

.three-d-stage canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  cursor: grab;
}
.three-d-stage canvas:active { cursor: grabbing; }

/* Overlay tags discrets en coin */
.three-d-corner {
  position: absolute;
  z-index: 2;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: var(--fw-semi);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
  pointer-events: none;
}
.three-d-corner--tl { top: var(--space-4); left: var(--space-4); }
.three-d-corner--tr { top: var(--space-4); right: var(--space-4); }
.three-d-corner--bl { bottom: var(--space-4); left: var(--space-4); }
.three-d-corner--br {
  bottom: var(--space-4); right: var(--space-4);
  display: inline-flex; align-items: center; gap: 8px;
}
.three-d-corner--br::before {
  content: '';
  width: 16px;
  height: 1px;
  background: var(--copper);
}

/* Cue interactif */
.three-d-cue {
  position: absolute;
  z-index: 2;
  bottom: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: var(--r-full);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: var(--fw-medium);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  transition: opacity var(--duration-base);
}
.three-d-cue.is-fading { opacity: 0; }
.three-d-cue svg {
  width: 12px;
  height: 12px;
}

/* === Toggle (ITE : poly graphité / laine de roche) === */
.three-d-toggle {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: var(--space-5);
  flex-wrap: wrap;
}
.three-d-toggle button {
  padding: 12px 24px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-weight: var(--fw-semi);
  font-size: var(--fs-sm);
  letter-spacing: 0.04em;
  border-radius: 2px;
  cursor: pointer;
  transition: all var(--duration-base);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.three-d-toggle button:hover {
  border-color: var(--copper);
  color: var(--copper);
}
.three-d-toggle button.is-active {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}
.three-d-toggle-dot {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* === Légende des couches === */
.three-d-legend {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-5);
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}
@media (max-width: 720px) {
  .three-d-legend { grid-template-columns: 1fr 1fr; }
}
.three-d-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  color: var(--ink-soft);
  font-weight: var(--fw-medium);
}
.three-d-legend-dot {
  width: 16px;
  height: 16px;
  border-radius: 2px;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Loading state */
.three-d-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: inherit;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: var(--fw-medium);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  z-index: 1;
}
.three-d-loading::after {
  content: '...';
  animation: dotPulse 1.4s infinite;
}
@keyframes dotPulse {
  0% { content: '.'; }
  33% { content: '..'; }
  66% { content: '...'; }
}
