@import url("https://fonts.googleapis.com/css2?family=Courier+Prime&display=swap");

@font-face {
  font-family: Eurostile;
  src: url(./fonts/Eurostile/EurostileBold.ttf) format('truetype');
  font-weight: bold;
}

@font-face {
  font-family: DS-Digital;
  src: url(./fonts/ds_digital/DS-DIGI.TTF) format('truetype');
}

:root {
  --top-dune-gray: #302b28;
  --solar-gray: #362f33;
  --screen-white: #d7e4e8;
  --keypad-gray: #aeaaab;
  --font-white: #fffdfa;
  --calculator-border-gray: #5d5d5d;
  --calculator-border-radius: 30px;
  --key-pink: #954465;
  --key-pink-hover: #a66a7a;
  --key-pink-active: #7e4e5a;
  --key-orange: #bb8456;
  --key-orange-hover: #c99a6f;
  --key-orange-active: #a97a4d;
  --key-gray: #6c6b67;
  --key-gray-hover: #7e7d79;
  --key-gray-active: #5a5956;
  --key-dark-gray: #454344;
  --key-dark-gray-hover: #575756;
  --key-dark-gray-active: #333231;
}

main {
  flex: 1;
  display: grid;
  place-items: center;
}

#top {
  display: flex;
  flex-direction: column;
  background: var(--top-dune-gray);
  border: 4px solid var(--calculator-border-gray);
  border-radius: var(--calculator-border-radius) var(--calculator-border-radius) 0 0;
  border-bottom: none;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* Head */

#head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 15px;
  padding-inline: 4px;
  color: var(--font-white);
  width: 100%;
}

#brand {
  font-family: Eurostile, monospace;
  font-size: 2.5rem;
  letter-spacing: 1.2px;
}

#model {
  font-family: Eurostile, monospace;
  font-size: 1.3rem;
  font-weight: bold;
  letter-spacing: 0.05rem;
  white-space: nowrap;
}

#solar {
  width: 120px;
  height: 35px;
  background-color: rgb(157, 157, 157);
  border: 4px solid var(--solar-gray);
  border-radius: 4px;
  display: flex;
  gap: 1px;
  margin-left: auto;

  & div {
    background-color: var(--solar-gray);
    width: 100%;
    height: 100%;
  }
}

/* Screen */

#screen {
  background-color: var(--screen-white);
  height: 100px;
  min-width: 300px;
  width: 100%;
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  padding: 8px 8px 0;
}

#input {
  font-family: DS-Digital;
  font-size: 2.7rem;
  white-space: nowrap;
}

#display {
  font-family: DS-Digital;
  font-size: 5.5rem;
  white-space: nowrap;
}

#keypad {
  background: var(--keypad-gray);
  border: 4px solid var(--calculator-border-gray);
  border-radius: 0 0 var(--calculator-border-radius) var(--calculator-border-radius);
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(5, 50px);
  gap: 12px;
}

/* Buttons */

button {
  cursor: pointer;
  font-family: 'Courier Prime', monospace;
  font-size: 3rem;
  border-radius: 6px;
  color: var(--font-white);
}

#negative {
  background: var(--key-pink);
}

#negative:hover {
  background: var(--key-pink-hover);
}

#negative:active,
#negative.active {
  background: var(--key-pink-active);
}

.erase {
  background: var(--key-orange);
}

.erase:hover {
  background: var(--key-orange-hover);
}

.erase:active,
.erase.active {
  background: var(--key-orange-active);
}

.operator {
  background: var(--key-gray);
}

.operator:hover {
  background: var(--key-gray-hover);
}

.operator:active,
.operator.active {
  background: var(--key-gray-active);
}

.digit {
  background: var(--key-dark-gray);
}

.digit:hover {
  background: var(--key-dark-gray-hover);
}

.digit:active,
.digit.active {
  background: var(--key-dark-gray-active);
}

#add {
  grid-area: 4 / 4 / 6 / 5;
}

@media (max-width: 450px) {
  #top {
    padding: 15px;
  }

  #solar {
    width: 90px;
  }

  #solar > div:nth-child(4) {
    display: none;
  }

  #screen {
    min-width: 0;
  }

  button {
    font-size: 2.75rem;
  }
}

@media (max-width: 400px) {
  #model {
    display: none;
  }

  #screen {
    height: 90px;
  }

  #input {
    font-size: 2.25rem;
  }

  #display {
    font-size: 4.5rem;
  }

  #keypad {
    padding: 15px;
    gap: 6px;
    grid-template-rows: repeat(5, 40px);
  }

  button {
    font-size: 2.5rem;
  }
}