.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
}
.nav__bar { display: flex; align-items: center; gap: 10px; height: var(--nav-h); }
.nav__brand { margin-right: auto; }
.nav__links { display: none; }

.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo__mark { width: 28px; height: 28px; color: var(--ink); }
.dark .logo__mark { color: var(--signal); }
.logo__word { font-size: 1.375rem; font-weight: 600; letter-spacing: -.05em; line-height: 1; }
.logo__light { font-weight: 400; }

/* Mobile menu without JavaScript: the toggle links to #menu, CSS :target shows the sheet. */
.nav__toggle {
  display: grid; place-content: center; gap: 5px; width: 38px; height: 38px;
  border: 1px solid var(--line-2); border-radius: var(--radius);
}
.nav__toggle span { display: block; width: 15px; height: 1.5px; border-radius: 1px; background: var(--ink); }
.nav__toggle--close { display: none; }
.nav__toggle--close span:first-child { transform: translateY(3.25px) rotate(45deg); }
.nav__toggle--close span:last-child { transform: translateY(-3.25px) rotate(-45deg); }
/* Sticky anchor at the reader's position, so jumping to #menu scrolls nowhere. */
.nav__anchor { position: sticky; top: 0; display: block; height: 1px; margin-bottom: -1px; scroll-margin-top: calc(-1 * (var(--nav-h) + 16px)); }
#menu:target + .nav .nav__toggle--open { display: none; }
#menu:target + .nav .nav__toggle--close { display: grid; }
.nav__sheet {
  position: absolute; left: 0; right: 0; top: var(--nav-h);
  display: none; padding: 8px var(--gutter) 24px; background: var(--page); border-bottom: 1px solid var(--line);
}
#menu:target + .nav .nav__sheet { display: grid; animation: sheet-in .25s var(--ease); }
.nav__sheet a { padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 1.375rem; letter-spacing: -.03em; }
.nav__sheet a:last-child { border-bottom: 0; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(-6px); } }

@media (min-width: 760px) {
  .nav__bar { gap: 18px; }
  .nav__links { display: flex; gap: 24px; margin-right: 10px; font-size: .9375rem; color: var(--ink-2); }
  .nav__links a { transition: color .2s var(--ease); }
  .nav__links a:hover { color: var(--ink); }
  .nav__toggle, .nav__sheet { display: none !important; }
}
@media (min-width: 1000px) { .nav__links { gap: 32px; } }
