#site-header { position: fixed; display: flex; justify-content: space-between; align-items: flex-start; width: 100vw; color: #000; padding: 1rem; z-index: 1; -webkit-user-select: none; user-select: none; #site-header-bg { position: absolute; top: 0%; left: 0; width: 100%; height: 100%; background-color: #FFF; z-index: -1; transform: translateY(-111%); box-shadow: 0 0 0.5rem 0 rgba(0, 0, 0, 0.2); transition: all 100ms ease; } &.scrolled:not(.nav-active) #site-header-bg { transform: translateY(0%); } a { display: block; text-decoration: none; text-transform: lowercase; color: #000; } } #site-titles { #site-title { font-family: waax; font-weight: 400; font-size: 44px; margin: 0; line-height: 1em; white-space: nowrap; transition: all 100ms ease; a:hover { text-decoration: underline; } .scrolled & { font-size: 32px; } .nav-active & { opacity: 0; } } // #site-subtitle { // font-size: 20px; // max-width: 11em; // font-weight: 400; // margin: 0; // } } #nav { margin: 0;; } #nav-container { position: relative; input { position: absolute; top: -0.6rem; right: -0.5rem; width: 2rem; height: 2rem; margin: 0; cursor: pointer; opacity: 0; /* hide this */ z-index: 2; /* and place it over the hamburger */ -webkit-touch-callout: none; } .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 100ms ease; &:first-child { transform-origin: 0% 0%; } &:nth-child(3) { transform-origin: 0% 100%; } } input:checked ~ .hamburger-bar { opacity: 1; transform: rotate(45deg) translate(3px,-1px); } input:checked ~ .hamburger-bar:nth-child(4) { opacity: 0; transform: rotate(0deg) scale(0.1, 0.1); } input:checked ~ .hamburger-bar:nth-child(3) { transform: rotate(-45deg) translate(-1px, 6px); } } #nav a { .nav-item-title { font-size: 1.25rem; line-height: 1.5rem; font-weight: 700; } &:hover .nav-item-title { text-decoration: underline; } .nav-item-subtitle { font-size: 1rem; line-height: 1rem; max-width: 280px; overflow: hidden; transition: max-width 200ms ease; .scrolled & { max-width: 1px; max-height: 1px; overflow: hidden; } } } // NARROW SCREEN @media only screen and (max-width: 1200px) { #nav-container { flex-direction: column; align-items: flex-end; margin: 1rem; input:checked ~ #nav { transform: translateX(-100%); } } #nav { position: absolute; width: 300px; right: -300px; top: 0; margin: -2.5rem; padding: 3.5rem 2.5rem 2.5rem; 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); li { padding: 1rem 0; } } } // WIDE SCREEN @media only screen and (min-width: 1201px) { #nav-container { width: 100%; input { display: none; } .hamburger-bar { display: none; } } #nav { position: relative; width: 100%; display: flex; justify-content: flex-end; ul { display: flex; padding: 0; } li { padding: 1rem 1.5rem 0; transition: all 100ms ease; .scrolled & { padding-top: 0.3rem; } } } }