* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  background-image: url(canvas/scenery-morning.svg);
  background-size: auto 100%;
  background-repeat: no-repeat;
  background-position: center;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: #445c7f;
  overflow-x: hidden;
  max-width: 100vw;
}

nav {
  display: flex;
  margin-top: 4%;
  margin-left: 4%;
  align-items: center;
  flex-wrap: wrap;
}

nav a {
  display: flex;
  margin-right: 3%;
  text-decoration: none;
  font-size: 20px;
  color: inherit;
}

#logo {
  margin-right: 3%;
  width: 80px;
  object-fit: contain;
}

#mode-img {
  object-fit: contain;
  cursor: pointer;
}

#bar {
  display: none;
}

#wrapper {
  width: 50vw;
  height: 50vw;
  position: absolute;
  top: 5%;
  right: 5%;
  z-index: -1;
  overflow-x: hidden;
  overflow-y: hidden;
}

#mainCanva {
  width: 100%;
  height: 100%;
}

h1 {
  font-family: "Patrick Hand", cursive;
  font-size: 4rem;
  margin: 0;
}

#intro {
  width: 38%;
  margin-left: 8%;
  height: 90vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#about {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: 80%;
  margin: auto;
  position: relative; /* so that profile-pic can be place relative to this div*/
}

#about p {
  width: 60%;
  font-size: 1.2em;
}

#profile-pic {
  position: absolute;
  top: 35%;
  width: 25%;
  left: 10%;
  border-radius: 50%;
}

#education {
  position: relative; /*so that bus container will follow its width*/
  width: 100vw;
}

#bus-container {
  position: relative;
  width: 100%;
}

#road {
  position: relative;
  object-fit: contain;
  width: 100%;
}

#school-bus {
  position: absolute;
  width: 10%;
  left: 0;
}

#education-text-container {
  position: absolute;
  top: 20%;
  left: 10%;
}

.edu-content {
  display: flex;
  width: 80%;
  margin: auto;
}

.icon {
  margin-right: 4%;
  width: 80px;
  object-fit: contain;
}

#project {
  width: 80%;
  margin: auto;
  text-align: center;
  color: #7d759f;
}

#education,
#project,
#contact {
  margin-top: 5%;
}

.project-content {
  text-align: left;
  background-color: rgba(255, 255, 255, 0.5);
  color: #666189;
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.532);
  padding: 3%;
  display: flex;
  margin-bottom: 30px;
}

.line1 {
  font-weight: bold;
  font-size: 1.2em;
  display: inline-block;
  padding-bottom: 10px;
}

.line2 {
  display: inline-block;
  padding-bottom: 10px;
}

.button {
  border: none;
  cursor: pointer;
  background-color: #666189;
  padding: 1.2% 5%;
  border-radius: 5px;
  font-size: 18px;
  color: white;
  text-decoration: none;
  margin: 2% 3%;
  display: inline-block;
  width: auto;
  white-space: nowrap;
}

.button:hover {
  background-color: #44405c;
}

.line4 {
  font-family: monospace;
  padding: 3px;
  margin: 10px;
  font-size: 15px;
  color: black;
}

.project-content .thumbnail {
  width: 35%;
  height: auto;
  margin-right: 5%;
  object-fit: contain;
}

#contact {
  color: white;
  text-align: center;
}

.contact-icon {
  width: 100px;
}

.contact-icon-color {
  position: absolute;
  visibility: hidden;
  width: 100px;
}

#contact-container {
  width: 70%;
  margin: auto;
  text-align: left;
}

.contact-content {
  display: inline-block;
  width: 48%;
  margin-bottom: 7%;
  cursor: pointer;
  position: relative;
}

.tooltiptext {
  position: absolute;
  transform: scale(0, 1);
  background-color: rgb(216, 216, 216);
  color: rgb(69, 69, 69);
  border-radius: 0 30px 30px 0;
  z-index: -1;
  padding: 10px 20px;
  height: 50px;
  top: 0;
  bottom: 0;
  margin: auto;
  left: 90px;
  font-family: "Patrick Hand", cursive;
}

.contact-icon:hover + .tooltiptext {
  visibility: visible;
  transform: scale(1, 1);
  transition: transform 0.3s ease-in-out;
  transform-origin: 0% 50%;
}

@media only screen and (max-width: 1080px) {
  #about {
    width: 95%;
  }
  #wrapper {
    top: 15%;
  }

  #education-text-container {
    left: 5%;
  }

  #contact-container {
    width: 90%;
  }

  .contact-icon {
    visibility: hidden;
  }

  .contact-icon-color {
    visibility: visible;
  }

  #project {
    margin-top: 15%;
    /*otherwise it will block the edu content*/
  }

  .tooltiptext {
    transform: scale(1, 1);
  }
}

@media only screen and (max-width: 850px) {

  #wrapper {
    width: 90vw;
    height: 90vw;
    position: relative;
    right: 0; /* to override the 5% right & top */
    top: 0;
    left: 0;
    bottom: 0;
    margin: auto;
  }

  #intro {
    width: 80%;
    height: auto;
    margin: auto;
    text-align: center;
  }

  #education-text-container {
    position: relative;
    width: 100vw; /*cz 100% of its parent is longer than 100vw*/
    left: 0; /*override the previous */
  }

  #project {
    width: 95%;
  }

  .contact-icon,
  .contact-icon-color {
    width: 80px;
  }

  .tooltiptext {
    padding: 10px 15px;
    left: 70px;
  }

  #mode-img {
    /* its not working, the hidden modeImg in small screen still remains */
    display: block;
    visibility: visible;
  }

  #education h1 {
    text-align: center;
  }
}

@media only screen and (max-width: 600px) {
  body {
    font-size: 0.9em;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1rem;
  }

  nav {
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 0;
    margin-left: 0;
  }

  nav a {
    display: none;
  }

  #bar {
    position: absolute;
    right: 10px;
    top: 10px; /*if not specify it will change with the changing nav height on openMenu*/
    display: block;
    font-size: 35px;
    cursor: pointer;
  }

  .inBar {
    position: relative;
    padding: 10px;
    width: 100vw;
    margin: 0;
    display: block;
  }

  .inBarDay {
    color: white !important;
    background-color: #445c7f;
  }

  .inBarNight {
    color: white !important;
    background-color: #202d41;
  }

  #mode-img {
    position: absolute;
    right: 60px;
    top: 10px;
  }

  #logo {
    width: 50px;
    margin: 5px 0 0 5px;
  }

  #about {
    align-items: center;
  }

  #about p {
    width: 100%;
  }

  #bus-container {
    display: none;
  }

  #profile-pic {
    position: relative;
    width: 50%;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
  }

  .project-content {
    display: block;
    text-align: center;
  }

  .project-content .thumbnail {
    width: 80%;
  }

  .button {
    font-size: 14px;
  }

  .contact-icon,
  .contact-icon-color {
    width: 70px;
  }

  .contact-content {
    width: 90%;
    margin: 2% auto;
  }

  .tooltiptext {
    padding: 10px 20px;
    left: 55px;
  }
}
