.work-carousel {
  position: relative;
  margin-top: 0;
}

.work-viewport {
  overflow: hidden;
  padding: 6px 0 34px;
}

.work-track {
  display: flex;
  gap: 22px;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.work-track .work-card {
  flex: 0 0 calc((100% - 44px) / 3);
  min-width: 0;
}

.portfolio-control {
  position: absolute;
  top: calc(50% - 26px);
  z-index: 4;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transform: translateY(-50%);
  transition: transform 0.22s ease, filter 0.22s ease;
}

.portfolio-control--previous {
  left: -58px;
}

.portfolio-control--next {
  right: -58px;
}

.portfolio-control img {
  display: block;
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 10px 16px rgba(11, 82, 255, 0.2));
  pointer-events: none;
}

.portfolio-control:hover,
.portfolio-control:focus-visible {
  transform: translateY(-50%) scale(1.08);
  filter: brightness(1.04);
}

.portfolio-control:focus-visible {
  outline: 3px solid rgba(11, 82, 255, 0.24);
  outline-offset: 3px;
  border-radius: 50%;
}

.portfolio-control:active {
  transform: translateY(-50%) scale(0.98);
}

.portfolio-status {
  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-width: 1240px) {
  .portfolio-control--previous {
    left: -28px;
  }

  .portfolio-control--next {
    right: -28px;
  }

  .portfolio-control img {
    width: 50px;
    height: 50px;
  }
}

@media (max-width: 900px) {
  .work-viewport {
    overflow: visible;
    padding: 0;
  }

  .work-track {
    display: grid;
    grid-template-columns: 1fr 1fr;
    transform: none !important;
  }

  .work-track .work-card {
    min-width: 0;
  }

  .work-track .work-card:nth-child(n + 4),
  .portfolio-control,
  .portfolio-status {
    display: none;
  }
}

@media (max-width: 620px) {
  .work-track {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .work-track,
  .portfolio-control {
    transition: none;
  }
}
