/* Lift Mechanism showcase (DUM-E) — real interactive glTF/GLB CAD viewer
   with a static-image fallback and a small supplementary build-photo strip */

.cad-showcase__intro {
  margin: 0 0 var(--space-lg);
  max-width: 42rem;
  font-size: 1rem;
  color: var(--color-text-muted);
}

.cad-showcase__stage {
  position: relative;
}

/* 3D viewer — hidden until JS enhances successfully (progressive enhancement) */
.cad-showcase__viewer {
  display: none;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 26rem;
  max-height: 46rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: radial-gradient(ellipse 80% 60% at 50% 20%, var(--color-accent-soft), var(--color-bg-muted) 70%);
  border: 1px solid var(--color-border-subtle);
  box-shadow: 0 0 0 1px var(--color-accent-glow), var(--shadow-md);
  transition: box-shadow 0.3s ease;
}

.cad-showcase--enhanced .cad-showcase__viewer {
  display: block;
}

.cad-showcase--enhanced .cad-showcase__fallback {
  display: none;
}

.cad-showcase__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}

.cad-showcase__canvas:active {
  cursor: grabbing;
}

.cad-showcase__hint {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  margin: 0;
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  pointer-events: none;
  opacity: 0.85;
  z-index: 2;
}

.cad-showcase__loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-bg-muted);
  z-index: 1;
}

.cad-showcase__loading[hidden] {
  display: none;
}

.cad-showcase__spinner {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 3px solid var(--color-border-subtle);
  border-top-color: var(--color-accent);
  animation: cad-showcase-spin 0.85s linear infinite;
}

@keyframes cad-showcase-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cad-showcase__spinner {
    animation: none;
  }
}

/* Static fallback — shown by default (no-JS / progressive enhancement base
   state) and whenever WebGL is unsupported, reduced motion is requested, or
   the GLB fails to load */
.cad-showcase__fallback {
  display: block;
  padding: var(--space-lg);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.cad-showcase__fallback img {
  display: block;
  width: 100%;
  max-width: 32rem;
  margin: 0 auto var(--space-md);
  border-radius: var(--radius-md);
  background: var(--color-bg-muted);
}

.cad-showcase__fallback p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

/* Static CAD render — replaces the live viewer; same large rectangular
   framing as .cad-showcase__viewer, but just a plain blurred-hole image,
   no canvas/JS. See the HTML comment in _includes/cad-showcase.html for why
   the live viewer is disabled. */
.cad-showcase__static {
  margin: 0;
  width: 100%;
  min-height: 26rem;
  max-height: 46rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: radial-gradient(ellipse 80% 60% at 50% 20%, var(--color-accent-soft), var(--color-bg-muted) 70%);
  border: 1px solid var(--color-border-subtle);
  box-shadow: 0 0 0 1px var(--color-accent-glow), var(--shadow-md);
}

.cad-showcase__static img {
  display: block;
  width: 100%;
  max-width: 32rem;
  margin: 0 auto;
  border-radius: var(--radius-md);
  background: var(--color-bg-muted);
}

.cad-showcase__static figcaption {
  margin-top: var(--space-md);
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  text-align: center;
}

/* Supplementary build-progress photo strip — secondary to the 3D viewer */
.cad-showcase__photos {
  margin-top: var(--space-xl);
}

.cad-showcase__photos-label {
  margin: 0 0 var(--space-md);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-faint);
}

.cad-showcase__photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  gap: var(--space-md);
}

.cad-showcase__photo {
  margin: 0;
  padding: var(--space-sm);
  background: var(--color-bg);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.cad-showcase__photo img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--color-bg-muted);
}

.cad-showcase__photo figcaption {
  margin-top: var(--space-sm);
  font-size: 0.75rem;
  color: var(--color-text-faint);
}

@media (hover: hover) and (pointer: fine) {
  .cad-showcase__photo:hover {
    border-color: var(--color-accent);
    box-shadow: 0 10px 26px var(--color-accent-glow);
    transform: translateY(-3px);
  }

  .cad-showcase__viewer:hover {
    box-shadow: 0 0 0 1px var(--color-accent), var(--shadow-md);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cad-showcase__photo {
    transition: none;
  }
}
