.site-header {
  position: sticky;
  z-index: 1000;
  top: 0;
  width: 100%;
  overflow: hidden;
  border-bottom: 1px solid rgb(13 79 145 / 10%);
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 10px 30px rgb(11 29 58 / 0%);
  backdrop-filter: blur(14px);
  transition: box-shadow 220ms ease, transform 220ms ease;
  animation: header-reveal 280ms ease-out both;
}

.site-header::before {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  content: "";
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgb(5 150 105 / 15%) 24%,
    rgb(20 184 166 / 72%) 50%,
    rgb(13 79 145 / 15%) 76%,
    transparent 100%
  );
  background-size: 200% 100%;
  opacity: 0.7;
  animation: header-accent 5.5s ease-in-out infinite;
  pointer-events: none;
}

.site-header.is-scrolled {
  box-shadow: 0 10px 30px rgb(11 29 58 / 9%);
}

.header-inner {
  display: flex;
  width: min(calc(100% - 32px), var(--content-width));
  min-height: 76px;
  margin-inline: auto;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  color: var(--color-navy);
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: block;
  width: 52px;
  height: 52px;
  overflow: hidden;
  border-radius: 13px;
  background: var(--color-white);
  filter: drop-shadow(0 5px 8px rgb(5 150 105 / 15%));
  isolation: isolate;
  animation: logo-glow 3.4s ease-in-out infinite;
}

.brand-mark::after {
  position: absolute;
  z-index: 2;
  top: -28%;
  left: -80%;
  width: 34%;
  height: 156%;
  content: "";
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 75%), transparent);
  transform: rotate(16deg);
  animation: logo-shine 4.6s ease-in-out infinite;
  pointer-events: none;
}

.brand-mark img {
  position: absolute;
  z-index: 1;
  top: -8px;
  left: -18px;
  display: block;
  width: 88px;
  max-width: none;
  height: 88px;
  object-fit: contain;
  transition: transform 220ms ease;
}

.brand:hover .brand-mark img,
.brand:focus-visible .brand-mark img {
  transform: scale(1.04);
}

.brand-name {
  display: inline-flex;
  padding-block: 3px;
  font-family: var(--font-heading);
  font-size: 1.03rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.015em;
  white-space: nowrap;
  background: linear-gradient(
    105deg,
    var(--color-navy) 0%,
    var(--color-navy) 40%,
    var(--color-primary) 48%,
    var(--color-teal) 52%,
    var(--color-emerald) 56%,
    var(--color-navy) 66%,
    var(--color-navy) 100%
  );
  background-size: 300% 100%;
  background-position: 100% 0;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation:
    brand-text-reveal 700ms ease-out both,
    brand-text-shine 10s 2s ease-in-out infinite;
}

.brand-name span {
  margin-left: 0.34em;
  color: transparent;
}

.primary-nav {
  display: flex;
  margin-left: auto;
  align-items: center;
  gap: 2px;
}

.nav-link {
  position: relative;
  padding: 12px 10px;
  color: var(--color-text);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: color 180ms ease;
}

.nav-link::after {
  position: absolute;
  right: 10px;
  bottom: 6px;
  left: 10px;
  height: 2px;
  content: "";
  border-radius: 2px;
  background: var(--color-teal);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 220ms ease;
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link[aria-current="page"] {
  color: var(--color-primary);
}

.nav-link:hover::after,
.nav-link:focus-visible::after,
.nav-link[aria-current="page"]::after {
  transform: scaleX(1);
  transform-origin: left;
}

.header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.login-link {
  display: inline-flex;
  min-height: 44px;
  padding-inline: 13px;
  align-items: center;
  color: var(--color-primary);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}

.contact-link {
  display: inline-flex;
  min-height: 44px;
  padding-inline: 17px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-primary);
  border-radius: 8px;
  color: var(--color-white);
  background: var(--color-primary);
  font-size: 0.79rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.contact-link:hover,
.contact-link:focus-visible {
  color: var(--color-primary);
  background: var(--color-white);
  box-shadow: 0 8px 18px rgb(13 79 145 / 16%);
  transform: translateY(-2px);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid rgb(13 79 145 / 16%);
  border-radius: 8px;
  color: var(--color-navy);
  background: var(--color-white);
  cursor: pointer;
}

.menu-toggle svg {
  width: 22px;
  height: 22px;
}

.menu-toggle .icon-close,
.menu-toggle[aria-expanded="true"] .icon-menu {
  display: none;
}

.menu-toggle[aria-expanded="true"] .icon-close {
  display: block;
}

@keyframes logo-shine {
  0%,
  68% {
    left: -80%;
  }
  88%,
  100% {
    left: 130%;
  }
}

@keyframes logo-glow {
  0%,
  100% {
    filter: drop-shadow(0 5px 8px rgb(5 150 105 / 15%));
    transform: translateY(0);
  }
  50% {
    filter: drop-shadow(0 7px 12px rgb(20 184 166 / 28%));
    transform: translateY(-1px);
  }
}

@keyframes header-reveal {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes header-accent {
  0%,
  100% {
    background-position: 100% 0;
    opacity: 0.42;
  }
  50% {
    background-position: 0 0;
    opacity: 0.78;
  }
}

@keyframes brand-text-reveal {
  from {
    opacity: 0;
    letter-spacing: 0.075em;
    transform: translateX(-5px);
  }
  to {
    opacity: 1;
    letter-spacing: 0.015em;
    transform: translateX(0);
  }
}

@keyframes brand-text-shine {
  0%,
  72%,
  100% {
    background-position: 100% 0;
  }
  88% {
    background-position: 0 0;
  }
}

@media (max-width: 1050px) {
  .header-inner {
    min-height: 70px;
  }

  .menu-toggle {
    display: grid;
  }

  .primary-nav {
    position: fixed;
    top: 71px;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    visibility: hidden;
    margin: 0;
    padding: 22px 24px 32px;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: var(--color-white);
    opacity: 0;
    transform: translateY(-12px);
    transition: opacity 220ms ease, transform 220ms ease, visibility 220ms;
  }

  .primary-nav.is-open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
  }

  .nav-link {
    padding: 15px 4px;
    border-bottom: 1px solid var(--color-gray);
    font-size: 1rem;
  }

  .nav-link::after {
    right: auto;
    bottom: -1px;
    left: 4px;
    width: 36px;
  }

  .mobile-only {
    display: inline-flex;
  }
}

@media (min-width: 1051px) {
  .mobile-only {
    display: none;
  }
}

@media (max-width: 620px) {
  .header-inner {
    width: min(calc(100% - 24px), var(--content-width));
  }

  .brand-mark {
    width: 45px;
    height: 45px;
    border-radius: 11px;
  }

  .brand-mark img {
    top: -7px;
    left: -15px;
    width: 76px;
    height: 76px;
  }

  .brand-name {
    font-size: 0.88rem;
  }

  .desktop-contact {
    display: none;
  }

  .primary-nav {
    padding-inline: 18px;
  }
}

@media (max-width: 370px) {
  .brand {
    gap: 8px;
  }

  .brand-name {
    font-size: 0.78rem;
  }

  .header-actions .login-link {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-mark,
  .brand-mark::after,
  .brand-name,
  .site-header,
  .site-header::before {
    animation: none;
  }

  .brand-name {
    background: none;
    color: var(--color-navy);
  }

  .brand-name span {
    color: var(--color-teal);
  }

  .site-header,
  .primary-nav,
  .nav-link::after,
  .contact-link,
  .brand-mark img {
    transition: none;
  }
}
