.scroll-stack-container {
  position: relative;
  width: 100%;
  padding: 30vh 0 10vh;
  max-width: 1200px;
  margin: 0 auto;
}

.scroll-stack-card {
  transform-origin: top center;
  will-change: transform, filter, opacity;
  backface-visibility: hidden;
  transform-style: preserve-3d;
  box-shadow: 0 20px 60px rgba(138, 43, 226, 0.3), 0 8px 20px rgba(0, 0, 0, 0.6);
  width: 90%;
  max-width: 900px;
  margin: 0 auto;
  padding: 3.5rem;
  border-radius: 35px;
  box-sizing: border-box;
  /* 30% transparent background */
  background: linear-gradient(
    135deg,
    rgba(10, 5, 15, 0.7) 0%,
    rgba(15, 8, 20, 0.7) 100%
  );
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(138, 43, 226, 0.3);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Ultra-smooth transitions */
  transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.scroll-stack-end {
  width: 100%;
  height: 50vh;
  pointer-events: none;
}

.scroll-stack-card:hover {
  background: linear-gradient(
    135deg,
    rgba(15, 8, 20, 0.75) 0%,
    rgba(20, 10, 25, 0.75) 100%
  );
  box-shadow: 0 30px 80px rgba(138, 43, 226, 0.5),
    0 12px 30px rgba(0, 0, 0, 0.8);
  border-color: rgba(138, 43, 226, 0.6);
  transform: translateY(-8px) scale(1.01);
  transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.scroll-stack-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #8a2be2 0%, #9370db 50%, #ba55d3 100%);
  border-radius: 35px 35px 0 0;
}

.scroll-stack-card::after {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(138, 43, 226, 0.08) 0%,
    transparent 70%
  );
  pointer-events: none;
  transition: opacity 0.4s ease;
  opacity: 0;
}

.scroll-stack-card:hover::after {
  opacity: 1;
}

.scroll-stack-card h3 {
  font-size: 2.2rem;
  margin-bottom: 1.2rem;
  color: #ffffff;
  font-weight: 700;
  letter-spacing: -0.5px;
  position: relative;
  padding-bottom: 0.5rem;
  text-shadow: 0 0 20px rgba(138, 43, 226, 0.5);
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.scroll-stack-card:hover h3 {
  text-shadow: 0 0 30px rgba(138, 43, 226, 0.7);
  transform: translateX(5px);
}

.scroll-stack-card h3::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #8a2be2, #9370db);
  border-radius: 2px;
  transition: width 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  box-shadow: 0 0 10px rgba(138, 43, 226, 0.6);
}

.scroll-stack-card:hover h3::after {
  width: 100px;
}

.scroll-stack-card p {
  font-size: 1.15rem;
  line-height: 1.8;
  color: rgba(220, 220, 230, 0.9);
  margin-bottom: 1.8rem;
  font-weight: 400;
  transition: color 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.scroll-stack-card:hover p {
  color: rgba(240, 240, 250, 0.95);
}

.scroll-stack-card .project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(138, 43, 226, 0.3);
}

.scroll-stack-card .tech-badge {
  padding: 0.6rem 1.2rem;
  background: linear-gradient(
    135deg,
    rgba(138, 43, 226, 0.15) 0%,
    rgba(147, 112, 219, 0.15) 100%
  );
  color: #c4b5fd;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid rgba(138, 43, 226, 0.3);
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  position: relative;
  overflow: hidden;
}

.scroll-stack-card .tech-badge::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s ease;
}

.scroll-stack-card .tech-badge:hover {
  background: linear-gradient(
    135deg,
    rgba(138, 43, 226, 0.3) 0%,
    rgba(147, 112, 219, 0.3) 100%
  );
  border-color: rgba(138, 43, 226, 0.6);
  color: #ffffff;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 16px rgba(138, 43, 226, 0.4);
}

.scroll-stack-card .tech-badge:hover::before {
  left: 100%;
}

.scroll-stack-card .project-links {
  display: flex;
  gap: 1.2rem;
  margin-top: 2.5rem;
}

.scroll-stack-card .project-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 2rem;
  border-radius: 15px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.scroll-stack-card .project-btn i {
  font-size: 1.2rem;
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.scroll-stack-card .project-btn:hover i {
  transform: translateX(4px) scale(1.15);
}

.scroll-stack-card .btn-live {
  background: linear-gradient(135deg, #8a2be2 0%, #9370db 100%);
  color: white;
  box-shadow: 0 8px 20px rgba(138, 43, 226, 0.4);
}

.scroll-stack-card .btn-live::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #9370db 0%, #ba55d3 100%);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.scroll-stack-card .btn-live:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 30px rgba(138, 43, 226, 0.6);
}

.scroll-stack-card .btn-live:hover::before {
  opacity: 1;
}

.scroll-stack-card .btn-code {
  background: rgba(138, 43, 226, 0.1);
  color: #c4b5fd;
  border: 2px solid #8a2be2;
  box-shadow: 0 4px 15px rgba(138, 43, 226, 0.2);
}

.scroll-stack-card .btn-code::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #8a2be2 0%, #9370db 100%);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.scroll-stack-card .btn-code:hover {
  color: white;
  border-color: transparent;
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 30px rgba(138, 43, 226, 0.5);
}

.scroll-stack-card .btn-code:hover::before {
  opacity: 1;
}

@media (max-width: 768px) {
  .scroll-stack-container {
    padding: 20vh 0 10vh;
  }

  .scroll-stack-card {
    padding: 2rem;
    max-width: 95%;
    border-radius: 25px;
  }

  .scroll-stack-card h3 {
    font-size: 1.6rem;
  }

  .scroll-stack-card p {
    font-size: 1rem;
    line-height: 1.6;
  }

  .scroll-stack-card .project-tech {
    gap: 0.5rem;
  }

  .scroll-stack-card .tech-badge {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }

  .scroll-stack-card .project-links {
    flex-direction: column;
    gap: 0.8rem;
  }

  .scroll-stack-card .project-btn {
    width: 100%;
    justify-content: center;
    padding: 0.9rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .scroll-stack-card {
    padding: 1.5rem;
  }

  .scroll-stack-card h3 {
    font-size: 1.4rem;
  }
}
