.works__gallery {
  position: relative;
}

.works {
  padding-top: var(--space-5);
}

.works__grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.works__item {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.works__label {
  text-align: right;
}

.works__label-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text-primary);
  margin: 0;
}

.works__label-tag {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  margin-top: var(--space-1);
}

.works__fade {
  position: absolute;
  bottom: -10px;
  left: calc(-1 * var(--content-px));
  right: calc(-1 * var(--content-px));
  height: 42%;
  pointer-events: none;
  z-index: 2;
}

.works__fade::before {
  content: "";
  position: absolute;
  inset: 0;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  mask-image: linear-gradient(
    to top,
    transparent 0%,
    black 18%,
    black 30%,
    transparent 75%
  );
  -webkit-mask-image: linear-gradient(
    to top,
    transparent 0%,
    black 18%,
    black 30%,
    transparent 75%
  );
}

.works__fade::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg) 35%, transparent 80%);
}

.works__cta {
  position: absolute;
  bottom: var(--space-8);
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 3;
}

.works__cta-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: 100px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--bg);
  background: var(--text-primary);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) ease,
    opacity var(--duration-fast) ease;
}

.works__cta-btn:hover {
  color: var(--bg);
  transform: translateY(-2px);
  box-shadow: var(--shadow-cta-hover);
}

.works__cta-btn:active {
  transform: scale(0.97);
}

.works__cta-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.works__card {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  display: block;
  text-decoration: none;
}

@supports (corner-shape: squircle) {
  .works__card {
    corner-shape: squircle;
    border-radius: 24px;
  }
}

.works__card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: var(--shadow-card-border);
  pointer-events: none;
}

.works__slides {
  position: absolute;
  inset: 0;
}

.works__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  will-change: opacity;
}

.works__photo:nth-child(1) {
  animation: works-crossfade 15s infinite 0s;
}

.works__photo:nth-child(2) {
  animation: works-crossfade 15s infinite 5s;
}

.works__photo:nth-child(3) {
  animation: works-crossfade 15s infinite 10s;
}

.works__item:nth-child(2) .works__photo:nth-child(1) {
  animation-delay: -2s;
}
.works__item:nth-child(2) .works__photo:nth-child(2) {
  animation-delay: 3s;
}
.works__item:nth-child(2) .works__photo:nth-child(3) {
  animation-delay: 8s;
}

.works__item:nth-child(3) .works__photo:nth-child(1) {
  animation-delay: -4s;
}
.works__item:nth-child(3) .works__photo:nth-child(2) {
  animation-delay: 1s;
}
.works__item:nth-child(3) .works__photo:nth-child(3) {
  animation-delay: 6s;
}

@keyframes works-crossfade {
  0% {
    opacity: 0;
  }
  1.5%,
  33.33% {
    opacity: 1;
  }
  34.83%,
  100% {
    opacity: 0;
  }
}
