/* root variables for easy access to thematic colors */
:root {
    --baseColor: #4A6163;
    --backgroundColor: #F9FAF4;
    --pastelRed: #F17A7E;
}

/* styling for the page background, scroll-behavior for the
navigation links to scroll smoothly when clicked */
html {
    background-color: var(--backgroundColor);
    font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    height: 100%;
    scroll-behavior: smooth;
}

/* header styling with flex display to spread nav and h1 evenly */
header {
    background-color: var(--baseColor);
    padding: 20px;
    margin-left: -12px;
    margin-right: -12px;
    margin-top: -12px;
    display: flex;
    justify-content: space-between;
}

header h1 {
    color: var(--backgroundColor);
    background-color: var(--pastelRed);
    padding: 6px 25px 6px 25px;
    margin-left: -16px;
}

nav {
    list-style-type: none;
    text-align: center; 
    padding: 0;
    margin-top: 24px;
}

/* the nav links have some special styling like underline offset 
the transition property is for when the links change styling
either by hovering or some other interaction*/
nav a {
    font-size: 20px;
    padding: 20px;
    color: var(--backgroundColor);
    text-decoration-color: #F17A7E;
    text-underline-offset: 12px;
    transition: all 0.1s ease-out;
}

/* when we hover over the nav items they will change the following styling
properties */
nav a:hover {
    font-weight: bold;
    text-decoration-thickness: 4px;
    text-underline-offset: 13px;
}

.hero {
    /* using linear-gradient to add a darken background effect to the image*/
    background-image: linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1)), url("forest.jpg");

    height: 400px;
    margin-left: -10px;
    margin-right: -12px;
    margin-top: -10px;

    /* these settings position and center the image to scale nicely on all screens */
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    position: relative;
}

#headshot {
    max-width: 150px;
    border: 5px solid var(--baseColor);
    top: 55%;
    left: 5%;
    position: absolute;
}

.hero figcaption {
    text-align: center;
    position: absolute;
    top: 85%;
    left: 85%;
    font-weight: bold;
    font-size: xx-large;
    transform: translate(-50%, -50%);
    color: var(--backgroundColor);
    background-color: var(--baseColor);
    padding: 16px;
}

body {
    background-color: var(--backgroundColor);
}

/* the h2s are major section headers and should be uniform,
to maintain positioning they were given a precise width measurement*/
h2 {
    color: var(--baseColor);
    text-align: right;
    margin-left: 64px;
    margin-top: 64px;
    line-height: 50px;
    font-size: xx-large;
    width: 91.42px;
}

/* each of the body sections are given a flexbox layout */
#about, #work, #contact {
    display: flex;
}

/* this styling creates a vertical line for each section */
.vl {
    border-left: 6px solid var(--baseColor);
    height: 200px;
    margin-top: 64px;
    margin-left: 64px;
    margin-bottom: 64px;
}

#about p {
    margin-left: 64px;
    margin-top: 96px;
    color: var(--baseColor);
    font-size: large;
    margin-right: 80px;
}

/* special height styling for the vertical line in the work section because
this section is much taller*/
#work .vl {
    height: 800px;
}

/* special flex column styling for the projects section to allow for
my projects to stack on top of one another */
#projects {
    display: flex;
    flex-flow: column;
    flex-wrap: wrap;  
    margin-top: 64px;
    width: 85%;
    align-self: center;
}

.secondaryRows a {
    display: inline-block;
    height: 90px;
    width: 100%;
    margin: 0px 8px 0px 8px;
    
}

/* secondaryprojects class selector with the default styling for each
secondary project and a default image 

there is also a filter to darken the image when not hovering*/
.secondaryProjects {
    display: inline-block;
    height: 90px;
    width: 100%;
    margin: 0px;
    background-image: url("stitch-row-counter.jpg");
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    position: relative;
    border: 5px solid var(--baseColor);
    filter: brightness(80%);
    transition: all 0.3s ease-out;
}

#projectImage2 {
    background-image: url("earthsattelitenasa.jpg");
}

#projectImage3 {
    background-image: url("spacexlaunch.jpg");
}

#projectImage4 {
    background-image: url("background.jpg");
}

/* bring to 100% brightness on hover */
#primaryProject:hover,
.secondaryProjects:hover {
    filter: brightness(100%);
}

/* primary project has special styling properties to make
it larger */
#primaryProject {
    height: 470px;
    width: 79%;
    margin: 8px auto;
    background-image: url("nasa-earth.jpg");
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    position: relative;
    border: 5px solid var(--baseColor);
    filter: brightness(80%);
    transition: all 0.3s ease-out;
}

#primaryProjectLink {
    margin: 0px 0px 0px 8px;
}

/* the secondary rows hold two projects each in  a row format
and should not wrap */
.secondaryRows {
    display: flex;
    flex-flow: row;
    flex-wrap: nowrap; 
    margin: 8px auto 8px auto;
    width: 80%;
}

#project1Text {
    display: inline;
    color: var(--backgroundColor);
    background-color: var(--baseColor);
    padding: 6px 8px;
    margin-top: -64px;
    text-align: center;
    position: relative;
    font-weight: bold;
    font-size: xx-large;
    top: 85%;
    right: 0%;
}

.secondaryProjects figcaption {
    display: inline;
    color: var(--backgroundColor);
    background-color: var(--baseColor);
    padding: 6px 8px;
    margin-top: -64px;
    text-align: center;
    position: relative;
    font-weight: bold;
    font-size: large;
    top: 60%;
    right: 0%;
}

/* the contact h3 need some styling to present as evenly aligned both
vertically and horizontally */
#contact h3 {
    display: flex;
    justify-content: center;
    text-align: center;
    margin-left: 46px;
    margin-right: 46px;
    vertical-align: middle;
    align-items: center;
    width: 100%;
}

h3 a {
    color: var(--baseColor);
    transition: all 0.1s ease-out;
}

/* each h3 has an anchor tag within them, so when hovering we
want the color to turn red */
h3 a:hover {
    color: var(--pastelRed);
}

/* the media query here is for most mobile devices

generally speaking this has things becoming smaller
or moving to the center of the screen*/
@media screen and (max-width: 768px){
    header {
        flex-direction: column;
        line-height: 2.5;
    }

    header h1 {
        margin-left: 0px;
    }

    .hero figcaption {
        top: 85%;
        left: 75%;
    }

    nav {
        margin-top: 0px;
        padding-bottom: 12px;
    }

    #about, #work, #contact {
        flex-direction: column;
    }

    h2 {
        text-align: center;
        align-self: center;
        margin: auto;
        width: auto;
    }

    /* the vertical line becomes a horizontal line here */
    .vl {
        border-left: none;
        border-top: 2px solid var(--baseColor);
        height: 0px;
        margin: auto 36px;
    }

    #about p {
        margin-top: 16px;
    }

    #work .vl {
        height: 0px;
    }

    .secondaryProjects figcaption {
        font-size: small;
    }

    #contact h3 {
        margin: 8px auto;
    }

    #aboutMeLinebreak {
        display:none;
    }
}

/* this media query is for the smallest of screen sizes,
if we are to get this small we need to reposition a 
few more elements as seen in the styling changes below: */
@media screen and (max-width: 280px) {

    #headshot {
        top: 25%;
        left: 23%;
    }

    .hero figcaption {
        top: 85%;
        left: 50%;
    }

    #about p {
        font-size: small;
        margin-left: 24px;
        margin-right: 16px;
    }

    .secondaryProjects figcaption {
        font-size: smaller;
    }

    #primaryProject {
        height: 280px;
    }

    #project1Text {
        font-size: large;
    }

    .secondaryProjects {
        height: 45px;
        margin-left: -16px;
    }
}