.stack-section {
  background: #ffffff;
  border-top: 1px solid rgb(var(--color-coal) / 0.08);
  padding: 64px 0;
}

.stack-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  text-align: center;
}

.stack-label {
  margin: 0 0 32px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgb(var(--color-text-secondary));
}

.stack-track-wrap {
  position: relative;
  overflow: hidden;
  padding-top: 120px;
  margin-top: -120px;
  -webkit-mask-image: linear-gradient(to right, transparent, black 2%, black 98%, transparent);
  mask-image: linear-gradient(to right, transparent, black 2%, black 98%, transparent);
  transform: translateZ(0);
}

.stack-track {
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  animation: stack-scroll 32s linear infinite;
  will-change: transform;
  backface-visibility: hidden;
}

.stack-track:hover,
.stack-track:focus-within {
  animation-play-state: paused;
}

@keyframes stack-scroll {
  from {
    transform: translateX(0) translateZ(0);
  }
  to {
    transform: translateX(-50%) translateZ(0);
  }
}

.stack-chip {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgb(var(--color-bg-light));
  border: 1px solid rgb(var(--color-coal) / 0.08);
  color: #374151;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: default;
}

.stack-chip svg {
  width: 14px;
  height: 14px;
  color: rgb(var(--color-text-secondary));
}

.stack-chip-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  z-index: 20;
  width: max-content;
  max-width: 220px;
  transform: translate(-50%, 4px);
  padding: 8px 12px;
  border-radius: 8px;
  background: rgb(var(--color-coal));
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
  white-space: normal;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.stack-chip-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgb(var(--color-coal));
}

.stack-chip:hover .stack-chip-tooltip,
.stack-chip:focus-visible .stack-chip-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

@media (prefers-reduced-motion: reduce) {
  .stack-track-wrap {
    overflow-x: auto;
  }

  .stack-track {
    animation: none;
  }
}
