html {
  scroll-behavior: smooth;
}

:root {
  --primary: #172b4d;
  --h-color: #3a4a42;
  --secondary: #36b37e;
  --secondary-btn: #36b37f;
  --weight: bold;
  --background: #ebf0ee;
}

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

.flex-center {
  align-items: center;
  display: flex;
  justify-content: center;
}

.flex-column {
  flex-direction: column;
}

.flex-row {
  flex-direction: row;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-nowrap {
  flex-wrap: nowrap;
}

.flex-wrap-reverse {
  flex-wrap: wrap-reverse;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.align-start {
  align-items: flex-start;
}

.align-center {
  align-items: center;
}

.align-end {
  align-items: flex-end;
}

.justify-start {
  justify-content: flex-start;
}

.justify-end {
  justify-content: flex-end;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-around {
  justify-content: space-around;
}

.h2-size {
  color: var(--primary);
  font-size: 40px;
  font-weight: var(--weight);
  line-height: 52px;
  text-align: center;
}

.logo {
  text-decoration: none;
  font-size: 1.6rem;
  color: #28352f;
}

.d-flex {
  display: flex;
}

.mobile-invisible {
  display: block;
}

.desktop-invisible {
  display: none;
}

body {
  width: 100%;
  min-height: 100vh;
  font-family: 'Inter', sans-serif;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

header {
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 14px;
}

header h2 {
  position: relative;
  animation: crane-float 2s alternate 5 ease-in-out both;
}

@keyframes crane-float {
  0% {
    transform: translateY(0);
  }

  100% {
    transform: translateY(-10px);
  }
}

nav .nav-menu {
  visibility: hidden;
  transform: translateY(-100%);
}

.btns-popup a {
  text-decoration: none;
}

nav .nav-menu.open,
nav .nav-menu.hide {
  visibility: visible;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  transition: all 1s ease-in-out;
  transform: translateY(0%);
  width: 100%;
  height: 100%;
  padding-left: 28px;
  padding-top: 62px;
  background-color: #fff;
}

nav .nav-menu.hide {
  visibility: hidden;
  transform: translateY(-100%);
}

nav .nav-menu.open .nav-link,
nav .nav-menu.hide .nav-link {
  font-size: 32px;
  line-height: 44px;
  font-weight: 600;
  margin: 12px;
}

nav .nav-menu.open .nav-link a,
nav .nav-menu.hide .nav-link a {
  text-decoration: none;
  color: var(--h-color);
}

nav .show-menu-btn {
  width: 30px;
  height: 30px;
  font-weight: var(--weight);
}

nav .closed-menu-btn {
  display: none;
  position: fixed;
  top: 38px;
  right: 38px;
  z-index: 2;
}

main {
  width: 100%;
}

ul {
  list-style: none;
}

.main-section {
  background-image: url("../image/header-illsutration-mobile@3x.png");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center top;
  width: 100%;
  margin: 0 auto;
  text-align: center;
  padding: 0 24px 0;
}

.main-section-title {
  padding-top: 54px;
  animation: top-bottom 1s ease-in-out;
}

@keyframes top-bottom {
  0% {
    transform: translateY(-50%);
  }

  100% {
    transform: translateY(0);
  }
}

.main-section-title h2 {
  color: var(--secondary);
}

.main-section p {
  max-width: 90%;
  margin: 50px auto 52px;
  color: var(--primary);
  font-size: 20px;
  line-height: 28px;
  animation: left-right 1s ease-in-out;
}

@keyframes left-right {
  0% {
    transform: translateX(-30%);
  }

  100% {
    transform: translateX(0);
  }
}

.social-media-icons li a img {
  padding: 0 20px;
  margin: 5px 0;
  transition: all 0.3s ease-in-out;
}

.card-container .card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.social-media-icons li a img:hover {
  transform: scale(1.4);
}

.works-section {
  text-align: center;
  flex-flow: column nowrap;
}

.woks-section-title h2 {
  max-width: 70%;
  margin: 0 auto;
  padding: 0 24px;
}

.works-section-title h2::after {
  content: " ";
  display: block;
  max-width: 48px;
  height: 4px;
  margin: 24px auto 62px;
  background-color: var(--secondary);
}

.frames ul {
  width: 100%;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  text-align: center;
}

.card-item-technologies li {
  list-style: none;
  background-color: #ebf0ee;
  font-size: 0.75rem;
  padding: 0.6rem;
  border-radius: 0.3rem;
  margin-right: 0.5rem;
  margin-top: 0.5rem;
}

.frames .languages li {
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  letter-spacing: 0.03em;
  padding: 12px;
  margin: 3px 5px;
  color: var(--secondary);
  background: #fff;
  border-radius: 8px;
}

button:hover {
  background-color: var(--secondary-btn);
  cursor: pointer;
  box-shadow: 10px 8px 16px rgba(54, 179, 127, 0.24);
  transform: scale(0.9);
}

button:active {
  background-color: #008552;
}

.about-section {
  background: url("../image/illustration2-about-me-mobile.svg") left 22% no-repeat, url("../image/illustration1-about-me-mobile.svg")  right 2%  no-repeat;
  background-size: 18%;
  padding-bottom: 60px;
}

.about-section .about {
  flex-direction: column;
  text-align: center;
  width: 100%;
  padding: calc(68px + 15px) 24px 15px;
}

.about h2 {
  margin: 0 auto;
  padding-bottom: 24px;
}

.about p {
  width: 90%;
  font-size: 20px;
  line-height: 32px;
  letter-spacing: 0.4px;
  font-weight: 400;
  color: #42526e;
  padding-bottom: 24px;
}

.about button,
.contact-form button {
  height: 48px;
  width: 159px;
  font-size: 17px;
  line-height: 24px;
  font-weight: 500;
  color: #fff;
  border: none;
  border-radius: 4px;
  background-color: var(--secondary-btn);
  letter-spacing: 0.03em;
  padding: 12px;
  margin-bottom: 10px;
  transition: all 0.4s ease 0.2s;
}

.contact-form button {
  margin-top: 7px;
  transition: all 0.4s ease 0.2s;
}

.about button:active {
  background-color: #36b37e;
}

.frame-wrapper {
  width: 100%;
  margin-top: 39px;
  display: grid;
  grid-gap: 24px;
  grid-template-columns: repeat(1, 1fr);
  grid-auto-rows: calc(352px + 20px);
  padding: 0 10px;
  text-align: center;
}

.frame-wrapper .frames {
  width: 327px;
  height: 352px;
  margin: 0 auto;
  border: 1px solid #c1c7d0;
  border-radius: 8px;
  justify-self: center;
  flex-direction: column;
  background: var(--background);
  transition: all 0.4s ease;
}

.frame-wrapper .frames:hover {
  transform: scale(1.05);
}

.frame-wrapper .tools-img {
  width: 140px;
  min-height: 140px;
}

.frames h3 {
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: #344563;
  margin-bottom: 24px;
}

/* Small devices (portrait tablets and large phones, 600px and up) */

@media screen and (min-width: 600px) {
  .main-section-title h1,
  .main-section-title h2 {
    font-weight: 800;
    letter-spacing: 0.4px;
  }

  .main-section p {
    max-width: 900px;
    letter-spacing: 0.6px;
  }

  .frame-wrapper .frames {
    width: 369px;
  }

  .frame-wrapper {
    padding: 0 24px;
  }
}

/* Medium devices (landscape tablets, 768px and up) */

@media screen and (min-width: 768px) {
  header {
    position: fixed;
    left: 0;
    right: 0;
    justify-content: center;
    background-color: #fff;
    z-index: 1;
  }

  header h2,
  nav .show-menu-btn {
    display: none;
  }

  nav .nav-menu {
    display: flex;
    justify-self: center;
    visibility: visible;
    transform: translateY(0%);
  }

  .nav-menu .nav-link a {
    display: flex;
    justify-self: center;
    padding: 5px 15px;
    margin: 3px;
    font-size: 16px;
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.5s ease-in-out;
  }

  .nav-menu .nav-link:first-child a {
    color: #172b4d;
  }

  .nav-menu .nav-link a:hover {
    color: #60c095;
    background-color: #0c6d45;
  }

  main {
    position: relative;
    padding-bottom: 58px;
  }

  .main-section {
    margin-top: 42px;
    background-image: none;
    background-image: url("../image/Header-llustration-desktop@2x.png");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
  }

  .main-section-title {
    padding-top: 170px;
  }

  .main-section p {
    width: 70%;
    margin: 24px auto 44px;
  }

  .social-media-icons li a img {
    padding: 0 20px;
  }

  .works-section-title h2 {
    padding: 80px 0 32px;
  }

  .works-section-title h2::after {
    display: none;
  }

  .scroll-down-icon {
    margin: 64px 0 245px;
  }

  .frame-wrapper {
    width: calc(654px + 24px + 20px);
    padding: 10px 10px;
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 24px;
    grid-auto-rows: calc(500px - 5px);
    margin: 0 auto;
    text-align: center;
  }

  .frame-wrapper .frames {
    width: 327px;
    height: 472px;
    align-self: center;
    justify-self: center;
  }

  .frame-wrapper .frames:last-child {
    grid-column: 1/span 2;
  }

  .about p {
    width: calc(654px - 24px);
  }

  .about-section {
    background-image: none;
    background-image: url("../image/illustration-about-me-1-desktop@2x.png"), url("../image/illustration-about-me-2-desktop@2x.svg");
    background-position: right 3%, left 18%;
    background-size: 16%;
    background-repeat: no-repeat;
    padding-bottom: 164px;
  }

  .form-sub-container {
    width: calc(654px + 24px);
    padding-top: 28px;
  }
}

section.contact-form {
  flex-direction: column;
  justify-content: space-around;
  text-align: center;
  background-image: url("../image/illustration-contact-form.svg");
  background-repeat: no-repeat;
  background-size: 10%;
  background-position: right 98%;
  margin: 9px;
}

form {
  width: 100%;
  text-align: center;
}

.form-sub-container {
  min-width: 307px;
  width: 100%;
}

.contact-form h2 {
  width: 100%;
  padding: 0 0 58px;
}

.contact-form input {
  margin: 10px;
  border: 1px solid #d0d9d4;
  border-radius: 4px;
  padding: 15px 10px;
  width: 95%;
  font-size: 16px;
}

.contact-form textarea {
  margin: 10px;
  margin-bottom: 24px;
  border-radius: 4px;
  padding: 12px;
  width: 95%;
  font-size: 16px;
  font-family: 'Inter', sans-serif;
}

input:focus,
textarea:focus {
  border: none;
  border: 1.3px solid #60c095;
  outline: none;
}

input:hover::placeholder,
textarea:hover::placeholder {
  transition: 0.5s;
  transform: translateX(5px);
}

.btn-submit-alert {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Large devices (laptops/desktops, 992px and up) */

@media screen and (min-width: 992px) {
  .mobile-invisible {
    display: none;
  }

  .desktop-invisible {
    display: block;
  }

  .frame-wrapper {
    width: calc(738px + 24px + 20px);
  }

  .frame-wrapper .frames {
    width: 369px;
    max-height: 474px;
  }

  .about-section {
    background-image: none;
    background-image: url("../image/illustration-about-me-1-desktop@2x.png"), url("../image/illustration-about-me-2-desktop@2x.png");
    background-position: right 3%, left 17%;
    background-size: 15%;
    background-repeat: no-repeat;
    padding-bottom: 164px;
  }

  .about-section .about {
    width: calc(738px + 24px);
    margin: 0 auto;
    padding-top: calc(68px + 15px);
    padding-bottom: 52px;
  }

  .about p {
    width: 100%;
  }

  section.contact-form {
    width: 100%;
    background-image: none;
    background-image:
      url("../image/illustration-1-contact-form-desktop.png"),
      url("../image/illustration-2-contact-form-desktop.svg"),
      url("../image/contact-form-illustratoin-3-desktop.svg");
    background-position: left bottom, 30% bottom, right bottom;
    background-size: 12%;
    background-repeat: no-repeat;
  }

  .form-sub-container {
    width: calc(450px + 24px);
    flex-direction: column;
    justify-content: space-around;
    align-items: flex-start;
    text-align: left;
    height: 390px;
    padding: 0;
    margin-left: 0;
  }

  .contact-form h2 {
    width: 663px;
    font-size: 30px;
    line-height: 50px;
    align-items: center;
    font-weight: bold;
    text-align: left;
  }

  .btn-submit-alert {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  form {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0;
    justify-content: center;
    width: 80%;
  }
}

/* Extra large devices (large laptops and desktops, 1200px and up) */

@media screen and (min-width: 1100px) {
  .frame-wrapper {
    width: calc(981px + 48px + 20px);
    margin: 0 auto;
    grid-template-columns: repeat(3, 1fr);
    text-align: center;
  }

  .frame-wrapper .frames {
    width: 327px;
    margin: 0 auto;
  }

  .frame-wrapper .frames:last-child {
    grid-column: 3/span 1;
  }

  .form-sub-container {
    width: calc(981px + 48px);
  }
}

.card-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  flex-direction: column;
}

.card-container {
  display: grid;
  width: 327px;
  grid-template-columns: repeat(1, 1fr);
  grid-gap: 1.5rem;
  overflow: hidden;
  padding: 0;
  min-height: 30rem;
}

.card-wrapper .card-item {
  flex-direction: column;
  border: 1px solid #d0d9d4;
  border-radius: 0.5rem;
}

.card-container .card-image {
  width: 100%;
  height: 15rem;
  overflow: hidden;
}

.card-container .card-details {
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 15rem;
}

.card-container .card-details .card-title {
  padding: 1rem;
}

.card-container .card-details .card-title h2 {
  margin: 0;
  color: #3a4a42;
}

.card-item-technologies {
  padding: 0;
  display: flex;
  padding-top: 0;
  justify-content: center;
  flex-wrap: wrap;
}

.card-btn-container {
  margin-bottom: 1rem;
}

.card-btn-container .card-btn {
  background-color: #36b37f;
  border: none;
  color: #fff;
  font-size: 0.9rem;
  padding: 0.8rem;
  border-radius: 0.3rem;
}

@media (min-width: 768px) {
  .card-container {
    width: 700px;
    padding: 10px 15px;
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .card-container {
    width: 700px;
    padding: 10px 10px;
    margin: 0 auto;
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .card-container {
    width: 98%;
    max-width: 999px;
    padding: 10px 4px;
    margin: 0 auto;
    grid-template-columns: repeat(3, 1fr);
  }
}
