@import url(reset.css);

:root {
  --bg-clr: rgb(250, 250, 250);
  --txt-clr: rgb(43, 43, 43);
  --main-clr: rgb(120, 203, 255);

  --btn-link-clr: rgb(45, 45, 45);
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background-color: var(--bg-clr);

  &::before {
    content: '';
    height: 50dvh;
    width: 100%;
    background-color: var(--main-clr);
    position: absolute;
    top: 0;
    z-index: 1;
  }
}

h2 {
  text-align: center;
  font-size: clamp(2rem, 2vw, 4rem);
  margin-bottom: 2rem;
  position: relative;
  color: var(--txt-clr);

  &::before {
    content: '';
    position: absolute;
    bottom: 0;
    background-color: var(--txt-clr);
    width: 0;
    height: 5px;
    transition: 0.3s ease;
  }
}

p,
address {
  font-size: clamp(1rem, 1.3vw, 2rem);
}

a {
  text-decoration: none;
  color: var(--btn-link-clr);
  transition: 0.2s ease-in-out;
  padding: 3px;

  &:hover {
    transform: scale(1.2);
  }
}

/* Main section */

main {
  padding-block: 6rem;
  background-color: var(--bg-clr);

  img {
    height: auto;
    max-width: 15rem;
    border-radius: 10px;
  }

  .wrapper {
    z-index: 2;
    position: relative;
  }

  h1 {
    position: absolute;
    bottom: 0;
    width: 100%;
    text-align: center;
    color: var(--bg-clr);
    font-size: 3rem;
  }

  .main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    z-index: 2;

    &:hover h2::before {
      width: 100%;
    }
  }

  .main-text {
    background-color: var(--bg-clr);
    padding: 0 1rem;
    font-size: 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    max-width: 50rem;
  }

  .main-btn-links {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 1rem;
  }

  a {
    font-size: 1.5rem;
  }
}

/* My Work section*/

.my-work {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-block: 6rem;
  padding-inline: 1rem;

  &:hover h2::before {
    width: 100%;
  }

  .work-cards {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-content: center;
    justify-content: center;
    gap: 2rem;
    width: 100%;
    margin: 0 auto;
  }

  .project-card {
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(109, 109, 109, 0.177);
    max-width: 22rem;
    border-radius: 15px;
    overflow: hidden;
    transition: 0.3s ease-in-out;
    box-shadow: 10px 10px 20px -13px rgba(0, 0, 0, 0.49);
    -webkit-box-shadow: 10px 10px 20px -13px rgba(0, 0, 0, 0.49);
    -moz-box-shadow: 10px 10px 20px -13px rgba(0, 0, 0, 0.49);

    &:hover {
      transform: translateY(-6px);

      p {
        opacity: 1;
      }
    }

    p {
      transition: 0.3s opacity ease-in-out;
      opacity: 0.7;
    }

    .screenshot {
      background-color: var(--main-clr);
      padding: 4rem 0;
      font-size: 3rem;
      text-align: center;
      line-height: 1;
    }

    .card-description {
      padding: 1.2rem 1.5rem;
      background-color: var(--bg-clr);
      height: 100%;
    }

    .card-header {
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 0.7rem;
    }

    .card-btn {
      display: flex;
      gap: 1rem;
      align-items: center;
      justify-content: center;
      a {
        font-size: 1.3rem;
      }
    }
  }
}

/* Contact section */

footer {
  background-color: var(--main-clr);

  &:hover h2::before {
    width: 100%;
  }

  h2 {
    margin-bottom: 0;
  }

  img {
    height: auto;
    width: 100%;
  }
}

.footer-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 1rem;
  padding: 1rem;
}

.btn-links {
  display: flex;
  align-self: center;
  gap: 1.2rem;
  font-size: 2rem;
}

/* Tablet Desktop breakpoint */

@media (min-width: 768px) {
  main {
    .main-content {
      position: relative;
      display: flex;
      flex-direction: row;
      align-items: center;
      justify-content: center;
      margin: 3rem;
      gap: 0;
    }

    .main-text {
      border-radius: 0px 10px 10px 0px;
    }

    img {
      max-width: 20rem;
    }

    .main-text {
      padding: 1rem 2rem;
      box-shadow: 10px 10px 20px -13px rgba(0, 0, 0, 0.49);
      -webkit-box-shadow: 10px 10px 20px -13px rgba(0, 0, 0, 0.49);
      -moz-box-shadow: 10px 10px 20px -13px rgba(0, 0, 0, 0.49);
    }

    .main-btn-links {
      align-self: flex-end;
    }
  }

  footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem 4rem;

    .footer-text {
      align-items: baseline;
    }

    .btn-links {
      align-self: flex-start;
    }

    img {
      max-width: 24rem;
      border-radius: 10px;
    }
  }
}
