/*===============
  global styles
===============*/

* {
  padding: 0;
  margin: 0;
  border: 0;
  outline: 0;
  background-color: inherit;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Poppins", sans-serif;
  line-height: 1.5;
  color: var(--clr-fg);
  background-color: var(--clr-bg);
}

.light {
  --clr-bg: #ffffff;
  --clr-bg-alt: #f4f4f4;
  --clr-fg: #262626;
  --clr-fg-alt: #161616;
  --clr-primary: #0f62fe;
}

.dark {
  --clr-bg: #161616;
  --clr-bg-alt: #262626;
  --clr-fg: #f4f4f4;
  --clr-fg-alt: #ffffff;
  --clr-primary: #4589ff;
}

::-moz-selection {
  background: var(--clr-primary);
  color: var(--clr-bg);
}

::-webkit-selection,
::selection {
  background: var(--clr-primary);
  color: var(--clr-bg);
}

h1,
h2,
h3,
h4 {
  line-height: 1.25;
  color: var(--clr-fg-alt);
}

h1 {
  font-size: 4rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.3rem;
}

ul {
  list-style-type: none;
}

a {
  text-decoration: none;
}

button {
  cursor: pointer;
}

@media (max-width: 900px) {
  h1 {
    font-size: 2.6rem;
  }
}

/*===================
  buttons and links
===================*/

.link {
  color: var(--clr-primary);
  padding: 0 0 0.3em 0;
  position: relative;
}

.link:hover {
  color: var(--clr-primary);
}

.link::before {
  content: "";
  display: inline;
  width: 0%;
  height: 0.2em;
  position: absolute;
  bottom: 0;
  background-color: var(--clr-primary);
  transition: width 0.2s ease-in;
}

.link:hover::before,
.link:focus::before {
  width: 100%;
}

.link--nav {
  color: var(--clr-fg);
  font-weight: 500;
}

.link--icon {
  color: var(--clr-fg);
  font-size: 1.2rem;
}

.btn {
  display: block;
  border-radius: 16px;
  padding: 0.8em 1.4em;
  font-weight: 500;
  font-size: 0.9rem;
  transition: transform 0.2s ease-in-out;
}

.btn--outline {
  color: var(--clr-primary);
  border: 2px solid var(--clr-primary);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn--outline:focus,
.btn--outline:hover {
  color: var(--clr-bg);
}

.btn--outline:before {
  content: "";
  position: absolute;
  background-color: var(--clr-primary);
  right: 100%;
  bottom: 0;
  left: 0;
  top: 0;
  z-index: -1;
  transition: right 0.2s ease-in-out;
}

.btn--outline:hover::before,
.btn--outline:focus::before {
  right: 0;
}

.btn--plain {
  text-transform: initial;
  background-color: var(--clr-bg-alt);
  border: 0;
}

.btn--plain:hover {
  transform: translateY(-4px);
}

.btn--icon {
  padding: 0;
  font-size: 1.2rem;
}

.btn--icon:hover,
.btn--icon:focus {
  color: var(--clr-primary);
}

.btn--icon:active {
  transform: translateY(-5px);
}

/*========
  layout
========*/

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

.header {
  height: 8em;
  max-width: 1100px;
  width: 95%;
  margin: 0 auto;
  justify-content: space-between;
}

main {
  max-width: 1100px;
  width: 95%;
  margin: 0 auto;
}

.section {
  margin-top: 5em;
}

.section__title {
  text-align: center;
  margin-bottom: 1em;
  text-transform: uppercase;
}

.nav__list {
  margin-right: 1.5em;
  display: flex;
}

.nav__list-item {
  margin-left: 1.5em;
}

.nav__hamburger {
  display: none;
  width: 1em;
}

.about {
  flex-direction: column;
  margin-top: 3em;
  text-align: center;
}

.about__name {
  color: var(--clr-primary);
  text-align: center;
}

.about__role {
  margin-top: 1.2em;
  text-align: center;
}

.about__desc {
  font-size: 1rem;
  max-width: 600px;
  text-align: center;
}

.about__desc,
.about__contact {
  margin-top: 2.4em;
  margin-left: auto;
  margin-right: auto;
}

.about .link--icon {
  margin-right: 0.8em;
}

.page {
  flex-direction: column;
  margin-top: 3em;
}

.page__title {
  margin-bottom: 0.25em;
  text-align: center;
}

.page__subtitle {
  margin-bottom: 2em;
  text-align: center;
  font-weight: 400;
  max-width: 70%;
}

.page__paragraph {
  margin-bottom: 2em;
  max-width: 70%;
}

.page__info {
  font-size: 0.8rem;
  margin-bottom: 1.5em;
  max-width: 70%;
}

.page__hero {
  display: block;
  margin-bottom: 2em;
  max-width: 100%;
  overflow: hidden;
  border-radius: 16px;
  cursor: pointer;
}

.page__img {
  display: block;
  margin-bottom: 2em;
  max-width: 70%;
  overflow: hidden;
  border-radius: 16px;
  cursor: pointer;
}

.page__imghalf {
  display: block;
  margin-bottom: 2em;
  max-width: 34.25%;
  overflow: hidden;
  border-radius: 16px;
  cursor: pointer;
}

.page__video {
  display: block;
  margin-bottom: 2em;
  max-width: 70%;
  overflow: hidden;
  border-radius: 16px;
  cursor: pointer;
}

/* .about .btn--outline { */
/*   margin-right: 1em; */
/* } */

.projects__grid {
  max-width: 1100px;
  margin: auto;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2em;
}

.project {
  position: relative;
  width: 345px;
  height: 345px;
  margin: auto;
  cursor: pointer;
  overflow: hidden;
  border-radius: 16px;
  transition: transform 0.2s linear;

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

.project:hover img {
  -webkit-filter: brightness(50%);
  transition: 0.2s linear;
}

.project:hover {
  transform: translateY(-7px);
}

.overlay {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100%;
  width: 100%;
  opacity: 0;
  transition: 0.2s ease;
  background-color: rgba(0, 0, 0, 0);
  display: flex;
  justify-content: center;
  align-items: center;

  .title h4 {
    color: white;
    font-size: 1.5rem;
    text-align: center;
  }

}

.project:hover .overlay {
  opacity: 1; /* Visible on hover */
}

.skills__list {
  max-width: 450px;
  width: 95%;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.skills__list-item {
  margin: 0.5em;
}

.contact {
  display: flex;
  flex-direction: column;
  margin-left: auto;
  margin-right: auto;
}

.footer {
  padding: 3em 0;
  margin-top: 4em;
  text-align: center;
}

.footer__link {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--clr-fg);
}

.scroll-top {
  display: none;
  position: fixed;
  bottom: 1em;
  right: 2em;
  background-color: transparent;
  font-size: 1.8rem;
  transition: transform 0.2s ease-in-out;
}

@media (max-width: 600px) {
  .header {
    height: 6em;
    max-width: 90%;
  }

  .section {
    margin-top: 4em;
  }

  .nav__list {
    flex-direction: column;
    padding: 4em 0;
    position: absolute;
    right: 0;
    left: 0;
    top: 5em;
    background-color: var(--clr-bg);
    width: 0;
    overflow: hidden;
    transition: width 0.2s ease-in-out;
  }

  .display-nav-list {
    width: 100%;
  }

  .nav__list-item {
    margin: 0.5em 0;
  }

  .nav__hamburger {
    display: flex;
    margin-left: 0.8em;
  }

  .about {
    align-items: flex-start;
    margin-top: 2em;
    margin: auto;
  }

  .footer {
    padding: 2em;
    margin-top: 3em;
  }

  .scroll-container {
    display: none;
  }

  .page__subtitle {
    max-width: 90%;
  }

  .page__paragraph {
    max-width: 90%;
  }

  .page__info {
    max-width: 90%;
  }

  .page__hero {
    max-width: 90%;
  }

  .page__img {
    max-width: 90%;
  }

  .page__imghalf {
    max-width: 90%;
  }

  .page__video {
    max-width: 90%;
  }
}
