.portfolio__thumb {
  position: relative;
  width: 100%;
  margin-top: 20px;
  border-radius: 8px;
  overflow: hidden;
}

.portfolio__img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  transition: opacity 0.2s ease;
}

.portfolio__video-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #b4bad3 0%, #f3f5fb 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.portfolio__video-wrapper {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 324px;
  border-radius: 16px;
  overflow: hidden;
  left: 8px;
  right: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.portfolio__hover-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (hover: hover) {
  .portfolio__thumb.has-video:hover .portfolio__video-bg {
    opacity: 1;
  }
  .portfolio__thumb.has-video:hover .portfolio__video-wrapper {
    opacity: 1;
    pointer-events: auto;
  }
  .portfolio__thumb.has-video:hover .portfolio__img {
    opacity: 0;
  }
}

.portfolio__item img {
  width: 100%;
}

.portfolio__head {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.portfolio__title-button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.portfolio__list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 40px;
}

.portfolio__item {
  background: #fafafa;
  border: 1px solid #cfcfcf;
  padding: 40px;
  border-radius: 16px;
  box-sizing: border-box;
}

.portfolio__item a {
  text-decoration: none;
}

.portfolio__title {
  color: #0d1118;
}

.portfolio__thumb img {
  width: 100%;
  border-radius: 8px;
  height: 100%;
  object-fit: cover;
  display: block;
}

.portfolio__excerpt {
  font-weight: 400;
  font-size: 16px;
  line-height: 150%;
  letter-spacing: 0;
  color: #4f4f4f;
}

.portfolio__info {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.mobile-only {
  display: none;
}

.portfolio-pagination-wrapper {
  margin-top: 24px;
  position: relative;
  display: flex;
  justify-content: center;
  display: none;
}

.portfolio-pagination {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  position: relative !important;
  top: unset !important;
  left: unset !important;
  bottom: unset !important;
  right: unset !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 100 !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  max-width: 72px;
  justify-content: flex-start;
}

.portfolio-pagination::-webkit-scrollbar {
  display: none;
}

.portfolio-pagination {
  scrollbar-width: none;
}

.portfolio-pagination .swiper-pagination-bullet {
  min-width: 8px !important;
  min-height: 8px !important;
  max-width: 8px !important;
  max-height: 8px !important;
  opacity: 1 !important;
  background: #cfcfcf !important;
  margin: 0 4px !important;
  outline: none !important;
  flex-shrink: 0;
}

.portfolio-pagination .swiper-pagination-bullet:first-child {
  margin-left: auto !important;
}

.portfolio-pagination .swiper-pagination-bullet:last-child {
  margin-right: auto !important;
}

.portfolio-pagination .swiper-pagination-bullet-active {
  background: #1629d6 !important;
  opacity: 1 !important;
}

@media screen and (max-width: 767px) {
  .desktop-only {
    display: none;
  }
  .mobile-only {
    display: flex;
    margin-top: 40px;
  }

  .portfolio__info {
    align-items: unset;
  }

  .mobile-only a {
    text-decoration: unset;
  }

  .portfolio__item img {
    margin-top: 24px;
  }

  .portfolio__info img {
    border-radius: 8px;
    height: 100%;
  }

  .portfolio__item {
    padding: 32px 16px;
  }

  .portfolio-pagination-wrapper {
    display: flex;
  }
}

@media screen and (max-width: 920px) {
  .portfolio__list {
    grid-template-columns: repeat(1, 1fr);
  }
}

@media screen and (min-width: 769px) {
  #primary section.portfolio {
    padding-top: 60px;
    padding-bottom: 60px;
  }
}

@media screen and (max-width: 768px) {
  #primary section.portfolio {
    padding-top: 40px;
    padding-bottom: 40px;
  }

  .portfolio__title-button {
    flex-direction: column;
    align-items: start;
  }
}

@media screen and (max-width: 500px) {
  .portfolio__title-button {
    align-items: unset;
  }
}
