/* ==========================================================================
   Site header (Pampadu navigation)
   ========================================================================== */

.site-header {
  position: relative;
  z-index: 20;
  background: var(--c-white);
  /* Hairline drawn inside the 50px bar, as in the design */
  box-shadow: inset 0 -1px #ececec;
  color: #2d2645;
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 35px;
  min-height: 50px;
}

.site-header__logo {
  display: flex;
  flex-shrink: 0;
  align-items: flex-start;
  gap: 8px;
  padding-block: 8px 7px;
}

.site-header__logo-mark {
  width: 38px;
  height: 35px;
}

.site-header__logo-text {
  width: 110px;
  height: 27px;
  margin-top: 5px;
}

/* Nav and buttons: part of the bar on desktop, a drop-down under the burger below 1200px */
.site-menu {
  display: contents;
}

.menu-toggle {
  display: none;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-left: auto;
  padding: 0;
  border: 0;
  background: none;
  color: #838b9c;
}

.menu-toggle > * {
  grid-area: 1 / 1;
  width: 24px;
  height: 24px;
}

.menu-toggle__close,
.is-menu-open .menu-toggle__open {
  visibility: hidden;
}

.is-menu-open .menu-toggle__close {
  visibility: visible;
}

.site-nav {
  flex: 1;
  align-self: stretch;
  min-width: 0;
}

/* Items spread over the 691px the design gives the menu */
.site-nav__list {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  max-width: 691px;
  height: 100%;
}

.site-nav__link {
  display: grid;
  grid-template-rows: 1fr 4px;
  align-items: center;
  height: 100%;
  padding-top: 4px;
  font-size: 15px;
  font-weight: 700;
  line-height: normal;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}

.site-nav__link::after {
  content: "";
  width: 100%;
  height: 4px;
  background: url("../img/nav-underline.svg") center / 100% 100% no-repeat;
  opacity: 0;
  transition: opacity 0.2s;
}

.site-nav__link:hover,
.site-nav__link--accent {
  color: #8e68ff;
}

.site-nav__link--dark {
  color: #000;
}

.site-nav__link:hover::after,
.site-nav__link--current::after {
  opacity: 1;
}

.site-header__actions {
  display: flex;
  flex-shrink: 0;
  gap: 5px;
  margin-left: auto;
}

.header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 34px;
  padding: 0 15px;
  border: 1px solid #a356f3;
  border-radius: 2px;
  color: #000;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: filter 0.2s, background-color 0.2s;
}

.header-btn:hover {
  background: #f6f0ff;
}

.header-btn--filled {
  min-width: 120px;
  padding-inline: 17px;
  border: 0;
  background: linear-gradient(209.9deg, #a356f3 7.35%, #6a2be3 107.02%);
  color: var(--c-white);
}

.header-btn--filled:hover {
  background: linear-gradient(209.9deg, #a356f3 7.35%, #6a2be3 107.02%);
  filter: brightness(1.08);
}

@media (max-width: 1199px) {
  .menu-toggle {
    display: grid;
  }

  .site-menu {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    display: grid;
    gap: 16px;
    padding: 8px var(--gutter) 24px;
    background: var(--c-white);
    box-shadow: 0 16px 32px -16px rgba(35, 24, 67, 0.35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition:
      opacity 0.2s,
      transform 0.2s var(--ease-out),
      visibility 0s 0.2s;
  }

  .is-menu-open .site-menu {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition:
      opacity 0.2s,
      transform 0.2s var(--ease-out);
  }

  .site-nav__list {
    flex-direction: column;
    gap: 0;
    max-width: none;
  }

  .site-nav__link {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0fc;
  }

  .site-nav__link::after {
    display: none;
  }

  .site-header__actions {
    margin-left: 0;
  }

  .site-header__actions .header-btn {
    flex: 1;
    min-height: 44px;
  }
}

/* Phones: 320px design — logo and burger in a 52px bar */
@media (max-width: 639px) {
  .site-header {
    box-shadow: none;
  }

  .site-header__inner {
    min-height: 52px;
  }

  .site-header__logo {
    gap: 5.84px;
    padding-block: 12px 12.91px;
  }

  .site-header__logo-mark {
    width: 29.28px;
    height: 27.09px;
  }

  .site-header__logo-text {
    width: 84.71px;
    height: 20.85px;
    margin-top: 3.61px;
  }
}
