/* General reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  margin: 0;
  padding: 0;
}
body {
  line-height: 1.5;
}
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}
input,
button,
textarea,
select {
  font: inherit;
}
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* CSS Variables */

:root {
  --paynes-gray: #5e747f;
  --oxford-blue: #000022;
  --buff: #cea07e;
  --peach-yellow: #edd9a3;
  --penn-red: #92140c;
  --jet: #2c302e;
  --outer-space: #474a48;
  --battleship-gray: #909590;
  --tomato: #fc5130ff;
  --paynes-gray: #366576;
  --prussian-blue: #092b40ff;
  --bright-pink-crayola: #ff5964;
  --white: #ffffff;
  --lapis-lazuli: #38618c;
  --argentinian-blue: #35a7ff;
}

/* Global styles */
html {
  font-size: 62.5%; /* 1rem = 10px */
}

body {
  font-family: "Lato", system-ui;
  font-size: 1.6rem;
  line-height: 1.5;
  color: var(--prussian-blue);
  min-height: 100vh;
}

/* Container */

.page {
  display: flex;
  flex-direction: column;
  background-color: white;
}

/* Header */

.header {
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  background: var(--bright-pink-crayola);
  color: var(--prussian-blue);
  border-bottom: 1px solid var(--prussian-blue);
}

.header__logo-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  align-self: stretch;
  width: 50px;
}
.header__logo-link {
  font-size: 3.2rem;
  padding-left: 4.8rem;
  color: var(--prussian-blue);
}
.header__logo-link:hover {
  transform: translateY(2px) scale(1.1);
}

/* Navigation */

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-left: auto;
  padding: 1rem;
}
.navbar__toggle {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  padding: 1rem;
}

.navbar__icon {
  width: 32px;
  height: 4px;
  background-color: var(--prussian-blue);
  margin: 3px 0;
  transition: all 0.3s ease-in-out;
}

.active .navbar__icon:nth-child(2) {
  opacity: 0;
}
.active .navbar__icon:nth-child(1) {
  transform: translateY(10px) rotate(45deg)
}
.active .navbar__icon:nth-child(3) {
  transform: translateY(-10px) rotate(-45deg);
}

.navbar__list {
  display: flex; 
  flex-direction: column;
  position: absolute;
  top: 70px; 
  left: 0;
  background-color: var(--bright-pink-crayola); 
  width: 100%;
  transition: all 0.3s ease-in-out;
  opacity: 0;
  visibility: hidden;
}

.navbar__item {
  border-top: 1px solid var(--prussian-blue);
  width: 100%;
}

.navbar__list.show {
  /*display: flex; */
  opacity: 1;
  visibility: visible;
  height: auto;
}

.navbar__link {
  text-decoration: none;
  display: inline-block;
  font-size: 2.4rem;
  text-align: center;
  color: var(--oxford-blue);
  color: var(--prussian-blue);
  padding: 1.2rem;
  width: 100%;
}

.navbar__link:hover {
  background: var(--lapis-lazuli);
}

/* Welcome Section */

.welcome {
  background-color: var(--paynes-gray);
  background: rgb(94, 116, 127);
  background: linear-gradient(
    34deg,
    rgba(94, 116, 127, 1) 0%,
    rgba(19, 87, 112, 0.8029412448573179) 50%,
    rgba(94, 116, 127, 1) 90%
  );
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8rem;
}

.welcome__heading {
  font-size: 6.4rem;
  line-height: 1.2;
}

.welcome__text {
  border-top: 1px solid gray;
  border-top: 1px solid var(--buff);
  font-weight: 200;
  margin: auto -3.2rem;
  text-align: center;
  font-size: 4.8rem;
  line-height: 1.2;
}

.welcome__about {
  margin: 4.8rem auto;
  padding: 4rem;
  width: 80rem;
  font-size: 2.4rem;
  color: #E5E4E2;
  border: 1px solid #E5E4E2;
  text-align: center;
}

/* Projects Section */

.projects {
  background: rgb(206, 160, 126);
  background: rgb(206, 160, 126);
  background: linear-gradient(
    34deg,
    rgba(206, 160, 126, 1) 0%,
    rgba(230, 195, 174, 1) 50%,
    rgba(206, 160, 126, 0.8505602924763656) 100%
  );
  background: linear-gradient(34deg, rgba(206, 160, 126, 1) 8%, rgba(230, 195, 174, 1) 50%, rgba(206, 160, 126, 1) 82%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem;
  
  scroll-margin-top: 60px;
}

.projects__heading {
  font-size: 5rem;
  color: var(--prussian-blue);
  margin-bottom: 3.2rem;
}

.projects__grid {
  width: 80%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.project {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  width: 35rem;
  height: auto;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.project.show {
  opacity: 1;
  transform: scale(1);
}

.project:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}
.project__card {
  display: flex;
  flex-direction: column;
  justify-content: stretch;
}
.porject__image-wrapper {
  flex: 1;
}
.project__image {
  width: 100%;
  height: 25rem;
  display: block;
}
.project__details {
  background-color: var(--prussian-blue);
  color: var(--buff);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex-grow: 1;
}

.project__title {
  text-align: center;
  font-size: 2rem;
  padding: 1rem 0;
  color: var(--tomato);
  font-weight: 300;
  flex: 1;
}

.project__languages {
  display: flex;
  justify-content: space-evenly;
  gap: 0.5rem;
  flex: 1;
}

.project__lang-icon {
  width: 3.2rem;
  height: auto;
}

.project__links {
  display: flex;
  justify-content: space-between;
  gap: 3rem;
  padding: 1rem;
}

.project__link {
  text-decoration: none;
  color: var(--buff);
  background-color: var(--prussian-blue);
  padding: 1rem;
  border-radius: 4px;
  font-size: 2rem;
  transition: background-color 0.3s ease;
  display: block;
  flex: 1;
  text-align: center;
}

.project__link--code {
  margin-right: auto;
}

.project__link--preview {
  margin-left: auto;
}

.project__link:hover {
  background-color: var(--bright-pink-crayola);
  color: var(--oxford-blue);
}

.projects__nav {
  margin: 3.2rem;
  display: flex;
  gap: 2rem;
}

.projects__nav-btn {
  display: block;
  border: none;
  background-color: hsl(198, 20%, 52%, 0.9);
  padding: 1rem 4.2rem;
  font-size: 3.6rem;
  color: var(--prussian-blue);
  cursor: pointer;
  border-radius: 5px;
  transition: all 0.3s ease;
}

.projects__nav-btn:hover {
  transform: scale(1.1);
  background-color: hsl(198, 20%, 42%, 0.9);
  box-shadow: 2px 2px 5px rgb(0, 0 ,0, 0.1);
}

.projects__nav-btn:disabled {
  background-color: #ccc;
  color: #888;
  cursor: not-allowed;
}

/* Contact Section */

.contact {
  height: 40rem;
  background-color: var(--paynes-gray);
  background: rgb(94, 116, 127);
  background: linear-gradient(
    34deg,
    rgba(94, 116, 127, 1) 0%,
    rgba(19, 87, 112, 0.8029412448573179) 50%,
    rgba(94, 116, 127, 1) 98%
  );

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.contact__wrapper {
  width: 50%;
  margin: 0 auto;
  padding: 3.2rem;
  display: flex;
  flex-direction: column;
  text-align: center;
  border: 1px solid var(--buff);
}
.contact__heading {
  color: var(--buff);
  font-size: 3.2rem;
  margin-bottom: 2rem;
}

.contact__list {
  list-style: none;
  display: flex;
  justify-content: space-evenly;
}
.contact__link {
  font-size: 4.8rem;
  color: var(--buff);
  padding: 1rem;
  display: inline-block;
}

.contact__link :hover {
  transform: scale(1.2);
}

.footer {
  height: 80px;
  background-color: var(--outer-space);
  border-top: 7px solid var(--bright-pink-crayola);
  text-align: center;
  padding-top: 2rem;
  color: var(--buff);
  font-size: 2rem;
  font-weight: 300;
}

/* Media Queries */

@media (min-width: 900px) {
  .header__logo-link {
    font-size: 4rem;
  }
.navbar {
  padding: 0;
}
  .navbar__toggle {
    display: none; 
  }

  .navbar__list {
    list-style: none;
    display: flex;
    position: static; 
    flex-direction: row; 
    opacity: 1;
    visibility: visible;

  }

  .navbar__item {
   border: none;
  }

  .navbar__link {
    font-size: 2.8rem;
    padding: 2.4rem;
  }

  .projects {
    scroll-margin-top: 90px;
  }
  .projects__grid {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    width: 100%;
  }

  .projects__heading {
    font-size: 6.4rem;
  }

  .project {
    flex-basis: calc(50% - 20px);
    max-width: 35rem;
  }

  .project__title {
    font-size: 2rem;
  }
}

.contact__heading {
  font-size: 4.8rem;
}

@media (min-width: 1200px) {
  .projects {
    width: 100%;
  }
  .projects__grid {
    width: 90%;

    .project__title {
      font-size: 2.4rem;
    }
  }
  .project {
    flex-basis: calc(33.333% - 20px);
    max-width: 40rem;
  }
}
