button {
  transform: rotateX(45deg);
  transform-style: preserve-3d;
  position: relative;
  background: #1976d2;
  border-radius: 6px;
  padding: 0.5em;
  display: grid;
  place-items: center;
  cursor: pointer;
  outline: none;
  transition:
    transform 0.1s ease,
    box-shadow 0.1s ease,
    scale 0.1s ease;
  border: 3px solid #0d47a1;
  color: white;
  font-size: clamp(18px, 2vw, 28px);
  font-weight: bold;
  z-index: 1;

  &:focus-visible {
    outline: 3px solid #007bff;
    outline-offset: 4px;
    border-radius: 12px;
    background: #e7f1ff;
  }
}

/* Shadow visible only when the menu is closed */
button[aria-expanded="false"] {
  box-shadow: 0 32px 0 #0d47a1;
}

/* Text inside shadow */
button[aria-expanded="false"]::after {
  content: attr(aria-label);
  position: absolute;
  top: 96%;
  left: 50%;
  transform: translate(-50%, 10px) skewX(-20deg);
  color: white;
  font-size: clamp(18px, 2vw, 28px);
  font-weight: bold;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  text-shadow:
    0 2px 0 #0d47a1,
    0 4px 8px rgba(0, 0, 0, 0.5);
  z-index: -1;
  transition: transform 0.1s ease, opacity 0.1s ease;
}

/* Hide text on active */
button:active::after {
  opacity: 0;
  transform: translate(-50%, 20px) skewX(-20deg);
}

button:active {
  transform: rotateX(45deg) translateY(4px) scale(0.98);
  box-shadow:
    inset -2px -2px 6px rgba(255, 255, 255, 0.3),
    inset 2px 2px 8px rgba(0, 0, 0, 0.2),
    0 4px 0 #0d47a1,
    0 8px 12px rgba(0, 0, 0, 0.4);
}
