I am trying to order my navigation bar so that the order is, nav, then button, then h1. I am following a tutorial here and it is the third option provided by the youtuber. The h1 should be pushed all the way to the right side. For some reason flex order will not work within the header and align it the correct way.
This is what it should look like:

*{
box-sizing: border-box;
padding:0;
margin:0;
}
body{
background-color: rgb(54, 54, 54);
font-family: sans-serif;
color: white;
}
li, a, button{
font-weight: 500;
font-size: 16px;
font-family: sans-serif;
color: rgb(255, 255, 255);
text-decoration: none;
}
header{
display: flex;
justify-content: space-between;
align-items: center;
height: 15vh;
padding: 30px 10%;
}
h1{
cursor: pointer;
margin-left: auto;
order: 3;
}
nav{
order: 1;
}
ul{
list-style: none;
}
ul li{
display: inline-block;
padding: 0 20px;
}
ul li a{
transition: all 0.3s ease;
}
ul li a:hover{
color: pink;
}
.cta{
order: 2;
}
button{
padding: 9px 25px;
background-color: white;
color: rgb(54, 54, 54);
border: none;
border-radius: 50px;
cursor: pointer;
transition: all 0.3s ease;
}
button:hover{
background-color: pink;
color: white;
}
<header>
<a href="/index.html"><h1>Loonieville</h1></a>
<nav>
<ul class='navlinks'>
<li><a href="/">Main St</a></li>
<li><a href="/">Town Hall</a></li>
<li><a href="/">Downtown</a></li>
</ul>
</nav>
<a href="" class='cta'><button>
Contact
</button></a>
</header>