:root {
  color-scheme: dark;
  --split: 45.8%;
  --bronze: 183 133 72;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  font-family: system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.factory {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background: #050606;
}

.visual-stage {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 0;
  width: min(100vw, 177.6833vh);
  height: min(100vh, 56.2799vw);
  width: min(100vw, 177.6833svh);
  height: min(100svh, 56.2799vw);
  aspect-ratio: 1672 / 941;
  overflow: hidden;
  isolation: isolate;
  transform: translate(-50%, -50%);
}

.scene-frame {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.scene-frame picture {
  position: absolute;
  inset: 0;
  display: block;
}

.scene {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: 50% 50%;
  user-select: none;
  pointer-events: none;
}

.scene--base {
  filter: brightness(1.01) contrast(1.02) saturate(1.01);
}

.scene--reaction {
  opacity: 0;
  mix-blend-mode: screen;
  filter: brightness(1.22) contrast(1.04) saturate(1.13);
  transition: opacity 360ms ease, filter 360ms ease;
  will-change: opacity;
}

.scene--upper {
  clip-path: inset(0 0 calc(100% - var(--split)) 0);
}

.scene--lower {
  clip-path: inset(var(--split) 0 0 0);
}

.factory[data-active="upper"] .scene--upper,
.factory[data-active="lower"] .scene--lower {
  opacity: .19;
}

.factory[data-active="upper"] .scene--lower,
.factory[data-active="lower"] .scene--upper {
  opacity: .012;
}

.vignette,
.atmosphere {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.atmosphere {
  z-index: 3;
  width: 100%;
  height: 100%;
  opacity: 1;
  mix-blend-mode: screen;
}

.vignette {
  z-index: 4;
  background:
    linear-gradient(180deg, rgb(0 0 0 / .17), transparent 18%, transparent 80%, rgb(0 0 0 / .18)),
    radial-gradient(ellipse at center, transparent 58%, rgb(0 0 0 / .35) 120%);
}

.access {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 10;
  display: block;
  cursor: pointer;
  outline: 0;
  touch-action: manipulation;
}

.access--upper {
  top: 0;
  height: var(--split);
}

.access--lower {
  top: var(--split);
  bottom: 0;
}

.access::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 340ms ease;
  pointer-events: none;
}

.access--upper::before {
  background: linear-gradient(180deg, rgb(255 188 99 / .025), rgb(255 177 68 / .14));
}

.access--lower::before {
  background: radial-gradient(ellipse at 50% 38%, rgb(255 183 83 / .15), transparent 59%);
}

.access:focus-visible::before {
  opacity: 1;
}

.access:focus-visible {
  box-shadow: inset 0 0 0 3px rgb(var(--bronze) / .9);
}

.sign-halo {
  position: absolute;
  display: block;
  opacity: 0;
  pointer-events: none;
  border-radius: 10%;
  background: radial-gradient(ellipse, rgb(255 194 105 / .23), rgb(179 118 52 / .055) 48%, transparent 73%);
  filter: blur(2px);
  transform: scale(.96);
  transition: opacity 260ms ease, transform 460ms cubic-bezier(.16, .72, .2, 1);
}

.access--upper .sign-halo {
  left: 33%;
  top: 49%;
  width: 34%;
  height: 43%;
}

.access--lower .sign-halo {
  left: 35%;
  top: 15%;
  width: 30%;
  height: 74%;
}

.access:focus-visible .sign-halo {
  opacity: 1;
  transform: scale(1.05);
}

.access:active .sign-halo {
  opacity: 1;
  transform: scale(.985);
  transition-duration: 80ms;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-aspect-ratio: 4/5) {
  :root {
    --split: 39.5%;
  }

  .visual-stage {
    width: min(100vw, 56.2799vh);
    height: min(100vh, 177.6833vw);
    width: min(100vw, 56.2799svh);
    height: min(100svh, 177.6833vw);
    aspect-ratio: 941 / 1672;
  }

  .access--upper .sign-halo {
    left: 16%;
    top: 62%;
    width: 68%;
    height: 32%;
  }

  .access--lower .sign-halo {
    left: 27%;
    top: 22%;
    width: 46%;
    height: 25%;
  }

  .vignette {
    background:
      linear-gradient(180deg, rgb(0 0 0 / .13), transparent 12%, transparent 89%, rgb(0 0 0 / .2)),
      radial-gradient(ellipse at center, transparent 66%, rgb(0 0 0 / .28) 125%);
  }
}

@media (hover: hover) and (pointer: fine) {
  .access:hover::before {
    opacity: 1;
  }

  .access:hover .sign-halo {
    opacity: 1;
    transform: scale(1.05);
  }
}

@media (hover: none), (pointer: coarse) {
  .access::before,
  .sign-halo {
    transition-duration: 120ms;
  }

  .access:active::before,
  .access:active .sign-halo {
    opacity: 1;
  }
}

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

  .atmosphere {
    display: none;
  }
}
