/* Header */

.header {
  position: relative;

  width: 100%;
  height: 8rem;

  border-bottom: 1px solid var(--clr-decoration);
}

.header-menu-open .header {
  position: fixed;
  top: 0;
  bottom: 8rem;
  left: 0;
  right: 0;
  z-index: 2;
  background-color:  var(--clr-background);
}

.header-menu-open .header::after {
  position: absolute;
  bottom: 0;
  left: 0;
  right: -15px;

  width: 120%;
  height: 1px;
  background-color: 1px solid var(--clr-decoration);
  content: '';
}

.header__logo {
  grid-column: 2 / 3;
}

.header__container {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 8rem;
  align-items: center;
  justify-items: center;

  padding-inline: 1.2rem;
}

@media (hover: hover) and (pointer: fine) {
  .header-menu-open .header__container {
    margin-right: var(--scrollbar-width, 15px);
  }
}

@media (width >= 768px) {
  .header__container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 5rem;

    max-width: 128rem;
    width: 100%;
    margin: 0 auto;
    padding-inline: 1.2rem;
  }
}

.header__nav {
  position: fixed;
  top: 8rem;
  bottom: 8rem;
  left: 0;
  right: 0;
  z-index: var(--menu-index);

  display: none;
  justify-content: center;
  align-content: center;

  padding-block: 2rem;
  border-bottom: 1px solid var(--clr-decoration);
  background-color: var(--clr-background);
}

@media (width >= 768px) {
  .header__nav {
    position: static;
    display: block;

    padding: 0;
    border-bottom: none;
    background-color: transparent;
  }
}

.header-menu-open .header__nav {
  display: flex;
}

.header__nav-link-list {
  width: 100%;
  margin: 0;
  padding: 0;

  list-style-type: none;
}

@media (width >= 768px) {
  .header__nav-link-list  {
    display: flex;
    flex-wrap: wrap;
  }
}

.header__nav-link {
  display: block;
  width: 100%;
  padding: 1.75em;

  text-align: center;
  font-weight: 700;
}

@media (hover: hover) and (pointer: fine) {
  .header__nav-link:hover {
    background-color: #D9D9D91A;
  }
}

.header__menu-toggle {
  grid-column: 3 / 4;
  justify-self: end;

  aspect-ratio: 1 / 1;
  padding: 10px;

  border: none;
  background-color: transparent;
  cursor: pointer;
}

@media (width >= 768px) {
  .header__menu-toggle {
    display: none;
  }
}

.header__menu-toggle .line {
  display: block;
  width: 25px;
  height: 2px;
  margin-bottom: 8px;

  background-color: var(--clr-label);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.header__menu-toggle .line:last-of-type {
  margin-bottom: 0;
}

.header-menu-open .line:first-of-type {
  transform-origin: left center;
  transform: rotateZ(45deg) scaleX(1.13);
}

.header-menu-open .line:nth-of-type(2) {
  opacity: 0;
  transform: translateX(-10px);
}

.header-menu-open .line:last-of-type {
  transform-origin: left center;
  transform: rotateZ(-45deg) scaleX(1.13);
}

/* About section*/
.about {
  padding-block: 6rem;
  border-bottom: 1px solid var(--clr-decoration);
}

.about__social-list-wrapper {
  display: none;
  background-color: var(--clr-background);
}

.header-menu-open .about__social-list-wrapper  {
  position: fixed;
  top: calc(100dvh - 8rem);
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--menu-index);

  display: flex;
  justify-content: center;
  align-items: center;
}

.about__social-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 3.125em;

  margin: 0;
  padding: 0;
  list-style-type: none;
}

.about__social-link svg {
  stroke: var(--clr-label);
  fill: var(--clr-background);
}

.about__picture-wrapper {
  grid-column: 1 / -1;
  justify-self: center;

  margin-bottom: 4rem;
}

@media (width >=1280px) {
  .about__picture-wrapper {
    grid-column: -5 / -1;
    grid-row: 1 / 3;
    align-self: center;
    justify-self: center;

    width: 300px;
    height: 317px;
    margin: auto;
  }
}

.about__picture {
  display: block;
  object-fit: fill;
}

.about__info {
  grid-column: 1 / -1;

  margin: 0 auto;
}

@media (width >=1280px) {
  .about__info {
      grid-column: 1 / -5;
      grid-row: 1 / 2;
  }
}

.about__title {
  text-align: center;
  margin-bottom: 4rem;
}

@media (width >=1280px) {
  .about__title {
    text-align: left;
  }
}

.about__title span:first-child {
  display: block;
  margin-bottom: 2rem;

  font-size: 1.8rem;
  line-height: 1.375;
  font-weight: 400;
  color: var(--clr-label);
}

.about__title span:nth-child(2) {
  color: var(--clr-text);
}

.about__title :not(:first-child) {
  display: block;
  font-size: 3rem;
  line-height: 1.375;
  font-weight: 700;
  color: var(--clr-accent);
}

@media (width >=1280px) {
  .about__title :not(:first-child) {
    font-size: 3.75rem;
    line-height: 1.175;
  }
}

.about__text {
  margin-bottom: 4rem;
  text-align: center;
}

@media (width >= 1280px) {
  .about__text {
    text-align: left;
  }
}

.about__button-group {
  grid-column: 1 / -1;

  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1.5em;

  margin-bottom: 6rem;
}

@media (width >=1280px) {
  .about__button-group {
      grid-column: 1 / -5;
      grid-row: 2 / 3;

      justify-content: start;
      margin-bottom: 0;
  }
}

.about__misc {
  grid-column: 1 / -1;
}

.tech-stack span {
  display: block;

  margin-bottom: 1.25em;
  text-align: center;
}

@media (width >=1280px) {
  .tech-stack span {
    text-align: start;
  }
}

.tech-stack__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1.2em;
}

@media (width >=1280px) {
  .about__misc {
    padding-top: 6rem;
  }
}

@media (width >=1280px) {
  .tech-stack__list {
    justify-content: start;
  }
}

.tech-stack__description:hover svg {
  fill: var(--clr-text);
  transform: scale(1.2);
  transition: fill 500ms ease, transform 500ms ease;
}

/* Projects section */

.projects {
  padding-block: 6rem;
  border-bottom: 1px solid var(--clr-decoration);
}

.projects__lead {
  grid-column: 1 / -1;
  text-align: center;
}

.projects__title {
  grid-column: 1 / -1;
  text-align: center;
  margin-bottom: 3rem;
}

.projects__item {
  display: flex;
  flex-direction: column;
  row-gap: 3rem;

  margin-bottom: 5.5rem;
}

.projects__item:last-of-type {
  margin-bottom: 0;
}

@media (width >= 768px) {
  .projects__item {
    margin-bottom: 0;
  }
}

@media (width >= 1280px) {
  .projects__item {
    margin-bottom: 12rem;

    display: grid;
    grid-template-columns: repeat(12, 1fr);
    column-gap: 3rem;
    align-items: center;
  }
}

.projects__item:first-of-type {
  grid-column: span 2;
}

@media (width >= 768px) {
  .projects__item:first-of-type {
    grid-column: span 4;
  }
}

@media (width >= 1280px ) {
  .projects__item:first-of-type {
    grid-column: 1 / -1;
  }
}

.projects__item:last-of-type {
  grid-column: span 2;
}

@media (width >= 768px) {
  .projects__item:last-of-type {
    grid-column: 5 / -1;
  }
}

@media (width >= 1280px) {
  .projects__item:last-of-type {
    grid-column: 1 / -1;
  }

  .projects__item--reversed > *:first-of-type {
    grid-column: 6 / -1;
    grid-row: 1 / 2;
  }

  .projects__item--reversed > *:last-of-type {
    grid-column: 1 / 6;
    grid-row: 1 / 2;
  }
}

@media (width >= 1280px) {
  .project-item__image-wrapper {
    grid-column: 1 / 8;
  }
}

.project-item__image img {
  width: 100%;
}

.project__info {
  display: flex;
  flex-direction: column;
  row-gap: 3rem;
}

@media (width >= 768px) {
  .project__info {
    row-gap: 4rem;
  }
}

@media (width >= 1280px) {
  .project__info {
    grid-column: 8 / -1;
    row-gap: 4.5rem;
  }
}

.project__title {
  margin: 0;
}

.project__list,
.project__social-list {
  display: flex;
  column-gap: 1rem;

  margin: 0;
  padding: 0;
  list-style-type: none;
}

.project__item {
  padding: 0.25em 0.75em;
  border: 1px solid var(--clr-accent);
  border-radius: 0.25em;

  font-family: var(--font-accent);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--clr-accent);
}

.project__social-link {
  display: block;
}

.project__social-link svg {
  fill: var(--clr-background);
}

@media (prefers-color-scheme: light) {
  .project__social-link svg {
    stroke: var(--clr-label);
  }
}

@media (prefers-color-scheme: dark) {
  .project__social-link svg {
    stroke: #B9BBC2;
  }
}

/* Contacts */
.contacts {
  padding-block: 6rem;
  border-bottom: 1px solid var(--clr-decoration);
}

.contacts__container {
  row-gap: 3rem;
}

@media (width >= 768px) {
  .contacts__container {
    align-items: center;
  }
}

.contacts__title {
  margin-bottom: 2rem;
}

.contacts__text {
  grid-column: 1 / -1;
  text-align: center;
}

@media (width >= 768px) {
  .contacts__text {
    grid-column: 1 / 5;
    text-align: left;
  }
}

@media (width >= 1280px) {
  .contacts__text {
    grid-column: 3 / 7;
    text-align: left;
  }
}

.contacts__form {
  grid-column: 1 / -1;

  display: flex;
  flex-direction: column;
  row-gap: 2rem;
  align-items: start;
}

.contacts__form:has(:invalid) button[type="submit"] {
  pointer-events: none;
  opacity: 0.5;
}

@media (width >= 768px) {
  .contacts__form {
    grid-column: 5 / -1;
    text-align: center;
  }
}

@media (width >= 1280px) {
  .contacts__form {
    grid-column: 7 / 11;
    text-align: left;
  }
}

.contacts-form__label {
  display: flex;
  flex-direction: column;
  row-gap: 2rem;

  width: 100%;
}

@media (width >= 768px) {
  .contacts-form__label {
    flex-direction: row;
    column-gap: 1.5rem;
  }
}

.contacts-form__label-text {
  font-size: 1.4rem;
  line-height: 1.57;

  color: var(--clr-label);
}

@media (width >= 768px) {
  .contacts-form__label-text {
    min-width: 9rem;
  }
}

.contacts-form__textarea,
.contacts-form__input {
  width: 100%;
  min-height: 10rem;
  padding: 1em  1.3em;

  font-size: 1.5rem;
  color: var(--clr-text);
  background: var(--clr-background);

  border: 1px solid var(--clr-label);
  border-radius: 0.6rem;

  resize: none;
  outline: inherit;
}

.contacts-form__input {
  min-height: 5rem;
}

.contacts-form__button {
  width: 100%;
  max-width: 34.5rem;
  margin: 0 auto;
}

@media (width >= 768px) {
  .contacts-form__button {
    max-width: 29.4rem;
    margin: 0;
    margin-left: auto;
  }
}

/* Footer */
.footer {
  overflow: hidden;
}

@media (width >= 768px) {
  .footer__container {
    align-items: center;
    padding-block: 2rem;
  }
}

.footer__nav-list {
  grid-column: 1 / -1;
  position: relative;

  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
  align-content: center;

  margin: 0;
  padding: 0;
  padding-block: 5rem;
  list-style-type: none;
}

@media (width >= 768px) {
  .footer__nav-list {
    grid-column: 4 / -1;
    grid-row: 1 / 2;

    flex-direction: row;
    column-gap: 1rem;

    padding-block: 0;
  }
}

.footer__nav-list:after {
  position: absolute;
  bottom: 0;
  left: -10rem;
  width: 128rem;
  border-bottom: 1px solid var(--clr-decoration);
  content: '';
}

@media (width >= 768px) {
  .footer__nav-list:after {
    display: none;
  }
}

.footer__nav-link {
  display: block;
  padding: 1rem;
  text-align: center;
}

.footer__copyright {
  grid-column: 1 / -1;

  padding-block: 1.75em;
  text-align: center;
}

@media (width >= 768px) {
  .footer__copyright {
    grid-column: 1 / 4;
    grid-row: 1 / 2;

    padding-block: 0;
    text-align: left;
  }
}
