.header {
  --header-transition: 0.3s var(--ease-out);
  --header-menu-transition: 0.6s ease;
  --header-line-gray: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='2' viewBox='0 0 10 2'%3E%3Crect width='2' height='2' fill='%23949097'/%3E%3C/svg%3E");
  --header-line-red: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='2' viewBox='0 0 10 2'%3E%3Crect width='2' height='2' fill='%23FF4D00'/%3E%3C/svg%3E");

  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 100;

  padding-top: var(--header-top);
}

/* is-menu-open is set by header.js. */
.header.is-menu-open {
  position: fixed;
}

.header + * {
  margin-block-start: 0;
}

.header-backdrop {
  display: none;

  @media (max-width: 1023px) {
    position: fixed;
    inset: 0;
    display: block;

    background-color: #241f27;
    visibility: hidden;
    opacity: 0;

    transition:
      opacity var(--header-menu-transition),
      visibility 0s linear 0.6s;
  }
}
.header.is-menu-open .header-backdrop {
  visibility: visible;
  opacity: 0.5;

  transition: opacity var(--header-menu-transition);
}

.header-container {
  position: relative;

  max-width: 1920px;
  margin: 0 auto;
  padding: 0 32px;

  @media (max-width: 767px) {
    padding: 0 16px;
  }
}

.header-bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;

  min-height: var(--header-height);

  @media (max-width: 1023px) {
    padding: 12px 24px;
    border-radius: 8px;

    background-color: #ffffff;
  }

  @media (max-width: 767px) {
    padding: 8px;
    border-radius: 6px;
  }
}

.header-logo {
  display: flex;
  flex-shrink: 0;

  border-radius: 8px;

  @media (max-width: 1023px) {
    border-radius: 4px;
  }
}
.header-logo:focus-visible {
  outline: 1px solid #1819d3;
  outline-offset: 4px;
}
.header-logo__image {
  display: block;

  width: 180px;
  height: 30px;
  object-fit: contain;

  @media (max-width: 767px) {
    width: 128px;
    height: 22px;
  }
}

.header-actions {
  display: flex;
  align-items: center;
}

.header-nav {
  @media (max-width: 1023px) {
    display: none;
  }
}
.header-nav__list {
  display: flex;
}
.header-nav__list li:not(:first-child) {
  margin-left: -1px;
}
.header-nav__list a {
  display: flex;
  align-items: center;

  height: 56px;
  padding: 0 37px;
  border: 1px solid #949097;

  background-color: #ffffff;
  color: #3b393d;

  font-size: 15px;
  line-height: 1.1;
  text-transform: uppercase;
  text-decoration: none;
  transition: color var(--header-transition);
}
.header-nav__list a:hover {
  @media (hover: hover) {
    color: #4b4cff;
  }
}
.header-nav__list a:focus-visible {
  position: relative;
  z-index: 1;

  border-color: #1819d3;
  outline: none;
}
.header-nav__list a:active {
  background-color: #f3f1f5;
  color: #1819d3;
}
.header-nav__list li:first-child a {
  padding-right: 23px;

  border-radius: 8px 0 0 8px;
}

.works-number {
  display: flex;
  align-self: flex-start;
  gap: 0.8px;

  margin: 10px 0 0 4px;
}
.works-number span {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 10px;
  height: 10px;
  border: 1px solid currentColor;
  border-radius: 50%;

  font-size: 7px;
  font-weight: 600;
  line-height: 1;
}

.header-lang {
  position: relative;

  margin-left: -1px;

  @media (max-width: 1023px) {
    margin-left: 0;
  }

  @media (max-width: 767px) {
    display: none;
  }
}
.header-lang__button {
  display: flex;
  align-items: center;
  gap: 4px;

  height: 56px;
  padding: 0 37px;
  border: 1px solid #949097;

  background-color: #ffffff;
  color: #3b393d;

  font-family: "Figtree", sans-serif;
  font-size: 15px;
  line-height: 1.1;
  text-transform: uppercase;
  cursor: pointer;

  @media (max-width: 1023px) {
    height: 35px;
    padding: 0 12px;
    border-radius: 4px;
  }
}
.header-lang__button:focus-visible {
  position: relative;
  z-index: 1;

  border-color: #1819d3;
  outline: none;
}
.header-lang__button:active {
  background-color: #f3f1f5;
  color: #1819d3;
}
.header-lang__chevron {
  transition: transform var(--header-transition);
}
.header-lang.is-open .header-lang__chevron {
  transform: rotate(180deg);
}

.header-lang__list {
  position: absolute;
  top: calc(100% - 1px);
  right: 0;
  left: 0;

  visibility: hidden;

  clip-path: inset(0 0 100% 0);
  transition:
    clip-path var(--header-transition),
    visibility 0s linear 0.3s;

  @media (max-width: 1023px) {
    top: calc(100% + 8px);
    left: auto;

    width: 112px;
  }
}
.header-lang.is-open .header-lang__list {
  visibility: visible;

  clip-path: inset(0);
  transition: clip-path var(--header-transition);
}
.header-lang__list li:not(:first-child) {
  margin-top: -1px;
}
.header-lang__link {
  display: flex;
  align-items: center;
  justify-content: center;

  padding: 12px;
  border: 1px solid #949097;

  background-color: #ffffff;
  color: #949097;

  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  transition: color var(--header-transition);

  @media (max-width: 1023px) {
    padding: 8px 12px;

    font-size: 15px;
    font-weight: 400;
    line-height: 1.3;
  }
}
.header-lang__link:hover {
  @media (hover: hover) {
    color: #4b4cff;
  }
}
.header-lang__link:focus-visible {
  position: relative;
  z-index: 1;

  border-color: #1819d3;
  outline: none;
}
.header-lang__link:active {
  background-color: #f3f1f5;
  color: #1819d3;
}
.header-lang__link.is-current {
  color: #1d191f;
}
.header-lang__list li:first-child .header-lang__link {
  @media (max-width: 1023px) {
    border-radius: 4px 4px 0 0;
  }
}
.header-lang__list li:last-child .header-lang__link {
  border-radius: 0 0 8px 8px;

  @media (max-width: 1023px) {
    border-radius: 0 0 4px 4px;
  }
}

.header-call {
  display: flex;
  align-items: center;

  height: 56px;
  margin-left: -1px;
  padding: 0 47px;
  border: 1px solid #949097;
  border-radius: 0 8px 8px 0;

  background-color: #ffffff;
  color: #4b4cff;

  font-size: 18px;
  font-weight: 600;
  line-height: 1.1;
  text-transform: lowercase;
  text-decoration: none;
  transition:
    color var(--header-transition),
    background-color var(--header-transition),
    border-color var(--header-transition);

  @media (max-width: 1023px) {
    height: auto;
    margin-left: 16px;
    padding: 10px 12px;
    border-color: #4b4cff;
    border-radius: 4px;

    font-size: 14px;
    letter-spacing: -0.28px;
  }

  @media (max-width: 767px) {
    margin-left: 0;
  }
}
.header-call:hover {
  @media (hover: hover) {
    background-color: #4b4cff;
    color: #ffffff;
  }

  @media (hover: hover) and (max-width: 1023px) {
    border-color: #1d191f;

    background-color: #ffffff;
    color: #1d191f;
  }
}
.header-call:focus-visible {
  position: relative;
  z-index: 1;

  border-color: #1819d3;
  outline: none;

  @media (max-width: 1023px) {
    border-color: #1d191f;

    color: #1819d3;
  }
}
.header-call:active {
  background-color: #f3f1f5;
  color: #1819d3;

  @media (max-width: 1023px) {
    border-color: #1d191f;

    background-color: #ffffff;
    color: #1d191f;
  }
}

.header-burger {
  display: none;

  @media (max-width: 1023px) {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 46px;
    height: 46px;
    margin-left: 48px;
    padding: 0;
    border: none;

    background: none;
    color: #241f27;

    cursor: pointer;
  }

  @media (max-width: 767px) {
    margin-left: 24px;
  }
}
.header-burger__close {
  display: none;
}
.header.is-menu-open .header-burger__open {
  display: none;
}
.header.is-menu-open .header-burger__close {
  display: block;
}

.header-menu {
  display: none;

  @media (max-width: 1023px) {
    position: absolute;
    top: calc(8px - var(--header-top));
    right: 8px;
    left: 8px;
    z-index: 1;
    display: block;

    max-height: calc(100svh - 16px);

    overflow-y: auto;

    padding: calc(var(--header-top) - 8px + var(--header-height) + 40px) 24px
      32px;
    border-radius: 24px;

    background-color: #e4e1e6;
    visibility: hidden;
    opacity: 0;

    transform: translateY(-30px);
    transition:
      opacity var(--header-menu-transition),
      transform var(--header-menu-transition),
      visibility 0s linear 0.6s;
  }

  @media (max-width: 767px) {
    top: calc(-1 * var(--header-top));
    right: 0;
    left: 0;

    height: 100svh;
    max-height: none;
    padding: calc(var(--header-top) + var(--header-height) + 40px) 16px 32px;
    border-radius: 0;
  }
}
.header.is-menu-open .header-menu {
  visibility: visible;
  opacity: 1;

  transform: none;
  transition:
    opacity var(--header-menu-transition),
    transform var(--header-menu-transition);
}

.header-menu__list {
  margin-top: -8px;
  margin-bottom: 88px;

  @media (max-width: 767px) {
    margin-bottom: clamp(24px, 6.9svh, 56px);
  }
}
.header-menu__list li:not(:last-child) {
  margin-bottom: 16px;
}

.header-menu__list a {
  display: block;

  padding: 8px 0 26px;

  background: var(--header-line-gray) left bottom / 10px 2px repeat-x;
  color: #949097;

  font-family: "Oswald", sans-serif;
  font-size: 29px;
  line-height: 1;
  text-decoration: none;
  transition:
    padding var(--header-transition),
    color var(--header-transition),
    background-color var(--header-transition);
}
.header-menu__list a:hover {
  @media (hover: hover) {
    padding-left: 12px;

    background-color: #ffffff;
    color: #4b4cff;
  }
}
.header-menu__list a:focus-visible,
.header-menu__list a:active {
  padding-left: 12px;

  outline: none;

  background-color: #ffffff;
  color: #4b4cff;
}
.header-menu__list .works-number {
  display: none;
}

.header-menu__langs {
  display: none;

  @media (max-width: 767px) {
    display: flex;
    gap: 16px;

    width: fit-content;
    margin: 0 auto clamp(32px, 9.7svh, 79px);
    padding: 4px;
    border: 1px solid #949097;
    border-radius: 999px;
  }
}
.header-menu__lang {
  display: flex;
  justify-content: center;

  width: 45px;
  padding: 10px;
  border: 1px solid #e4e1e6;
  border-radius: 999px;

  color: #949097;

  line-height: 1.3;
  text-transform: uppercase;
  text-decoration: none;
}
.header-menu__lang.is-current {
  background-color: #ffffff;
  color: #3b393d;
}

.header-menu__footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;

  padding: 24px 10px 0;

  background: var(--header-line-red) left top / 10px 2px repeat-x;
}
.header-menu__footer p {
  color: #949097;

  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}
.header-menu__footer a {
  color: #4b4cff;

  font-size: 17px;
  font-weight: 500;
  line-height: 1.3;
  text-decoration-line: underline;
  text-decoration-thickness: 8.5%;
  text-underline-offset: 25%;
  text-transform: lowercase;
  transition: color var(--header-transition);
}
.header-menu__footer a:hover {
  @media (hover: hover) {
    color: #1d191f;
  }
}
.header-menu__footer a:focus-visible {
  outline: 1px solid #949097;
  outline-offset: 1px;

  color: #1819d3;
}
.header-menu__footer a:active {
  color: #1d191f;
}
