*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Set up custom properties */
/* Changes here will update throughout the site */
:root {
    /* Font families */
    /* Update these if changing the Google fonts link in the head */
    --ff-primary: 'Source Sans Pro', sans-serif;
    --ff-secondary: 'Source Code Pro', monospace;

    /* Font weights */
    --fw-reg: 300;
    --fw-bold: 900;

    /* Colors */
    --clr-light: #fff;
    --clr-dark: #303030;
    --clr-accent: #2EB8A7;

    /* Font sizes */
    --fs-h1: 3rem;
    --fs-h2: 2.25rem;
    --fs-h3: 1.25rem;
    --fs-body: 1rem;

    /* box shadow */
    --bs: 0.25em 0.25em 0.75em rgba(0,0,0,.25), /* add subtle shadow */ 
          0.125em 0.125em 0.25em rgba(0,0,0,.15); /* layer another shadow */
}

/* Make font sizes larger on larger screen sizes */
@media (min-width: 800px) {
    :root {
        --fs-h1: 4.5rem;
        --fs-h2: 3.75rem;
        --fs-h3: 1.5rem;
        --fs-body: 1.125rem;
    }
}

/* General styles */
html {
    scroll-behavior: smooth; /* easy way with native CSS to enhance UX scrolling -- NOT Supported in Safari */
}

body {
    background-color: var(--clr-light);
    color: var(--clr-dark);
    margin: 0;
    font-family: var(--ff-primary);
    font-size: var(--fs-body);
    line-height: 1.6; /* use as default on everything */
}

section {
    padding: 5em 2em; /* prevent things from touching sides of screen when not wanted */
}

img {
    display: block;
    max-width: 100%;
}

:focus {
    outline: 3px solid var(--clr-accent); /* border for attention when tabbing through items on webpage */
    outline-offset: 3px;
}

/* Buttons */
.btn {
    display: inline-block; 
    padding: .5em 2.5em; /* give size */
    background: var(--clr-accent);
    color: var(--clr-dark);
    text-decoration: none; /* since can be set on link  */
    cursor: pointer; /* in case ever put it on button instead of link */
    text-transform: uppercase;
    letter-spacing: 2px; /* helps space out letters when using uppercase text-transform */
    font-weight: var(--fw-bold);
    transition: transform 200ms ease-in-out;
}

.btn:hover {
    transform: scale(1.1);
}

strong { font-weight: var(--fw-bold); }

/* Typography */
h1,
h2,
h3 {
    line-height: 1;
    margin: 0;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

.section__title {
    margin-bottom: .25em; /* Always to margins and padding on text using ems since it's relative to the font size */
}

.section__title--intro {
    font-weight: var(--fw-reg);
}

.section__title--intro strong { 
    display: block; /* Compound selector exception to keep company name on second line */
}

.section__subtitle {
    margin: 0;
    font-size: var(--fs-h3);
}

.section__subtitle--intro,
.section__subtitle--about {
    background: var(--clr-accent);
    padding: .25em 1em;
    font-family: var(--ff-secondary);
    margin-bottom: 1em;
}

.section__subtitle--tech {
    color: var(--clr-accent);
    font-weight: var(--fw-bold);
    margin-bottom: 2em;
}

.section__subtitle--work {
    color: var(--clr-accent);
    font-weight: var(--fw-bold);
    margin-bottom: 2em; /* change from 2em to 1em when adding tech wrapper */
}

/* header styling */
header {
    display: flex;
    justify-content: space-between;
    padding: 1em;
}

.logo {
    max-width: 100px;
}

.nav {
    position: fixed;
    background: var(--clr-dark);
    color: var(--clr-light);
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    
    transform: translateX(100%);
    transition: transform 250ms cubic-bezier(.5, 0, .5, 1);
}

.nav__list {
    list-style: none;
    display: flex;
    height: 100%;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav__link {
    color: inherit;
    font-weight: var(--fw-bold);
    font-size: var(--fs-h2); /* in your face! */
    text-decoration: none;
}

.nav__link:hover {
    color: var(--clr-accent);
}

.nav-toggle {
    padding: .5em;
    background: transparent;
    border: 0;
    cursor: pointer;
    position: absolute;
    right: 1em;
    top: 1em;
    z-index: 1000;
}

.nav-open .nav {
    transform: translateX(0); /* nav menu slides in and out from right */
}

.nav-open .nav-toggle {
    position: fixed; /* fixed now bc didn't want it to scroll with site previously */
}

.nav-open .hamburger {
    transform: rotate(.625turn);
}

.nav-open .hamburger::before {
    transform: rotate(90deg) translateX(-6px);
}

.nav-open .hamburger::after {
    opacity: 0;
}

.hamburger {
    display: block;
    position: relative;
}

.hamburger,
.hamburger::before,
.hamburger::after {
    background: var(--clr-accent);
    width: 2em;
    height: 3px;
    border-radius: 1em;
    transition: transform 250ms ease-in-out;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
}

.hamburger::before { top: 6px; }
.hamburger::after { bottom: 6px; }

/* Intro section layout */
.intro {
    position: relative;
}

.intro__img {
    box-shadow: var(--bs);
}

@media (min-width: 600px) {
    .intro {
        display: grid;
        width: min-content; /* shrink down - section will match content within it */
        margin: 0 auto; /* keep centered at different screen sizes */
        grid-column-gap: 1em; /* add spacing between img and text */
        grid-template-areas: 
            "img title"
            "img subtitle";
        grid-template-columns: min-content max-content;
    }

    .intro__img {
        grid-area: img;
        min-width: 250px; /* To prevent img from ever disappearing */
        position: relative;
        z-index: 2; /* make sure img is on top */
    }

    .section__subtitle--intro {
        display: inline-block; /* set the width to be the size of itself */
    }

    .section__subtitle--intro {
        align-self: start; /* stop from stretching down */
        grid-column: -1 / 1; /* stretch entire length */
        grid-row: 2; /* eliminate overlap */
        text-align: right;
        position: relative;
        left: -1.5em; /* pull over to the left */
        width: calc(100% + 1.5em); /* make width match again on right side while using relative postioning */

        padding-left: calc(200px + 4em); /* prevent text from ever going under img */
        padding-right: 1em;
    }
}

/* My services section layout */

.my-services {
    background-color: var(--clr-dark); /* set up bg color first in case bg img fails to load - text can still be read */
    background-image: url(../img/services-bg-2.jpg);
    background-size: cover; /* ensure never repeats itself */
    background-attachment: fixed; /* add parallax effect fixed scrolling - change from fixed to normal to remove */
    /* background-blend-mode: multiply; make background image less bright */
    color: var(--clr-light);
    text-align: center;
}

.section__title--services {
    color: var(--clr-accent);
    position: relative;
}

/* pseudo element */
.section__title--services::after {
    content: ''; /* content required to appear */
    display: block;
    width: 3em;
    height: 1px;
    margin: 0.5em auto 1em;
    /* background: currentColor; to match section title */
    background: var(--clr-light);
    opacity: 0.25; /* make it more of a design element */
}

.services {
    margin-bottom: 4em;
}

.service {
    max-width: 500px; /* prevent text from extending too wide on smaller screens */
    margin: 0 auto;
}

/* need to break into multiple columns on larger screens */
@media (min-width: 900px) {
    .services {
        display: flex; /* make three columns */
        max-width: 900px;
        margin-left: auto;
        margin-right: auto;
    }

    .service + .service { /* look at sibling and add margin to left */
        margin-left: 2em;
    }
}

/* smartphones, touchscreens - disable parallax fixed scroll */
@media (hover: none) and (pointer: coarse) {
    .my-services {
        background-attachment: scroll;
    }
}

/* About me section layout*/

.about-me {
    max-width: 1000px; /* using pixels instead of rem used on fonts for browser font settings */ 
    margin: 0 auto;
}

.about-me__img {
    box-shadow: var(--bs);
}

@media (min-width: 600px) {
    .about-me {
        display: grid;
        grid-template-columns: 1fr 200px; /*  */
        grid-template-areas: 
            "title img"
            "subtitle img"
            "text img";
        grid-column-gap: 2em;
    }

    .section__title--about {
        grid-area: title;
    }

    .section__subtitle--about {
        grid-column:  1 / -1;
        grid-row: 2;
        position: relative;
        left: -1em;
        width: calc(100% + 2em);
        padding-left: 1em;
        padding-right: calc(200px + 4em); /* prevent text from ever going under img */
    }
    
    .about-me__img {
        grid-area: img;
        position: relative;
        z-index: 2;
    }
}

/* Tech section */
.tech {
    background-color: var(--clr-dark);
    color: var(--clr-light);
    text-align: center;
}

.tech_icons {
    width: 80%;
    max-width: 800px;
    margin: 0 auto;
    /* padding: 2rem 0; */
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: auto;
    grid-gap: 2em;
    justify-items: center;
    font-size: 2rem;
}

@media (max-width: 728px) {
    .tech_icons {
        width: 100%;
        column-gap: 1rem;
        row-gap: 4rem;
    }
  }

.tech_icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-align: center;
}

.tech_icon i {
    font-size: var(--fs-h2);
    /* padding-bottom: .25em; */
}

.tech_icon p {
    width: 100%;
    font-size: var(--fs-body);
}


.tech_icon .devicon-apache-plain {
    font-size: var(--fs-h2);
    margin-top: -1rem;
}

.tech_icon .devicon-nginx-plain {
    font-size: var(--fs-h2);
    margin-bottom: -1.5rem;
    margin-top: -1.5rem;
}

@media (max-width: 728px) {
    .tech_icon i {
      font-size: 2rem;
    }
    .tech_icon .material-icons {
      font-size: 2rem;
    }
    .tech_icon .fa-terminal {
      font-size: 2.3rem;
      padding-top: 7px;
      padding-bottom: 0px;
    }
    .tech_icon p {
      font-size: 0.8rem;
    }

    /* .tech_icon .combined-icons {
        margin-bottom: -0.6rem;
    } */
  }

/* My Work section */
.my-work {
    background-color: var(--clr-light);
    color: var(--clr-dark);
    text-align: center;
}

.portfolio {
    display: grid;
    /* grid-template-columns: repeat(3, 1fr); automatically makes three columns */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /*  each grid has min size of 300 px, but if there is room, it will grow */
    /* could set max width to keep from going on and on into one string */
}

.portfolio__item {
    background: var(--clr-accent);
    overflow: hidden; /* prevents hover from going outside img */
}

.portfolio__img {
    transition: transform 750ms cubic-bezier(.5, 0, .5, 1), /* similar to ease-in-out, but a little more subtle */
    opacity 250ms linear; 

}

.portfolio__item:focus {
    position: relative;
    z-index: 2;
}

.portfolio__img:hover,
.portfolio__item:focus .portfolio__img {
    transform: scale(1.2);
    opacity: .75; 

}

@media (max-width: 728px) {
    .portfolio {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /*  each grid has min size of 300 px, but if there is room, it will grow */
    }
}

/* Footer section */

.footer {
    background: #111; /* almost black */
    color: var(--clr-accent);
    text-align: center;
    padding: 2.5em 0;
    font-size: var(--fs-h3);
}

.footer a { 
    color: inherit; /* want color of links to come through - all links in footer */
    text-decoration: none; 
}

.footer__link {
    font-weight: var(--fw-bold);
}

.footer__link:hover,
.social-list__link:hover {
    opacity: .7;
}

.footer__link:hover {
    text-decoration: underline;
}

.social-list {
    list-style: none;
    display: flex;
    justify-content: center;
    margin: 2em 0 0; /* set a margin bottom of 0 to eliminate empty space at the bottom */
    padding: 0;
}

.social-list__item {
    margin: 0 .5em;
}

.social-list__link {
    padding: .5em;
}

/* Portfolio item pages */

.portfolio-item-individual {
    padding: 0 2em 2em;
    max-width: 1000px;
    margin: 0 auto;
}

.portfolio-item-individual p {
    max-width: 800px;
    margin-left: auto; /* not using margin 0 auto bc want to keep default top and bottom margins */ 
    margin-right: auto;
}