body { 
    background: white;
    margin: 0;
    overflow: hidden;
}

h1 {
    font-family: "Roboto Slab";
    font-size: 4.5em;
    color: black;
    letter-spacing: 1.5;  
    width: 100%;
    margin: 0;
}

h2 {
    font-family: "Roboto Slab";
    font-size: 2em;
    color: black;
    margin: 0;
    font-weight: normal;
}

#links {
    font-family: 'Raleway';
    color: black;
    letter-spacing: .2em;
    position: relative;
    font-size: 2em;
    width: 50%;
    text-align: left;
    margin-left: 60vw;
    margin-top: 42vh;
}

.link {
    margin-bottom: 2vh;
    display: grid;
    grid-template-columns: .1fr 1fr;
}

#background {
    background-color: #328CC1;
    width: 100em;
    height: 50em;
    z-index: -1;
    transform: rotate(-30deg) translate(-2.5%, -55%);
    position: fixed;
}

#title {
    text-align: right;
    z-index: 2;
    position: relative;
    margin-right: 45vw;
}

i {
    color: #328CC1;
}

p {
    text-align: center;
}

a {
    text-decoration:none;
    color: black;
}

a:visited {
    text-decoration:none;
    color: black;
}

a:hover, a:focus {
    color: black;
}

.hover-underline-1:after, .hover-underline-2:after, .hover-underline-3:after, .hover-underline-7:hover::after {
    content: '';
    position: absolute;
    transform: scaleX(0);
    height: 2px;
    left: 9%;
    background-color: black;
    transform-origin: bottom right;
    transition: transform 0.25s ease-out;
}
  
.hover-underline-1:hover::after, .hover-underline-2:hover::after, .hover-underline-3:hover::after, .hover-underline-7:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

footer {
    font-family: "Roboto Slab";
    margin: 0 1%;
}

.optics-links {
    font-family: "Raleway";
    color: black;
    letter-spacing: .2em;
    font-size: 2em;
    border-top: solid black .25em;
    border-bottom: solid black .25em;
    margin: auto;
    padding: 3% 5%;
    box-sizing: border-box;
    height: 46vh;
    display: grid;
    grid-template-columns: 50% 50%;
    grid-gap: 5vh;
}

nav ul {
    list-style-type: none;
    font-family: "Raleway";
    font-size: 1.5em;
    margin: 0;
    display: grid;
    grid-template-columns: .1fr .1fr .2fr;
    padding: 0;
}

.optics-header {
    background-color:#328CC1;
    height: 50vh;
    padding: 0 2%;
}

.header {
    background-color:#328CC1;
    padding: 2% 2%;
}

.optics-header h1 {
    margin-top: 8vh;
}

#review {
    overflow:auto;
}

.return-button {
    font-family: "Roboto Slab";
    background-color:#328CC1;
    font-size: 1.5em;
    margin-top: 20vh;
}

#review-content {
    border-top: solid black .25em;
    border-bottom: solid black .25em;
    padding: 1% 2%;
}

#review-content p {
    text-align: left;
}

.hover-underline-4:after, .hover-underline-5:after, .hover-underline-6:after {
    content: '';
    position: absolute;
    transform: scaleX(0);
    height: 2px;
    background-color: black;
    transform-origin: bottom right;
    transition: transform 0.25s ease-out;
    bottom: 92%;
}
  
.hover-underline-4:hover::after, .hover-underline-5:hover::after, .hover-underline-6:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.hover-underline-4:after {
    width: 4.6%;
    left: 2%;
}

.hover-underline-5:after {
    width: 6.5%;
    left: 11.5%;
}

.hover-underline-6:after {
    width: 13%;
    left: 21.2%;
}

#mfprism, #lensometer, #lens-thickness, #pantoscopic, #eikonic, #spec-mag {
    overflow: auto;
}

#optics-textbook {
    padding: 5%;
    border-top: solid black .25em;
    border-bottom: solid black .25em;
    font-size: 2em;
}

#optics-textbook h2, h3 {
    font-size: 1em;
    margin: 1% 0;
}

#demo, #calc, #spec {
    border-top: solid black .25em;
    border-bottom: solid black .25em;
    font-size: 2em;
    margin: auto;
}

#demo video {
    display: block;
    margin: auto;
}

#demo p {
    font-size: .75em;
    text-align: left;
    margin: 2% 5%;
}

iframe {
    display: block;
    margin: 3% auto;
}

#calc h2 {
    font-size: 1em;
    text-align: center;
    margin-top: 1vh;
}

button {
    display: block;
    margin: 2% auto;
    font-family: "Roboto Slab";
    font-size: .6em;
    border: none;
    background-color:#328CC1;
    border-radius: .5em;
    padding: .5% 1%;
}

#calc td{
    font-size: .75em;
    padding: 2% 5%;
    width: 75%;
}

#calc table, #spec table {
    margin: auto;
    border-collapse: collapse;
}

#calc p {
    font-size: .7em;
}

#spec p {
    font-size: .7em;
}

#spec ul {
    font-size: .7em;
}

#spec h3 {
    text-align: center;
    font-size: .7em;
}

.hover-underline-1:after {
    bottom: 80%;
    width: 20%;
    left: 9%;
}

.hover-underline-2:after {
    bottom: 52%;
    width: 62%;
    left: 9%;
}

.hover-underline-3:after {
    bottom: 25%;
    width: 58%;
    left: 9%;
}

.hover-underline-7:after {
    bottom: 0%;
    width: 32%;
    left: 9%;
}

@media only screen and (max-width: 800px) {

    #links {
        margin-left: 3vw;
        margin-top: 10vh;
        letter-spacing: 0.1em;
        width: 100%;
    }

    .link {
        grid-template-columns: .15fr 1fr;
    }

    i {
        color: black;
    }

    #title {
        margin-right: 5vw;
    }

}

@media only screen and (min-device-width: 320px) and (max-device-width: 480px) {
    body {
        overflow: auto;
    }

    .optics-header {
        height: auto;
    }

    .optics-header h1 {
        margin-top: 2vh;
    }

    nav ul {
        font-size: 2.5em;
        grid-template-columns: auto;
    }

    .optics-links {
        grid-template-columns: auto;
        font-size: 4em;
        grid-gap: 1vh;
        height: auto;
    }

    .return-button {
        margin-top: 2vh;
        font-size: 2em;
    }
}
@media  (max-device-width: 450px) and (orientation : portrait) {
    body {
        overflow: hidden;
    }

    #background {
        transform: rotate(-30deg) translate(-9%, -60%);
        position: absolute;
        width: 109em;
        height: 49em;
    }

    #title {
        margin-top: 0;
        margin-right: 25vw;
    }

    h1 {
        font-size: 7.5em;
    }

    #links {
        margin-top: 15%;
        margin-left: 75vw;
        font-size: 4em;
    }

    #content {
        margin-top: 5%;
    }
}

@media (max-device-width: 900px) and (orientation : landscape) {
    #title {
        margin-top: -150vh;
    }

    #links {
        margin-left: 85vw;
        margin-top: 12vh;
    }

}