:root {
  color-scheme: dark;
  --stage-scale: 1;
  --system-orange: #ff7300;
  --system-red: #ff174d;
  --system-black: #05070a;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #000;
  overscroll-behavior: none;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

#viewport {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #000;
}

#stage {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3840px;
  height: 2160px;
  overflow: hidden;
  background: #000;
  isolation: isolate;
  transform: translate(-50%, -50%) scale(var(--stage-scale));
  transform-origin: center;
}

.screen-image {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 3840px;
  height: 2160px;
  pointer-events: none;
  backface-visibility: hidden;
  transform: translateZ(0);
}

#screen-image-incoming {
  z-index: 2;
  opacity: 0;
}

#motion-elements {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
  transform: translateZ(0);
}

.motion-element {
  position: absolute;
  display: block;
  pointer-events: none;
  transform-origin: center;
  backface-visibility: hidden;
  will-change: transform, opacity;
}

.motion-home-hand {
  animation: hand-attention 1550ms cubic-bezier(.4, 0, .2, 1) infinite;
}

.motion-home-cta,
.motion-back {
  animation: action-attention 1800ms cubic-bezier(.4, 0, .2, 1) infinite;
}

.motion-pin-available {
  animation: pin-breathe 1850ms cubic-bezier(.4, 0, .2, 1) infinite;
  animation-delay: var(--motion-delay, 0ms);
}

.motion-pin-active {
  animation: none;
  opacity: 1;
  transform: none;
  will-change: auto;
}

@keyframes hand-attention {
  0%,
  100% {
    opacity: .78;
    transform: translate3d(0, 8px, 0) scale(.96);
  }

  46% {
    opacity: 1;
    transform: translate3d(0, -5px, 0) scale(1.045);
  }

  62% {
    opacity: .96;
    transform: translate3d(0, 0, 0) scale(1.015);
  }
}

@keyframes action-attention {
  0%,
  100% {
    opacity: .82;
    transform: scale(.985);
  }

  48% {
    opacity: 1;
    transform: scale(1.035);
  }

  64% {
    opacity: .96;
    transform: scale(1.012);
  }
}

@keyframes pin-breathe {
  0%,
  100% {
    opacity: .72;
    transform: scale(.91);
  }

  44% {
    opacity: 1;
    transform: scale(1.09);
  }

  62% {
    opacity: .94;
    transform: scale(1.025);
  }
}

#hotspots {
  position: absolute;
  inset: 0;
  z-index: 5;
}

.hotspot {
  position: absolute;
  display: block;
  min-width: 88px;
  min-height: 88px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  outline: 0;
  background: transparent;
  color: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.hotspot:focus-visible {
  outline: 6px solid var(--system-orange);
  outline-offset: 4px;
}

body.debug-hotspots .hotspot {
  border: 4px solid #00ff91;
  background: rgb(0 255 145 / 18%);
  color: #fff;
  font-size: 26px;
  font-weight: 700;
}

#transition-system {
  position: absolute;
  inset: 0;
  z-index: 8;
  overflow: hidden;
  pointer-events: none;
  visibility: hidden;
}

#transition-system.active,
#transition-system.cold-start {
  visibility: visible;
}

.shutter-panel {
  position: absolute;
  top: 0;
  width: calc(50% + 4px);
  height: 100%;
  overflow: hidden;
  background:
    linear-gradient(
      90deg,
      rgb(255 115 0 / 0%) 0,
      rgb(255 115 0 / 5%) 72%,
      rgb(255 115 0 / 12%) 100%
    ),
    repeating-linear-gradient(
      0deg,
      transparent 0 118px,
      rgb(255 255 255 / 3%) 118px 120px
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0 178px,
      rgb(255 115 0 / 4%) 178px 180px
    ),
    linear-gradient(135deg, #040609 0%, #0b1017 48%, #05070a 100%);
  opacity: 1;
  will-change: transform;
}

#shutter-left {
  left: 0;
  transform: translate3d(-101%, 0, 0);
}

#shutter-right {
  right: 0;
  background:
    linear-gradient(
      -90deg,
      rgb(255 23 77 / 0%) 0,
      rgb(255 23 77 / 4%) 72%,
      rgb(255 23 77 / 10%) 100%
    ),
    repeating-linear-gradient(
      0deg,
      transparent 0 118px,
      rgb(255 255 255 / 3%) 118px 120px
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0 178px,
      rgb(255 23 77 / 4%) 178px 180px
    ),
    linear-gradient(225deg, #040609 0%, #0b1017 48%, #05070a 100%);
  transform: translate3d(101%, 0, 0);
}

.door-edge {
  position: absolute;
  top: 0;
  width: 10px;
  height: 100%;
  background:
    repeating-linear-gradient(
      0deg,
      rgb(255 255 255 / 92%) 0 18px,
      var(--system-orange) 18px 54px,
      rgb(255 115 0 / 32%) 54px 72px
    );
  box-shadow:
    0 0 18px rgb(255 115 0 / 42%),
    0 0 54px rgb(255 115 0 / 20%);
}

#shutter-left .door-edge {
  right: 0;
}

#shutter-right .door-edge {
  left: 0;
  background:
    repeating-linear-gradient(
      0deg,
      rgb(255 255 255 / 92%) 0 18px,
      var(--system-red) 18px 54px,
      rgb(255 23 77 / 30%) 54px 72px
    );
  box-shadow:
    0 0 18px rgb(255 23 77 / 38%),
    0 0 54px rgb(255 23 77 / 18%);
}

.door-circuit {
  position: absolute;
  display: block;
  width: 620px;
  height: 220px;
  border: 3px solid rgb(255 115 0 / 20%);
  opacity: .7;
}

.door-circuit::before,
.door-circuit::after {
  position: absolute;
  display: block;
  content: "";
  background: rgb(255 115 0 / 26%);
}

.door-circuit::before {
  top: 50%;
  left: 100%;
  width: 240px;
  height: 3px;
}

.door-circuit::after {
  top: calc(50% - 10px);
  left: calc(100% + 232px);
  width: 20px;
  height: 20px;
  border: 3px solid rgb(255 115 0 / 48%);
  background: #070a0f;
  transform: rotate(45deg);
}

.door-circuit-a {
  top: 330px;
  right: 330px;
  border-right: 0;
}

.door-circuit-b {
  right: 680px;
  bottom: 350px;
  width: 420px;
  height: 160px;
  border-right: 0;
}

#shutter-right .door-circuit {
  right: auto;
  left: 330px;
  border-color: rgb(255 23 77 / 18%);
  border-right: 3px solid rgb(255 23 77 / 18%);
  border-left: 0;
  transform: scaleX(-1);
}

#shutter-right .door-circuit-b {
  right: auto;
  left: 680px;
}

#seam-flash {
  position: absolute;
  top: 0;
  left: calc(50% - 5px);
  width: 10px;
  height: 100%;
  background: linear-gradient(
    180deg,
    var(--system-orange),
    #fff 48%,
    var(--system-red)
  );
  box-shadow:
    0 0 24px rgb(255 255 255 / 48%),
    0 0 72px rgb(255 115 0 / 30%);
  opacity: 0;
  transform: scaleY(.06);
  will-change: transform, opacity;
}

#system-signal {
  position: absolute;
  top: calc(50% - 38px);
  left: calc(50% - 84px);
  display: flex;
  width: 168px;
  height: 76px;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border-top: 2px solid rgb(255 115 0 / 28%);
  border-bottom: 2px solid rgb(255 23 77 / 28%);
  background: #070a0f;
  opacity: 0;
  will-change: opacity, transform;
}

#system-signal span {
  display: block;
  width: 20px;
  height: 20px;
  background: var(--system-orange);
  opacity: .22;
  transform: scale(.72);
}

#system-signal span:nth-child(2) {
  background: var(--system-red);
}

#loading {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  background: #000;
  opacity: 0;
  transition: opacity 180ms linear;
}

#loading.visible {
  opacity: 1;
}

.loading-mark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 92px;
  height: 92px;
  border: 6px solid rgb(255 115 0 / 22%);
  border-top-color: var(--system-orange);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: loading-spin 800ms linear infinite;
}

.loading-label {
  position: absolute;
  top: calc(50% + 88px);
  left: 50%;
  color: var(--system-orange);
  font: 700 22px/1 Arial, Helvetica, sans-serif;
  letter-spacing: .18em;
  transform: translateX(-50%);
}

@keyframes loading-spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

  #transition-system {
    display: none !important;
  }

  .motion-element {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

body.motion-disabled #transition-system {
  display: none;
}

body.motion-disabled .motion-element {
  animation: none !important;
  opacity: 1;
  transform: none;
}
