/* V6.12 — Mobile-friendly compact capsule navigation */
.site-header .mobile-toggle {
  display: none;
  flex: 0 0 40px;
  align-items: center;
  justify-content: center;
  appearance: none;
  padding: 0;
  font-family: inherit;
  font-size: 21px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.site-header .mobile-toggle:hover {
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 4px 12px rgba(102, 69, 85, .09);
}

.site-header .mobile-toggle:active {
  transform: scale(.96);
}

.site-header .mobile-toggle:focus-visible,
.site-header .nav-links a:focus-visible {
  outline: 3px solid rgba(151, 113, 194, .55);
  outline-offset: 3px;
}

@media (max-width: 1180px) {
  :root {
    --header-height: 74px;
  }

  .site-header {
    position: sticky;
    top: 0;
    min-height: var(--header-height);
    padding-top: 8px;
    z-index: 60;
  }

  .site-header .nav-wrap {
    box-sizing: border-box;
    width: calc(100% - 28px);
    min-height: 56px;
    padding: 5px 7px 5px 11px;
    gap: 8px;
  }

  .site-header .nav-links {
    display: none;
  }

  .site-header .nav-actions {
    flex: 0 0 auto;
    gap: 8px;
  }

  .site-header .mobile-toggle {
    display: inline-flex;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 50%;
    color: #674c72;
    background: rgba(255, 255, 255, .72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .92), 0 3px 10px rgba(102, 69, 85, .05);
  }

  .site-header .nav-links.open {
    position: fixed;
    top: calc(var(--header-height) + 4px);
    right: max(14px, env(safe-area-inset-right));
    bottom: auto;
    left: max(14px, env(safe-area-inset-left));
    z-index: 92;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    justify-content: stretch;
    gap: 8px;
    box-sizing: border-box;
    width: auto;
    max-height: calc(100vh - var(--header-height) - 20px);
    max-height: calc(100dvh - var(--header-height) - 20px);
    margin: 0;
    padding: 13px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 22px;
    background: linear-gradient(125deg, rgba(255, 249, 242, .98), rgba(250, 240, 250, .98));
    box-shadow: 0 24px 60px rgba(78, 54, 81, .2), inset 0 1px 0 rgba(255, 255, 255, .92);
    -webkit-backdrop-filter: blur(24px) saturate(1.12);
    backdrop-filter: blur(24px) saturate(1.12);
    animation: nav-capsule-enter-v612 .18s ease-out both;
  }

  .site-header .nav-links.open a {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 0;
    min-height: 46px;
    padding: 12px 10px;
    border: 1px solid rgba(255, 255, 255, .86);
    border-radius: 999px;
    color: #5f4c5a;
    font-size: 14px;
    line-height: 1.35;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    background: rgba(255, 255, 255, .63);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .82);
    -webkit-tap-highlight-color: transparent;
  }

  .site-header .nav-links.open a:hover,
  .site-header .nav-links.open a.active,
  .site-header .nav-links.open a[aria-current="page"] {
    color: #5f3e68;
    border-color: rgba(255, 255, 255, .98);
    background: linear-gradient(120deg, rgba(255, 255, 255, .96), rgba(242, 226, 247, .9));
    box-shadow: 0 3px 10px rgba(111, 75, 117, .08), inset 0 1px 0 rgba(255, 255, 255, .96);
  }

  .site-header .nav-links.open a::after {
    display: none !important;
    content: none !important;
  }

  body.nav-open {
    overflow: hidden;
  }

  body.nav-open .site-header {
    z-index: 90;
  }

  body.nav-open .site-header .mobile-toggle {
    position: relative;
    z-index: 93;
  }

  body.nav-open .site-header .nav-links.open {
    z-index: 92;
    pointer-events: auto;
  }

  body.nav-open::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(57, 41, 59, .18);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    pointer-events: auto;
  }
}

@media (max-width: 780px) {
  :root {
    --header-height: 68px;
  }

  .site-header .nav-wrap {
    width: calc(100% - 20px);
    min-height: 52px;
    padding: 4px 6px 4px 9px;
    gap: 6px;
  }

  .site-header .brand {
    min-width: 0;
    gap: 6px;
  }

  .site-header .brand-logo {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .site-header .brand-text strong {
    font-size: 16px;
    letter-spacing: -.03em;
  }

  .site-header .brand-text span {
    display: none;
  }

  .site-header .nav-actions .btn {
    display: none;
  }

  .site-header .mobile-toggle {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
    font-size: 20px;
  }

  .site-header .nav-links.open {
    top: calc(var(--header-height) + 4px);
    right: max(10px, env(safe-area-inset-right));
    left: max(10px, env(safe-area-inset-left));
    gap: 7px;
    padding: 11px;
    border-radius: 20px;
  }

  .site-header .nav-links.open a {
    min-height: 44px;
    padding: 11px 8px;
    font-size: 14px;
  }
}

@media (max-width: 360px) {
  .site-header .nav-wrap {
    width: calc(100% - 16px);
    padding-left: 7px;
    gap: 5px;
  }

  .site-header .brand {
    gap: 5px;
  }

  .site-header .brand-logo {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .site-header .brand-text strong {
    font-size: 14px;
  }

  .site-header .mobile-toggle {
    flex-basis: 36px;
    width: 36px;
    height: 36px;
  }

  .site-header .nav-links.open {
    grid-template-columns: minmax(0, 1fr);
  }
}

@keyframes nav-capsule-enter-v612 {
  from { opacity: 0; transform: translateY(-5px) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .site-header .mobile-toggle,
  .site-header .nav-links.open {
    animation: none;
    transition: none;
  }
}
