Rotating a character relative to the ground's rotation

Hello I’m new to unity and I’m attempting to create my first game. I’ve been trying to figure this out for two days now but haven’t made any progress. In the game the character runs up a hill that gets steeper and steeper; I’m trying to smoothly rotate the character relative to the ground’s x rotation. Here’s my script so far.

void Start(){
    //bool rotate = false;
      float rotSmoothing = 0.5f;
}
// Update is called once per frame
void Update () {
	RaycastHit hit;

	if(Physics.Raycast(transform.position, -Vector3.up, out hit, 3)){
		
		Quaternion Rot = Quaternion.Slerp (transform.rotation,   
                   hit.collider.gameObject.transform.rotation,rotSmoothing * Time.deltaTime);	
                    transform.rotation = Quaternion.Euler (-Rot.eulerAngles.x,transform.eulerAngles.y,transform.eulerAngles.z);
                   Debug.DrawRay (transform.position, -Vector3.up * 3, Color.red);
	
	}
}

Simply remove the negative sign in front of Rot.eulerAngles.x:

transform.rotation = Quaternion.Euler(Rot.eulerAngles.x, transform.eulerAngles.y, transform.eulerAngles.z);

Another thing I noticed, in the second parameter of Quaternion.Slerp, you can just do: hit.collider.transform.rotation instead of hit.collider.gameObject.transform.rotation.