@media (prefers-color-scheme: light) {
  body {
    --background-items: #ebf0ee;
    --background-container: #fff;
    --theme: #36b37e;
    --button-hover: rgba(54, 179, 127, 0.24);
    --button-press: #008552;
    --title: #172b4d;
    --bgPop: rgb(193, 199, 208);
    --bgPopT: rgba(193, 199, 208, 0.7);
    --contPop: #fff;
  }
}

@media (prefers-color-scheme: dark) {
  .dark {
    --background-items: #555;
    --background-container: #222;
    --theme: #36b37e;
    --button-hover: rgba(54, 179, 127, 0.24);
    --button-press: #008552;
    --title: #fafafa;
    --contPop: rgb(85, 85, 85);
    --bgPopT: rgba(85, 85, 85, 0.7);
    --bgPop: #222;
  }
}

body {
  background-color: var(--background-container);
  font-family: 'Inter', Arial, Helvetica, sans-serif;
  font-style: normal;
  margin: 0;
  justify-content: center;
  text-align: center;
  font-weight: 400;
  color: var(--title);
}

#menu {
  padding: 0;
}

.error-balloon {
  position: absolute;
  padding: 8px;
  background-color: #f8d7da;
  color: #721c24;
  font-size: 12px;
  border-radius: 4px;
  transition: opacity 0.3s ease;
}

#error-message {
  display: flex;
  align-items: flex-start;
  width: 100%;
  margin-left: 2.5%;
}

.error-balloon::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 10px;
  margin-top: -6px;
  border: 6px solid transparent;
  border-top-color: #f8d7da;
  transition: opacity 0.3s ease;
}

.error-balloon.hide {
  opacity: 0;
  pointer-events: none;
}

header {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  position: absolute;
}

.nav {
  position: relative;
  margin: 0 auto;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  height: 0;
}

header a {
  list-style: none;
  display: inline-block;
  padding: 0 1%;
  color: var(--title);
  font-weight: 600;
}

a:link {
  text-decoration: none;
}

#intro {
  width: 50vw;
  padding-top: 30vh;
}

#main {
  justify-content: center;
  display: flex;
  height: 142vh;
  background-image: url(img/Header-llustration-desktop.png);
  background-position: top right;
  background-size: contain;
  background-repeat: no-repeat;
}

#name {
  color: var(--title);
  margin-bottom: 0;
}

#profile {
  color: var(--theme);
  margin-top: 0;
}

#description {
  font-size: 1.2vw;
  font-weight: 400;
  line-height: 1.8vw;
}

.main-title {
  font-weight: 800;
  font-size: 3vw;
  text-align: center;
  letter-spacing: 0.37px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.sm-icons {
  display: flex;
  justify-content: center;
  flex-direction: row;
  padding: 0;
}

#ham-menu {
  display: none;
}

.il-icons {
  display: flex;
  justify-content: center;
  flex-direction: row;
}

.icons img {
  padding: 1vw;
  margin: 0 auto;
  width: 1.5vw;
}

#works {
  display: grid;
  grid-template-columns: auto;
  grid-template-rows: auto auto auto;
  margin: 4vw 0;
}

#w-title {
  font-size: 2.5vw;
}

.grid-work {
  display: grid;
  justify-content: center;
  grid-template-columns: 23% 23% 23%;
  grid-template-rows: 50% 50%;
  flex-direction: row;
  flex-wrap: wrap;
  padding: 0% 10% 0% 10%;
  column-gap: 1%;
  row-gap: 2%;
  margin-bottom: 2%;
}

.grid-item {
  background-color: var(--background-items);
  border: 1px solid var(--background-items);
  border-radius: 8px;
  display: flex;
  flex-direction: column-reverse;
}

.grid-data {
  background-color: var(--background-container);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  margin-top: 72%;
}

.hero-title {
  text-align: center;
}

.lang-list {
  display: flex;
  justify-content: center;
  padding: 0;
  margin-top: 0;
}

.lang-item {
  text-align: center;
  padding: 2%;
  border-radius: 8px;
  background-color: var(--background-items);
  font-size: 0.8vw;
  font-weight: 600;
  margin: 0% 1% 0% 1%;
}

.grid-button-container {
  margin: 0% 0% 6% 0%;
  display: flex;
  justify-content: center;
}

.grid-button {
  background-color: var(--theme);
  color: var(--background-container);
  padding: 0.7vw;
  border-radius: 4px;
  border: none;
  font-size: 0.8vw;
}

.grid-button:hover {
  box-shadow: 0 8px 16px var(--button-hover);
}

.grid-button:active {
  background-color: var(--button-press);
}

.popup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bgPopT);
  backdrop-filter: blur(3px);
  z-index: 9999;
}

.popup-active {
  display: flex;
  overflow: auto;
  justify-content: center;
}

#popup-but-cont {
  width: 100%;
  justify-content: end;
  height: 6vw;
}

.popup-button {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  justify-content: space-between;
  justify-items: center;
  height: 5vh;
  padding: 0 4%;
  margin-left: 1vw;
  border-radius: 8px;
  flex-direction: row;
}

#popup-live-link {
  font-size: 100%;
  padding: 0 4%;
}

#popup-source-link {
  font-size: 100%;
}

.popup-content {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  width: 80%;
  max-width: 100%;
  background-color: var(--contPop);
  padding: 2em 20px;
  border-radius: 16px;
  justify-content: space-between;
  margin: 4vh 0;
  height: max-content;
}

#popup-close {
  margin: -3.5em 0;
  width: 3em;
  height: 3em;
  background-color: var(--bgPop);
  border: none;
  border-radius: 8px;
  padding: 0.25em 0;
}

.popup-image {
  width: 80vw;
  height: 57vw;
  background-repeat: no-repeat;
  background-size: contain;
  display: flex;
  align-items: flex-start;
  flex-direction: row-reverse;
  margin-top: 1.5em;
  border-radius: 8px;
  order: 1;
}

.popup-title {
  text-align: left;
  margin: 0;
  font-size: 3vw;
  order: 2;
  font-weight: 700;
}

.popup-description {
  text-align: left;
  line-height: 140%;
  font-size: 100%;
  order: 5;
}

.close-button {
  position: absolute;
  top: 10px;
  right: 10px;
  cursor: pointer;
  font-size: 24px;
}

.popup-button svg {
  margin-left: 1vh;
}

.popup-links {
  display: flex;
  justify-content: end;
  gap: 20px;
  order: 3;
  width: 40%;
  margin: 0.1em 0;
}

#popup-technologies {
  justify-content: left;
  order: 4;
  width: 100%;
}

.dt-pop-langitem {
  padding: 1.2vh 0.7vw 0.2vw;
  background-color: var(--bgPop);
  color: var(--title);
  height: 2.5vh;
  margin: 0 0.4vw;
  font-size: 80%;
}

#popupspace {
  height: 85vh;
  width: 100%;
  margin-top: 81vh;
  display: block;
  margin-bottom: 10vh;
}

.about-me {
  background-image: url(img/about-me-background.png);
  background-repeat: no-repeat;
  background-size: contain;
  padding: 5vw 25vw;
}

#about-title {
  font-size: 2.5vw;
}

#about-text {
  font-size: 1.2vw;
  line-height: 1.8vw;
}

#resume-button {
  padding: 0.8vw;
}

#about-grid {
  display: grid;
  justify-content: center;
  grid-template-columns: 19.2vw 19.2vw 19.2vw;
  grid-template-rows: 16.5vw;
  padding: 0% 10% 0% 10%;
  column-gap: 1%;
  row-gap: 2%;
  margin-bottom: 2%;
}

#about-grid-data {
  margin-top: 0;
  flex-direction: column;
  justify-content: space-around;
  background-color: var(--background-items);
}

.about-icon-div {
  margin-top: 1.7vw;
}

.about-icon {
  width: 4.2vw;
}

#wrap-lang-list {
  height: 7vw;
}

#about-lang-list {
  padding: 1.1vw 1.5vw;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-evenly;
  margin: 0;
}

.about-grid-item-title {
  color: var(--title);
  margin-bottom: 0;
  font-size: 2vw;
}

.about-lang-item {
  text-align: center;
  padding: 4%;
  border-radius: 8px;
  background-color: var(--background-container);
  color: var(--theme);
  font-size: 0.7vw;
  font-weight: 600;
  margin: 1% 0%;
}

#contact {
  background-image: url(img/final.png);
  background-repeat: no-repeat;
  background-size: contain;
  background-position: bottom;
  height: 35vw;
  justify-content: center;
  display: flex;
  align-items: center;
}

#contact-div {
  background-image: url(img/final.png);
  background-repeat: no-repeat;
  background-size: contain;
  height: 25vw;
  padding: 5vw 20vw;
  display: flex;
  justify-content: center;
}

#invite {
  font-weight: 700;
  font-size: 1.5vw;
  text-align: left;
  line-height: 2.5vw;
  width: 23vw;
}

#contact-center {
  display: flex;
  justify-content: center;
}

#contact-form-div {
  width: 37vw;
}

#survey-form {
  padding: 1vw 0 1vw 1vw;
  display: flex;
  flex-wrap: wrap;
}

.form {
  background: var(--background-container);
  border: 1px solid var(--background-items);
  border-radius: 4px;
  box-sizing: border-box;
  height: 2vw;
  padding: 0.5vw;
  color: var(--title);
}

.name {
  width: 100%;
  margin: 0 2.5% 0.5vw 2.5%;
}

#email {
  width: 100%;
  margin: 0.5vw 2.5%;
}

#comments {
  width: 95%;
  height: 8vw;
  margin: 0.5vw 2.5%;
}

#submit-button {
  justify-content: left;
  margin: 1vw 2.5%;
}

textarea::placeholder {
  font-family: 'Inter', Arial, Helvetica, sans-serif;
}

#icons-footer {
  margin: 0;
}

#email-para {
  display: none;
}

.grid-title {
  font-size: 1vw;
}

@media (max-width: 768px) {
  #main {
    width: 100%;
    background-repeat: no-repeat;
    background-size: 100%;
    background-image: url(img/mobile-background.png);
    background-position-y: 15vw;
    height: 100vh;
  }

  .nav {
    height: 0;
    transition: 0.6s;
    background-color: var(--background-container);
  }

  .nav-active {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    transition: 1s;
    overflow-y: hidden;
  }

  #menu {
    display: flex;
    visibility: hidden;
    padding: 2em 1.5em;
    font-size: 2em;
    flex-flow: column;
    align-items: flex-start;
    height: 0;
  }

  #nav.nav-active #menu {
    visibility: visible;
    overflow-y: hidden;
    transition: 0.6s;
    height: 7em;
  }

  .ham-top,
  .ham-mid,
  .ham-botom {
    width: 24px;
    border-radius: 10px;
    height: 3px;
    position: absolute;
    top: 0;
    left: 0;
    background-color: var(--theme);
    transition: 1s;
  }

  .ham-top {
    top: 0%;
    transform: translateY(-50%);
  }

  .ham-mid {
    top: 6px;
  }

  .ham-botom {
    top: 13px;
    bottom: 0;
  }

  #nav.nav-active #ham-menu #ham-but .ham-top {
    transform: rotate(45deg);
    top: 0;
    transition: 1s;
  }

  #nav.nav-active #ham-menu #ham-but .ham-mid,
  #nav.nav-active #ham-menu #ham-but .ham-botom {
    transform: rotate(-45deg);
    top: 0;
    transition: 1s;
  }

  #menu .menuItem {
    margin: 0.5em 0;
  }

  #intro {
    width: 90%;
    padding-top: 8vh;
    padding-bottom: 11vh;
  }

  #name {
    padding: 0 5vw 0 5vw;
  }

  .main-title {
    font-size: 12vw;
  }

  #description {
    font-size: 5.6vw;
    font-weight: 400;
    line-height: 8vw;
  }

  #ham-menu {
    display: block;
    position: absolute;
    top: 26px;
    right: 24px;
    cursor: pointer;
  }

  .hamburger {
    display: block;
    z-index: 2;
    height: 24px;
    width: 24px;
    position: relative;
    outline: none;
    border: 0;
    background: transparent;
    margin-top: 7px;
  }

  #w-title {
    font-size: 10vw;
    padding: 5vw;
    margin-bottom: 2vw;
    margin-top: 0;
  }

  #works {
    padding: 5vw;
    margin-bottom: 80vw;
  }

  .separator {
    width: 7vw;
    border-radius: 10px;
    height: 0.8vw;
    display: flex;
    background-color: var(--theme);
    margin: 0 auto;
    margin-bottom: 10vw;
  }

  .grid-work {
    display: flex;
    padding: 0;
  }

  .grid-title {
    font-size: 4vw;
    height: 50%;
  }

  .grid-item {
    background-color: var(--background-items);
    border: 1px solid var(--background-items);
    border-radius: 8px;
    margin: 3vw;
    height: 130vw;
    display: flex;
    flex-direction: column-reverse;
    width: 93%;
  }

  .grid-data {
    background-color: var(--background-container);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    padding: 0 0 3vw 0;
  }

  .hero-title {
    text-align: center;
  }

  .lang-list {
    display: flex;
    justify-content: space-between;
    padding: 0;
  }

  .lang-item {
    text-align: center;
    padding: 3vw;
    border-radius: 8px;
    background-color: var(--background-items);
    font-size: 3vw;
    font-weight: 500;
  }

  .grid-button-container {
    margin: 0 1vw 0 1vw;
    display: flex;
    justify-content: center;
  }

  .grid-button {
    background-color: var(--theme);
    color: var(--background-container);
    width: 30vw;
    height: 10vw;
    border-radius: 8px;
    border: none;
    font-size: 3.5vw;
  }

  #about-title {
    font-size: 10vw;
  }

  #about-lang-list {
    justify-content: center;
  }

  .about-me {
    padding: 0 5vw;
    margin: 25vw 0;
    background-image: url(img/about-me-background-mobile.png);
    background-size: cover;
  }

  #about-text {
    font-size: 5.2vw;
    line-height: 8.8vw;
  }

  #resume-button {
    padding: 0.8vw;
  }

  #about-grid {
    grid-template-columns: 100%;
    grid-template-rows: 80vw 80vw 80vw;
    margin-bottom: 10vw;
  }

  #about-grid-data {
    height: 100%;
    width: 100%;
    margin: 0;
    justify-content: center;
  }

  .about-icon {
    width: 30%;
  }

  .about-lang-item {
    padding: 2.7vw 2.9vw;
    font-size: 3vw;
    margin: 1vw;
  }

  .about-grid-item-title {
    font-size: 8vw;
    margin: 2vw 0;
  }

  #contact-center {
    flex-wrap: wrap;
    height: 170vw;
  }

  #contact-div {
    padding: 5vw 10vw;
    background-image: none;
  }

  #invite {
    font-size: 12vw;
    text-align: center;
    line-height: 15vw;
    width: 79%;
  }

  #about {
    margin: 0 0 20vh 0;
    padding-top: 0.5vw;
  }

  #contact {
    background-image: url(img/background-final.png);
    background-size: 20vw;
    background-repeat: no-repeat;
    background-position: bottom right;
    height: 240vw;
    align-items: normal;
  }

  #about-me {
    background-image: url(img/about-me-background-mobile.png);
  }

  #contact-form-div {
    width: 100%;
  }

  .desktop {
    display: none;
  }

  .form {
    width: 100% !important;
    height: 10vw;
    padding: 2vw;
    color: var(--title);
  }

  #survey-form {
    padding: 1vw 0 1vw 1vw;
    justify-content: center;
    display: flex;
    flex-wrap: wrap;
  }

  #comments {
    height: 30vw;
  }

  #submit-button {
    justify-content: center;
    margin: 5vw 2.5%;
  }

  #email-para {
    display: flex;
    justify-content: center;
    font-size: 5vw;
  }

  footer {
    padding-top: 5vw;
  }

  #icons-footer {
    height: 10.5vw;
    padding-bottom: 10vw;
  }

  .icons img {
    padding: 2vw;
    width: 7.5vw;
  }

  /* popup area */

  #popup-but-cont {
    justify-content: space-between;
    height: 100%;
    margin: 0;
  }

  .popup-button {
    height: 7vh;
    padding: 0 5vw;
  }

  #popup-live-link {
    height: 6vh;
    width: 40%;
    font-size: 4vw;
    margin: 0;
  }

  #popup-source-link {
    height: 6vh;
    width: 54%;
    font-size: 4vw;
  }

  .popup-content {
    flex-direction: column;
    width: 80vw;
    padding: 20px;
  }

  #popup-close {
    margin: 5%;
    width: 8%;
    height: 10%;
    background-color: transparent;
  }

  .popup-image {
    order: 1;
  }

  .popup-title {
    margin: 2% 0;
    font-size: 8.5vw;
    order: 2;
  }

  .popup-description {
    font-size: 4vw;
    order: 4;
  }

  .popup-links {
    justify-content: center;
    order: 5;
    width: 100%;
    height: 7vh;
  }

  #popup-technologies {
    margin: 1vw 0 1vw 0;
    order: 3;
  }

  .dt-pop-langitem {
    background-color: var(--bgPop);
  }
}
