*, *:befor, *after{
  box-sizing: border-box;
}

:root{
  --main-red: #be3144;
  --main-black: #000000;
  --main-dark: #444;
  --main-white: white;
  --main-blue: #45567d;
  --main-blue_1: #31436d;
  --main-blue_2: #3e4f75;
  --main-blue_3: #6481c0;
  --main-grey: #323d49;
  --main-grey_2: #d2d3d4;
}

body, body *{
  margin: 0;
  padding: 0;
  font-family: Helvetica, sans-serif;
}
  
header{
  position: fixed;
  top: 0;
  left: 0;
  z-index: 99;
  width: 100%;
}

#navbar{
  height: 10vh;
  background-color: var(--main-red);
}

#navbar ul{
  display: flex;
  gap: 4rem;
  height: 100%;
  margin-right: 4rem;
  align-items: center;
  justify-content: end;
  list-style-type: none;
}

#navbar a{
  color: var(--main-white);
  text-decoration: none;
  font-size: 1.5rem;
}

#welcome-section{
  display: flex;
  min-height: 100vh;
  align-items: center;
  flex-direction: row;
  justify-content: center;
  backGround-color: var(--main-dark);

  & > div{
    width: 60%;

    & > p{
      line-height: 1.7em;
      color: var(--main-grey_2);

      & > span{
        font-size: 1.5rem;
        font-style: italic;
        text-align: center;
        color: var(--main-red);
        backGround-color: var(--main-dark);
      }
    }
  }

  & h1{
    color: var(--main-white);
    font-size: 3.5rem;
    margin-bottom: 2rem;
  }

  & figure {
    height: auto;
    display: flex;
    margin: 0 2rem;
    flex-direction: column;
    align-items: center;

    & img{
      height: 250px;
      width: 250px;
      border-radius: 50%;
    }
  }
}

#projects{
  padding-bottom: 30px;
  background-color: var(--main-blue);
}

#skills{
  padding-bottom: 30px;
  background-color: var(--main-blue_1);
}

.project-tile{
  display: block;
  height: 55vh;
  margin-bottom: 7rem;
  text-decoration: none;

  & > figure > div{
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  &:hover{
    & img{
      height: auto;
      /*object-fit: contain;*/
    }

    & .linkProject{
      display: flex;
    }
  }
}

ul > li > a{
  text-decoration: none;
  color: var(--main-grey_2);
}

.linkProject{
  flex: 1;
  row-gap: 5px;
  display: none;
  flex-wrap: wrap;
  column-gap: 50px;
  padding: 10px 5px;
  align-items: center;
  flex-direction: row;
  list-style-type: none;
  justify-content: center;
  background-color: var(--main-grey);
  border-top: 1px solid var(--main-black);

  & > li{
    padding: 5px 10px;
    border-radius: 5px;
    border: 1px solid var(--main-grey_2);

    &:hover{
      background-color: var(--main-red);
      border-color: var(--main-grey_2);
    }
  }

  & > li > a{
    display: flex;
    font-weight: bold;
    align-items: center;
    justify-content: center;
    color: var(--main-grey_2);
  }
}

#projects h1, #skills h1{
  border-bottom: 2px solid var(--main-white);
  color: var(--main-white);
  font-size: 2.5rem;
  text-align: center;
  padding-top: 5rem;
  padding-bottom: 2px;
  width: fit-content;
  margin: 0 auto 5rem auto;
}

.skills{
  padding: 0px 5vw;
  padding-bottom: 50px;

  & > div{
    display: flex;
    padding: 10px 0;
    align-items: center;

    & > h2{
      width: 300px;
      color: var(--main-grey_2);
    }

    & > ul{
      display: flex;
      column-gap: 8vw;
      row-gap: 3vw;
      align-items: center;
      flex-wrap: wrap;
      list-style-type: none;
      justify-content: center;

      & > li{
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        height: 120px;
        width: 100px;
        border-radius: 15px;
        color: var(--main-grey_2);
        
        background-color: var(--main-blue_2);

        & span:first-of-type{
          margin-bottom: 8px;
        }

        &:hover{
          background-color: var(--main-blue_3);
        }
      }
    }
  }
}

.projects-grid{
  display: grid;
  justify-content: space-evenly;
  grid-template-columns: repeat(3, max(350px, 30vw));
}

figure{
  height: 100%;
}

figure img{
  height: 100%;
  overflow: hidden;
  object-fit: cover;
}

.aling_left{
  object-position: left;
}

figcaption{
  display: flex;
  height: 4rem;
  font-weight: bold;
  text-align: center;
  letter-spacing: 0.2rem;
  align-items: center;
  justify-content: center;
  color: var(--main-white);
  background-color: var(--main-grey);
  border: 1px solid var(--main-black);
}

#contact{
  display: flex;
  height: 70vh;
  color: var(--main-white);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--main-grey);
}

#contact h1{
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

#contact p{
  font-style: italic;
  margin-bottom: 5rem;
  font-size: 1.2rem;
}

#contact ul{
  display: flex;
  column-gap: 5rem;
  row-gap: 2rem;
  flex-wrap: wrap;
  list-style-type: none;
  justify-content: center;
}

#contact a{
  font-size: 2rem;
  text-decoration: none;
  color: var(--main-white);
}

#contact li{
  display: flex;
  align-items: center;
  transition: transform 0.4s ease-out;

  & > a{
    display: flex;
    align-items: center;
  }
}

.iconSpace{
  margin-right: 0.5rem;
}

#contact li:hover{
  transform: translateY(10px);
}

@media (max-width: 1100px){
  .projects-grid{
    grid-template-columns: repeat(2, max(400px, 30vw));
  }

  .project-tile{
    & img{
      height: auto;
      /*object-fit: contain;*/
    }

    & .linkProject{
      display: flex;
    }
  }

  #welcome-section{
    padding-top: 90px;
    flex-direction: column;
     
    & > div{
      width: 90%;
      padding-bottom: 40px;

      & > h1{
        text-align: center;
      }
    }
  }

  .skills > div{
    & > h2{
      width: 250px;
    }

    & > ul{
      column-gap: 4vw;
    }
  }
}

@media (max-width: 850px){
  #navbar ul{
    gap: 2rem;
    margin-right: 0;
    justify-content: center;
  }
  
  #navbar a{
    font-size: 1rem;
  }

  .projects-grid{
    grid-template-columns: max(400px, 90vw);
  }

  .skills{
    padding-bottom: 0;

    & > div{
      flex-direction: column;
      padding-bottom: 30px;
      text-align: center;

      & > h2{
        padding-bottom: 20px;
      }
    }
  }

  #contact{
    padding: 30px 20px;
    
    & > h1{
      font-size: 2rem;
    }
  }
}

@media (max-width: 410px){
  #navbar ul{
    gap: 1rem;
  }

  .projects-grid{
    grid-template-columns: max(300px, 100vw);
  }
}