@import url("https://fonts.googleapis.com/css2?family=Varela+Round&display=swap");
:root {
  --light-color: #fff;
  --dark-color: #111;
  --darkish-color: #333;
  --lightish-color: #888;
  --grid-gap: .1rem;

  color: var(--light-color);
  font-size: 20px;
  font-family: "Varela Round", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body{
  background-color: var(--darkish-color);
  min-height: 100vh;
  max-width: 100vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

input{
  border: unset;
  border-right: 2px solid #aaa;
  border-bottom:2px solid #aaa;
  border-left: 2px solid var(--dark-color);
  border-top: 2px solid var(--dark-color);
}

button{
  font-size: 1rem;
  padding: .75rem 1.5rem;
  border: unset;
  cursor: pointer;
  color: var(--light-color);
  outline: 1px solid var(--light-color);
  transition: all .15s ease-out;
}

h1{
  text-align: center;
  margin: .5em;
}

h1 a{
  font-size: clamp(1rem, 5vw, 100vw);
  color: var(--light-color);
  text-decoration: none;
  text-transform: uppercase;
  user-select: none;
  text-shadow: 0 0 1em currentColor;
}

.calculator{
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: calc(var(--grid-gap) * 3);
  padding: .1rem;
  border: 2px solid var(--lightish-color);
  box-shadow:
    0 0 0 1px #fff,
    0 0 30px var(--dark-color);
}

.display{
  background-color: var(--lightish-color);
  min-height: 5.5rem;
  width: 20rem;
  grid-column: span 4;
  border-right: 2px solid #fff;
  border-bottom:2px solid #fff;
  border-left: 2px solid var(--dark-color);
  border-top: 2px solid var(--dark-color);
  
  display: flex;
  flex-direction: column;
  padding: 0 1rem;
  justify-content: space-around;
}

#characters-display{
  background-color: transparent;
  color: var(--darkish-color);
  padding: .5em;
  width: 100%;
  font-size: 1rem;
}
#characters-display:focus{
  outline: none;
}

#result-display{
  color: var(--dark-color);
  word-wrap: break-word;
  font-size: 1.5rem;
  text-align: right;
}

.numbers{
  grid-column: span 3;
  grid-row: span 2;
  
  display: grid;
  grid-template-columns: repeat(3, auto);
}
[numbers]{
  background: #770;
}
[numbers]:hover{
  background: #550;
}
#point{
  grid-column: span 2;
}

#equal-to{
  background: #600;
}

#clear,
#equal-to,
#backspace,
#answer{
  background: #800;
}
#clear:hover,
#equal-to:hover,
#backspace:hover,
#answer:hover{
  background: #600;
}

.operator,
#change-sign{
  background: #058;
}
.operator:hover,
#change-sign:hover{
  background: #037;
}










@media (max-width: 412px) {
  .calculator{
    transform: scale(.8);
  }
}

@media (max-width: 340px) {
  .calculator{
    transform: scale(.5);
  }
}