.site-header {
  position: relative;
  z-index: 20;
  border-bottom: 1px solid var(--header-line);
  color: var(--header-ink);
  transition: color 540ms ease, border-color 540ms ease;
}

.site-header__inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: clamp(24px, 3vw, 54px);
  align-items: center;
  min-height: 84px;
}

.brand {
  position: relative;
  z-index: 2;
  display: inline-flex;
  width: 220px;
  color: var(--header-ink);
  transition: color 540ms ease;
}

.brand__logo {
  width: 100%;
  height: auto;
}

.site-nav {
  display: flex;
  gap: clamp(18px, 1.8vw, 34px);
  align-items: center;
  justify-content: center;
  min-width: 0;
  font-size: clamp(0.86rem, 0.92vw, 0.98rem);
  font-weight: 500;
  white-space: nowrap;
}

.site-nav__link,
.site-nav__label {
  position: relative;
  padding-block: 12px;
}

.site-nav__link::after {
  position: absolute;
  right: 0;
  bottom: 7px;
  left: 0;
  height: 1px;
  content: "";
  transform: scaleX(0);
  transform-origin: right;
  background: currentColor;
  transition: transform 220ms ease;
}

.site-nav__label {
  opacity: 0.72;
}

.site-nav .site-nav__mobile-cta {
  display: none;
}

.button {
  --button-border: transparent;
  display: inline-flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 24px;
  border: 1px solid var(--button-border);
  border-radius: 10px;
  font-size: 0.96rem;
  font-weight: 650;
  line-height: 1.15;
  text-align: center;
  transition: transform 180ms ease, background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

.button svg,
.text-link svg {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.button--primary {
  --focus-color: var(--primary-focus);
  background: var(--primary-bg);
  color: var(--primary-ink);
}

.button--header {
  --button-border: var(--header-button-line);
  min-height: 50px;
  padding-inline: 20px;
  color: var(--header-button-ink);
  background: transparent;
  font-size: 0.91rem;
}

.site-header__cta {
  min-width: 184px;
}

.site-header__cta svg {
  width: 18px;
  height: 18px;
}

.text-link {
  --focus-color: var(--secondary-ink);
  display: inline-flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 0 2px;
  border-bottom: 1px solid var(--secondary-line);
  color: var(--secondary-ink);
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.25;
  transition: color 180ms ease, border-color 180ms ease;
}

.menu-toggle {
  position: relative;
  display: none;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--header-line);
  border-radius: 10px;
  background: transparent;
  color: var(--header-ink);
}

.menu-toggle span {
  position: absolute;
  left: 12px;
  width: 20px;
  height: 1.5px;
  background: currentColor;
  transition: transform 220ms ease, top 220ms ease;
}

.menu-toggle span:first-child {
  top: 17px;
}

.menu-toggle span:last-child {
  top: 26px;
}

.menu-toggle[aria-expanded="true"] span:first-child {
  top: 21px;
  transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:last-child {
  top: 21px;
  transform: rotate(-45deg);
}

@media (hover: hover) {
  .site-nav__link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
  }

  .button:hover {
    transform: translateY(-2px);
  }

  .button--primary:hover {
    background: var(--primary-bg-hover);
  }

  .button--header:hover {
    border-color: var(--header-button-ink);
    background: var(--header-button-hover);
  }

  .text-link:hover {
    border-color: currentColor;
  }
}

@media (max-width: 1220px) {
  .site-header__inner {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
  }

  .site-header__cta {
    grid-column: 3;
    justify-self: end;
  }

  .menu-toggle {
    grid-column: 4;
    justify-self: end;
  }

  .site-nav {
    position: absolute;
    z-index: 30;
    top: calc(100% + 10px);
    right: 32px;
    display: none;
    width: min(420px, calc(100vw - 64px));
    padding: 20px;
    border: 1px solid var(--header-line);
    border-radius: var(--radius-sm);
    background: var(--header-panel);
    box-shadow: var(--shadow-soft);
    color: var(--header-ink);
    white-space: normal;
  }

  .site-header.is-enhanced .menu-toggle {
    display: inline-flex;
  }

  .site-header.is-enhanced .site-nav.is-open {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: stretch;
  }

  .site-nav__link,
  .site-nav__label {
    min-height: 44px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--header-line);
  }

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

  .site-nav__label {
    opacity: 0.62;
  }
}

@media (max-width: 640px) {
  .site-header__inner {
    min-height: 66px;
  }

  .brand {
    width: 174px;
  }

  .site-header__cta {
    display: none;
  }

  .site-nav {
    right: 16px;
    width: calc(100vw - 32px);
    max-height: calc(100svh - 84px);
    overflow-y: auto;
  }

  .site-nav .site-nav__mobile-cta {
    display: inline-flex;
    width: 100%;
    margin-top: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-nav__link::after,
  .button,
  .menu-toggle span {
    transition: none;
  }
}
