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

/* Pause all animations till content is loaded */
.js-loading *,
.js-loading *:before,
.js-loading *:after {
  animation-play-state: paused !important;
}

.loading-image {
  width: 5em;
  margin: auto;
  margin-top: 3em;
}

/* Custom Properties */

:root {
  --ff-primary: "Source Sans Pro", sans-serif;
  --ff-secondary: "Source Code Pro", monospace;

  --fw-reg: 300;
  --fw-bold: 900;

  --clr-light: #fff;
  --clr-dark: #303030;
  --clr-accent: rgb(170, 238, 170);

  --fs-h1: 3rem;
  --fs-h2: 2.25rem;
  --fs-h3: 1.25rem;
  --fs-body: 1rem;

  --bs: 0.25em 0.25em 0.75em rgba(0, 0, 0, 0.25),
    0.125em 0.125em 0.25em rgba(0, 0, 0, 0.15);
}

@media (min-width: 850px) {
  :root {
    --fs-h1: 4.5rem;
    --fs-h2: 3.75rem;
    --fs-h3: 1.5rem;
    --fs-body: 1.125rem;
  }
}

/* General styles */

html {
  scroll-behavior: smooth;
}

body {
  background: var(--clr-light);
  color: var(--clr-dark);
  margin: 0;
  font-family: var(--ff-primary);
  font-size: var(--fs-body);
  line-height: 1.6;
}

section {
  padding: 5em 2em;
}

img {
  display: block;
  max-width: 100%;
}

video {
  display: block;
  max-width: 100%;
}


strong {
  font-weight: var(--fw-bold);
}

:focus {
  outline: 3px solid var(--clr-accent);
  outline-offset: 3px;
}

/* Buttons */

.btn {
  display: inline-block;
  padding: 0.5em 2.5em;
  background: var(--clr-accent);
  color: var(--clr-dark);
  text-decoration: none;
  cursor: pointer;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: var(--fw-bold);
  transition: transform 200ms ease-in-out;
}

.btn:hover {
  transform: scale(1.1);
}

.project-btns-container {
  text-align: center;
}

.btn-right-space {
  margin-right: 2em;
}

.btn-space {
  margin-right: 2em;
}

@media (max-width: 530px) {
  .project-btns-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .btn-space {
    margin-right: 0;
    margin-bottom: 1.5em;
  }
}

@media (max-width: 376px) {
  .btn-right-space {
    margin: 0;
    margin-bottom: 1.5em;
  }

  .services-btns-containter {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
}

/* Typography */

h1,
h2,
h3 {
  line-height: 1;
  margin: 0;
}

h1 {
  font-size: var(--fs-h1);
}
h2 {
  font-size: var(--fs-h2);
}
h3 {
  font-size: var(--fs-h3);
}

.section__title {
  margin-bottom: 0.25em;
}

.animate-pop-in {
  animation: pop-in 0.6s cubic-bezier(0, 0.9, 0.3, 1.2) forwards;
}

.section__title--intro {
  opacity: 0;
  font-weight: var(--fw-reg);
  animation-delay: 0.4s;
}

.section__title--intro strong {
  opacity: 0;
  display: block;
  animation-delay: 0.6s;
}

.section__subtitle {
  margin: 0;
  font-size: var(--fs-h3);
}

.section__subtitle--intro {
  opacity: 0;
  animation-delay: 0.8s;
}

.section__subtitle--intro,
.section__subtitle--about {
  background: var(--clr-accent);
  padding: 0.25em 1em;
  font-family: var(--ff-secondary);
  margin-bottom: 1em;
}

.section__subtitle--work,
.section__subtitle--professional-timeline {
  color: var(--clr-accent);
  font-weight: var(--fw-bold);
  margin-bottom: 2em;
}

/* Header */

header {
  display: flex;
  justify-content: space-between;
  padding: 1em;
}

.logo {
  margin: -8px;
  max-width: 170px;
}

/* Nav and Hamburger Menu */

.nav {
  position: fixed;
  background: var(--clr-dark);
  color: var(--clr-light);
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transform: translateX(100%);
  transition: transform 250ms cubic-bezier(0.5, 0, 0.5, 1);
}

.nav__list {
  list-style: none;
  display: flex;
  height: 100%;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  margin: 0;
  padding: 0;
}

.nav__link {
  color: inherit;
  font-weight: var(--fw-bold);
  font-size: 2em;
  text-decoration: none;
}

.nav__link:hover {
  color: var(--clr-accent);
}

.nav-toggle {
  padding: 0.5em;
  background: transparent;
  border: 0;
  cursor: pointer;
  position: absolute;
  right: 1em;
  top: 1em;
  z-index: 1000;
}

.nav-open .nav {
  transform: translateX(0);
}

.nav-open .nav-toggle {
  position: fixed;
}

.nav-open .hamburger {
  transform: rotate(0.625turn);
}

.nav-open .hamburger::before {
  transform: rotate(90deg) translateX(-6px);
}

.nav-open .hamburger::after {
  opacity: 0;
}

.hamburger {
  display: block;
  position: relative;
}

.hamburger,
.hamburger::before,
.hamburger::after {
  background: var(--clr-accent);
  width: 2em;
  height: 3px;
  border-radius: 1em;
  transition: transform 250ms ease-in-out;
}

.hamburger::before,
.hamburger::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
}

.hamburger::before {
  top: 6px;
}

.hamburger::after {
  bottom: 6px;
}

/*  Intro section  */

.intro {
  position: relative;
}

.intro__img {
  box-shadow: var(--bs);
}

.animate-slide-right {
  opacity: 0;
  animation: slide-right 0.6s cubic-bezier(0, 0.9, 0.3, 1.2) forwards;
}

.title__img {
  animation-delay: 0.6s;
  box-shadow: var(--bs);
}

.section__subtitle--intro {
  display: inline-block;
}

@media (min-width: 655px) {
  .intro {
    display: grid;
    width: min-content;
    margin: 0 auto;
    grid-column-gap: 1em;
    grid-template-areas:
      "img title"
      "img subtitle";
    grid-template-columns: min-content max-content;
  }

  .intro__img,
  .title__img {
    grid-area: img;
    min-width: 250px;
    position: relative;
    z-index: 2;
  }

  .intro__img {
    clip-path: polygon(0 20%, 100% 0, 85% 100%, 10% 85%);
  }

  .section__subtitle--intro {
    align-self: start;
    grid-column: -1 / 1;
    grid-row: 2;
    text-align: right;
    position: relative;
    left: -1.5em;
    width: calc(100% + 1.5em);
  }
}

/*  My Services  */

.my-services {
  background-color: var(--clr-dark);
  background-image: url(../img/others/services-bg.jpg);
  background-size: cover;
  /* background-blend-mode: multiply; */
  color: var(--clr-light);
  text-align: center;
  opacity: 0;
}

.animate-slide-up {
  animation: slide-up 0.5s 0.5s ease-out forwards;
}

@keyframes slide-up {
  0% {
    opacity: 0;
    transform: translateY(5rem);
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

.section__title--services {
  color: var(--clr-accent);
  position: relative;
  /* text-shadow: 0 0 2px rgba(0, 0, 0, 0.6); */
}

.section__title--services::after {
  content: "";
  display: block;
  width: 2em;
  height: 1px;
  margin: 0.5em auto 1em;
  background: var(--clr-light);
  opacity: 0.25;
}

.services {
  margin-bottom: 4em;
}

.animate-scroll-slide-right {
  opacity: 0;
  animation: scroll-slide-right 0.7s 10s cubic-bezier(0, 0.9, 0.3, 1.2) forwards;
}

.is-visible {
  opacity: 1;
  transform: translateX(-10rem);
}

.service {
  max-width: 500px;
  margin: 0 auto;
  text-shadow: 0 0 1px black;
}

.service-1 {
  animation-delay: 0.6s;
}

.service-2 {
  animation-delay: 0.8s;
}

.service-3 {
  animation-delay: 1s;
}

@media (min-width: 800px) {
  .services {
    display: flex;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
  }

  .service + .service {
    margin-left: 2em;
  }
}

/* Professional timeline */

.professional-timeline {
  background-color: var(--clr-dark);
  color: var(--clr-light);
  text-align: center;
}

.professional-timeline__title {
  text-align: center;
}

.professional-timeline__body {
  max-width: 1200px;
  margin: 0 auto;
}

.professional-timeline__item {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  margin-top: 1em;
  border-bottom: 1px solid grey;
  padding-bottom: 1.5em;
}

.professional-timeline__item:last-child {
  border: none;
}

.professional-timeline__year {
  background-color: var(--clr-accent);
  color: var(--clr-dark);
  padding: .5em 1em;
  font-family: var(--ff-secondary);
  margin-right: 2em;
  width: 400px;
}

.professional-timeline__technologies {
  width: 70%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-align: left;
}

.professional-timeline__technologies__subtitle {
  border-bottom: 1px solid var(--clr-light);
}

.professional-timeline__academy-name {
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 1.1em;
}

.repo-link {
  margin-left: 1.5em;
  color: var(--clr-accent);
  text-decoration: none;
}

.repo-link:hover {
  text-decoration: underline;
}

.professional-timeline__org {
  color: var(--clr-accent);
  letter-spacing: 1px;
}

.professional-timeline__org-item {
  margin-left: 1.5em;
}

.professional-timeline__project-link {
  color: white;
  text-decoration: none;
}

.professional-timeline__project-link:hover {
  cursor: pointer;
  color: rgb(197, 194, 194);
}

@media (max-width: 1215px) {
  .professional-timeline__item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: none;
  }

  .professional-timeline__year {
    padding: .5em 1em;
    margin-right: 0;
    width: 90%;
  }
  
  .professional-timeline__technologies {
    width: 90%;
    margin: 0;
  }
}

/* About me */

.about-me {
  max-width: 1000px;
  margin: 0 auto;
}

.about-me__img {
  box-shadow: var(--bs);
}

.link {
  text-decoration: none;
  color: var(--clr-dark);
  border-bottom: 1px solid var(--clr-dark);
}

.link:hover {
  color: black;
  border-bottom: 1px solid black;
}

/* About me animations */
.animate-show-on-scroll {
  opacity: 0;
  transform: translateY(4em) rotateZ(-5deg);
  transition: transform 4s 0.25s cubic-bezier(0, 1, 0.3, 1),
    opacity 0.3s 0.25s ease-out;
  will-change: transform, opacity;
}

.animate-show-on-scroll.is-visible {
  opacity: 1;
  transform: rotateZ(-2deg);
}

@media (min-width: 600px) {
  .about-me {
    display: grid;
    grid-template-columns: 1fr 200px;
    grid-template-areas:
      "title img"
      "subtitle img"
      "text img";
    grid-column-gap: 2em;
  }

  .section__title--about {
    grid-area: title;
  }

  .section__subtitle--about {
    grid-column: 1 / -1;
    grid-row: 2;
    position: relative;
    left: -1em;
    width: calc(100% + 2em);
    padding-left: 1em;
    padding-right: calc(200px + 4em);
  }

  .about-me__img {
    grid-area: img;
    position: relative;
    z-index: 2;
  }
}

/* Angle */

.angle {
  position: relative;
}

.angle:after {
  content: "";
  position: absolute;
}

/* Angle 2 */

.angle2 {
  background-color: var(--clr-dark);
}

.angle2:after {
  background-color: #fff;
  -webkit-clip-path: polygon(0 0, 100% 0, 25% 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

@media (min-width: 900px) {
  .angle2,
  .angle2:after {
    height: 85px;
  }
}

@media (min-width: 600px) {
  .angle2,
  .angle2:after {
    height: 65px;
  }
}

.angle2,
.angle2:after {
  height: 45px;
  width: 100%;
}

/* Angle 4 */

.angle4 {
  background-color: #fff;
}

.angle4:after {
  background-color: var(--clr-dark);
  -webkit-clip-path: polygon(0 0, 100% 0, 100% 70%, 77% 100%, 12% 32%, 0 60%);
  clip-path: polygon(0 0, 100% 0, 100% 70%, 77% 100%, 12% 32%, 0 80%);
}

@media (min-width: 900px) {
  .angle4,
  .angle4:after {
    height: 105px;
  }
}

@media (min-width: 600px) {
  .angle4,
  .angle4:after {
    height: 75px;
  }
}

.angle4,
.angle4:after {
  height: 50px;
  width: 100%;
}

/* My Work */

.my-work {
  background-color: var(--clr-dark);
  color: var(--clr-light);
  text-align: center;
}

.portfolio {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.portfolio__item {
  background: var(--clr-accent);
  overflow: hidden;
}

.portfolio__img {
  transition: transform 750ms cubic-bezier(0.5, 0, 0.5, 1), opacity 250ms linear;
}

.portfolio__item:focus {
  position: relative;
  z-index: 2;
}

.portfolio__img:hover,
.portfolio__item:focus .portfolio__img {
  transform: scale(1.2);
  opacity: 0.5;
}

/* Skills */

.my-skills {
  background-color: #fff;
  margin: auto;
  max-width: 1000px;
}

/* Polygon & angle */
/* @media (max-width: 1000px) {
  .my-skills {
    position: relative;
    z-index: 10;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10vw), 0 100%);
    padding-bottom: 8em;
    margin-bottom: -10vw;
  }

  .hidden {
    display: none;
  }
} */

@media (max-width: 600px) {
  .my-skills {
    padding-bottom: 6em;
  }
}

.section__title--skills {
  color: #111;
  font-weight: var(--fw-bold);
  margin-bottom: 1em;
}

.section__subtitle--skills {
  margin-bottom: 2em;
  font-size: 1em;
}

.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
}

.icon-container {
  margin: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.5em;
}

.icon-container > img {
  width: 3em;
}

.icon-container > span {
  font-size: 1em;
}

@media (max-width: 650px) {
  .skills {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  }

  .icon-container {
    max-width: 2.5em;
  }
}

/* Contact form */

.contact-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8em 0 5em 0;
  background-color: var(--clr-dark);
  color: var(--clr-light);
}

.input-container {
  max-width: 600px;
  width: 80%;
}

input,
textarea {
  width: 100%;
  margin-bottom: 1em;
  padding: 0.5em;
  border: none;
  font-family: inherit;
  /* border-right: 2px solid var(--clr-accent);
  border-bottom: 2px solid var(--clr-accent); */
}

textarea {
  resize: none;
  height: 10em;
}

.form-btn {
  border: none;
  padding: 0.9em 2em;
  font-family: inherit;
  font-size: 0.8rem;
}

.form-btn:hover {
  border: none;
}

/* Footer */

.footer {
  background: #111;
  color: var(--clr-accent);
  text-align: center;
  padding: 2.5em 0;
  font-size: var(--fs-h3);
}

.footer a {
  color: inherit;
  text-decoration: none;
}

.footer__link {
  font-weight: var(--fw-bold);
}

.footer__link:hover,
.social-list__link:hover {
  opacity: 0.7;
}

.footer__link:hover {
  text-decoration: underline;
}

.social-list {
  list-style: none;
  display: flex;
  justify-content: center;
  margin: 2em 0 0;
  padding: 0;
}

.social-list__item {
  margin: 0 0.5em;
}

.social-list__link {
  padding: 0.5em;
}

/* Individual portfolio item styles */

.portfolio-item-individual {
  padding: 0 2em 2em;
  max-width: 1000px;
  margin: 0 auto;
}

.portfolio-item-individual p {
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.portfolio-skills-container {
  margin: auto;
  margin-top: 1.5em;
  max-width: 700px;
}

.portfolio-skills__subtitle {
  font-weight: bold;
  text-align: center;
  margin-bottom: 2em;
}

/* Carousel */

.carousel {
  max-width: 100%;
  position: relative;
}

.carousel .carousel-item,
.carousel .carousel-item-hidden {
  display: none;
}

.carousel .carousel-item-visible {
  display: block;
  animation: fadeVisibility 0.7s;
}

.carousel .carousel-item img video {
  width: 100%;
  /* max-width: 1000px; */
  height: auto;
}

.carousel .carousel-actions {
  display: flex;
  width: 100%;
  justify-content: space-between;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.carousel .carousel-actions button {
  border-radius: 50px;
  background-color: white;
  border: 0;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  width: 40px;
  height: 40px;
}

.carousel .carousel-actions button#carousel-button-prev {
  margin-left: 20px;
}

.carousel .carousel-actions button#carousel-button-next {
  margin-right: 20px;
}

.video-btn__container {
  display: flex;
  justify-content: center;
}

.video-btn {
  margin: .5em .5em 0 .5em;
  border: none;
  background-color: white;
}

.video-btn:hover {
  cursor: pointer;
}

@keyframes fadeVisibility {
  0% {
    opacity: 0;
  }
  50% {
    opacity: 0.8;
  }
  100% {
    opacity: 1;
  }
}

/* Animation for intro image */
@keyframes slide-right {
  0% {
    opacity: 0;
    transform: translateX(-6rem);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

/* Animation for intro title and subtitle */
@keyframes pop-in {
  0% {
    opacity: 0;
    transform: translateY(-4rem) scale(0.8);
  }
  50% {
    opacity: 0.8;
    transform: none;
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

/* Animation for services */
@keyframes scroll-slide-right {
  0% {
    opacity: 0;
    transform: translateX(-10rem);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}
