@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;500;600;700&display=swap');

/* natural box model */
html {
box-sizing: border-box;
}
*, *:before, *:after {
box-sizing: inherit;
}

/* 
    UTLILITIES
*/
.show-desktop { /* show for 768px and up */
    display: none;
}
.show-mobile { /* show for 767px and below */
    display: block;
}
.show-desktop-sm { /* show for 650px and up */
    display: inline;
}
.show-mobile-xs { /* show for 649px and below */
    display: none;
}
/* grid layouts */
.grid-2,
.grid-3,
.grid-4 {
    display: grid;
    grid-gap: 10px;
    margin-bottom: 10px;
}
.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}
.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}
.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* colors */
:root {
    --darkgray: rgb(104, 104, 104);
    --shadow: rgba(150, 150, 150, 0.3);
    --lightblue: rgb(230,255,255);
    --lightgray: rgb(176, 176, 176);
    --cyan: rgba(0, 255, 255, .8);
}

body {
    font-family: 'Quicksand', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--lightblue);
    position: relative;
    min-height: 100vh;
}

/* 
    TYPOGRAPHY
*/
h1, h2, h3, p {
    font-family: 'Quicksand', sans-serif;
    color: var(--darkgray);
}
h1 { /* a designer, coder and writer */
    font-weight: 300;
    font-size: 42px;
    letter-spacing: 0.05em;
    margin: 0.5em 0;
}
h2 { /* section headers for mobile */
    text-align: center;
    font-size: 26px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}
/* links */
article a {
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 20px;
} 
a:link, a:visited {
    color: var(--darkgray);
    text-decoration: none;
    box-shadow: inset 0 -.1em var(--cyan);
    transition: box-shadow .5s; 
}
a:hover, a:active {
    box-shadow: inset 0 -.55em var(--cyan);
    transition: box-shadow .5s;
}

/* 
    SPACING/STRUCTURE
*/
header, nav, article {
    max-width: 800px;
    padding: 0 25px 0;
    margin: 0 auto;
}
header {
    text-align: center;
}

/* 
    HEADER
*/
/* socials buttons */
.socials {
    display: flex;
    position: fixed;
    top: 30px;
    right: 15px;
    flex-flow: row wrap;
    z-index: 1000;
}
.socials a:link,
.socials a:visited {
    font-size: 20px;
    padding-top: 5.5px;
    color: var(--darkgray);
    width: 40px;
    height: 40px;
    text-align: center;
    background-color: var(--lightblue);
    border: 1px solid var(--darkgray);
    border-radius: 50%;
    margin: 0 7.5px;
    box-shadow: none;
    transition: color .35s ease-out, background-color .35s ease-out, border-color .35s ease-out;  
}
.socials a:hover,
.socials a:active {
    background-color: var(--darkgray);
    color: var(--lightblue);
    transition: color .35s ease-in, background-color .35s ease-in, border-color .35s ease-in;
}
/* waving hand */
header img {
    width: 160px;
    height: auto;
    display: block;
    margin: 0 auto;
    padding: 50px;
    opacity: 0;
    --rotate: 0;
    transform: rotate(var(--rotate));
    animation: delay .5s ease forwards, wave 3.5s ease;
    transition: transform .25s ease;
}
header img:hover {
    --rotate: 25deg;
    transition: transform .25s ease;
}
/* name animation */
#hi-there {
    max-width: 650px;
    stroke: var(--darkgray);
    fill: none;
    margin: 0;
    stroke-miterlimit:10;
    animation: fill 2s ease forwards 3s;
    display: block;
    margin: 0 auto;
}

/* 
    NAV: four buttons
*/
nav {
    position: relative;
}
nav:after { /* gray line that goes across the page */
    content: '';
    height: 3px;
    width: 100vw;
    bottom: 0;
    margin-left: calc(50% - 50vw - 30px);
    background-color: var(--darkgray);
    display: block;
    position: absolute;
}
nav ul {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-gap: 10px;
    padding: 30px 0 0 0;
    margin: 0;
}
nav li { /* style the buttons */
    list-style-type: none;
    text-transform: uppercase;
    font-weight: bold;
    color: var(--lightgray);
    border: 3px solid var(--lightgray);
    padding: 15px;
    cursor: pointer;
    text-align: center;
    display: block;
    font-size: 20px;
    letter-spacing: 0.075em;
    position: relative;
    transition: color 0.3s;
}
nav li:hover { /* name changes color on hover */
    color: var(--darkgray);
    transition: color 0.3s;
}
/* lines for the drawing animation on hover */
.lines:before,
.lines1:before,
.lines2:before {
    content: '';
    position: absolute;
    background-color: var(--darkgray);
}
/* left side */
.lines:before {
    bottom: 0;
    left: -3px;
    height: 0;
    width: 3px;
    transition: height .2s .4s;
}
nav li:hover .lines:before {
    height: 100%;
    transition: height .2s;
}
/* top */
.lines1:before {
    left: -3px;
    top: -3px;
    height: 3px;
    width: 0;
    transition: width .2s .2s;
}
nav li:hover .lines1:before {
    width: calc(100% + 3px);
    transition: width .2s .2s;
}
/* right side */
.lines2:before {
    right: -3px;
    top: -3px;
    height: 0;
    width: 3px;
    transition: height .2s;
}
nav li:hover .lines2:before {
    height: calc(100% + 3px);
    transition: height .2s .4s;
}
/* style the active li */
nav li.active {
    color: var(--darkgray);
    border-color: var(--darkgray);
    position: relative;
    z-index: 300;
}
/* add blue box over bottom border of active li */
nav li.active:after {
    content: '';
    width: calc(100%);
    transform: translateX(-15px);
    background-color: var(--lightblue);
    height: 20px;
    position: absolute;
    bottom: -4px;
    display: block;
    z-index: 300;
}

/*
    MAIN
*/
main {
    position: relative;
    z-index: 100;
    padding: 0;
    margin: 0;
    margin-top: -3px;
}

/* 
    ARTICLE
*/
article {
    padding-top: 60px;
    display: none;
}
article img {
    width: 100%;
    box-shadow: 1px 1px 10px var(--shadow);
}
figure {
    margin: 50px 0 4.0em;
    padding: 0;
}
/* apply grid layout to writing clips */
.writing-clip {
    margin-bottom: 2.0em;
    display: flex;
    flex-flow: row wrap;
    align-items: flex-start;
}
.writing-clip p {
    font-weight: 800;
    font-size: 1.25em;
    margin: 3px 0 0.5em 0;
    font-weight: lighter;
}
.writing-clip p {
    flex-basis: 16.67%;
}
.writing-clip div {
    flex-basis: 83.33%;
}

.web-clip {
    display: flex;
    flex-flow: row wrap;
    margin-bottom: 2.0em;
    justify-content: space-between;
}
.web-clip p:not(.codepen) {
    margin-top: 0;
    font-size: 1.25em;
}
.web-clip p:first-child {
    margin: 0 0 0.25em;
}
.web-clip .image {
    width: 67%;
}
.web-clip .image img {
    height: auto;
}
#webdev .web-clip div:nth-child(2) {
    width: 30%;
}
.cp_embed_wrapper {
    width: 100%;
    margin-bottom: 10px;
}

/* 
    FOOTER
*/
footer {
    background: linear-gradient(to bottom, rgba(0,0,0,.1) 0%, rgba(0,0,0,0) 5%, rgba(0,0,0,0) 100%);
    background-color: var(--darkgray);
    width: 100vw;
    margin: 0;
    margin-top: 60px;
    overflow: hidden;
    display: flex;
    align-items: center;
}
footer > div {
    max-width: 800px;
    padding: 0 25px 0;
    margin: 40px auto;
    display: flex;
    align-items: center;
}
footer img {
    border-radius: 50%;
    height: 150px;
    margin-right: 1.0em;
    border: 3px solid var(--lightblue);
}
footer p {
    color: var(--lightblue);
    font-size: 20px;
    margin-top: 0;
}
footer p:last-child {
    margin-bottom: 0;
}
footer a:link, footer a:visited {
    color: var(--lightblue);
}
footer a:hover, footer a:active {
    color: var(--lightblue);
}

/*
    ANIMATIONS
*/
h1 {
    opacity: 0;
    animation: delay 2s ease forwards 2.2s;
}
.socials {
    opacity: 0;
    animation: delay 2s ease forwards 2.2s;
}
main,
footer {
    opacity: 0;
    height: 0;
    overflow: hidden;
    animation: delay 2s ease forwards 2.2s;
}

/* animate drawing effect*/
@keyframes line-anim {
    to {
        stroke-dashoffset: 0;
    }
} 
/* animate fill */
@keyframes fill {
    from {
        fill: transparent;
    }
    to {
        fill: var(--darkgray);
    }
}
/* animate lines next to subhead */
@keyframes increase {
    to {
        width: 350px;
        background: var(--darkgray);
    }
}
/* delay appearance of subhed */
@keyframes delay {
    0% { opacity: 0; height: auto; }
    100% { opacity: 1; height: auto; }
}
/* credit: https://jarv.is/notes/css-waving-hand-emoji/ */
@keyframes wave {
    0% { transform: rotate( 0.0deg) }
   10% { transform: rotate(14.0deg) }  
   /* The following five values can be played with to make the waving more or less extreme */
   20% { transform: rotate(-8.0deg) }
   30% { transform: rotate(14.0deg) }
   40% { transform: rotate(-4.0deg) }
   50% { transform: rotate(10.0deg) }
   60% { transform: rotate( 0.0deg) }  
   /* Reset for the last half to pause */
  100% { transform: rotate( 0.0deg) }
}

/* 
    LAZY LOADING
*/
.image {
    position: relative;
    background: rgba(0,0,0,.1);
}
.image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}
img:not([src]) { /* hide image before it's loaded so alt tag isn't shown during lazy load */
    visibility: hidden;
}
.lazyload,
.lazyloading {
    opacity: 0;
}
.loading,
.lazyload,
.lazyloaded,
.image {
    opacity: 1;
    transition: opacity 2s cubic-bezier(0.215, 0.61, 0.355, 1);
}
@keyframes placeHolderShimmer{
    0%{
        background-position: -468px 0
    }
    100%{
        background-position: 468px 0
    }
}
.loading {
    animation-duration: 1.8s;
    animation-fill-mode: forwards;
    animation-iteration-count: infinite;
    animation-name: placeHolderShimmer;
    animation-timing-function: linear;
    background: #f6f7f8;
    background: linear-gradient(to right, rgba(0,0,0,.15) 8%, rgba(0,0,0,.2) 38%, rgba(0,0,0,.15) 54%);
    background-size: 1000px 640px;
    position: relative;
}

/* 
    MEDIA QUERIES
*/

/* #xtra small (576 px and under) */
@media (max-width: 650px) { 
    .show-desktop-sm { 
        display: none;
    }
    .show-mobile-xs {
        display: block;
    }
    nav li i {
        font-size: 24px;
    }
}
/* Small devices (768px and under) */
@media (max-width: 768px) {
    /* 
        TYPOGRAPHY
    */
    h1 {
        font-size: 30px;
        margin-top: 0.3em;
        text-align: left;
    }
    h2 {
        /* margin-bottom: -1.0em; */
        margin: -0.5em 0 0.5em;
        text-align: left;
    }
    article a {
        font-size: 1.2em;
        margin-bottom: 20px;
    } 
    .web-clip p,
    .writing-clip p {
        font-size: 1.2em;
    }
    footer p {
        font-size: 18px;
    }
    /* 
        SPACING/IMAGE SIZES
    */
    .socials {
        background-color: var(--darkgray);
        padding: 8px;
        border-radius: 50px 0 0 50px;
        top: 10px;
        opacity: 0;
        right: -3px;
        box-shadow: -1px 3px 6px 0 rgba(0,0,0,.2);
        animation: slide-in 1.5s ease forwards 2.2s;
    }
    header img {
        width: 60px;
        margin: 0 0;
        padding: 30px 0 40px;
    }
    header {
        margin-bottom: 1.0em;
    }
    .writing-clip {
        display: block;
    }
    .web-clip {
        display: block;
        margin-bottom: 3.0em;
    }
    .web-clip .image {
        width: 100%;
        padding-top: 60.7708% !important;
        margin-bottom: 5px;
    }
    .web-clip div {
        width: 100% !important;
    }
    .web-clip p {
        margin: 0.5em 0;
    }
    footer > div {
        display: block;
    }
    footer img {
        display: none;
    }
    @keyframes slide-in {
        0% { right: -185px; }
        100% { right: 0; opacity: 1;}
    }
    .grid-2,
    .grid-3,
    .grid-4 {
        display: block;
        padding-bottom: 0;
    }
    .grid-2 .image,
    .grid-3 .image,
    .grid-4 .image {
        margin-bottom: 10px;
    }
    nav li {
        font-size: 0.95em;
    }
}
