.publications {
  margin-top: 100px;
  max-width: 1024px;
  margin: 0 auto;
  padding: 5rem 0 2rem;
}

.publications-container {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
}

.publications-box {
  width: 225px;
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: flex-start;
  background-color: var(--highlight2-color);
  color: var(--text-color-inverse);
  margin-top: 10px;
  margin-left: 4px;
  margin-right: 4px;
  margin-bottom: 220px;
  position: relative;
}

@keyframes picAnimation {
  to {
    transform: position(fixed) width(270px) top(-5px) left(50%) translateX(-50%);
  }
}

@keyframes deAnimation {
  to {
    transform: position(absolute) width(225px) top(0px) left(0px) translateX(0px);
  }
}

.publications-image_X {
  position: absolute;
  width: 225px;
  top: 0px;
  left: 0px;
}

#publication1 {
  position: absolute;
  width: 225px;
  top: 0px;
  left: 0px;
  transition: width 200ms ease, top 200ms ease;
}

.hover1 #publication1 {
  position: fixed;
  width: 770px;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  transition: top 200ms ease, width 200ms ease;
  animation: picAnimation 1s forwards 0.3s;
}

#publication2 {
  position: absolute;
  width: 225px;
  top: 0px;
  left: 0px;
  transition: width 200ms ease, top 200ms ease;
}

.hover2 #publication2 {
  position: fixed;
  width: 770px;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  transition: top 200ms ease, width 200ms ease;
  animation: picAnimation 1s forwards 0.3s;
}

#publication3 {
  position: absolute;
  width: 225px;
  top: 0px;
  left: 0px;
  transition: width 200ms ease, top 200ms ease;
  animation: deAnimation 1s forwards 0.3s;

}

.hover3 #publication3 {
  position: fixed;
  width: 770px;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  transition: top 200ms ease, width 200ms ease;
  animation: picAnimation 1s forwards 0.3s;
}

#publication4 {
  position: absolute;
  width: 225px;
  top: 0px;
  left: 0px;
  transition: width 200ms ease, top 200ms ease;
}

.hover4 #publication4 {
  position: fixed;
  width: 770px;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  transition: top 200ms ease, width 200ms ease;
  animation: picAnimation 1s forwards 0.3s;
}

.publications-item {
  font-size: 1rem;
  font-weight: bold;
  line-height: 2rem;
  color: var(--text-color);
  margin-left: 0.5rem;
  position: relative;
  top: 240px;
}

@media (max-width: 950px) {

  .publications-container {
    justify-content: space-evenly;
  }

}

@media (max-width: 980px) {

  .publications-container {
    justify-content: space-evenly;
  }

}