:root {
  --background: #000;
  --primary: rgb(125, 207, 235);
  --secondary: #fff;
  --third: rgba(150, 151, 175, 0.4);
  --fourth: rgb(198, 224, 233);
  --fifth: rgba(150, 151, 175, 0.4);
  --sixth: #000;
}
[data-theme="light"] {
  --background: #8cd9d9;
  --primary: #333;
  --secondary: #fff;
  --third: none;
  --fourth: #333;
  --fifth: rgba(48, 48, 68, 0.9);
  --sixth: #abdddd;
}

*,
*::before,
::after {
  box-sizing: border-box;
  margin: 0;
}
body {
  height: 100vh;
  place-items: center;
  background-color: var(--background);
  font-family: "Ubuntu", sans-serif;
  scroll-behavior: smooth;
}
header {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}
h1 {
  color: var(--secondary);
  margin-top: 300px;
  margin-left: 60px;
}
h2 {
  color: var(--primary);
  font-size: 2.5em;
  text-align: center;
}
h3 {
  margin-bottom: 1.2rem;
}
nav {
  color: var(--primary);
  margin-top: -100px;
  display: flex;
  font-size: 20px;
  line-height: 30px;
  flex-direction: row;
}
ul {
  display: flex;
  flex-direction: row;
}
li {
  display: inline-block;
  margin: auto 20px;
  list-style-type: none;
}
li a {
  display: inline-block;
  color: var(--primary);
  text-decoration: none;
}
.wrapper {
  display: inline-block;
  position: absolute;
  top: 60%;
  left: 50%;
  perspective: 1000px;
}
.cube-container {
  display: inline-block;
  position: relative;
  transform-style: preserve-3d;
  animation: spin 30s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate3d(0, 1, 0, 0deg);
  }
  50% {
    transform: rotate3d(0, 1, 0, 180deg);
  }
  100% {
    transform: rotate3d(0, 1, 0, 360deg);
  }
}

.cube {
  display: inline-block;
  position: absolute;
  width: 300px;
  height: 300px;
  border: 1px solid #333;
  background: var(--third);
}
.front {
  transform: translateX(-150px) translateY(-150px) translateZ(150px);
}
.back {
  transform: translateX(-150px) translateY(-150px) translateZ(-150px)
    rotateY(180deg);
}
.right {
  transform: translateY(-150px) rotateY(90deg);
}
.left {
  transform: translateY(-150px) translateX(-300px) rotateY(270deg);
}
.bottom {
  transform: translateX(-150px) rotateX(90deg);
}
.top {
  transform: translateX(-150px) translateY(-300px) rotateX(270deg);
}
.cube-container {
  display: inline-block;
  background-color: red;
  transform: rotateX(90deg) rotateY(90deg);
}
.cube::after {
  content: "🖥";
  font-size: 5em;
  color: white;
  font-weight: 200;
}

.section {
  display: grid;
  place-items: center;
  cursor: pointer;
}

.card {
  width: 400px;
  cursor: pointer;
}
.card-container {
  text-align: center;
  position: relative;
  cursor: pointer;
  padding: 15em 5em;
  transition: transform 4s;
  transform-style: preserve-3d;
}
.card:hover .card-container {
  transform: rotateY(180deg);
}
.active {
  transform: rotateY(180deg);
}
.card-img,
.card-back {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 5em 3em;
  cursor: pointer;
  transform-style: preserve-3d;
  display: grid;
  align-content: center;
  border: 2px rgb(198, 224, 233) solid;
  border-radius: 2px;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.card-img {
  background-size: cover;
  background-position: center;
}
.cosmetics {
  background-image: url(img/cosmeticsshop.jpg);
}
.travel {
  background-image: url(img/travel.jpg);
}
.game {
  background-image: url(img/game.jpg);
  top: -30px;
}
.tailor {
  background-image: url(img/tailor.jpg);
}
.quiz {
  background-image: url(img/quiz.jpg);
}
.food {
  background-image: url(img/food.jpg);
}
.shoppinglist {
  background-image: url(img/shoppinglist.jpg);
}
.numbers {
  background-image: url(img/numbers.jpg);
}
.card-img::before {
  content: "";
  position: absolute;
  transform: translateZ(3rem);
}

.card-description {
  line-height: 1.6;
  transform: translateZ(6rem);
}
.card-description a {
  color: rgb(226, 226, 89);
  cursor: pointer;
}
.card-back {
  background-color: var(--fifth);
  color: rgb(198, 224, 233);
  transform: rotateY(180deg);
}

.about p {
  color: var(--fourth);
  width: 30%;
  margin: 2rem auto 2.5rem auto;
  text-align: center;
  line-height: 30px;
  border: 1px solid rgb(187, 220, 231);
  border-radius: 4px;
  padding: 25px;
  box-shadow: 1px 2px 20px rgb(86, 167, 194);
  background-color: var(--sixth);
}
.contact {
  color: var(--primary);
  text-align: center;
  line-height: 1.8rem;
  font-size: 0.8rem;
  margin: 20px;
  padding-bottom: 2rem;
}

.contact a {
  color: var(--fourth);
  text-decoration: none;
}
.contact a:hover {
  color: #fff;
}
form {
  display: flex;
  flex-direction: column;
  color: var(--fourth);
  font-size: 0.8em;
  margin: 20px auto 0 auto;
  width: 40%;
  max-width: 500px;
}
form label {
  text-align: left;
  font-size: 1.2em;
  padding: 10px;
}
form input,
#message {
  padding: 10px;
  font-size: 14px;
  background-color: rgb(187, 220, 231);
  border-radius: 5px;
  font-weight: bold;
}

form button {
  font-size: 1.5em;
  padding: 10px;
  width: 130px;
  margin: 1.5em auto;
  background-color: rgb(86, 167, 194);
  border-radius: 5px;
  color: var(--secondary);
  cursor: pointer;
}
form button:hover {
  background-color: rgb(64, 76, 80);
  transform: scaleY(0.95);
}
form input:focus,
#message:focus {
  background-color: #fff;
}
#message {
  height: 120px;
}
#message::placeholder {
  text-align: left;
}

@media screen and (max-width: 350px) and (min-width: 300px) {
  body {
    width: 80%;
    margin: 20px auto;
  }
  .section {
    margin: 20px auto 130px auto;
  }
  .about p {
    width: 70%;
  }
}
@media screen and (max-width: 400px) and (min-width: 350px) {
  .section {
    margin: 20px auto 100px auto;
  }
  .about p {
    width: 70%;
  }
}
@media screen and (max-width: 450px) and (min-width: 400px) {
  body {
    width: 80%;
    margin: 20px auto;
  }
  main {
    width: 100%;
  }
  .wrapper {
    perspective: 1500px;
  }
  .section {
    margin: 20px auto 100px auto;
  }
  .card {
    width: 300px;
  }
  form {
    width: 300px;
  }
  .about p {
    width: 80%;
  }
}
@media screen and (max-width: 600px) and (min-width: 450px) {
  body {
    width: 90%;
    margin: 20px auto;
    padding: 20px;
  }
  .wrapper {
    perspective: 1500px;
  }
  .section {
    margin: 20px auto 100px auto;
  }
  .about p {
    width: 60%;
  }
  form {
    width: 80%;
  }
}

@media screen and (min-width: 600px) {
  .section {
    margin: 65px auto 100px auto;
  }
  nav {
    font-size: 30px;
  }
  h1 {
    margin-left: 100px;
  }
  .about p {
    min-width: 300px;
  }
  form {
    min-width: 400px;
  }
}

/* Mode Switch */
.mode {
  display: flex;
  align-items: center;
  z-index: 100;
  position: absolute;
  right: 25px;
  top: 30px;
  border-radius: 5px;
  background-color: var(--background);
}

.mode span {
  margin-right: 10px;
  font-size: 1rem;
  padding-left: 15px;
  border-radius: 5px;
  color: var(--primary);
}

.mode-text {
  position: relative;
  top: -4px;
  right: 5px;
}

.mode-switch {
  display: inline-block;
  height: 34px;
  position: relative;
  width: 60px;
}

.mode-switch input {
  display: none;
}

.slider {
  background: var(--primary);
  position: absolute;
  cursor: pointer;
  bottom: 0;
  left: 0;
  right: 0;
  top: 0;
  transition: 0.4s;
  border-radius: 34px;
}

.slider::before {
  background: var(--secondary);
  bottom: 4px;
  content: "";
  height: 26px;
  left: 4px;
  position: absolute;
  transition: 0.4s;
  width: 26px;
  border-radius: 50%;
}

input:checked + .slider {
  background: var(--primary);
}

input:checked + .slider::before {
  transform: translateX(26px);
}

.fas {
  font-size: 30px;
  margin-right: 5px;
}
