
/* General Styles START */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { scroll-behavior: smooth; }

html, body {
    font-family: 'Josefin Sans', sans-serif;
    width: 100%;
}

h1, h2, h3, h4, h5, h6, header, .btn {
    font-family: 'Fjalla One', sans-serif;
}

h2, h3 { font-weight: lighter; }

a { text-decoration: none; }

button:focus { outline: none; }

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid-container {
    display: grid;
    align-items: center;
    justify-items: center;
}

/* General Styles END */

/***************************/

/* Navigation Styles START */

header {
    display: grid;
    grid-template-columns: 1fr 2fr;
    align-items: center;
    font-size: 25px;
    letter-spacing: 2px;
    height: 15vh;
    width: 100%;
    padding: 0 5vw;
    position: fixed;
    transition: 1s ease;
    z-index: 2;
}

header.show-header { background-color: rgba(0,0,0,0.9); }


#logo, #brand {
    display: flex;
    align-items: center;
    z-index: 2;
}

#logo img { height: 35px; }

#brand {
    color: transparent;
    letter-spacing: 2px;
    margin-left: 4%;
    position: relative;
    text-transform: uppercase;
}

nav {
    justify-self: end;
    width: 350px;
}

ul.nav-bar {
    background-color: #121212;
    display: grid;
    align-items: center;
    justify-items: center;
    grid-template-rows: repeat(4, 50px);
    grid-row-gap: 20px;
    height: 100vh;
    width: 100%;
    list-style-type: none;
    opacity: 0;
    position: fixed;
    left: 0;
    top: -85vh;
    transition: .5s ease-in-out;
}

ul.nav-bar.open {
    opacity: 1;
    padding-top: 80px;
    top: 0;
    z-index: 2;
}

ul.social-icons { list-style-type: none; }

ul.social-icons li {
    display: inline-block;
    list-style-type: none;
    margin-right: 10px;
}

.social-link .fa {
    color: white;
    font-size: 1.4em;
    opacity: 0.4;
    transition: .3s ease;
}

ul.nav-bar li { text-align: center; }

a.nav-link {
    color: transparent;
    cursor: pointer;
    display: inline-block;
    position: relative;
    text-transform: uppercase;
}

button {
    background-color: transparent;
    border: 3px solid #dc0508;
    border-radius: 3px;
    color: #dc0508;
    cursor: pointer;
    transition: .3s ease;
}

#menu-btn {
    cursor: pointer;
    position: absolute;
    right: 4%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
}

#menu-btn span {
    background: white;
    display: block;
    margin-bottom: 8px;
    position: relative;
    width: 36px;
    height: 3px;
    transition: .5s;
}

#menu-btn:hover span { background-color: #dc0508; }

#menu-btn span:nth-child(1),
#menu-btn span:nth-child(3) {
    transform-origin: left;
}

#menu-btn span:nth-child(2) { transform-origin: center; }

#menu-btn span:nth-child(3) { margin-bottom: 0; }

#menu-btn.active span:nth-child(1) {
    left: 3px;
    transform: rotate(45deg);
}

#menu-btn.active span:nth-child(2) {
    right: 3px;
    transform: rotate(315deg) translateY(2px);
}

#menu-btn.active span:nth-child(3) {
    transform: scaleX(0);
}

@media screen and (min-width: 768px) {
    
    ul.nav-bar {
        background-color: transparent;
        grid-template-columns: repeat(3, auto);
        grid-template-rows: none;
        grid-column-gap: 10px;
        height: auto;
        justify-items: end;
        opacity: 1;
        padding: 0;
        position: relative;
        top: 0;
    }

    ul.nav-bar .social-icons { display: none; }

    #menu-btn { display: none; }
}

/* Navigation Styles END */

/***************************/

/* Section Styles START */

section {
    font-size: 20px;
    height: 100vh;
    padding: 0 30px;
    padding-top: 16vh;
}

#home {
    background: url("./images/david-bg-mobile.jpg") no-repeat fixed center;
    background-size: cover;
    color: white;
    height: 100vh;
    width: 100%;
    position: relative;
}

#bg-vid {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;;
}

#bg-vid video {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

#bg-vid::after {
    background: rgba(0, 0, 0, 0.8);
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
}

#hero {
    font-size: 22px;
    text-align: center;
    width: 400px;
}

#hero h1, h2, h3 {
    display: inline-block;
    font-size: 2.2em;
    letter-spacing: 2px;
    padding-bottom: 15px;
    position: relative;
}

#hero h1::after, h2::after, h3::after {
    border-bottom: 3px solid #dc0508;
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
}

#hero p {
    font-size: .8em;
    margin: 25px 0;
}

#hero h1 > span { color: #dc0508; }

.btn-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-gap: 20px;
    width: 100%;
}

.btn {
    border-radius: 2px;
    color: white;
    cursor: pointer;
    font-size: 16px;
    letter-spacing: 2px;
    overflow: hidden;
    position: relative;
    left: 0;
    top: 0;
    width: 100%;
    height: 40px;
    z-index: 1;
}

#about {
    grid-template-rows: auto minmax(200px, 300px) auto;
    grid-gap: 20px;
    width: 100%;
    height: auto;
}

#about p {
    line-height: 22px;
    width: 100%;
}

#about .slider {
    border-radius: 50%;
    box-shadow: 0 0 3px 1px rgba(0, 0, 0, 0.3), 2px 3px 5px 1px rgba(0, 0, 0, 0.3);
    position: relative;
    width: 300px;
    height: 300px;
}

#about .slider img {
    border-radius: 50%;
    position: absolute;
    left: 0;
    opacity: 0;
    top: 0;
    transition: opacity .4s ease-in-out;
    width: 100%;
}

#about .slider img.show-slide { opacity: 1; }

#work {
    width: 100%;
    height: auto;
    text-align: center;
}

#projects {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    grid-gap: 20px;
    margin: 20px auto;
    width: 100%;
}

#modal {
    background-color: white;
    border-radius: 5px;
    opacity: 0;
    padding: 20px 30px;
    position: fixed;
    left: 50%;
    top: 50%;
    width: 92vw;
    height: 92vh;
    visibility: hidden;
    transform: translate(-50%, -50%);
    transition: .3s ease;
    z-index: 5;
}

#modal.show {
    visibility: visible;
    opacity: 1;
}

#modal-overlay {
    background-color: rgba(0, 0, 0, 0.5);
    position: fixed;
    left: 0;
    top: 0;
    opacity: 0;
    visibility: hidden;
    transition: .3s ease;
    width: 100vw;
    height: 100%;
    z-index: 3;
}

#modal-overlay.show {
    visibility: visible;
    opacity: 1;    
}

#modal-title {
    font-size: 1.2em;
    text-align: left;
    width: 100%;
}

#modal-title::after {
    left: 0;
    width: 25%;
    transform: none;
}

#modal-desc {
    font-size: .9em;
    height: 100%;
    width: 100%;
    line-height: 1.3;
    overflow: auto;
    text-align: left;
}

#close-btn {
    position: absolute;
    right: 15px;
    top: 15px;
    width: 32px;
    height: 32px;
}

#close-btn:hover {
    background-color: #dc0508;
    color: white;
    font-size: 17px;
    transform: scale(1.1);
}

.project {
    cursor: pointer;
    height: 197px;
    position: relative;
    transition: .3s ease;
}

.project img,
.project-container img,
.project::after {
    border-radius: 5px;
    width: 100%;
    height: 100%;
}

#modal .project-container {
    grid-template-rows: repeat(4, auto);
    grid-gap: 15px;
    width: 100%;
    height: 100%;
}

.project-container img {
    height: auto;
    max-width: 350px;
}

#project-btn-group { max-width: 500px; }
#project-btn-group .btn::after { color: #dc0508; }

#contact {
    flex-direction: column;
    height: auto;
    justify-content: flex-start;
    padding-top: 15vh;
}

#contact h2 {
    margin-bottom: 20px;
    text-align: center;
}

#contact p {
    margin: 0 auto 20px;
    max-width: 650px;
    text-align: left;
}

.form-container {
    margin-bottom: 20px;
    text-align: center;
    width: 100%;
}

.form-control {
    border: 1px solid #9d9d9d;
    border-radius: 2px;
    margin-bottom: 10px;
    padding: 10px 15px;
    resize: none;
    width: 100%;
}

#form-submit,
#after-submit .btn {
    border: none;
    background-color: #dc0508;
}

#form-submit .btn-overlay,
#after-submit .btn-overlay { background-color: #880508; }

#after-submit.flex-center {
    flex-direction: column;
    position: absolute;
    top: 0;
    left: 0;
    padding: 0 30px;
    width: 100%;
    height: 100vh;
}

#after-submit h2 {
    margin-bottom: 50px;
    text-align: center;
}

footer {
    background: #121212;
    position: relative;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6vh;
}

footer a {
    color: white;
    font-size: .9em;
    margin-right: 4%;
    opacity: 0.4;
    transition: .3s ease;
}

footer a:hover,
.social-link .fa:hover { opacity: 1; }

@media screen and (orientation: landscape) and (max-width: 960px) {
    #modal .project-container {
        grid-template-columns: 1fr 1fr;
        padding: 15px;
    }

    #modal-title,
    #project-btn-group { grid-column: 1/3; }
}

@media screen and (min-width: 768px) {
    #bg-vid { display: block; }

    #hero {
        font-size: 30px;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    #about {
        grid-template-columns: minmax(200px, 300px) 1fr;
        grid-template-rows: repeat(2, auto);
        grid-row-gap: 10px;
    }

    #about h2 { grid-column: span 2;}

    #projects { width: 90%; }

    .project::after {
        background-color: rgba(0, 0, 0, 0.5);
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        height: 100%;
        width: 100%;
    }

    .project:hover { transform: translateY(-10px); }
    
    .project:hover::after { display: none; }

    #modal-desc { font-size: 1em; }

    #form-submit,
    #after-submit .btn { max-width: 190px; }

    .form-container { max-width: 650px; }

    footer a { font-size: 1.1em; }

    .social-link .fa {
        font-size: 1.4em;
        margin-right: 15px;
    }
}

@media screen and (min-width: 1128px) {
    #projects { width: 1000px; }

    #modal {
        padding: 30px 50px;
        width: 80vw;
        height: 80vh;
    }
}

/* Section Styles END */

/***************************/

/* Animation Styles START */

.btn-text {
    display: block;
    position: absolute;
    left: -100%;
    top: 50%;
    width: 100%;
    transform: translateY(-50%);
    transition: .3s ease;
}

.btn-overlay {
    background-color: #dc0508;
    border-radius: 2px;
    display: block;
    position: absolute;
    left: -150%;
    top: 0;
    width: 130%;
    height: 100%;
    transform: skew(20deg);
    transition: .3s ease;
}

.btn::before {
    border: 3px solid #dc0508;
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
}

.btn::after {
    content: attr(data-text);
    color: white;
    position: absolute;
    letter-spacing: 2px;
    left: 50%;
    top: 50%;
    width: 100%;
    transform: translate(-50%, -50%);
    transition: .3s ease;
}

.btn:hover::after {
    transform: translate(20px, -50%);
    opacity: 0;
}

.btn:hover .btn-text {
    transform: translate(100%, -50%);
    opacity: 1;
}

.btn:hover .btn-overlay {
    transform: translateX(100%) skew(20deg);
    opacity: 1;
}

.flip-x::before, .flip-x::after,
.flip-y::before, .flip-y::after {
    content: attr(data-text);
    color: white;
    position: absolute;
    transition: .3s ease;
    left: 0;
    text-shadow: 2px 2px rgba(0,0,0,0.5) !important;
}

.flip-y::before{ top: 0; }

.flip-x::after,
.flip-y::after {
    color: #dc0508;
    opacity: 0;
}

.flip-x::after { left: -20px; }
.flip-y::after  { top: -20px; }

.flip-y:hover::before,
.flip-y:hover::after {
    transform: translateY(20px);
}

.flip-x:hover::before,
.flip-x:hover::after {
    transform: translateX(20px);
}

.flip-x:hover::before,
.flip-y:hover::before { opacity: 0; }

.flip-x:hover::after,
.flip-y:hover::after { opacity: 1; }

/* Animation Styles END */

/***************************/
