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

/* TODO: update from boilerplate */
:root {
    --ff-primary: 'Inconsolata', monospace;
    --ff-secondary: 'Kanit', monospace;
    
    --fw-reg: 400;
    --fw-bold: 900;
    
    --clr-light: #fff;
    --clr-soft: #ddd;
    --clr-dark: #303030;
    --clr-accent: #2980f3;
    
    --fs-h1: 3rem;
    --fs-h2: 2.25rem;
    --fs-h3: 1.25rem;
    --fs-body: 1rem;
    
    --bs: 0.25em 0.25em 0.75em rgba(0, 0, 0, 0.25),
          0.125em 0.125em 0.25em rgba(0, 0, 0, 0.125);
}

@media (min-width: 800px) {
    :root {
        --fs-h1: 4.5rem;
        --fs-h2: 3rem;
        --fs-h3: 1.5rem;
        --fs-body: 1.125rem;
    }
}

/* General styles */

html {
    scroll-behavior: smooth;
}

body {
    background: var(--clr-light);
    color: var(--clr-dark);
    margin: 0;
    font-family: var(--ff-primary);
    font-size: var(--fs-body);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

section {
    padding: 5em 2em;
}

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

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

:focus {
    outline: 3px solid var(--clr-accent);
    outline-offset: 3px;
}

/* Buttons */

.btn {
    display: inline-block;
    padding: .5em 2.5em;
    background: var(--clr-accent);
    color: var(--clr-dark);
    text-decoration: none;
    cursor: pointer;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: var(--fw-bold);
    transition: transform 200ms ease-in-out;
    border-radius: 8px;
}

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

/* Typography */

h1, h2, h3 {
    line-height: 1.1;
    margin: 0;
}

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

.section__title {
    margin-top: .25em;
}

.section__title--intro {
    font-weight: var(--fw-reg);
    display: flex;
    align-items: flex-end;
    margin-bottom: 0.25em;
}

.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;
}

/* header */

header {
    position: fixed;
    width: 100%;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    padding: 1em;
}

.logo {
    max-width: 50px;
    z-index: 1000;
}

.nav {
    position: fixed;
    background: var(--clr-dark);
    color: var(--clr-light);
    top: 0;
    bottom: 70%;
    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;
    align-items: center;
    margin: 1em;
    padding: 0;
}

.nav__link {
    color: inherit;
    font-weight: var(--fw-bold);
    font-size: var(--fs-h3);
    text-decoration: none;
}

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

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

.nav-open .nav {
    transform: translateX(0);
}

.nav-open .nav-toggle {
    position: fixed;
}

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

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

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

.break-line {
    width: 200px;
}

.hamburger {
    background: var(--clr-dark);
    width: 2em;
    height: 3px;
    border-radius: 1em;
    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; }

@media (max-width: 800px) {
    .nav {
        bottom: 0;
        font-weight: var(--fw-bold);
    }
}

/* index Intro */

.intro {
    position: relative;
}

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

.project__img {
    box-shadow: var(--bs);
    width: 250px;
}

@media (min-width: 800px) {
    .intro {
        display: grid;
        width: min-content;
        margin: 0 auto;
        grid-column-gap: 1em;
        grid-template-areas: 
            "img title"
            "img subtitle";
        grid-template-columns: min-content max-content;  
    }
    
    .intro__img {
        grid-area: img;
        min-width: 250px;
        position: relative;
        z-index: 2;
    }
    
    .section__subtitle--intro {
        align-self: start;
        grid-column: -1 / 1;
        grid-row: 2;
        text-align: right;
        position: relative;
        left: -1em;
        width: calc(100% + 1.5em);
    }
}

/* index My Projects */

.my-projects {
    background-color: var(--clr-dark);
    background-image: url(../img/dsim-screenshot-blurred.png);
    background-size: cover;
    background-blend-mode: multiply;
    color: var(--clr-light);
    text-align: center;
}

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

.section__title--projects::after {
    content: '';
    display: block;
    width: 2.5em;
    height: 1px;
    margin: 0.5em auto 0.25em;
    background: var(--clr-light);
    opacity: 0.25;
}

.projects {
    margin-bottom: 4em;
}

.project {
    text-align: center;
    max-width: 600px;
    min-width: 30%;
    margin: 0 auto;
}

.project-title {
    margin-top: 1.5em;
    margin-bottom: 1em;
}

.project-link {
    color: var(--clr-light);
}

.project-link:hover {
    opacity: 0.7;
}

.project-text {
    text-align: justify;    
}

@media (min-width: 800px) {
    .projects {
        display: flex;
        align-items: flex-start;
        justify-content: center;
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .project {
        margin-left: 1em;
        margin-right: 1em;
    }
}

/* index My Skills */

.section__title--skills {
    color: var(--clr-dark);
    text-align: center;
}

.section__text--skills {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.skills {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1em;
    margin-left: auto;
    margin-right: auto;
}

.skill {
    align-items: left;
    min-width: 200px;
}

.skill_link {
    text-decoration: none;
    color: var(--clr-dark);
}

.skill_link:hover {
    opacity: .7;
}

@media (max-width: 800px) {
    .skills {
        max-width: 250px;
    }
}

/* index About Me */

.section__about-me {
    padding: 2em;
}

.about-me {
    margin: 0 auto;
}

.about-me__body {
    font: var(--ff-secondary);
    font-weight: 500;
}

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

.about-me__text {
    margin-top: 2em;
    margin-bottom: 0em;
}

@media (min-width: 800px) {
    .about-me {
        margin: 0 auto;
        max-width: 800px;
    }
    
    .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: 2em;
        padding-right: calc(200px + 4em); 
    }
    
    .about-me__img {
        grid-area: img;
        position: relative;
        z-index: 2;
    }
}

.resume-btn {
    margin: 4em auto 6em auto;
}

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

.footer a { 
    color: inherit;
    text-decoration: none;
}

.footer__link {    
    font-weight: bold;
}

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

.social-list {
    list-style: none;
    display: flex;
    justify-content: center;
    margin: 1em 0 0;
    padding: 0;
}

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

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

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

/* All Projects */

.section__title--all-projects {
    text-align: center;
    padding: 1em;
}

.project-list {
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    padding-top: 1em;
}

.project-item {
    outline: 2px solid var(--clr-soft);
    margin-bottom: 1em;
    display: flex;
}

@media (max-width: 800px) {
    .project-item {
        flex-direction: column;
    }
}

.project-item-img {
    max-width: 200px;
    max-height: 200px;
    margin: 1em;
}

.project-item-text {
    text-align: left;
    margin: 1em;
    max-width: 700px;
}

.project-item-tags {
    opacity: .8;
    font-style: italic;
}

/* Individual project pages */
.section__individual-project {
    max-width: 800px;
    margin: 0 auto;
}

.individual-project-title {
    text-align: center;
}

.section__individual-subtitle {
    text-align: left;
    background-color: var(--clr-accent);
    margin: .5em 0;
    padding: .25em 1em;
}

.individual-project-links {
    margin: 3em 0;
    display: flex;
    gap: 1em;
    justify-content: center;
}

.individual-project-text {
    text-align: justify;
}

.individual-project-note {
    text-align: center;
    margin-top: 3em;
    font-style: italic;
}

.individual-project-img-small {
    width: 450px;
    margin: 0 auto;
}

.individual-project-img-full {
    margin: 0 auto;
    box-shadow: var(--bs);
}

/* Page not found */

.section__error {
    max-width: 1000px;
    margin: auto auto;
}
