.stack-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.stack-toggle {
  margin-top: 14px;
  min-height: 38px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background-color: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.stack-toggle:hover {
  border-color: var(--accent);
  background-color: var(--glow-mint);
  color: var(--text);
}

.stack-toggle[hidden] {
  display: none;
}

.stack-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  min-height: 112px;
  overflow: hidden;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--card-accent) 44%, var(--border));
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--card-glow), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
    var(--surface);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
  user-select: none;
}

.stack-card:hover {
  border-color: var(--card-accent);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.26);
  transform: translateY(-5px);
}

.stack-card__badge {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 8px;
  background-color: rgba(31, 31, 40, 0.8);
  border: 1px solid color-mix(in srgb, var(--card-accent) 64%, var(--border));
  color: var(--card-accent);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
}

.stack-card__badge svg {
  width: 34px;
  height: 34px;
  fill: currentColor;
}

.stack-card__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stack-card__eyebrow {
  color: var(--card-accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.stack-card__title {
  margin-top: 4px;
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
}

.stack-card__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  color: var(--text-soft);
  font-size: 0.95rem;
  font-family: var(--fonts-monospace);
}

.stack-card__footer span {
  border-radius: 8px;
  border: 1px solid rgba(220, 215, 186, 0.16);
  padding: 4px 8px;
  background-color: rgba(31, 31, 40, 0.4);
  font-style: italic;
}

@media (max-width: 780px) {
  .stack-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .stack-grid {
    grid-template-columns: 1fr;
  }

  .stack-card {
    grid-template-columns: 1fr;
  }
}
