/* Sienda navbar motion refinement: slower, directional movement with a soft finish. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(245, 247, 252, 0.96);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: box-shadow .24s ease, background-color .24s ease;
}

.site-header.is-page-scrolled {
  box-shadow: 0 8px 28px rgba(21, 27, 43, 0.08);
  background: rgba(245, 247, 252, 0.98);
}

.site-header .header-inner {
  position: relative;
}

.site-header .brand-full-logo {
  display: block;
  width: 177px;
  height: auto;
  max-width: min(177px, 40vw);
  transition: width 850ms cubic-bezier(.65, 0, .35, 1);
}

/*
 * Full desktop navigation only. The logo stays absolutely anchored to the
 * header container so its `left` value can animate rather than snap when its
 * layout mode changes. The nav remains right-aligned while it exits.
 */
@media (min-width: 861px) {
  .site-header .header-inner {
    justify-content: flex-end;
  }

  .site-header .brand {
    position: absolute;
    left: 0;
    top: 50%;
    margin: 0;
    z-index: 2;
    transform: translateY(-50%);
    transition:
      left 900ms cubic-bezier(.65, 0, .35, 1),
      transform 900ms cubic-bezier(.65, 0, .35, 1);
    will-change: left, transform;
  }

  .site-header .primary-nav {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    transition:
      opacity 650ms ease-in-out,
      transform 800ms cubic-bezier(.65, 0, .35, 1),
      visibility 0s linear 0s;
    will-change: opacity, transform;
  }

  /* Scroll down: the wordmark glides right into the centre as controls exit right. */
  .site-header.is-nav-centered .brand {
    left: 50%;
    transform: translate(-50%, -50%);
  }

  .site-header.is-nav-centered .brand-full-logo {
    width: 158px;
  }

  .site-header.is-nav-centered .primary-nav {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(52px);
    transition:
      opacity 650ms ease-in-out,
      transform 800ms cubic-bezier(.65, 0, .35, 1),
      visibility 0s linear 800ms;
  }
}

/* Keep mobile and compact tablet navigation accessible and unchanged. */
@media (max-width: 760px) {
  .site-header .header-inner {
    min-height: 70px;
  }

  .site-header .brand-full-logo {
    width: 154px;
    max-width: min(154px, 48vw);
  }

  .site-header.is-page-scrolled .header-inner {
    min-height: 66px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header,
  .site-header .brand,
  .site-header .brand-full-logo,
  .site-header .primary-nav {
    transition: none !important;
    will-change: auto !important;
  }
}
