.portfolio {
  background: transparent;
  padding: 80px 0;
  color: #fff;
  z-index: 200;
  position: relative;
}
.portfolio__container {
  padding: 32px 0;
  text-align: center;
}
.portfolio__slider-wrapper {
  position: relative;
  overflow: hidden;
}

.portfolio__grid.scrollable {
  display: flex;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
  will-change: scroll-position;
}
.portfolio__grid.scrollable::-webkit-scrollbar {
  display: none;
}

/* Each item slides with no gap */
.portfolio__item {
  flex: 0 0 33.3333%;
  position: relative;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  opacity: 1;
  isolation: isolate;
  transition: transform var(--hover-duration, 320ms) var(--hover-ease, ease),
              box-shadow var(--hover-duration, 320ms) ease,
              filter var(--hover-duration, 320ms) ease;
  will-change: transform;
}

.portfolio__item::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(120% 60% at 20% 0%, rgba(211, 171, 103, 0.22), transparent 75%);
  opacity: 0;
  transition: opacity var(--hover-duration, 320ms) ease;
  pointer-events: none;
}

.portfolio__image {
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 9;
  object-fit: cover;
  transition: transform var(--hover-duration, 320ms) var(--hover-ease, ease),
              filter var(--hover-duration, 320ms) ease;
}

.portfolio__item:hover .portfolio__image {
  transform: scale(1.08);
  filter: brightness(1.05);
}

.portfolio__item:hover {
  transform: translateY(-12px);
}

.portfolio__item:hover::before {
  opacity: 1;
  animation: kde-glint 3s linear infinite;
}

.portfolio__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));
  padding: 2rem;
  transform: translateY(0);
  opacity: 1;
  transition: opacity var(--hover-duration, 320ms) ease,
              transform var(--hover-duration, 320ms) var(--hover-ease, ease),
              background var(--hover-duration, 320ms) ease;
}

.portfolio__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #fff;
  font-size: var(--fs-2rem);
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  z-index: 10;
  transition: background var(--hover-duration, 320ms) ease,
              transform var(--hover-duration, 320ms) var(--hover-ease, ease),
              box-shadow var(--hover-duration, 320ms) ease;
}

.portfolio__arrow[disabled] {
  opacity: 0.3;
  pointer-events: none;
}
.portfolio__arrow--left {
  left: 0;
  transform: translateY(-50%) rotate(180deg);
}
.portfolio__arrow--right {
  right: 0;
}
.portfolio__arrow:hover {
  background: rgba(211, 171, 103, 0.15);
  box-shadow: 0 10px 32px rgba(211, 171, 103, 0.25);
}

.portfolio__more-inline {
  display: flex;
  align-items: center;
  gap: 2rem;
  vertical-align: middle;
  padding: 20px 20px 0 0;
  transition: transform var(--hover-duration, 320ms) var(--hover-ease, ease),
              color var(--hover-duration, 320ms) ease;
}
.portfolio__more-inline .services__title {
  flex: 1;
  transition: opacity 0.3s ease;
}
.portfolio__more-inline:hover .services__title {
  opacity: 0.8;
  cursor: pointer;
}
.portfolio__more-inline:hover {
  transform: translateX(6px);
  color: var(--color-hero, #D3AB67);
}
.portfolio__more-inline .service-arrow__icon {
  width: 42px;
  height: auto;
  filter: brightness(0) saturate(100%) invert(74%) sepia(14%) saturate(1017%)
    hue-rotate(342deg) brightness(94%) contrast(88%);
  transition: transform 0.3s ease;
}

.portfolio__more-inline:hover .service-arrow__icon {
  transform: translateX(4px);
}

.portfolio__more-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex: 0 0 35%;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-radius: 999px;
  position: relative;
  overflow: hidden;
  transition: color var(--hover-duration, 320ms) ease,
              transform var(--hover-duration, 320ms) var(--hover-ease, ease),
              box-shadow var(--hover-duration, 320ms) ease;
}

.portfolio__more-link::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(211, 171, 103, 0.2), transparent);
  opacity: 0;
  transition: opacity var(--hover-duration, 320ms) ease;
}

.portfolio__more-link .services__title {
  max-width: none;
}

.portfolio__more-link:hover,
.portfolio__more-link:focus {
  text-decoration: none;
  color: inherit;
}

.portfolio__item:hover .portfolio__overlay {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.78), rgba(211, 171, 103, 0.25));
}

.portfolio__more-link:hover {
  color: var(--color-hero, #D3AB67);
  transform: translateX(8px);
  box-shadow: 0 12px 35px rgba(211, 171, 103, 0.35);
}

.portfolio__more-link:hover::before {
  opacity: 1;
  animation: kde-glint 2.6s linear forwards;
}

.portfolio__item:focus-within .portfolio__overlay {
  transform: translateY(-6px);
}

/* Responsive */
@media (max-width: 1024px) {
  .portfolio__item {
    flex: 0 0 50%;
  }
}

@media (max-width: 768px) {

  .portfolio {
    padding: 0;
    padding-bottom: 20px
  }

  .portfolio__item {
    flex: 0 0 100%;
  }

  .portfolio__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-1-5rem);
    padding: 0.35rem 0.5rem;
    background: transparent;
  }
  .portfolio__overlay {
    padding: 1.25rem;
  }
  .portfolio__more-link {
    flex: 0 0 50%;
  }

  .portfolio__more-inline {
    gap: 0.5rem;
    padding: 20px 0 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portfolio__item,
  .portfolio__item::before,
  .portfolio__overlay,
  .portfolio__image,
  .portfolio__arrow,
  .portfolio__more-link,
  .portfolio__more-link::before,
  .portfolio__more-inline {
    transition: none !important;
    animation: none !important;
  }
}
