/* Page names use the clear, spaced lettering of the cultural continuum label. */
.window-titlebar nav > a,
#main:not([data-page^="passage/"]) > .intro > .eyebrow:first-child {
  font-family: Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-style: normal;
  font-synthesis: none;
  font-kerning: normal;
  letter-spacing: .12em;
  text-transform: uppercase;
}

#main:not([data-page^="passage/"]) > .intro > .eyebrow:first-child {
  font-size: 9px;
  line-height: 1.6;
}

.window-titlebar nav > a {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  flex: 0 0 auto;
  gap: 8px;
  min-height: 48px;
  width: 100%;
  max-width: 100%;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
}

.window-titlebar .page-label{
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  position: relative;
  isolation: isolate;
  white-space: nowrap;
}

.window-titlebar .page-initial{
  display: inline-block;
  flex: 0 0 auto;
  position: relative;
  margin-right: 0;
  font-size: 1em;
  font-style: normal;
  line-height: inherit;
  letter-spacing: inherit;
}

.window-titlebar .page-rest{
  position: relative;
  z-index: 1;
  font-size: 1em;
  font-style: normal;
  line-height: inherit;
}

.window-titlebar nav > a > .signal-dot {
  flex: 0 0 auto;
  margin-left: 0;
}

.window-titlebar nav > a > span:not(.page-label):not(.signal-dot){
  font-family: Helvetica, Arial, sans-serif;
  font-size: .45em;
  font-style: normal;
  font-weight: 400;
  line-height: 1;
}

/* One anchored control unfolds into the same compact menu on every screen. */
.window-titlebar {
  position: relative;
  height: 70px;
  min-height: 70px;
  padding: 0;
}

.mobile-navigation {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 31;
  display: flex;
  align-items: center;
}

.menu-toggle {
  position: relative;
  z-index: 31;
  display: inline-flex;
  flex: 0 0 44px;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
}

.menu-toggle:hover,
.menu-toggle[aria-expanded=true] { background: rgb(98 0 199 / .09); }
.menu-lines { display: grid; gap: 5px; width: 22px; }
.menu-lines > span {
  display: block;
  height: 2px;
  width: 100%;
  border-radius: 2px;
  background: currentColor;
  transition: transform 240ms ease, opacity 180ms ease;
}
.window-titlebar.menu-open .menu-lines > span:first-child { transform: translateY(7px) rotate(45deg); }
.window-titlebar.menu-open .menu-lines > span:nth-child(2) { opacity: 0; }
.window-titlebar.menu-open .menu-lines > span:last-child { transform: translateY(-7px) rotate(-45deg); }

.window-titlebar nav {
  position: absolute;
  z-index: 30;
  top: 12px;
  left: 12px;
  right: auto;
  display: flex;
  flex-flow: column nowrap;
  align-items: stretch;
  justify-content: flex-start;
  width: min(280px, calc(100% - 24px));
  max-width: none;
  max-height: min(78dvh, 440px);
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-padding-top: 54px;
  gap: 3px;
  padding: 54px 8px 8px;
  border: 1px solid var(--control);
  border-radius: 22px;
  background: #aaa5b1;
  box-shadow: 0 8px 24px #30203d26;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: scale(.94, .9);
  transform-origin: 22px 22px;
  clip-path: inset(0 calc(100% - 44px) calc(100% - 44px) 0 round 22px);
  transition: opacity 200ms ease, transform 240ms cubic-bezier(.2, .8, .2, 1),
    clip-path 240ms cubic-bezier(.2, .8, .2, 1), visibility 0s linear 240ms;
}

/* The cap keeps scrolled links below the trigger on short screens. */
.window-titlebar nav::before {
  content: "";
  position: sticky;
  top: -54px;
  z-index: 2;
  flex: 0 0 46px;
  margin: -54px -8px 5px;
  border-radius: 21px 21px 0 0;
  background: inherit;
}

.window-titlebar.menu-open nav {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
  clip-path: inset(0 0 0 0 round 22px);
  transition-delay: 0s;
}

@media (max-width: 767px) {
  .window-titlebar { height: 66px; min-height: 66px; }
}

@media (prefers-reduced-motion: reduce) {
  .window-titlebar nav,
  .menu-lines > span { transition: none; }
}
