/* FONTS */

@font-face {
  font-style: normal;
  font-weight: 500;
  src: url("./assets/fonts/static/SpaceGrotesk-Medium.ttf");
  font-family: "Space Grotesk";
}

@font-face {
  font-style: normal;
  font-weight: 700;
  src: url("./assets/fonts/static/SpaceGrotesk-Bold.ttf");
  font-family: "Space Grotesk";
}

/* VARIABLES */

:root {
  --clr-black: 0, 0%, 8%;
  --clr-green: 153, 71%, 59%;
  --clr-red: 7, 100%, 68%;
  --clr-grey: 0, 0%, 14%;
  --clr-light-grey: 0, 0%, 85%;
  --clr-white: 0, 0%, 100%;

  --text-heading-xl-size: 8.8rem;
  --text-heading-xl-height: 1;
  --text-heading-xl-ls: -0.25rem;

  --text-heading-l-size: 4.8rem;
  --text-heading-l-height: 5.6rem;
  --text-heading-l-ls: -0.15rem;

  --text-heading-m-size: 2.4rem;
  --text-heading-m-height: 3.2rem;

  --text-body-size: 1.8rem;
  --text-body-height: 2.8rem;
}

/* RESET */

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

html {
  position: relative;
  overflow-x: hidden;
  font-size: 62.5%;
}

img {
  max-width: 100%;
}

input,
button,
textarea {
  font: inherit;
}

/* GENERAL */

body {
  position: relative;
  background-color: hsl(var(--clr-black));
  overflow-x: hidden;
  color: hsl(var(--clr-light-grey));
  font-weight: 500;
  font-size: var(--text-body-size);
  font-family: "Space Grotesk", sans-serif;
}

p {
  line-height: var(--text-body-height);
}

/* UTILITY */

.sr-only:not(:focus):not(:active) {
  clip: rect(0 0 0 0);
  position: absolute;
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
}

.container {
  margin: 0 auto;
  width: 100%;
  max-width: 1110px;
}

.button {
  display: inline-block;
  transition: color 0.3s ease-in-out;
  border: 0;
  border-bottom: 2px solid hsl(var(--clr-green));
  background-color: transparent;
  padding-bottom: 1rem;
  color: hsl(var(--clr-white));
  font-weight: 700;
  font-size: 1.6rem;
  line-height: 2.6rem;
  letter-spacing: 0.229rem;
  text-decoration: none;
  text-transform: uppercase;
}

.button:hover {
  cursor: pointer;
  color: hsl(var(--clr-green));
}

.icon:hover {
  filter: brightness(0) saturate(100%) invert(100%) sepia(25%) saturate(5196%)
    hue-rotate(73deg) brightness(95%) contrast(85%);
}

/* HEADER */

.header {
  position: absolute;
  top: 3.9rem;
  z-index: 1;
  width: 100%;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header__logo {
  color: hsl(var(--clr-white));
  font-size: 3.2rem;
  letter-spacing: -0.044rem;
  text-decoration: none;
}

.header__list {
  display: flex;
  align-items: center;
  gap: 3.2rem;
  list-style-type: none;
}

/* HERO */

.hero {
  margin-bottom: 10.4rem;
}

.hero .container {
  display: flex;
  position: relative;
  justify-content: flex-end;
}

.hero .container::before {
  position: absolute;
  top: 133px;
  left: -265px;
  content: url("./assets/images/pattern-rings.svg");
}

.hero .container::after {
  position: absolute;
  right: 380px;
  bottom: 70px;
  content: url("./assets/images/pattern-circle.svg");
}

.hero__content {
  position: absolute;
  top: 198px;
  left: 0;
  max-width: 706px;
}

.hero__title {
  margin-bottom: 4.3rem;
  color: hsl(var(--clr-white));
  font-size: var(--text-heading-xl-size);
  line-height: var(--text-heading-xl-height);
  letter-spacing: var(--text-heading-xl-ls);

  span {
    position: relative;
    &::after {
      position: absolute;
      bottom: 6px;
      left: 0;
      z-index: -1;
      background-color: hsl(var(--clr-green));
      width: 100%;
      height: 6px;
      content: "";
    }
  }
}

.hero__text {
  margin-bottom: 6.6rem;
  max-width: 445px;
}

/* SKILL SECTION */

.skills-section {
  margin-bottom: 14rem;
}

.skills-section .container {
  position: relative;
}

.skills-section .container::before {
  position: absolute;
  right: -404px;
  bottom: -55px;
  content: url("./assets/images/pattern-rings.svg");
}

.skills-section__list {
  display: grid;
  position: relative;
  grid-template-columns: repeat(3, 1fr);
  gap: 5.8rem 3rem;
  border-top: 1px solid hsl(var(--clr-light-grey));
  padding-top: 7.2rem;
  list-style-type: none;
}

.skill {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.skill__title {
  color: hsl(var(--clr-white));
  font-size: var(--text-heading-l-size);
  line-height: var(--text-heading-l-height);
  letter-spacing: var(--text-heading-l-ls);
}

/* PROJECTS SECTION */

.projects-section {
  margin-bottom: 14rem;
}

.projects-section__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8rem;
}

.projects-section__title {
  color: hsl(var(--clr-white));
  font-size: var(--text-heading-xl-size);
  line-height: var(--text-heading-xl-height);
  letter-spacing: var(--text-heading-xl-ls);
}

.projects-section__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6.9rem 3rem;
}

.project {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.project__top {
  position: relative;
  overflow: hidden;
}

.project__top:hover {
  cursor: pointer;
}

.project__top:hover .project__image-overlay {
  transform: translateX(0);
}

.project__image-overlay {
  display: flex;
  position: absolute;
  top: 0;
  left: 0;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4.8rem;
  transform: translateX(100%);
  transition: transform 0.8s ease-in-out;
  background-color: hsl(var(--clr-black), 0.75);
  width: 100%;
  height: 100%;
}

.project__bottom {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.project__title {
  color: hsl(var(--clr-white));
  font-size: var(--text-heading-m-size);
  line-height: var(--text-heading-m-height);
  letter-spacing: var(--text-heading-m-ls);
  text-transform: uppercase;
}

.project__list {
  display: flex;
  align-items: center;
  gap: 1.8rem;
  list-style-type: none;
}

.project__mobile-nav {
  display: none;
  gap: 3rem;
}

/* FOOTER */

.footer {
  background-color: hsl(var(--clr-grey));
  padding: 8.4rem 0 9.2rem 0;
}

.footer__top {
  display: flex;
  position: relative;
  justify-content: space-between;
  padding-bottom: 9.2rem;
}

.footer__top::before {
  position: absolute;
  bottom: 47px;
  left: -370px;
  content: url("./assets/images/pattern-rings.svg");
}

.footer__left {
  max-width: 445px;
}

.footer__title {
  margin-bottom: 3.6rem;
  color: hsl(var(--clr-white));
  font-size: var(--text-heading-xl-size);
  line-height: var(--text-heading-xl-height);
  letter-spacing: var(--text-heading-xl-ls);
}

.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid hsl(var(--clr-light-grey));
  padding-top: 4.7rem;
}

.footer__logo {
  color: hsl(var(--clr-white));
  font-size: 3.2rem;
  letter-spacing: -0.044rem;
  text-decoration: none;
}

.footer__list {
  display: flex;
  align-items: center;
  gap: 3.2rem;
  list-style-type: none;
}

/* FORM */

.form {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3.2rem;
  width: 100%;
  max-width: 445px;
}

.form__group {
  position: relative;
  transition: margin-bottom 0.3s ease-in-out;
  width: 100%;
}

.form__group::after {
  position: absolute;
  top: 0;
  right: 0;
  opacity: 0;
  z-index: 1;
  transition: opacity 0.3s ease-in-out;
  content: url("./assets/images/icon-error.svg");
}

.form__group--error .form__error {
  bottom: -0.5rem;
  transform: translateY(100%);
}

.form__group--error .form__input {
  border-bottom-color: hsl(var(--clr-red));
}

.form__group--error::after {
  opacity: 1;
}

.form__group--correct .form__input {
  border-bottom-color: hsl(var(--clr-green));
}

.form__input {
  position: relative;
  z-index: 1;
  transition: border-bottom-color 0.3s ease-in-out;
  outline: 0;
  border: 0;
  border-bottom: 1px solid hsl(var(--clr-light-grey));
  background-color: hsl(var(--clr-grey));
  padding: 0 2.4rem 1.6rem 2.4rem;
  width: 100%;
  color: hsl(var(--clr-white));
  font-size: 1.6rem;
  line-height: 2.6rem;
  letter-spacing: -0.022rem;
  text-transform: uppercase;
}

.form__textarea {
  min-height: 107px;
}

.form__error {
  position: absolute;
  right: 0;
  bottom: 5px;
  transition: bottom 0.3s ease-in-out, transform 0.3s ease-in-out;
  color: hsl(var(--clr-red));
  font-size: 1.2rem;
  line-height: 1.6rem;
  letter-spacing: -0.017rem;
}

/* ATTRIBUTION */

.attribution {
  position: absolute;
  bottom: 0;
  left: 0;
  border-top-right-radius: 1rem;
  padding: 0.8rem;
  color: hsl(var(--clr-light-grey));
  font-size: 1rem;
}

.attribution__link {
  color: hsl(var(--clr-green));
  font-weight: 700;
  text-decoration: none;
}

.attribution__link:hover {
  text-decoration: underline;
}

/* MEDIA QUREIES */

@media screen and (max-width: 1110px) {
  .container {
    padding: 0 3rem;
  }

  .hero__content {
    left: 3rem;
  }

  .hero__image {
    position: relative;
    right: -3rem;
    z-index: -1;
  }

  .attribution {
    display: none;
  }
}

@media screen and (max-width: 768px) {
  :root {
    --text-heading-xl-size: 7.2rem;
    --text-heading-xl-height: 1;
    --text-heading-xl-ls: -0.205rem;

    --text-heading-l-size: 4.8rem;
    --text-heading-l-height: 5.6rem;
    --text-heading-l-ls: -0.15rem;

    --text-heading-m-size: 2.4rem;
    --text-heading-m-height: 3.2rem;

    --text-body-size: 1.8rem;
    --text-body-height: 2.8rem;
  }

  .header {
    top: 2.9rem;
  }

  .hero {
    margin-bottom: 6rem;
  }

  .hero .container::before {
    top: 86px;
    left: -265px;
  }

  .hero .container::after {
    right: 0;
    bottom: 0;
    transform: translateX(50%);
  }

  .hero__content {
    top: unset;
    bottom: 0;
    max-width: 445px;
  }

  .hero__title {
    margin-bottom: 6rem;
  }

  .hero__text {
    margin-bottom: 3.4rem;
  }

  .hero__image img {
    width: 322px;
    height: 600px;
  }

  .skills-section {
    margin-bottom: 10rem;
  }

  .skills-section__list {
    grid-template-columns: 1fr 1fr;
    gap: 5.2rem 0.7rem;
    padding-top: 5.2rem;
  }

  .skills-section .container::before {
    right: -332px;
    bottom: -65px;
  }

  .projects-section {
    margin-bottom: 10rem;
  }

  .projects-section__header {
    margin-bottom: 6rem;
  }

  .projects-section__grid {
    gap: 6rem 2.4rem;
  }

  .project__top:hover .project__image-overlay {
    transform: translateX(100%);
  }

  .project__mobile-nav {
    display: flex;
  }

  .footer {
    padding: 6rem 0 4rem 0;
  }

  .footer__top {
    flex-direction: column;
    align-items: center;
    gap: 4.8rem;
    text-align: center;
  }

  .footer__top::before {
    bottom: 27px;
    left: -398px;
  }

  .footer__title {
    margin-bottom: 2rem;
  }

  .footer__bottom {
    padding-top: 3rem;
  }
}

@media screen and (max-width: 500px) {
  :root {
    --text-heading-xl-size: 4rem;
    --text-heading-xl-height: 1;
    --text-heading-xl-ls: -0.114rem;

    --text-heading-l-size: 3.2rem;
    --text-heading-l-height: 4rem;
    --text-heading-l-ls: -0.1rem;

    --text-body-size: 1.6rem;
    --text-body-height: 2.6rem;
  }

  .container {
    padding: 0 1.6rem;
  }

  .header {
    top: 2rem;
  }

  .header .container {
    flex-direction: column;
    gap: 2rem;
  }

  .hero {
    margin-bottom: 8rem;
  }

  .hero .container {
    flex-direction: column;
    align-items: center;
    gap: 4rem;
  }
  .hero .container::before {
    top: 124px;
    left: -342px;
    z-index: -1;
  }

  .hero .container::after {
    top: 254px;
  }

  .hero__content {
    position: static;
    text-align: center;
  }

  .hero__title {
    margin-bottom: 2.4rem;
  }

  .hero__text {
    margin-bottom: 2.4rem;
  }

  .hero__image {
    right: unset;
    order: -1;
    z-index: 1;
  }
  .hero__image img {
    width: 174px;
    height: 383px;
  }

  .skills-section {
    margin-bottom: 8rem;
  }

  .skills-section__list {
    grid-template-columns: 1fr;
    gap: 2.4rem;
    border-bottom: 1px solid hsl(var(--clr-light-grey));
    padding-top: 4rem;
    padding-bottom: 4rem;
    width: calc(100% - 3.2rem);
    text-align: center;
  }

  .skills-section .container::before {
    right: -344px;
    bottom: -66px;
  }

  .skill {
    gap: 0.1rem;
  }

  .projects-section {
    margin-bottom: 8rem;
  }

  .projects-section__header {
    margin-bottom: 4rem;
  }

  .projects-section__grid {
    grid-template-columns: 1fr;
    gap: 4rem;
  }

  .footer {
    padding: 6rem 0;
  }

  .footer__bottom {
    flex-direction: column;
    gap: 2rem;
    padding-top: 3.9rem;
  }

  .form__group--error {
    margin-bottom: 2rem;
  }
}
