.tech-stack {
  border-top: 1px solid rgba(23, 23, 23, 0.08);
  border-bottom: 1px solid rgba(23, 23, 23, 0.08);
  background: linear-gradient(180deg, #fff 0, #fafafa 100%);
}

.tech-stack .container {
  text-align: center;
}

.tech-stack h2 {
  margin: 0;
  font-size: clamp(1.625rem, 3vw, 2.375rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: #0a0a0a;
}

.tech-stack .subtitle {
  margin: 1rem auto 0;
  max-width: 44rem;
  font-size: 1rem;
  line-height: 1.75;
  color: #404040;
}

.stack-grid {
  margin-top: 2.25rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: center;
  justify-items: center;
}

@media (min-width: 768px) {
  .stack-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2rem;
  }
}

@media (min-width: 1024px) {
  .stack-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 2.5rem;
  }
}

.stack-grid img {
  display: block;
  width: 46px;
  height: 46px;
  opacity: 0.65;
  filter: grayscale(100%);
  transition: transform 0.25s ease, filter 0.25s ease, opacity 0.25s ease;
}

.stack-grid img:hover,
.stack-grid img:focus-visible {
  opacity: 1;
  filter: grayscale(0);
  transform: scale(1.05);
}

.tech-stack-carousel-block {
  border-top: 1px solid rgba(23, 23, 23, 0.08);
  border-bottom: 1px solid rgba(23, 23, 23, 0.08);
  background: linear-gradient(180deg, #fff 0, #fafafa 100%);
}

.tech-stack-shell {
  display: grid;
  gap: 1.5rem;
  align-items: center;
}

@media (min-width: 1024px) {
  .tech-stack-shell {
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    gap: 2rem;
  }
}

.tech-stack-cta h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  line-height: 1.24;
  letter-spacing: -0.01em;
  color: #0a0a0a;
}

.tech-stack-cta p {
  margin: 0.9rem 0 0;
  max-width: 28rem;
  line-height: 1.7;
  color: #404040;
}

.tech-stack-cta .btn {
  margin-top: 1rem;
}

.tech-carousel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(23, 23, 23, 0.08);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.95);
  padding: 0.9rem 0.35rem;
}

.tech-carousel::before,
.tech-carousel::after {
  content: "";
  position: absolute;
  top: 0;
  width: 72px;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.tech-carousel::before {
  left: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 0));
}

.tech-carousel::after {
  right: 0;
  background: linear-gradient(270deg, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 0));
}

.tech-carousel-track {
  display: flex;
  width: max-content;
  gap: 0.8rem;
  align-items: center;
  animation: techCarouselRtl 42s linear infinite;
  will-change: transform;
}

.tech-carousel:hover .tech-carousel-track {
  animation-play-state: paused;
}

.tech-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  border-radius: 0.85rem;
  border: 1px solid rgba(23, 23, 23, 0.1);
  background: #fff;
  flex: 0 0 auto;
}

.tech-chip img {
  display: block;
  width: 38px;
  height: 38px;
  opacity: 0.65;
  filter: grayscale(100%);
  transition: transform 0.25s ease, filter 0.25s ease, opacity 0.25s ease;
}

.tech-chip:hover img,
.tech-chip:focus-within img {
  opacity: 1;
  filter: grayscale(0);
  transform: scale(1.05);
}

@keyframes techCarouselRtl {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tech-carousel-track {
    animation: none !important;
    transform: none !important;
  }

  .tech-chip img {
    transition: none !important;
  }
}
