/* TN Estate Law 3D overlay. Separate from the theme's existing motion scripts. */
.tnel3d-stage {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms ease;
  overflow: hidden;
  contain: layout size style;
}
.tnel3d-stage.is-ready { visibility: visible; }
.tnel3d-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
/* Theme header and navigation already have their own higher z-index. */
@media (max-width: 767px) {
  .tnel3d-stage:not(.tnel3d-mobile) { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .tnel3d-stage { display: none !important; }
}

/* Hero: the consultation card makes room for the 3D pen and paper. The class is only
   set while the 3D scene is actually running, and removed again on any fallback. */
@media (prefers-reduced-motion: no-preference) {
  body.tnel3d-solo .tn-main .tn-hero__stage { visibility: hidden; }
}

/* Stage 2: reserved space under the third strip card's description.
   Height is set from JavaScript, so nothing shifts if the add-on cannot run. */
.tnel3d-slot {
  display: block;
  width: 100%;
  margin-top: 14px;
}
/* Stage 1 on narrow screens, where the theme hides the hero card. */
.tnel3d-slot--hero { margin-top: 22px; }

/* Stage 3: the navy quote box gives its grid cell to the signed document.
   Only applied while the 3D story is actually running. */
body.tnel3d-story .tn-main .tn-split2 .tn-pull {
  background: none;
  box-shadow: none;
  padding: 0;
  overflow: visible;
  min-height: var(--tnel3d-sign-h, 520px);
}
body.tnel3d-story .tn-main .tn-split2 .tn-pull::before,
body.tnel3d-story .tn-main .tn-split2 .tn-pull::after {
  display: none;
}
body.tnel3d-story .tn-main .tn-split2 .tn-pull > * {
  display: none;
}

/* Immediate hero fallback, shown before the WebGL scene is ready (see the
   inline script in tnel3d_poster()). Pure CSS/SVG plus one small WebP of the
   document's own GLB texture - nothing else to download. */
.tnel3d-poster {
  position: fixed;
  z-index: 9; /* just under .tnel3d-stage (10), so the real canvas settles on top */
  align-items: center;
  justify-content: flex-start;
  gap: 6%;
  pointer-events: none;
  opacity: 1;
  transition: opacity 220ms ease;
}
.tnel3d-poster--out { opacity: 0; }
.tnel3d-poster__paper {
  width: 66%;
  height: 94%;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  transform: rotate(-3deg);
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.35));
}
.tnel3d-poster__pen {
  width: 16%;
  height: 86%;
  align-self: flex-start;
  transform: rotate(-5deg);
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.35));
}
@media (max-width: 767px) {
  .tnel3d-poster:not(.tnel3d-mobile-poster) { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .tnel3d-poster { display: none !important; }
}
