.spatial-services {
  position: relative;
  width: 100%;
  max-width: none;
  overflow: clip;
  border-block: 1px solid var(--line);
  background: #111111;
}

.spatial-heading {
  padding-bottom: clamp(3.5rem, 7vw, 6rem);
}

.spatial-heading h2 {
  max-width: 12ch;
  font-size: clamp(3.5rem, 8vw, 8.5rem);
  font-weight: 540;
  letter-spacing: -0.075em;
  line-height: 0.84;
}

.spatial-heading p {
  max-width: 44rem;
  margin-top: 2rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.45vw, 1.3rem);
  line-height: 1.5;
}

.spatial-shell {
  display: grid;
  grid-template-columns: minmax(16rem, 0.48fr) minmax(0, 1.52fr);
  width: min(100%, var(--max-width));
  margin-inline: auto;
  padding: 0 var(--page-gutter) clamp(6rem, 12vw, 12rem);
}

.service-rail {
  position: relative;
  z-index: 2;
  align-self: stretch;
  border-block: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
  background: var(--ink-soft);
}

.service-rail button {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 6.7rem;
  align-content: center;
  gap: 0.55rem;
  padding: 1.2rem clamp(1.1rem, 2vw, 2rem);
  overflow: hidden;
  border: 0;
  border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--paper);
  text-align: left;
  cursor: pointer;
  transition: color 220ms ease, transform 350ms var(--ease-out);
}

.service-rail button:last-child {
  border-bottom: 0;
}

.service-rail button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--paper);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 480ms var(--ease-out);
}

.service-rail button:hover,
.service-rail button:focus-visible {
  transform: translateX(0.35rem);
}

.service-rail button[aria-selected="true"] {
  color: var(--ink);
}

.service-rail button[aria-selected="true"]::before {
  transform: scaleX(1);
  transform-origin: left;
}

.service-rail span {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.service-rail strong {
  font-size: clamp(1.1rem, 1.6vw, 1.45rem);
  font-weight: 520;
  letter-spacing: -0.035em;
}

.spatial-viewport {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --spot-x: 50%;
  --spot-y: 50%;
  position: relative;
  isolation: isolate;
  min-height: min(76dvh, 52rem);
  overflow: hidden;
  border-block: 1px solid var(--line-strong);
  border-right: 1px solid var(--line-strong);
  background:
    radial-gradient(circle at 66% 34%, rgba(245, 245, 242, 0.08), transparent 24%),
    linear-gradient(145deg, #191919, #0d0d0d 62%);
  perspective: 1300px;
  touch-action: pan-y;
}

.spatial-viewport:focus-visible {
  outline-offset: -3px;
}

.spatial-spotlight {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  width: 22rem;
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.22;
  background: radial-gradient(circle, rgba(245, 245, 242, 0.33), transparent 68%);
  filter: blur(20px);
  transform: translate3d(calc(var(--spot-x) - 11rem), calc(var(--spot-y) - 11rem), 0);
  transition: opacity 350ms ease;
}

.spatial-room {
  position: absolute;
  inset: 6% 4% 18%;
  z-index: 1;
  transform: rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) scale(0.96);
  transform-style: preserve-3d;
  transform-origin: center;
  transition: transform 500ms var(--ease-out);
  will-change: transform;
}

.spatial-viewport.is-pointer-active .spatial-room {
  transition-duration: 90ms;
}

.spatial-ring,
.spatial-axis {
  position: absolute;
  pointer-events: none;
  opacity: 0.18;
}

.spatial-ring {
  top: 50%;
  left: 50%;
  aspect-ratio: 1;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  transform: translate3d(-50%, -50%, -210px) rotateX(64deg);
}

.spatial-ring-one {
  width: 64%;
}

.spatial-ring-two {
  width: 92%;
  transform: translate3d(-50%, -50%, -330px) rotateX(64deg);
}

.spatial-axis {
  top: 50%;
  left: 50%;
  background: var(--line-strong);
  transform: translate3d(-50%, -50%, -260px);
}

.spatial-axis-horizontal {
  width: 112%;
  height: 1px;
}

.spatial-axis-vertical {
  width: 1px;
  height: 112%;
}

.spatial-layer {
  --focus-depth: 0px;
  --focus-scale: 0.92;
  --layer-opacity: 0.18;
  position: absolute;
  z-index: 2;
  overflow: hidden;
  border: 1px solid rgba(245, 245, 242, 0.28);
  opacity: var(--layer-opacity);
  background: #101010;
  box-shadow: 0 1.8rem 5rem rgba(0, 0, 0, 0.42);
  transform:
    translate3d(0, 0, calc(var(--layer-depth) + var(--focus-depth)))
    rotateX(var(--layer-rx, 0deg))
    rotateY(var(--layer-ry, 0deg))
    rotateZ(var(--layer-rz, 0deg))
    scale(var(--focus-scale));
  transition: transform 900ms var(--ease-out), opacity 600ms ease, filter 600ms ease;
  transform-style: preserve-3d;
}

.spatial-layer img,
.spatial-layer video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.08) brightness(0.78);
}

.spatial-layer video {
  background: #111111;
}

.spatial-layer.is-secondary {
  --focus-depth: 110px;
  --focus-scale: 0.98;
  --layer-opacity: 0.62;
}

.spatial-layer.is-primary {
  --focus-depth: 250px;
  --focus-scale: 1.04;
  --layer-opacity: 1;
  z-index: 4;
  filter: saturate(0) brightness(1.08);
}

.spatial-layer-film {
  --layer-depth: -100px;
  --layer-rx: 2deg;
  --layer-ry: -7deg;
  top: 13%;
  left: 20%;
  width: 62%;
  aspect-ratio: 16 / 10;
}

.spatial-layer-signal {
  --layer-depth: 35px;
  --layer-ry: -12deg;
  top: 5%;
  left: 59%;
  width: 35%;
  aspect-ratio: 1.44;
}

.spatial-layer-lab {
  --layer-depth: 75px;
  --layer-ry: 11deg;
  top: 48%;
  left: 4%;
  width: 38%;
  aspect-ratio: 1.3;
}

.spatial-layer-experience {
  --layer-depth: 105px;
  --layer-rx: -4deg;
  --layer-ry: -8deg;
  top: 52%;
  left: 56%;
  width: 41%;
  aspect-ratio: 16 / 9;
}

.spatial-layer-voice {
  --layer-depth: 10px;
  --layer-ry: 9deg;
  top: 6%;
  left: 4%;
  width: 24%;
  height: 66%;
}

.spatial-layer-voice img {
  object-fit: contain;
  object-position: center bottom;
  background: radial-gradient(circle at 50% 62%, #303030, #111111 66%);
}

.spatial-core {
  position: absolute;
  top: 45%;
  left: 50%;
  z-index: 3;
  display: grid;
  width: clamp(7rem, 13vw, 11rem);
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  opacity: 0.24;
  transform: translate3d(-50%, -50%, 180px);
  transition: opacity 600ms ease, transform 900ms var(--ease-out);
}

.spatial-core::before,
.spatial-core::after {
  content: "";
  position: absolute;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.spatial-core::before { inset: 18%; }
.spatial-core::after { inset: 36%; background: var(--paper); }

.spatial-core span {
  position: absolute;
  z-index: 1;
  width: 2px;
  height: 20%;
  background: var(--ink);
}

.spatial-core span:first-child { transform: translateX(-0.5rem) scaleY(0.65); }
.spatial-core span:last-child { transform: translateX(0.5rem) scaleY(0.8); }

[data-active-service="3"] .spatial-core {
  opacity: 0.95;
  transform: translate3d(-50%, -50%, 300px) scale(1.08);
}

.spatial-stage-copy {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 7;
  width: min(58%, 42rem);
  min-height: 14.5rem;
  padding: clamp(1.4rem, 2.8vw, 2.6rem);
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
  background: rgba(14, 14, 14, 0.91);
}

.spatial-instruction {
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.spatial-stage-copy h3 {
  font-size: clamp(1.9rem, 3vw, 3.5rem);
  font-weight: 520;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.spatial-stage-copy > p {
  max-width: 40rem;
  margin-top: 1rem;
  color: var(--muted-strong);
  line-height: 1.45;
}

.spatial-stage-copy strong {
  display: inline-block;
  margin-top: 1.25rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--paper);
  font-size: 0.82rem;
  font-weight: 650;
}

.spatial-instruction {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  z-index: 7;
  max-width: 24ch;
  line-height: 1.45;
}

.is-spatial-live[data-active-service="3"] .spatial-core::before {
  animation: spatial-breathe 2.6s ease-in-out infinite;
}

@keyframes spatial-breathe {
  0%, 100% { opacity: 0.35; transform: scale(0.86); }
  50% { opacity: 1; transform: scale(1.2); }
}

@media (max-width: 980px) {
  .spatial-shell {
    grid-template-columns: 1fr;
  }

  .service-rail {
    display: flex;
    overflow-x: auto;
    border-right: 1px solid var(--line-strong);
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
  }

  .service-rail::-webkit-scrollbar { display: none; }

  .service-rail button {
    flex: 0 0 min(17rem, 72vw);
    min-height: 5.75rem;
    border-bottom: 0;
    scroll-snap-align: start;
  }

  .spatial-viewport {
    min-height: min(72dvh, 46rem);
    border-top: 0;
    border-left: 1px solid var(--line-strong);
  }
}

@media (max-width: 740px) {
  .spatial-heading {
    padding: 5.5rem 1rem 3.5rem;
  }

  .spatial-heading h2 {
    font-size: clamp(3.2rem, 15vw, 5.25rem);
  }

  .spatial-shell {
    padding: 0 1rem 5.5rem;
  }

  .spatial-viewport {
    min-height: 43rem;
  }

  .spatial-room {
    inset: 3% 1% 31%;
  }

  .spatial-layer-film {
    top: 14%;
    left: 8%;
    width: 84%;
  }

  .spatial-layer-signal {
    top: 2%;
    left: 54%;
    width: 43%;
  }

  .spatial-layer-lab {
    top: 58%;
    left: 0;
    width: 48%;
  }

  .spatial-layer-experience {
    top: 62%;
    left: 50%;
    width: 49%;
  }

  .spatial-layer-voice {
    top: 2%;
    left: 0;
    width: 31%;
    height: 68%;
  }

  .spatial-stage-copy {
    width: 100%;
    min-height: 17rem;
    border-left: 0;
  }

  .spatial-stage-copy h3 {
    font-size: clamp(2rem, 9vw, 3rem);
  }

  .spatial-instruction {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .spatial-room {
    transform: scale(0.96);
    transition: none;
    will-change: auto;
  }

  .spatial-layer,
  .spatial-core,
  .service-rail button,
  .service-rail button::before {
    transition: none;
  }

  .spatial-spotlight {
    display: none;
  }

  .spatial-core::before {
    animation: none !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .spatial-stage-copy {
    background: var(--ink);
  }
}
