:root {
    --dark-grey: rgba(5, 6, 19, 0.8);
    --light-tuiquoise: rgba(187, 221, 207, 1);
    --dark-green: rgba(74, 96, 104, 0.9);
    --opacity-low: .4;
    --opacity-high: .6;
}

html {
    /* set 1rem to 10px instead of native 16px to make it easier to calculate font-size values for the rest of the page (e.g. 1.6rem is 16px, 2.0rem is 20px, etc.) */
    font-size: 62.5%;
}

body {
    /* Sans Serif font stack is implemented to help select the best font for each type of computer operating system */
    font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
    font-size: 1.75rem;
    line-height: 1.5;
    color: var(--dark-grey);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-bottom: 0.625rem;
  font-weight: 700;
  line-height: 1.1;
}

h1 {
    font-size: 4rem;
}
  
h2 {
  font-size: 3.5rem;
}

h3 {
    font-size: 4.5rem;
}

h4 {
  font-size: 2.5rem;
}

p {
  margin-bottom: 1.5rem;
}

/* Header Start */
/* header flex horizontally to center the .page-title and navigation bar */
header {
    padding: 10px 0px;
    padding-bottom: 10px;
    background-color: var(--dark-grey);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    padding: 0 10px 0 70px;
    background-color: var(--light-tuiquoise);
    color: var(--dark-grey);
}

/* navigation flex horizontally for desktop screen */
nav ul {
    display: flex;
    flex-wrap: wrap;
}

.main-nav ul {
    padding-right: 70px;
}

.main-nav li a {
    color: var(--light-tuiquoise);
    border-bottom: 3px solid var(--light-tuiquoise);
    font-size: 2rem;
    text-decoration: none;
    padding: 5px 10px;
    margin: 5px;
}

/* Strip Image Starts */
/* image box flex to ajust the postion and width of .page-subtitle */
.hero-img {
    background-image: url("../images/portfolio-background.jpg");
    height: 150px;
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
}
.page-subtitle {
    margin: auto 70px 20px auto;
    padding: 0px 7px;
    background-color: var(--light-tuiquoise);
} 
/* Strip Image Starts */

/* Content Starts */
.content {
    color: var(--dark-green);
    padding: 0 70px;
}

/* About Me Starts */
/* .block flex horizontally: title on the left and description on the right */
.block {
    display: flex;
    margin: 40px 0;
}

.block-title-box {
    width: 20%;
    display: flex;
    justify-content: flex-end;
}

/* .block-title one word per line. Text align right */
.block-title{
    display: flex;
    justify-content: flex-end;
    width: 1%;
    margin-right: 20px;
    padding: 0 15px;
    text-align: right;
    border-right: 3px solid var(--dark-green);
}

.block-descr-box {
    width: 80%;
    font-size: 2rem;
    padding: 0 10px;
}

/* #profile-photo floats right with text wrap around */
#profile-photo {
    float: right;
    height: 200px;
    width: 200px;
    border-radius: 50%;
    padding: 5px;
}
/* About Me End */

/* Work Description Starts */
.project-display {
    display: flex;
    flex-wrap: wrap;
}

.project {
    height: 370px;
    width: 50%;
    padding: 10px;
}

/* the image of the first project is larger */
.project:nth-of-type(1) {
    height: 600px;
    width: 100%;
}

.project a {
    position: relative;
    display: inline-block;
    width: 100%;
    height: 100%;
    border: 5px solid var(--light-tuiquoise);
}

.project-background {
    height: 100%;
    /* background-size: cover; */
    background-position: center;
    background-color: rgba(204, 204, 204, 1);
    opacity: var(--opacity-low);
    transition: opacity 0.8s;
}

.project-background:hover {
    opacity: var(--opacity-hight);
}

#project1 .project-background{
    background-image: url("https://raw.githubusercontent.com/JessGiannini/FeedYourBoredom/main/assets/images/homepage.png");
    background-size: cover;
}

#project2 .project-background{
    background-image: url("https://raw.githubusercontent.com/qtian13/Weather-Dashboard/main/assets/images/desktop_screen.png");
    background-size: 120% 100%;
}

#project3 .project-background{
    background-image: url("https://raw.githubusercontent.com/qtian13/code-quiz/main/assets/images/homepage.png");
    background-size: 100% 150%;
}

#project4 .project-background{
    background-image: url("https://raw.githubusercontent.com/qtian13/password-generator/main/assets/images/desktop_screen.png");
    background-size: 100% 200%;
}

#project5 .project-background{
    background-image: url("https://raw.githubusercontent.com/qtian13/CSS-cheat-sheet/main/assets/images/desktop_screen.png");
    background-size: 100% 200%;
}

.project-title {
    position: absolute;
    bottom: 20px;
    color: var(--dark-green);
    background-color: var(--light-tuiquoise);
} 

.project-title h4 {
    margin: 6px 6px 3px 6px;
}

.project-title p {
    margin: 0px 6px 6px 6px;
}

/* Contact Me Starts */
.contact-nav {
    margin: auto 0; 
    width: 80%;   
}

.contact-nav ul {
    justify-content: space-around;
}

.contact-nav li a {
    font-size: 1.8rem;
    text-decoration: none;
    padding: 5px 5px;
    color: var(--dark-green);
    border-bottom: 3px solid var(--dark-green);
}
/* Contact Me Ends */

/* adjust layout for tablet screen */
@media screen and (max-width: 991px) {
    h1, .main-nav, .block-title-box, .block-descr-box  {
        width: 100%;
    }

    header, section {
        flex-direction: column;
    }
    
    .main-nav ul {
        justify-content: flex-end;
    }

    .content {
        padding: 20px 40px;
    }

    .block {
        margin: 10px 0;
    }

    .block-title {
        justify-content: flex-start;
        width: 100%;
        border-right-style: none;
        border-bottom: 3px solid var(--dark-green);
        margin: auto;
    }

    .block-descr-box {
        margin-top: 20px;
    }

    .project-title {
        bottom: -4px;
    }
}

/* adjust layout and shrink font size and block size for mobile screen */
@media screen and (max-width: 767px) {
    h1 {
        font-size: 3.5rem;
    }

    h2 {
        font-size: 3rem;
    }

    h3 {
        font-size: 4rem;
    }

    h4 {
        font-size: 2rem;
    }

    header h1 {
        text-align: center;
        padding: 0px;
    }

    nav ul {
        flex-direction: column;
        align-items: center;
    }

    .main-nav ul {
        padding-right: 0px;
    }

    .contact-nav li a, .main-nav li a {
        border-style: none;
        text-decoration: underline;
    }

    .hero-img h2{
        width: 100%;
        margin: 0px;
        text-align: center;
    }

    .content {
        padding-left: 20px;
        padding-right: 20px;
    }

    .block-title {
        justify-content: center;
    }

    .block-descr-box {
        font-size: 1.3rem;
    }

    #profile-photo {
        width: 150px;
        height: 150px;
    }

    .project {
        width: 100%;
    }

    .project-title {
        width: 100%;
    }

    .project-title h4, .project-title p {
        display: inline-block;
    }

    .project:nth-of-type(1) {
        height: 300px;
    }
}






