/* The section links share the navigation scale and retain full-height touch targets. */
html[data-study] #top #nav {
  --menu-pad: max(var(--edge), calc((100% - var(--layout)) / 2 + var(--edge)));
  --menu-ink: var(--ui-ink);
  --menu-muted: var(--ui-muted);
  --nav-rule: var(--ui-outline);
  --rail-gap: .25rem;
  --nav-hover: color-mix(in srgb, var(--ui-ink) 6%, var(--page));
}
html[data-study] #top #nav[data-moving] {
  background: var(--page);
  box-shadow: 0 1px var(--nav-rule);
}
html[data-study] #top #nav :is(#navLinks, .phone-sections) a {
  display: inline-grid;
  grid-template-areas: "label";
  align-items: center;
  min-height: var(--ui-icon-size);
  padding: 0 .875rem;
  border-radius: 0;
  background: transparent;
  color: var(--menu-muted);
  font: 500 .875rem/1.2 var(--font);
  letter-spacing: -.01em;
}
html[data-study] #top #nav :is(#navLinks, .phone-sections) a .section-label,
html[data-study] #top #nav :is(#navLinks, .phone-sections) a::before {
  grid-area: label;
}
/* Reserve the bold label's width so the rail stays still as the active section changes. */
html[data-study] #top #nav :is(#navLinks, .phone-sections) a::before {
  content: attr(data-label) / "";
  visibility: hidden;
  pointer-events: none;
  font-weight: 700;
}
html[data-study] #top #nav :is(#navLinks, .phone-sections) a .section-label::after {
  content: none;
}
html[data-study] #top #nav :is(#navLinks, .phone-sections) a[aria-current="location"] {
  color: var(--menu-ink);
  font-weight: 700;
}
html[data-study] #top #nav :is(#navLinks, .phone-sections) a:focus-visible {
  outline: none;
}
html[data-study] #top #nav :is(#navLinks, .phone-sections) a:focus-visible .section-label {
  outline: 2px solid var(--menu-ink);
  outline-offset: .25rem;
}
html[data-study] #top #nav #touchBtn {
  position: relative;
  height: var(--ui-chip-height) !important;
  gap: .375rem;
  padding: 0 .875rem !important;
  border: 1px solid var(--ui-outline);
  border-radius: 99rem;
  background: var(--ui-surface) !important;
  color: var(--ui-ink) !important;
  font: 500 .875rem/1.2 var(--font) !important;
  letter-spacing: -.01em;
}
html[data-study] #top #nav #touchBtn::before {
  content: "";
  position: absolute;
  inset: -.25rem 0;
}
html[data-study] #top #nav #touchBtn[aria-expanded="true"] {
  border-color: var(--ui-ink);
}
html[data-study] #top #nav .touch-menu {
  top: calc(100% + .5rem);
  padding: .375rem;
  border: 1px solid var(--ui-outline);
  border-radius: 1rem !important;
  background: var(--ui-surface);
  box-shadow: 0 .5rem 1.5rem rgb(18 22 19 / .07) !important;
}
html[data-study] #top #nav .touch-menu a {
  min-height: var(--ui-icon-size);
  color: var(--ui-ink);
  font: 500 .875rem/1.3 var(--font);
}
html[data-study] #top #nav .nav-tools,
html[data-study] #top #nav #themeBtn[aria-pressed] {
  border-radius: 50%;
  color: var(--ui-ink);
}
@media (hover: hover) {
  html[data-study] #top #nav :is(#navLinks, .phone-sections) a:hover {
    color: var(--menu-ink);
  }
  html[data-study] #top #nav :is(.touch-menu a, .nav-tools, #themeBtn[aria-pressed]):hover {
    background: var(--nav-hover);
    color: var(--ui-ink);
  }
  html[data-study] #top #nav #touchBtn:hover {
    border-color: var(--ui-ink);
    text-decoration: none;
  }
}
@media (min-width: 961px) and (max-width: 1180px) {
  html[data-study] #top #nav[data-mode="expanded"] {
    --rail-start: calc(var(--menu-pad) + var(--wordmark-width) + .5rem);
    --rail-end: calc(var(--menu-pad) + 11rem);
    --rail-gap: .125rem;
  }
}
@media (max-width: 700px), (max-width: 960px) and (hover: none) and (pointer: coarse) {
  html[data-study] #top #nav .phone-sections {
    gap: var(--rail-gap);
  }
  html[data-study] #top #nav .row-bottom {
    padding: .5rem var(--menu-pad);
    border-block: 1px solid var(--ui-outline);
    background: var(--page);
    box-shadow: none;
  }
  html[data-study] #top #nav .theme-setting {
    min-height: var(--ui-icon-size);
    padding-inline: .875rem;
    color: var(--ui-ink);
    font: 500 .875rem/1.2 var(--font);
  }
}
@media (prefers-reduced-motion: no-preference) {
  html[data-study] #top #nav[data-ready],
  html[data-study] #top #nav :is(#touchBtn, .section-label, .nav-tools, #themeBtn[aria-pressed], .touch-menu a) {
    transition:
      color var(--ui-fast) var(--ui-ease),
      background-color var(--ui-fast) var(--ui-ease),
      border-color var(--ui-fast) var(--ui-ease),
      box-shadow var(--ui-fast) var(--ui-ease);
  }
  html[data-study] #top #nav .touch-menu,
  html[data-study] #top #nav #touchBtn svg {
    transition-duration: var(--ui-fast);
    transition-timing-function: var(--ui-ease);
  }
  html[data-study] #top #nav[data-ready] .row-bottom {
    transition: opacity var(--ui-fast) var(--ui-ease), visibility 0s linear var(--ui-fast);
  }
  html[data-study] #top #nav[data-ready] .row-bottom:where(:not([inert])) {
    transition-delay: 0s;
  }
}
@media (prefers-reduced-motion: reduce) {
  html[data-study] #top #nav *,
  html[data-study] #top #nav *::after {
    transition: none !important;
  }
}
