/* Isometric 3D hero (three.js).
   .has-3d is set on <html> by an inline script when WebGL may work: the SVG is hidden and the
   3D block (with a loader) takes its place. Without it, or after a failure, the SVG stays. */
.hero__image img { aspect-ratio: 4 / 3; object-fit: contain; }
.hero3d { display: none; position: relative; width: 100%; aspect-ratio: 4 / 3; }
.has-3d .hero3d { display: block; }
.has-3d .hero__image > img { display: none; }

.hero3d canvas {
  position: absolute; inset: 0; display: block; width: 100%; height: 100%;
  opacity: 0; transition: opacity .8s ease;
}
.hero3d.is-ready canvas { opacity: 1; }

.hero3d__loader {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; text-align: center; color: var(--blue-dark);
  opacity: 0; transition: opacity .4s ease; pointer-events: none;
}
.hero3d.is-loading .hero3d__loader { opacity: 1; }
.hero3d__title { font-size: 20px; font-weight: 800; }
.hero3d__step { font-size: 15px; color: var(--muted); min-height: 1.4em; }

/* three bricks being laid one after another */
.hero3d__bricks { position: relative; width: 84px; height: 44px; }
.hero3d__bricks i {
  position: absolute; width: 38px; height: 18px; border-radius: 3px; background: #b4553a;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.15); opacity: 0;
  animation: hero3d-brick 2.4s ease-in-out infinite;
}
.hero3d__bricks i:nth-child(1) { left: 2px; bottom: 0; }
.hero3d__bricks i:nth-child(2) { left: 44px; bottom: 0; animation-delay: .3s; }
.hero3d__bricks i:nth-child(3) { left: 23px; bottom: 22px; animation-delay: .6s; background: var(--accent); }
@keyframes hero3d-brick {
  0% { opacity: 0; transform: translateY(-18px); }
  15%, 75% { opacity: 1; transform: translateY(0); }
  90%, 100% { opacity: 0; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .hero3d__bricks i { animation: none; opacity: 1; }
  .hero3d canvas, .hero3d__loader { transition: none; }
}
