#stack {
  padding: 6rem 10%;
}

.stack-section {
  min-height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.stack-container {
  display: flex;
  gap: 2.5rem;
  width: 100%;
  max-width: 1300px;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
}

.stack-card {
  flex: 1 1 45%;
  min-width: 300px;
  max-width: 600px;
  padding: 3.5rem;
  background: transparent;
  border: none;
  border-radius: 8px;
  transition: var(--transition-slow);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stack-card:hover {
  background: rgba(255, 255, 255, 0.05);
}

.stack-card:hover h2 {
  color: #fff;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.8), 0 0 40px rgba(255, 255, 255, 0.4);
}

.stack-card:hover h2::after {
  width: 60px;
  background: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.stack-card:hover .stack-icon i {
  opacity: 0.8;
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.3));
}

.stack-card h2 {
  font-family: 'Italiana', serif;
  font-size: 1.8rem;
  color: #fff;
  margin-bottom: 2rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.7), 0 0 30px rgba(255, 255, 255, 0.3);
  transition: var(--transition-slow);
}

.stack-card h2::after {
  content: "";
  display: block;
  margin: 10px auto 0;
  width: 30px;
  height: 1px;
  background: var(--text-soft);
  transition: var(--transition-slow);
}

.stack-card:hover h2::after {
  width: 60px;
  background: var(--accent);
}

.stack-icons {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
}

.stack-icon {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-slow);
}

.stack-icon i {
  font-size: 36px;
  color: #fff;
  opacity: 0.5;
  transition: var(--transition-slow);
}

.stack-icon:hover {
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
  transform: translateY(-8px) scale(1.1);
}

.stack-icon:hover i {
  opacity: 1;
  color: #fff;
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.4));
}

.stack-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 15px);
  transform: translateX(-50%) translateY(10px);
  background: #1a1a1a;
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-family: 'Didact Gothic', sans-serif;
  line-height: 1.5;
  min-width: 150px;
  max-width: 200px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  z-index: 100;
  visibility: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.stack-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 5px);
  transform: translateX(-50%) translateY(10px);
  border-width: 5px;
  border-style: solid;
  border-color: #1a1a1a transparent transparent transparent;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  z-index: 100;
  visibility: hidden;
}

.stack-icon:hover::after,
.stack-icon:hover::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 900px) {
  #stack {
    padding: 4rem 5% 5rem;
  }
  .stack-container {
    flex-direction: column;
    gap: 2rem;
  }
  .stack-icons {
    justify-content: center;
    gap: 1rem;
  }
}

.stack-icon.exploring i {
  opacity: 0.2;
}

.stack-icon.exploring:hover i {
  opacity: 0.5;
}

.stack-icon.exploring:hover {
  background: transparent;
  transform: translateY(-2px);
}