@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@350;400;500&display=swap");

* {
  scroll-behavior: smooth;
}

body {
  font-family: "Open Sans", sans-serif;
  margin: 0;
  scroll-behavior: smooth;
  text-decoration: none;
  background: #eee;
  height: auto;
}

body a {
  opacity: 1;
  transition: 400ms;
}

body a:hover {
  opacity: 0.5;
}

/* Navbar */
#navbar {
  display: flex;
  justify-content: baseline;
  align-items: center;
  text-align: center;
  max-width: 900px;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  height: 44px;
  line-height: 44px;
  width: 100%;
  position: fixed;
  top: 0;
  z-index: 1000;
  overflow: hidden;
}

#navbar a {
  color: #fff;
  float: left;
  text-align: center;
  padding: 0 20px;
  text-decoration: none;
  opacity: 0.8;
  transition: 400ms;
}

#nav-items {
  float: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#navbar a:hover {
  opacity: 1;
}

#nav-logo {
  position: relative;
  margin-right: 1rem;
  margin-left: -16rem;
  vertical-align: -10px;
  width: 8%;
  max-width: 8%;
  height: auto;
}

@media screen and (max-width: 768px) {
  #nav-text,
  #nav-logo {
    display: none;
  }

  #nav-items {
    display: flex;
  }
}

main {
  max-width: 900px;
  box-shadow: 30px 0px 40px rgba(0, 0, 0, 0.1),
    -30px 1px 40px rgba(0, 0, 0, 0.1);
}

#home {
  margin-top: 44px;
  background-color: #eee;
  background-image: url("img/home-img.png");
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
}

#home h2 {
  font-weight: 400;
  font-size: 2rem;
}

#home img {
  width: 100%;
}

#home-text {
  display: flex;
  flex-direction: column;
  height: 50vh;
  justify-content: center;
  align-items: center;
  white-space: nowrap;
}

.stack {
  display: grid;
  grid-template-columns: 1fr;
}

.stack span {
  font-weight: bold;
  grid-row-start: 1;
  grid-column-start: 1;
  font-size: 4rem;
  --stack-height: calc(100% / var(--stacks) - 1px);
  --inverse-index: calc(calc(var(--stacks) - 1) - var(--index));
  --clip-top: calc(var(--stack-height) * var(--index));
  --clip-bottom: calc(var(--stack-height) * var(--inverse-index));
  clip-path: inset(var(--clip-top) 0 var(--clip-bottom) 0);
  animation: stack 340ms cubic-bezier(0.46, 0.29, 0, 1.24) 1 backwards
      calc(var(--index) * 120ms),
    glitch 2s ease infinite 2s alternate-reverse;
}

.stack span:nth-child(odd) {
  --glitch-translate: 8px;
}
.stack span:nth-child(even) {
  --glitch-translate: -8px;
}

@keyframes stack {
  0% {
    opacity: 0;
    transform: translateX(-50%);
    text-shadow: -2px 3px 0 red, 2px -3px 0 blue;
  }
  60% {
    opacity: 0.5;
    transform: translateX(50%);
  }
  80% {
    transform: none;
    opacity: 1;
    text-shadow: 2px -3px 0 red, -2px 3px 0 blue;
  }
  100% {
    text-shadow: none;
  }
}

@keyframes glitch {
  0% {
    text-shadow: -2px 3px 0 red, 2px -3px 0 blue;
    transform: translate(var(--glitch-translate));
  }
  2% {
    text-shadow: 2px -3px 0 red, -2px 3px 0 blue;
  }
  4%,
  100% {
    text-shadow: none;
    transform: none;
  }
}

#container {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2rem;
}

#about-contact a {
  color: black;
}

.contact-container {
  padding: 1rem 0 0 1rem;
}

.btn {
  padding: 0.5rem 2rem;
  border: 1px black solid;
  display: inline-block;
  margin: 2rem 0 0;
  border-radius: 50px;
  text-decoration: none;
  color: #333;
}

#about-text h3 {
  font-size: 1rem;
  font-weight: 500;
}

#projects-gallery {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  height: auto;
  align-items: center;
  text-align: center;
}

.projects-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 300px;
  height: 300px;
  background-color: white;
  border: 1px solid rgba(59, 58, 58, 0.46);
  border-radius: 20px;
  box-shadow: -10px 5px 10px gray;
  top: 0;
  transition: top ease 0.5s;
}

.projects-item:hover {
  top: -10px;
}

.projects-item img {
  height: 10rem;
}

.projects-item a {
  color: black;
  text-decoration: none;
}

#footer {
  text-align: center;
}

#footer a {
  color: black;
  text-decoration: none;
}

.contact-info a {
  text-decoration: underline;
}

@media (min-width: 768px) {
  #navbar {
    max-width: 100vw;
  }

  main {
    max-width: 100vw;
  }

  #home-text {
    height: 100vh;
  }

  #projects-gallery {
    flex-direction: row;
    justify-content: flex-start;
  }
}
