.menu-container { position: relative; display: flex; align-items: flex-end; margin-bottom: 20px; //background: #fff; color: #000; padding: 20px; z-index: 1; -webkit-user-select: none; user-select: none; box-sizing: border-box; font-weight: 500; } #site-titles { #site-title { font-family: waax; font-weight: 400; font-size: 44px; margin: 10px 0; white-space: nowrap; } #site-subtitle { font-size: 20px; max-width: 11em; font-weight: 400; margin: 0; } } .menu-container a { display: block; text-decoration: none; color: #000; transition: color 0.1s ease; text-transform: lowercase; &:hover { color: #2FB6BC; } } .menu-container input { display: block; width: 30px; height: 30px; right: 10px; top: 10px; margin: 0; position: absolute; cursor: pointer; opacity: 0; /* hide this */ z-index: 2; /* and place it over the hamburger */ -webkit-touch-callout: none; } .menu-container .hamburger-bar { display: block; width: 14px; height: 2px; margin-bottom: 2px; position: relative; background: #000; border-radius: 2px; z-index: 1; transform-origin: 3px 0px; transition: all 0.1s ease; } .menu-container .hamburger-bar:first-child { transform-origin: 0% 0%; } .menu-container .hamburger-bar:nth-child(3) { transform-origin: 0% 100%; } .menu-container input:checked ~ .hamburger-bar { opacity: 1; transform: rotate(45deg) translate(3px,-1px); } .menu-container input:checked ~ .hamburger-bar:nth-child(4) { opacity: 0; transform: rotate(0deg) scale(0.1, 0.1); } .menu-container input:checked ~ .hamburger-bar:nth-child(3) { transform: rotate(-45deg) translate(-1px, 6px); } .menu { list-style: none; margin: 0; } .menu li { margin-bottom: 0; padding: 10px 0; .menu-item-title { display: block; font-size: 20px; font-weight: 700; } .menu-item-subtitle { font-size: 16px; } } @media only screen and (max-width: 1000px) { .menu-container { flex-direction: column; align-items: flex-end; } #site-titles { position: absolute; left: 20px; top: 20px; } .menu { position: absolute; box-sizing: border-box; width: 300px; right: -300px; top: 0; margin: -20px; padding: 75px 50px 50px; background: #eee; -webkit-font-smoothing: antialiased; /* to stop flickering of text in safari */ transform-origin: 0% 0%; transform: translateX(0%); transition: transform 0.1s cubic-bezier(0.77,0.2,0.05,1.0); } .menu-container input:checked ~ .menu { transform: translateX(-100%); } } @media only screen and (min-width: 1001px) { .menu-container { width: 100%; } .menu-container a { color: #000; } .menu-container input { display: none; } .menu-container .hamburger-bar { display: none; } .menu { position: relative; width: 100%; display: flex; justify-content: flex-end; } .menu ul { display: flex; padding: 0; } .menu li { padding: 0 20px; } }