
* {
  /* border: 1px solid black; */
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: aliceblue;
  font-family: sans-serif;
  position: relative;
}

.btn {
  padding: 0.7rem 1rem;
  border-radius: 10px;
  text-transform: capitalize;
  background-color: pink;
  text-decoration: none;
  color: black;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}


/* :root {
  --leftPosition: 50%;
  --topPosition: 50%;
} */

/* 
but from the looks of it
you dont even need to set them
*/

.btn::before {
  content: "";
  position: absolute;
  background-color: orangered;
  width: 0;
  height: 0;

  /* 
    line of thought
    pseudo elements cant be accessed from js selector
    so we shall use css varaibles and access those instead
    then we can change them dynamically
    */

  left: var(--leftPosition);
  top: var(--topPosition);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  transition: width .5s, height .5s;
}

.btn:hover::before{
  width: 300px;
  height: 300px;
}

.btn span {
  position: relative;
  z-index: 1;
}
