.hero,
.contact-shell {
  isolation: isolate;
}

body .hero:has(> .hero-3d) {
  min-height: min(680px, calc(100svh - 68px));
  display: flex;
  align-items: center;
}

.hero-3d {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.hero-3d[data-ready="true"] {
  opacity: 1;
}

.hero-3d[data-failed="true"] {
  display: none;
}

.hero-3d canvas {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: auto;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  filter: saturate(1.08) contrast(1.04);
}

.hero-3d canvas[data-dragging="true"] {
  cursor: grabbing;
}

[data-hero-dragging="true"] {
  cursor: grabbing;
  user-select: none;
  -webkit-user-select: none;
}

.contact-shell .hero-3d {
  bottom: auto;
  height: min(900px, 100svh);
}

.hero-3d::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(7, 23, 43, 0.96) 0%,
    rgba(7, 23, 43, 0.84) 34%,
    rgba(7, 23, 43, 0.34) 58%,
    rgba(7, 23, 43, 0.04) 100%
  );
}

.contact-shell .hero-3d::after {
  background: linear-gradient(
    90deg,
    rgba(7, 11, 29, 0.56) 0%,
    rgba(7, 11, 29, 0.78) 43%,
    rgba(7, 11, 29, 0.68) 70%,
    rgba(7, 11, 29, 0.48) 100%
  );
}

.hero > .container,
.contact-layout {
  position: relative;
  z-index: 1;
}

@media (min-width: 901px) {
  .hero:has(> .hero-3d) > .container:not(.hero-grid) > h1,
  .hero:has(> .hero-3d) > .container:not(.hero-grid) > p,
  .hero:has(> .hero-3d) > .container:not(.hero-grid) > .hero-actions,
  .hero:has(> .hero-3d) > .container:not(.hero-grid) > .hero-note,
  .hero:has(> .hero-3d) > .container:not(.hero-grid) > .hero-copy {
    max-width: 650px;
  }
}

@media (max-width: 900px) {
  body .hero:has(> .hero-3d) {
    min-height: min(680px, calc(100svh - 56px));
  }

  .hero-3d::after {
    background:
      linear-gradient(180deg, rgba(7, 23, 43, 0.2) 0%, rgba(7, 23, 43, 0.72) 35%, rgba(7, 23, 43, 0.88) 100%),
      linear-gradient(90deg, rgba(7, 23, 43, 0.7) 0%, rgba(7, 23, 43, 0.34) 100%);
  }
}

@media (max-width: 760px) {
  .hero-3d[data-ready="true"] {
    opacity: 0.92;
  }

  .contact-shell .hero-3d {
    height: 720px;
  }

  .contact-shell .hero-3d::after {
    background:
      linear-gradient(180deg, rgba(7, 11, 29, 0.22) 0%, rgba(7, 11, 29, 0.76) 32%, rgba(7, 11, 29, 0.94) 100%),
      linear-gradient(90deg, rgba(7, 11, 29, 0.7), rgba(7, 11, 29, 0.4));
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-3d {
    transition: none;
  }
}
