#poczatek[data-atrx-room] [data-hero-art] {
  max-width: none;
  pointer-events: none;
}

#poczatek[data-atrx-room] :is([data-hero-visual], [data-hero-motion]) {
  /* The original hero script assigns inline artwork dimensions on resize. */
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  inset: auto;
  margin: 0;
  transform: none;
  mask-image: none;
}

#poczatek[data-atrx-room] [data-hero-image] {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: calc(var(--room-focus-x) * 100%) center;
}

#poczatek[data-atrx-room] [data-hero-motion] {
  --room-focus-x: .66;
  --room-image-width: max(100cqw, calc(100cqh * 4 / 3));
  container-type: size;
  overflow: clip;
}

#poczatek[data-atrx-room] .room-status-lights {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: calc(var(--room-focus-x) * 100%);
  width: var(--room-image-width);
  height: calc(var(--room-image-width) * 3 / 4);
  transform: translate(calc(var(--room-focus-x) * -100%), -50%);
  pointer-events: none;
}

#poczatek[data-atrx-room] [data-room-light] {
  position: absolute;
  left: calc(var(--light-x) * 100% / 1448);
  top: calc(var(--light-y) * 100% / 1086);
  width: clamp(2.5px, .5cqw, 4.5px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 3px 1px currentColor, 0 0 8px currentColor;
  opacity: .06;
  animation: atrx-room-flash var(--light-cycle) linear var(--light-delay) infinite;
}

#poczatek[data-atrx-room] [data-room-light="blue"] { color: #6aaaff; }
#poczatek[data-atrx-room] [data-room-light="green"] { color: #c4ff91; }

#poczatek[data-atrx-room] [data-room-blink="double"] { animation-name: atrx-room-double-flash; }
#poczatek[data-atrx-room] [data-room-blink="hold"] { animation-name: atrx-room-hold; }

@keyframes atrx-room-flash {
  0%, 18%, 36%, 100% { opacity: .06; }
  22%, 30% { opacity: 1; }
}

@keyframes atrx-room-double-flash {
  0%, 14%, 32%, 46%, 64%, 100% { opacity: .06; }
  18%, 25%, 50%, 57% { opacity: 1; }
}

@keyframes atrx-room-hold {
  0%, 35%, 74%, 100% { opacity: .06; }
  40%, 64% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  #poczatek[data-atrx-room] .room-status-lights { display: none; }
}

@media (width < 901px) {
  #poczatek[data-atrx-room] {
    --room-view-height: clamp(245px, 71vw, 420px);
    container-type: inline-size;
  }

  #poczatek[data-atrx-room] .hero-stage {
    padding-bottom: calc(var(--room-view-height) + 32px);
  }

  #poczatek[data-atrx-room] [data-hero-art] {
    position: absolute;
    inset: 0 auto 0 50%;
    width: 100cqw;
    height: auto;
    margin: 0;
    transform: translateX(-50%);
  }

  #poczatek[data-atrx-room] [data-hero-motion] {
    --room-focus-x: .83;
  }

  #poczatek[data-atrx-room] [data-hero-motion]::before {
    content: "";
    position: absolute;
    z-index: 1;
    inset: 0;
    background: linear-gradient(
      rgb(40 45 56 / 94%),
      rgb(40 45 56 / 79%) calc(100% - var(--room-view-height)),
      rgb(40 45 56 / 26%) calc(100% - var(--room-view-height) * .55),
      rgb(40 45 56 / 8%)
    );
    pointer-events: none;
  }
}

@media (min-width: 901px) {
  #poczatek[data-atrx-room] [data-hero-art] {
    position: absolute;
    inset: 0 calc((100% - 100vw) / 2) 0 auto;
    width: min(63vw, 1180px);
    height: auto;
    margin: 0;
    transform: none;
  }

  #poczatek[data-atrx-room] .hero-copy {
    grid-column: 1;
  }

  #poczatek[data-atrx-room] [data-hero-motion] {
    mask-image:
      linear-gradient(90deg, transparent 0%, rgb(0 0 0 / 8%) 8%, #000 49%),
      linear-gradient(180deg, transparent var(--header-height, 84px), #000 25%, #000 82%, transparent 100%);
    mask-composite: intersect;
  }

  #poczatek[data-atrx-room] [data-hero-motion]::after {
    /* Track the wall seam at x=201 in the 1448px-wide photo through object-fit: cover. */
    content: "";
    position: absolute;
    z-index: 1;
    inset-block: 0;
    left: calc(var(--room-focus-x) * 100cqw - (var(--room-focus-x) - 201 / 1448) * var(--room-image-width));
    width: 100px;
    transform: translateX(-50%);
    -webkit-backdrop-filter: blur(9px);
    backdrop-filter: blur(9px);
    mask-image: linear-gradient(90deg, transparent, #000 35%, #000 65%, transparent);
    pointer-events: none;
  }
}
