The distance between the plasma membrane and the actomyosin cortex acts as a nanogate to control cell surface mechanics