/* One navigation tree, with a roomy menu on phones and tablets. */
.site-header {
  --site-header-height: 80px;
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  height: auto;
  padding: 0;
  background: #fff;
  box-shadow:
    0 4px 24px #341a3f0b,
    inset 0 -1px #a24aa31c;
  transition: box-shadow 200ms ease;
}
.site-header.scrolled {
  box-shadow:
    0 6px 22px #341a3f13,
    inset 0 -1px #a24aa31c;
}
.site-header > .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  max-width: 1360px;
  min-height: 80px;
  margin-inline: auto;
  padding: 12px 24px;
}
.site-header .logo {
  min-width: 0;
  flex: 0 1 auto;
}
.site-header .logo a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #34223f;
  text-decoration: none;
}
.site-header .logo img {
  flex: 0 0 50px;
  width: 50px;
  height: 50px;
  margin: 0;
  object-fit: contain;
}
.site-header .brand-name {
  font-family: var(--heading-font, "Nunito", sans-serif);
  font-size: 1.18rem;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #34223f;
}
.site-header #primary-navigation {
  flex: 0 0 auto;
}
.site-header #primary-navigation ul {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.1vw, 18px);
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-header #primary-navigation li {
  margin: 0;
  padding: 0;
}
.site-header #primary-navigation a {
  display: inline-flex;
  position: relative;
  align-items: center;
  min-height: 44px;
  color: #49364f;
  font-family: var(--accent-font, "Montserrat", sans-serif);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition:
    color 180ms ease,
    background-color 180ms ease;
}
.site-header #primary-navigation a::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3px;
  height: 3px;
  width: auto;
  border-radius: 3px;
  background: linear-gradient(90deg, #a24aa3 70%, #e9bf71);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}
.site-header #primary-navigation a:hover,
.site-header #primary-navigation a[aria-current="page"] {
  color: #873888;
}
.site-header #primary-navigation a:hover::before,
.site-header #primary-navigation a[aria-current="page"]::before {
  transform: scaleX(1);
}
.site-header #primary-navigation a.btn-primary {
  justify-content: center;
  padding: 11px 18px;
  border: 1px solid #944298;
  border-radius: 50px;
  background: linear-gradient(135deg, #aa4dab, #923f96);
  box-shadow:
    0 4px 14px #8e349226,
    inset 0 1px #ffffff2e;
  color: #fff;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.5;
}
.site-header #primary-navigation a.btn-primary:hover {
  background: #78317e;
  color: #fff;
  transform: none;
}
.site-header #primary-navigation a.btn-primary::before {
  display: none;
}
.site-header #primary-navigation a.btn-primary[aria-current="page"] {
  box-shadow:
    0 0 0 3px #f4e1ba,
    0 4px 14px #8e349226;
}
.site-header :is(a, button):focus-visible {
  outline: 3px solid #a24aa3;
  outline-offset: 4px;
  border-radius: 8px;
}
.site-header .mobile-menu-toggle,
.site-header .menu-backdrop {
  display: none;
}

/* Keep all links on smaller laptops without squeezing the academy name. */
@media (min-width: 1025px) and (max-width: 1279px) {
  .site-header > .container {
    gap: 16px;
    padding-inline: 20px;
  }
  .site-header .logo a {
    gap: 9px;
  }
  .site-header .logo img {
    flex-basis: 44px;
    width: 44px;
    height: 48px;
  }
  .site-header .brand-name {
    font-size: 1.05rem;
    white-space: nowrap;
  }
  .site-header .brand-line {
    display: inline;
  }
  .site-header #primary-navigation ul {
    gap: clamp(10px, 1vw, 13px);
  }
  .site-header #primary-navigation a {
    font-size: 0.875rem;
  }
  .site-header #primary-navigation a.btn-primary {
    padding-inline: 14px;
  }
}

@media (min-width: 1025px) and (max-width: 1100px) {
  .site-header .brand-line {
    display: block;
  }
}

/* Width handles phones; primary touch input keeps larger tablets in menu mode. */
@media (max-width: 1024px),
  (max-width: 1366px) and (hover: none) and (pointer: coarse) {
  .site-header {
    --site-header-height: 76px;
  }
  .site-header > .container {
    min-height: 76px;
    gap: 16px;
    padding-block: 10px;
  }
  .site-header .logo a {
    gap: 12px;
  }
  .site-header .logo img {
    flex-basis: 50px;
    width: 50px;
    height: 50px;
  }
  .site-header .brand-name {
    font-size: 1.18rem;
    white-space: normal;
  }
  .site-header .brand-line {
    display: inline;
  }
  .site-header .mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 0 0 auto;
    width: 100px;
    min-height: 46px;
    padding: 10px 14px;
    border: 1px solid #e4d5e9;
    border-radius: 12px;
    background: #fcf8fd;
    color: #733778;
    font: 700 0.82rem/1.2 var(--body-font, sans-serif);
    cursor: pointer;
    transform: none;
    transition:
      background-color 180ms ease,
      border-color 180ms ease;
    touch-action: manipulation;
  }
  .site-header .mobile-menu-toggle:hover,
  .site-header .mobile-menu-toggle[aria-expanded="true"] {
    background: #f3e8f6;
    border-color: #c69ccc;
  }
  .site-header .menu-icon {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
  }
  .site-header .menu-icon path {
    transform-origin: 12px 12px;
    transition:
      transform 180ms ease,
      opacity 180ms ease;
  }
  .site-header [aria-expanded="true"] .menu-icon path:first-child {
    transform: translateY(6px) rotate(45deg);
    transform-origin: 12px 6px;
  }
  .site-header [aria-expanded="true"] .menu-icon path:nth-child(2) {
    opacity: 0;
  }
  .site-header [aria-expanded="true"] .menu-icon path:last-child {
    transform: translateY(-6px) rotate(-45deg);
    transform-origin: 12px 18px;
  }
  .site-header .menu-backdrop:not([hidden]) {
    display: block;
    position: fixed;
    inset: var(--site-header-height) 0 0;
    background: #24142f66;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1;
    touch-action: none;
  }
  .site-header #primary-navigation {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    right: max(24px, env(safe-area-inset-right));
    left: auto;
    width: min(420px, calc(100% - 48px));
    height: auto;
    max-height: calc(
      100dvh - var(--site-header-height) - 24px - env(safe-area-inset-bottom)
    );
    margin: 0;
    padding: 12px;
    border: 1px solid #e8dcec;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 20px 60px #21122d33;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #d9bce1 transparent;
    opacity: 1;
    z-index: 2;
    transition: none;
  }
  .site-header #primary-navigation.active {
    display: block;
  }
  .site-header #primary-navigation ul {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }
  .site-header #primary-navigation a {
    display: flex;
    justify-content: flex-start;
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.94rem;
    line-height: 1.5;
    white-space: normal;
  }
  .site-header #primary-navigation a::before {
    display: none;
  }
  .site-header #primary-navigation a:hover,
  .site-header #primary-navigation a[aria-current="page"]:not(.btn-primary) {
    background: #f6edf8;
    color: #803583;
  }
  .site-header
    #primary-navigation
    a[aria-current="page"]:not(.btn-primary)::after {
    content: "";
    width: 7px;
    height: 7px;
    margin-left: auto;
    border-radius: 50%;
    background: #a24aa3;
  }
  .site-header #primary-navigation li:last-child {
    margin-top: 6px;
    padding-top: 12px;
    border-top: 1px solid #eee5f1;
  }
  .site-header #primary-navigation a.btn-primary {
    border-radius: 12px;
  }
  html.site-menu-open,
  html.site-menu-open body {
    overscroll-behavior: none;
  }
}

@media (max-width: 480px) {
  .site-header {
    --site-header-height: 68px;
  }
  .site-header > .container {
    min-height: 68px;
    padding: 10px max(16px, env(safe-area-inset-right)) 10px
      max(16px, env(safe-area-inset-left));
    gap: 12px;
  }
  .site-header .logo a {
    gap: 10px;
  }
  .site-header .logo img {
    width: 40px;
    height: 44px;
    flex-basis: 40px;
  }
  .site-header .brand-name {
    font-size: 1rem;
    line-height: 1.25;
  }
  .site-header .brand-line {
    display: block;
  }
  .site-header .mobile-menu-toggle {
    width: 92px;
    padding-inline: 10px;
  }
  .site-header #primary-navigation {
    right: max(12px, env(safe-area-inset-right));
    width: calc(100% - 24px);
    top: calc(100% + 8px);
    max-height: calc(
      100dvh - var(--site-header-height) - 20px - env(safe-area-inset-bottom)
    );
    border-radius: 16px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .site-header #primary-navigation.active {
    animation: navigation-entry 180ms ease-out;
  }
  @keyframes navigation-entry {
    from {
      opacity: 0;
      transform: translateY(-6px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  .site-header,
  .site-header #primary-navigation a,
  .site-header #primary-navigation a::before,
  .site-header .mobile-menu-toggle,
  .site-header .menu-icon path {
    transition: none;
  }
}
