*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
/* reset button */
button {
  appearance: none;
  background-color: transparent;
  border: none;
  cursor: pointer;
  outline: none;
  padding: 0;
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  text-decoration: none;
  text-transform: none;
  line-height: normal;
  overflow: visible;
}

body{
  min-height: 100svh;
  background-color: rgb(15, 23, 42);
  color: white;
  display: grid;
  place-content: center;
  font-size: 1rem;
  font-family: system-ui;
}

nav {
  --_clr-txt: rgb(255, 255, 255);
  --_clr-txt-svg: rgb(147, 158, 184);
  --_ani-speed: 6s; /* speed of rotating text */

  display: flex;
  /*flex-wrap: wrap;*/
  gap: 1rem;
  font-size: 1.4rem;
}
nav>button {
  position: relative;
  display: grid;
  place-content: center;
  grid-template-areas: 'stack';
  padding: 0 1.5rem;
  text-transform: uppercase;
  font-weight: 300;
}

/* place button items on top of each other */
nav>button>span {
  transition: all 300ms ease-in-out;
  grid-area: stack;
}
/* nav icon */
nav>button>span:last-of-type {
  margin-top: 0.25rem;
  transform: scale(0);
  transition-delay: 0ms;
  border-radius: 50%;
}
/* hover - hide text */
nav>button:focus-visible>span:first-of-type,
nav>button:hover>span:first-of-type {
  transform: scale(0);
}
/* hover - reveal icon */
nav>button:focus-visible>span:last-of-type,
nav>button:hover>span:last-of-type {
  transform: scale(1);
}

/* nav SVG circular text*/
nav>button>svg {
  position: absolute;
  width: 200px;
  height: 200px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transform-origin: center;
  opacity: 0;
  text-transform: uppercase;
  transition: all 300ms ease-in-out;
  color: var(--_clr-txt-svg);
}
/* hover - reveal rotating SVG */
nav>button:focus-visible>svg,
nav>button:hover>svg {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  transition-delay: 150ms;
  transition: all 300ms ease-in-out;
}
/*
@supports (-webkit-touch-callout: none) {
/* specific to iOS devices * / 
button svg {
    /* adjust position for iOS * /
    translate: -50% -50%;
    animation: rotate var(--_ani-speed) linear infinite;
}
}
@supports not (-webkit-touch-callout: none) {
*/


button svg g {
  transform-origin: center;
  animation: rotate var(--_ani-speed) linear infinite;
}


@keyframes rotate {
  0% {
      transform: rotate(0deg);
  }
  100% {
      transform: rotate(360deg);
  }
}