/* Shared icon + label badges for the homepage and technology slides. */
.tech-badge,
.stack-chips .tech-badge {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .7);
  color: var(--ink);
  font: 600 12px/1.3 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  white-space: nowrap;
}

.tech-icon {
  display: block;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.language-grid > .tech-badge {
  min-height: 76px;
  padding: 15px 12px;
  flex-direction: column;
  justify-content: center;
  gap: 9px;
  border-radius: 13px;
  font-size: 11px;
}

.language-grid .tech-icon {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
}

.tech-page .tool-group h3 { margin-top: 0; }
.tech-page .tool-group .stack-chips { gap: 9px; }
.tech-page .tool-group .tech-badge { background: rgba(255, 255, 255, .68); }

@media (max-width: 540px) {
  .tech-badge,
  .stack-chips .tech-badge { padding: 8px 11px; gap: 8px; }
  .language-grid > .tech-badge { padding: 13px 9px; }
}

/* Keep the glow behind the badge content and the site's custom cursor intact. */
.tech-badge {
  position: relative;
  isolation: isolate;
  --glow-x: 50%;
  --glow-y: 50%;
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.tech-badge::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(85px circle at var(--glow-x) var(--glow-y),
    rgba(181, 164, 236, .3), rgba(147, 218, 236, .15) 48%, transparent 78%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.tech-badge .tech-icon {
  transition: transform 220ms ease;
}

.tech-badge:focus-visible {
  outline: 2px solid rgba(116, 98, 166, .7);
  outline-offset: 3px;
  border-color: rgba(145, 126, 190, .56);
  box-shadow: 0 4px 15px rgba(139, 120, 186, .12), inset 0 0 10px rgba(180, 209, 237, .14);
  transform: translateY(-2px);
}

.tech-badge:focus-visible::before { opacity: 1; }
.tech-badge:focus-visible .tech-icon { transform: translateY(-1px) rotate(-3deg) scale(1.04); }

@media (hover: hover) and (pointer: fine) {
  .tech-badge:hover,
  .tech-badge.is-glowing {
    border-color: rgba(145, 126, 190, .56);
    box-shadow: 0 4px 15px rgba(139, 120, 186, .12), inset 0 0 10px rgba(180, 209, 237, .14);
    transform: translateY(-2px);
  }

  .tech-badge:hover::before,
  .tech-badge.is-glowing::before { opacity: 1; }

  .tech-badge:hover .tech-icon,
  .tech-badge.is-glowing .tech-icon { transform: translateY(-1px) rotate(-3deg) scale(1.04); }
}

@media (prefers-reduced-motion: reduce) {
  .tech-badge,
  .tech-badge::before,
  .tech-badge .tech-icon { transition: none; }

  .tech-badge:focus-visible,
  .tech-badge:focus-visible .tech-icon,
  .tech-badge:hover,
  .tech-badge:hover .tech-icon,
  .tech-badge.is-glowing,
  .tech-badge.is-glowing .tech-icon { transform: none; }
}
