nav {
    border-style: solid;
    border-color: rgba(0, 0, 0, .05);
    border-width: 0 0 1px 0;
    padding: 1rem 0;
    overflow: auto;
}

nav ul {
    margin: 0 auto;
    padding: 0;
}

nav .main-menu {
    border-style: solid;
    border-color: rgba(0, 0, 0, .05);
    border-width: 1px 0 0 0;
    display: none;
}

#tm:checked ~ .main-menu {
  display: block;
}

nav input[type="checkbox"] {
  display: none;
}

nav li {
  border-style: solid;
  border-color: rgba(0, 0, 0, .05);
  border-width: 0 0 1px;
}

nav li, 
nav ul a {
  position: relative;
  display: block;
  white-space: nowrap;
}

nav .main-menu a {
  color: #000;
}

nav a {
    padding: 0 1.5em;
    text-decoration: none;
    line-height: 4.5rem;
    display: block;
}

nav ul a:hover {
  background-color: #000;
  color: #fff;
}

nav input[type="checkbox"]:checked ~ .sub-menu {
  display: block;
}

nav label {
    display: block;
    width: 100%;
    position: relative;
    padding-right: 1.5rem;
    cursor: pointer;
    margin: 0;
}

nav label::-moz-focus-inner,
nav label,
nav label:focus,
nav label:active {
    outline: none;
    border: 0;
}

nav > ul {
    width: 100%;
    float: none;
    margin-top: 4.5rem;
}

#toggle-menu {
    position: absolute;
    top: 0;
    right: 0;
    width: 1.5rem;
    height: 1.5rem;
    margin: 0.7rem 1rem 0.45rem;
    padding: 0.5rem 0;
}

.spinner {
    transition: all 0.3s;
    box-sizing: border-box;
    position: absolute;
    height: 3px;
    width: 100%;
    background-color: #000;
}

.horizontal {
    transition: all 0.3s;
    box-sizing: border-box;
    position: relative;
    float: left;
    margin-top: 0.3rem;
}
.diagonal.part-1 {
    position: relative;
    transition: all 0.3s;
    box-sizing: border-box;
    float: left;
}
.diagonal.part-2 {
    transition: all 0.3s;
    box-sizing: border-box;
    position: relative;
    float: left;
    margin-top: 0.3rem;
}

input[type=checkbox]:checked ~ #toggle-menu > .horizontal {
    transition: all 0.3s;
    box-sizing: border-box;
    opacity: 0;
}
input[type=checkbox]:checked ~ #toggle-menu > .diagonal.part-1 {
    transition: all 0.3s;
    box-sizing: border-box;
    transform: rotate(135deg);
    margin-top: 0.4rem;
}
input[type=checkbox]:checked ~ #toggle-menu > .diagonal.part-2 {
    transition: all 0.3s;
    box-sizing: border-box;
    transform: rotate(-135deg);
    margin-top: -0.7rem;
}

ul.main-menu li:last-child {
    border-width: 0;
}

nav ul li a:active {
    background-color: #000 !important;
}

nav h1 {
    float: left;
    margin: 0;
}

nav ul {
    float: right;
}

nav h1,
nav h1 a {
    font-size: 1rem;
    font-weight: normal;
    text-decoration: none;
    color: #000;
}

@media only screen and (min-width: 1000px) {
    nav {
        padding: 2rem 0;
    }

    nav > ul {
        float: right;
        height: 100%;
        width: auto;
        margin-top: 0;
    }

    nav .main-menu {
        border-top: 0;
        display: block;
    }

    #toggle-menu {
        display: none;
    }

    nav li {
        float: left;
        border-width: 0 1px 0 0;
    }

    nav input[type="checkbox"]:checked ~ .sub-menu {
        display: none;
    }
}
