:root {
  /* LAYOUT */
  --max-viewport-desktop-width: 900px;
  --max-width: 900px;
  --tilt-angle: 5rem;
  --tilt-angle-negative: calc(0px - var(--tilt-angle));
  --vertical-padding: 5dvh;

  /* TYPOGRAPHY */
  --ff-primary: "Montserrat", Helvetica, sans-serif;
  --ff-secondary: "Six Caps", sans-serif;

  /* THEME */
  --clr-accent__100: rgba(42, 159, 172, 0.75);
  --clr-accent__500: rgb(42, 159, 172);
  --clr-accent__700: rgba(8, 20, 26, 0.75);
  --clr-accent__900: rgb(41, 90, 95);

  --clr-primary__100: rgba(255, 255, 255, 0.25);
  --clr-primary__400: rgba(46, 49, 65, 0.8);
  --clr-primary__500: #2e3141;
  --clr-primary__800: rgba(255, 255, 255, 0.025);
  --clr-primary__900: #171921;
}

/* RESETS */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  line-height: 1;
}

*::-webkit-scrollbar {
  width: 0.75dvw;
  height: 0.75dvh;
}

*::-webkit-scrollbar-thumb {
  background: var(--clr-accent__500);
  border-radius: 0.5rem;
}

*::-webkit-scrollbar-track,
*:hover::-webkit-scrollbar-track,
*:hover::-webkit-scrollbar-thumb {
  background: var(--clr-primary__500);
}

.fa-cv::before {
  content: "CV";
  font-family: var(--ff-primary);
  font-weight: 700;
}

/* DEFAULTS */
html,
body {
  scroll-behavior: smooth;
  font-size: min(1dvmin, 5px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

body {
  min-height: 100dvh;
  font-family: var(--ff-primary);
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.75);
  background-color: var(--clr-primary__500);
  opacity: 1;
}

main {
  position: absolute;
  top: 0;
  right: 0;
  height: 100dvh;
  width: 100dvw;
}

img {
  max-width: 100%;
}

p {
  line-height: 1.25;
}

a {
  color: var(--clr-accent__500);
  text-decoration: none !important;
}

a:hover,
a:focus {
  text-decoration: underline;
  color: rgba(255, 255, 255, 0.75);
  text-shadow: 0 0 1rem var(--clr-accent__500), 0 0 1rem var(--clr-accent__500);
}

input,
textarea,
button {
  color: #fff;
  width: 100%;
  outline: none;
  background: rgba(255, 255, 255, 0.025);
  border: solid 2px rgba(255, 255, 255, 0.125);
  border-radius: 5px;
}

input:focus,
textarea:focus,
footer button:focus {
  border-color: var(--clr-accent__500);
}

section {
  padding: calc(var(--vertical-padding) * 2) 0;
}

section,
footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-top: auto;
}

footer button::before {
  z-index: -1;
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background-color: #fff;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
}

footer button:hover::before,
footer button:focus::before {
  opacity: 0.05;
}

/* THEME */
section > article,
.footer__content {
  position: relative;
  width: 100%;
  max-width: var(--max-width);
  background-repeat: no-repeat;
  background-position: top;
  background-size: 100% calc(100% - var(--tilt-angle));
  padding: calc(var(--tilt-angle) * 2) var(--tilt-angle);
}

section.about-me,
section.portfolio,
section.skills {
  position: relative;
}

section.about-me::before,
section.portfolio::before,
section.skills::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url(../../assets/img/portfolio_background.webp);
  background-attachment: fixed;
  background-position: center top;
  background-size: cover;
  opacity: 0.05;
  filter: blur(5px);
}

aside {
  z-index: 1;
  position: fixed;
  top: 0;
  right: 0;
  height: 7.5rem;
  display: flex;
  align-items: center;
}

.header {
  z-index: 1;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  height: 7.5rem;
  width: 100%;
  background-color: var(--clr-primary__500);
}

.header__content {
  display: flex;
  align-items: center;
  width: 100%;
  flex-direction: row;
}

.header__logo {
  width: fit-content;
  font-weight: 600;
  font-size: 3rem;
  padding: 1.5rem;
}

.header__socials {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: row;
  list-style: none;
  font-weight: 600;
  margin: auto;
}

.header__social {
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid var(--clr-primary__100);
  border-radius: 50%;
  font-size: 2rem;
  height: 6rem;
  width: 6rem;
  cursor: pointer;
  text-decoration: none;
  margin: 0.5rem 1rem;
}

.hero {
  z-index: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--tilt-angle)), 0 100%);
  background-color: var(--clr-primary__500);
  background-image: url("../../assets/img/portfolio_background.webp");
  background-attachment: fixed;
  background-position: center top;
  background-size: cover;
  height: calc(100dvh + var(--tilt-angle));
  max-width: 100%;
}

.hero::after {
  z-index: -1;
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background-image: linear-gradient(
    var(--clr-primary__400) 0%,
    var(--clr-primary__500) 95%,
    var(--clr-primary__500) 100%
  );
}

.hero__content {
  position: sticky;
  top: calc(var(--vertical-padding) * 2);
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 22rem;
  width: fit-content;
  padding: 0;
}

.hero__content::after {
  content: "";
  position: absolute;
  bottom: 0;
  height: 0.02em;
  width: 75%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--clr-primary__100);
  border-radius: 1rem;
  animation: hero__socials--load 0.7s ease-in forwards;
}

.hero__sub-title {
  z-index: 0;
  position: relative;
  width: 100%;
  text-transform: uppercase;
  font-size: 0.15em;
  text-indent: 1.25em;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 5rem;
  animation: hero__sub-title--load 0.6s ease-in forwards;
}

.hero__sub-title::before {
  z-index: -1;
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background-color: var(--clr-accent__500);
  height: 0.1em;
  width: 1em;
  top: 50%;
  transform: translateY(-50%);
}

.hero__title {
  font-size: 1em;
  color: var(--clr-accent__500);
  position: relative;
  height: 1.75em;
  margin-top: -0.3em;
  padding-right: 3rem;
  animation: hero__title--load 0.5s ease-in forwards;
}

.hero__title span {
  position: absolute;
  left: 0.25em;
  margin-top: 0.9em;
  font-size: 0.75em;
  color: transparent;
  -webkit-text-stroke: 0.01em #fff;
}

.hero__socials {
  position: relative;
  top: -5rem;
  display: flex;
  flex-direction: row;
  justify-content: space-evenly;
  list-style: none;
  font-size: 5rem;
  width: 75%;
  font-weight: 600;
  animation: hero__sub-title--load 0.7s ease-in forwards;
}

.hero__social {
  display: flex;
  justify-content: center;
  align-items: center;
  outline: 1px solid var(--clr-primary__100);
  border-radius: 50%;
  height: 10rem;
  width: 10rem;
  cursor: pointer;
  text-decoration: none;
  margin: auto 1rem;
}

.intro {
  z-index: 0;
  position: relative;
  margin-top: calc(var(--tilt-angle-negative) - 1px);
  clip-path: polygon(
    0 var(--tilt-angle),
    100% 0,
    100% 100%,
    0 calc(100% - var(--tilt-angle))
  );
  text-shadow: -2px 2px 3px var(--clr-primary__400);
}

.intro video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100dvw;
  height: 100dvh;
  object-fit: fill;
  opacity: 0.5;
}

.intro__content {
  font-size: 3rem;
  z-index: 0;
  position: relative;
  width: calc(100% - 50rem);
  max-width: calc(var(--max-width) - 50rem);
  box-shadow: inset 0 0 3px var(--clr-primary__400);
  border-radius: 1rem;
  text-align: center;
  backdrop-filter: blur(20px);
}

.intro__title {
  font-size: 6rem;
  text-align: center;
  font-family: var(--ff-secondary);
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.intro__title::after {
  content: "";
  width: 50%;
  height: 0.05em;
  background: var(--clr-accent__500);
  box-shadow: -2px 2px 3px var(--clr-primary__400);
  display: block;
  margin: 1em auto;
  border-radius: 1rem;
}

.about-me {
  font-size: 4rem;
  background-color: var(--clr-primary__900);
  margin-top: calc(var(--tilt-angle-negative) - 1px);
  clip-path: polygon(
    0 0,
    100% var(--tilt-angle),
    100% calc(100% - var(--tilt-angle)),
    0 100%
  );
  background-image: url("../../assets/img/tie_fighter.webp");
  background-repeat: no-repeat;
  background-size: 7.5em;
  background-position: top right;
}

.about-me__content {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
}

.about-me__title {
  font-size: 6rem;
  font-family: var(--ff-secondary);
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.about-me__title::after {
  content: "";
  right: 0;
  width: 100%;
  height: 0.05em;
  background: var(--clr-accent__500);
  display: block;
  margin: 1em 0;
  margin-left: auto;
  border-radius: 1rem;
}

.about-me__text {
  width: 50%;
  margin-top: 0;
  margin: 0 auto;
}

.about-me__text a {
  color: var(--clr-accent__500);
}

.about-me__text a:hover,
.about-me__text a:focus {
  text-decoration: underline !important;
}

.about-me__text p {
  margin-top: 5rem;
}

.about-me__text p:first-child {
  margin-top: 0;
}

.about-me__sub-title {
  z-index: 1;
  position: absolute;
  margin-top: -10rem;
  min-width: auto !important;
  color: var(--clr-primary__500);
  font-size: 4rem;
  line-height: 90%;
  -webkit-text-stroke: 0.1rem #fff;
  text-shadow: 0 0 0 var(--clr-primary__100);
  transform: translate(10%, 150%);
  filter: drop-shadow(1rem 1rem 0 var(--clr-primary__400));
}

.about-me__sub-title span {
  z-index: -1;
  position: inherit;
  font-size: 2em;
  color: transparent;
  transform: translate(-25%, -25%);
  -webkit-text-stroke: 1px var(--clr-accent__500);
}

.about-me__sub-title span::before {
  z-index: inherit;
  content: "&";
  position: inherit;
  top: -0.01em;
  left: -0.01em;
  color: transparent;
  -webkit-text-stroke: 1px var(--clr-primary__500);
}

.about-me__image {
  display: flex;
  justify-content: flex-end;
  margin: 0 auto;
  margin-top: calc(var(--tilt-angle) * 2.5);
  max-width: min(100%, 410px);
}

.about-me__image img {
  width: auto;
  max-height: calc(100dvh - 12rem);
  height: auto;
  margin: auto 0;
  border-radius: 0.5rem;
  object-fit: contain;
  object-position: top left;
}

.portfolio {
  background-color: var(--clr-primary__500);
  background-image: linear-gradient(var(--color-accent__dark), transparent);
  margin-top: calc(var(--tilt-angle-negative) - 1px);
  clip-path: polygon(
    0 var(--tilt-angle),
    100% 0,
    100% 100%,
    0 calc(100% - var(--tilt-angle))
  );
}

.portfolio__items {
  text-align: center;
  flex-wrap: wrap;
  margin: 0 auto;
  gap: 2rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.portfolio__item {
  position: relative;
  display: flex;
  border-radius: 2rem;
}

.portfolio__item picture {
  display: flex;
  height: 100%;
  width: 100%;
}

.portfolio .featured {
  position: relative;
  display: flex;
  margin: 0;
  overflow: hidden;
  -webkit-box-flex: 1;
  flex: 1 1 20rem;
  grid-column: 1 / span 2;
  grid-row: 1 / span 2;
}

.portfolio__item > a,
.portfolio__link {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  text-shadow: none;
  color: #fff;
  overflow: hidden;
  cursor: pointer;
}

.portfolio__link::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 5px 1px var(--clr-primary__900);
}

.portfolio__image {
  display: flex;
  object-fit: cover;
  width: 100%;
  height: 100%;
  transition: transform 1s;
  aspect-ratio: 1;
}

.portfolio__item:hover .portfolio__image,
.portfolio__item:focus .portfolio__image,
.portfolio__item::after {
  transform: scale(1.1);
}

.portfolio__item figcaption {
  display: none;
  font-size: 1.75em;
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: var(--clr-accent__700);
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 1em;
  opacity: 0;
  transition: opacity 300ms, backdrop-filter 300ms;
}

.portfolio__item:hover figcaption,
.portfolio__item:focus figcaption {
  opacity: 1;
  backdrop-filter: blur(5px);
}

.portfolio__item b {
  font-size: 3rem;
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
  padding: 1rem 0;
}

.portfolio__title {
  font-size: 6rem;
  font-family: var(--ff-secondary);
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding-top: 0.1em;
  line-height: 1.25;
}

.portfolio__content > .portfolio__title::after {
  content: "";
  right: 0;
  width: 100%;
  height: 0.05em;
  background: var(--clr-accent__500);
  display: block;
  margin: 1em 0;
  margin-left: auto;
  border-radius: 1rem;
}

.portfolio__desc {
  line-height: 1;
  font-size: 3rem;
  margin-top: auto;
  margin-bottom: 0.25em;
}

.skills {
  background-color: var(--clr-primary__900);
  margin-top: calc(var(--tilt-angle-negative) - 1px);
  clip-path: polygon(0 0, 100% var(--tilt-angle), 100% 100%, 0 100%);
}

.skills__title {
  font-size: 6rem;
  font-family: var(--ff-secondary);
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.skills__title::after {
  content: "";
  right: 0;
  width: 100%;
  height: 0.05em;
  background: var(--clr-accent__500);
  display: block;
  margin: 1em 0;
  margin-left: auto;
  border-radius: 1rem;
}

.skills__link,
.skills__item {
  max-width: 100%;
  border-radius: 1rem;
  box-shadow: 0 0 3px var(--clr-primary__900);
}

.footer__content {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  font-size: 3rem;
  padding-bottom: 0;
}

.footer__title {
  width: 100%;
  font-size: 6rem;
  font-family: var(--ff-secondary);
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.footer__title::after {
  content: "";
  right: 0;
  width: 100%;
  height: 0.05em;
  background: var(--clr-primary__100);
  background-color: var(--clr-primary__500);
  display: block;
  margin: 1em 0;
  margin-left: auto;
  border-radius: 1rem;
}

.footer__content p {
  width: 100%;
  margin-bottom: 1em;
}

.footer__contact {
  width: calc(40% - 1.5em);
  margin: auto;
}

.footer__contact label {
  display: block;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin: 0 0 0.7em 0;
  text-transform: uppercase;
}

.footer__contact input {
  padding: 0 1em;
  height: 2.75em;
}

.footer__contact textarea {
  padding: 0.75em 1em;
}

.footer__contact button {
  z-index: 1;
  position: relative;
  width: auto;
  background-color: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 0.8em;
  font-weight: 700;
  height: 3.75em;
  letter-spacing: 0.1em;
  line-height: 3.75em;
  padding: 0 2.25em;
  text-align: center;
  text-transform: uppercase;
}

.footer__social-links {
  width: calc(60% - 1.5em);
  padding: 3rem;
  font-size: 3.5rem;
  list-style: none;
  margin: 0 auto;
  white-space: nowrap;
}

.footer__social-link {
  display: block;
  width: 100%;
  font-weight: 600;
  padding-bottom: 6rem;
}

.footer__social-link .fa {
  width: 1.75em;
  text-align: center;
}

footer {
  padding: 2rem;
}

.copyright {
  font-size: 3rem;
  color: var(--clr-primary__100);
}

/* MECHANICS */
.hamburger {
  z-index: 1;
  position: fixed;
  top: 0;
  right: 0;
  display: none;
  align-items: center;
  background: transparent;
  border: none;
  fill: var(--clr-accent__500);
  padding: 0 3rem;
  width: 12rem;
  height: 7rem;
  cursor: pointer;
}

.hamburger:hover,
.hamburger:focus {
  text-decoration: underline;
  fill: rgba(255, 255, 255, 0.75);
  filter: drop-shadow(0 0 0.5rem var(--clr-accent__500))
    drop-shadow(0 0 0.5rem var(--clr-accent__500));
}

.hamburger label {
  position: absolute;
  top: -100dvh;
  height: 0;
  color: transparent;
}

.hamburger__bar {
  height: 1rem;
  width: 100%;
}

.hamburger svg {
  height: 50%;
  width: 100%;
}

#menu {
  position: fixed;
  top: 0;
  right: 0;
}

#menu ul {
  display: flex;
  flex-direction: row;
  list-style: none;
  font-size: 3rem;
  padding: 0 2.25rem;
  border-radius: 1rem;
}

#menu li {
  display: flex;
  font-weight: 900;
  font-size: 3rem;
  margin-left: 1.5rem;
}

#menu li:last-of-type {
  border: 0;
}

.menu__link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 7rem;
}

.menu__link .fa {
  display: none;
  position: fixed;
  opacity: 0.1;
  font-size: 2em;
}

/* RESPONSIVE */
@media screen and (min-width: 900px) {
  .hero {
    z-index: 0;
  }

  .hero__socials {
    display: none;
  }
}

@media screen and (max-width: 900px) {
  .about-me__text {
    width: 100%;
  }

  .portfolio__items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  aside .hamburger {
    display: flex;
  }

  #menu {
    height: 100%;
    width: 100%;
    display: flex;
    cursor: default;
    user-select: none;
    z-index: 3;
    backdrop-filter: blur(3px);
    transform: translateY(-101dvh);
    transition: transform 0.3s;
  }

  .menu--open #menu {
    transform: translateY(0);
  }

  #menu ul {
    flex-direction: column;
    margin: auto;
    background: var(--clr-primary__500);
    padding: var(--tilt-angle) calc(var(--tilt-angle) * 2);
    box-shadow: 0 0 0.5em 0 rgb(0 0 0 / 50%);
  }

  #menu li {
    border-bottom: 1px solid var(--clr-primary__100);
  }

  .menu__link {
    font-family: var(--ff-secondary);
    font-weight: 500;
    font-size: 7.5rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    padding: 0.5em 0.25em;
    text-decoration: none;
    text-align: center;
    width: 100%;
  }

  .menu__link .fa {
    display: flex;
  }
}

@keyframes hero__sub-title--load {
  0% {
    opacity: 0;
    transform: translateX(-25%);
  }

  100% {
    opacity: 1;
    transform: translateX(0%);
  }
}

@keyframes hero__socials--load {
  0% {
    opacity: 0;
    transform: translateX(-75%);
  }

  100% {
    opacity: 1;
    transform: translateX(-50%);
  }
}

@keyframes hero__title--load {
  0% {
    opacity: 0;
    transform: translateX(25%);
  }

  100% {
    opacity: 1;
    transform: translateX(0%);
  }
}
