:root {
  --accent: #8c69c6;
  --background: #1f2223;
  --secondary: #181a1b;
  --text: #c7c8c8;
}

/* General */

html,
body {
  background: var(--background);
  margin: 0;
  padding: 0;
  color: var(--text);
  font-family: "Inter", sans-serif;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
  color: var(--text);
  text-decoration: none;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
}

h1.header {
  color: var(--accent, #8c69c6);
  font-family: "Ubuntu Mono", monospace;
  font-size: min(3.5rem, 9vw);
  font-style: normal;
  font-weight: 700;
  line-height: normal;
  width: fit-content;
}

h2.header {
  color: var(--accent, #8c69c6);
  font-family: "Ubuntu Mono", monospace;
  font-size: 2.5rem;
  font-style: normal;
  font-weight: 700;
  line-height: normal;
  width: fit-content;
}

a.button {
  display: flex;
  overflow: hidden;
  padding: 1rem 4rem;
  border-radius: 0.5rem;
  border: 2px solid var(--accent, #8c69c6);
  justify-content: center;
  align-items: center;
  align-self: stretch;

  font-weight: 700;
  transition: background 0.3s ease;
}

a.button.fill {
  background: var(--accent, #8c69c6);
}

a.button:not(.fill):hover {
  background: var(--accent, #8c69c6);
}

a.button.fill:hover {
  background: transparent;
}

/* Progress nav */

nav > .nav-progress {
  --width: 0%;

  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  height: 0.25rem;
  background: var(--accent);
  width: var(--width);
}

nav > .nav-top {
  position: fixed;
  z-index: 100;
  top: 1rem;
  right: 1rem;
  width: 4rem;
  height: 4rem;
  border-radius: 1rem;
  background: var(--accent);
  display: grid;
  place-items: center;
  transition: transform 0.3s ease;
  box-shadow: var(--secondary) 0 0 1rem;
}

nav > .nav-top.hidden {
  transform: translateY(-6rem);
}

nav > .nav-top > img {
  width: 3rem;
}

/* Front section */

main > div.front {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 6rem;
}

main > div.front > div.title {
  display: flex;
  height: 47.5rem;
  overflow: hidden;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 1rem;
  flex-shrink: 0;
}

main > div.front > div.title > p {
  color: var(--text, #c7c8c8);
}

main > div.front > div.title > div.buttons {
  display: flex;
  gap: 1rem;
}

main > div.front > div.image {
  display: flex;
  height: 47.5rem;
  overflow: hidden;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  gap: 1rem;
  flex-shrink: 0;
}

main > div.front > div.image > img {
  width: 40rem;
  height: 40rem;
  overflow: hidden;
  flex-shrink: 0;
}

/* Projects section */

main > div.projects {
  display: flex;
  overflow: hidden;
  padding: 2rem 0rem;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2rem;
}

main > div.projects > div.project {
  width: min(calc(100vw - 2rem), 72rem);
  display: flex;
  overflow: hidden;
  padding: 2rem;
  border-radius: 1rem;
  justify-content: center;
  align-items: center;
  gap: 2rem;
}

main > div.projects > div.project > img {
  width: 32rem;
  border-radius: 1rem;
}

main > div.projects > div.project > div.info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.75rem;
}

main > div.projects > div.project > div.info > h1 {
  color: var(--accent, #8c69c6);
  font-family: "Ubuntu Mono", monospace;
  font-size: 2rem;
}

main > div.projects > div.project > div.info > .made-with {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

main > div.projects > div.project > div.info > .made-with > img {
  width: 1.5rem;
}

main > div.projects > div.project > div.info > .buttons {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Skills section */

main > div.technical-skills {
  position: relative;
  width: 100vw;
  height: 44rem;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  padding: 1rem;
}

main > div.technical-skills .skills {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(auto, 1fr);
  place-items: center;
  gap: 2rem;
}

main > div.technical-skills .skills > .item {
  display: grid;
  grid-template-rows: 6rem 1fr;
  place-items: center;
  gap: 0.5rem;
  transition: transform 0.3s ease;
}

main > div.technical-skills .skills > .item:hover {
  transform: translateY(-0.5rem);
}

main > div.technical-skills .skills > .item > img {
  max-width: 6rem;
  max-height: 6rem;
}

main > div.technical-skills > .background {
  z-index: -1;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: auto;
  background: var(--secondary);
}

main > div.technical-skills > .background > .filler {
  height: 100%;
}

/* Process secion */

main > div.process {
  padding: 4rem max(4rem, calc(calc(100vw - 59rem) / 2));
  display: grid;
  grid-template-columns: repeat(4, 14rem);
  grid-template-rows: repeat(2, 14rem);
  gap: 1rem;
}

main > div.process > .item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem;
  border-radius: 1rem;
}

main > div.process > .item > h1 {
  font-family: "Ubuntu Mono";
}

.span-2 {
  grid-column: span 2;
}

.span-3 {
  grid-column: span 3;
}

/* Footer section */

main > div.footer {
  height: 10rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: 4rem;
}

main > div.footer > .logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--accent, #8c69c6);
}

main > div.footer > .logo > img {
  width: 4rem;
}

main > div.footer > .logo > h1 {
  color: var(--accent, #8c69c6);
  font-family: "Ubuntu mono", monospace;
  font-size: 2.5rem;
  font-weight: 700;
}

main > div.footer > .links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3rem;
}

main > div.footer > .links > a {
  width: 3rem;
  height: 3rem;
}

main > div.footer > .links > a > img {
  width: 100%;
}

/* Effects / media queries */

.type {
  --type-duration: 1.6s;
  --type-delay: 0s;
  --width: 100%;

  margin: 0;
  width: 0;
  white-space: nowrap;
  overflow: hidden;

  animation: type var(--type-duration) linear var(--type-delay) forwards,
    type-blink 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55)
      calc(var(--type-duration) + var(--type-delay)) alternate infinite;
}

@media screen and (max-width: 1415px) {
  main > div.front {
    grid-template-columns: 1fr 10px;
  }

  main > div.front > div.image {
    display: none;
  }
}

@media screen and (max-width: 67rem) {
  main > div.front {
    padding: 1rem;
  }
  main > div.process {
    padding: 4rem max(1rem, calc(calc(100vw - 29rem) / 2));
    grid-template-columns: repeat(2, 14rem);
    grid-template-rows: repeat(3, 14rem);
  }

  main > div.projects > div.project {
    flex-direction: column;
    padding-inline: 0;
  }

  main > div.projects > div.project > img {
    width: min(calc(100vw - 2rem), 32rem);
  }

  main > div.footer {
    padding-inline: 1rem;
  }

  main > div.footer > div.links {
    padding-inline: 1rem;
    gap: 1.75rem;
  }

  .empty {
    display: none !important;
  }

  .span-3 {
    grid-column: span 2;
  }
}

@media screen and (max-width: 763px) {
  main > div.front > div.title > .buttons {
    flex-direction: column;
    width: 100%;
  }

  main > div.technical-skills .skills {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media screen and (max-width: 647px) {
  main > div.technical-skills .skills {
    grid-template-columns: repeat(4, 1fr);
  }

  main > div.footer > div.logo > h1 {
    display: none;
  }
}

@media screen and (max-width: 31rem) {
  main > div.process {
    grid-template-columns: repeat(2, 1fr);
  }

  main > div.projects > div.project > div.info > .buttons {
    flex-direction: column;
  }

  main > div.technical-skills {
    height: 54rem;
  }

  main > div.technical-skills .skills {
    grid-template-columns: repeat(3, 1fr);
  }
}

@keyframes type {
  0% {
    width: 0;
  }

  1%,
  99% {
    border-right: 2px solid var(--accent);
  }

  100% {
    width: var(--width);
    border-right: none;
  }
}

@keyframes type-blink {
  from {
    border-right: 2px solid var(--accent);
  }

  to {
    border-right: 2px solid transparent;
  }
}
