:root {
  --animation-duration: 1s;
  --animation-timing-function: cubic-bezier(0.65, -0.19, 0.54, 1.18);
  --color-primary-light: #a7fff5;
  --color-primary: #5effec;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  font-size: 16px;
  letter-spacing: 0.05rem;
  line-height: 1.5;
  color: #111;
}

nav {
  height: 6vh;
  padding: 0 2rem;
  background-color: #181818;
  border-bottom: 1px solid var(--color-primary);
}

nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 2.5rem;
  width: 100%;
  height: 100%;
}

nav a {
  color: inherit;
  text-decoration: none;
  font-weight: bold;
  color: #fff;
}

nav a:hover {
  text-decoration: underline;
  color: var(--color-primary);
}

nav a:focus {
  outline: none;
}

.active {
  color: var(--color-primary);
}

main {
  height: calc(100vh - 6vh);
  background-color: #222;
  overflow: hidden;
  position: relative;
}

.slide {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  visibility: hidden;
  width: clamp(1rem, 90vw, 50rem);
  height: 80vh;
  overflow-y: auto;
  background-color: var(--color-primary-light);
  border-radius: 0.5rem;
  padding: 2rem;
}

.slide:first-child {
  background-color: #fff !important;
}

.slide-active {
  visibility: visible;
  animation: slideIn calc(var(--animation-duration) * 1.1)
    var(--animation-timing-function) forwards;
}

@keyframes slideIn {
  from {
    transform: translate(100vw, -50%);
  }

  to {
    transform: translate(-50%, -50%);
  }
}

.slide-inactive {
  visibility: visible;
  animation: slideOut var(--animation-duration) var(--animation-timing-function)
    forwards;
}

.slide-inactive-up {
  visibility: visible;
  animation: slideOutUp var(--animation-duration)
    var(--animation-timing-function) forwards;
}

@keyframes slideOut {
  from {
    transform: translate(-50%, -50%);
  }

  to {
    transform: translate(-50%, 100vh);
  }
}

@keyframes slideOutUp {
  from {
    transform: translate(-50%, -50%);
  }

  to {
    transform: translate(-50%, calc(-100vh - 50%));
  }
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
}

h1 span {
  display: block;
  font-size: 1.8rem;
}

#inicio {
  display: grid;
  grid-template-columns: 1fr 1fr;
  place-items: center;
  gap: 1rem;
}

.slide p {
  margin-top: 1rem;
  font-size: 1.2rem;
}

#inicio img {
  width: 100%;
  aspect-ratio: 1;
  max-width: 70vw;
  border-radius: 50%;
  object-fit: cover;
}

.icons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  padding: 0.3rem;
  font-weight: bold;
  text-decoration: none;
  transition: transform 0.2s var(--animation-timing-function);
}

.icons a:active {
  transform: translateY(0.1rem);
}

.icons svg {
  width: 2rem;
  height: 2rem;
}

#inicio .icons {
  margin-top: 1rem;
}

#inicio a {
  color: #111;
}

#inicio a:hover {
  background-color: #fff;
}

#sobre-mi .icons {
  margin-top: 1.5rem;
}

#sobre-mi svg {
  height: 2.5rem;
  width: 2.5rem;
}

#proyectos a {
  color: #fff;
}

#proyectos a:hover {
  background-color: #111;
}

#proyectos svg {
  width: 3rem;
  height: 3rem;
}

.proyecto {
  text-align: center;
  max-width: 30rem;
  margin: 0 auto;
  position: relative;
  margin-top: 1rem;
  border-radius: 0.5rem;
  overflow: hidden;
}

.proyecto img {
  width: 100%;
  object-fit: cover;
}

.proyecto:hover .content {
  opacity: 1;
}

.content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;

  background-color: rgba(0, 0, 0, 0.6);
  color: #fff;
  opacity: 0;
  transition: opacity 0.3s;
}

@media screen and (max-width: 820px) {
  #inicio {
    display: flex;
    flex-direction: column;
  }

  #inicio .icons {
    justify-content: center;
  }
}

@media screen and (max-width: 400px) {
  #proyectos svg {
    width: 2rem;
    height: 2rem;
  }
}

@media screen and (pointer: fine) {
  .slide {
    scrollbar-width: 0.3rem;
    scrollbar-color: #999 transparent;
  }

  .slide::-webkit-scrollbar-thumb {
    background-color: #999;
    border: 4px solid transparent;
    border-radius: 0.5rem;
    background-clip: padding-box;
  }

  .slide::-webkit-scrollbar {
    width: 0.8rem;
  }
}