* {
    margin: 0;
    box-sizing: border-box;
}

/* Variables */

:root {
    --content-max-width: 1050px;
    --text-color: #000000c0;
}

/* Font Setup */
/* Roughly duplicating Typography.js Noriega theme */
/* https://github.com/KyleAMathews/typography.js/tree/master/packages/typography-theme-noriega */

html {
    font-family: 'Lato', sans-serif;
    font-size: 115%;
    line-height: 1.6rem;
    color: var(--text-color);
}

h1, h2, h3, h4, h5, h6 {
    line-height: 2rem;
    margin: 0.5rem 0;
}

section {
    padding-bottom: 1rem;
}

/* Anchor adjustment to account for header */
a.anchor {
    display: block;
    position: relative;
    top: -80px;
    visibility: hidden;
}

/* Button links */
a.button {
    border: none;
    border-radius: 0.5rem;

    padding: 0 1rem;

    background-color: #e5e5e5;
    cursor: pointer;

    text-decoration: none;
    text-align: center;
    font-size: 80%;
    color: inherit;
}
a.button:hover {
    background-color: #cccccc;
}

/* --------------------------------- */
/* Header -------------------------- */

header {
    position: sticky;
    top: 0;
    background-color: white;
}

header nav {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 1rem 2rem 1.5rem;
}

header ul {
    display: flex;
    flex-direction: row;
    justify-content: end;
    align-items: center;

    margin: 0;
    padding: 0;
    list-style-type: none;
}

header li {
    padding-left: 1rem;
}

header a {
    text-decoration: none;
    color: var(--text-color);
    transition: border 100ms ease;
}

header a:hover, header a:active, header a.active {
    border-bottom: 2px var(--text-color) solid;
}

@media screen and (max-width: 500px) {
    header ul {
        justify-content: center;
    }
    header li {
        padding: 0 0.5rem;
    }
}

/* --------------------------------- */
/* Content ------------------------- */

main {
    max-width: var(--content-max-width);
    margin: auto;
    padding: 0 2rem;
}

.section-header {
    text-align: center;
}

/* About Section ------------------- */

#about {
    display: flex;
    flex-direction: row;

    justify-content: center;
    align-items: center;
}

.about-text {
    padding-bottom: 6px;
}

.about-text * {
    padding: 0.25rem 0;
}

.portrait {
    display: flex;
    margin: 0.5rem;
}

.portrait img {
    border-radius: 50%;
    background-color: #b4b4b4;
}

/* Wrap text under image and allow image to scale down on mobile */
@media screen and (max-width: 800px) {
    #about {
        flex-wrap: wrap;
    }
    .portrait img {
        max-width: 250px;
        width: 100%;
        height: auto;
    }
}
/* Add flex gap on desktop */
@media screen and (min-width: 800px) {
    .portrait {
        margin-right: 1.5rem;
    }
}

/* Projects Section ---------------- */

.project {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.project-header {
    max-width: 130px;
    width: 100%;
}

.project-header * {
    margin: 0;
}

.project p {
    margin: 0;
    padding: 0 1rem;
}

.project-links {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.project-links a.button {
    margin: 0.25rem 0;
    width: 125px;
}

@media screen and (max-width: 800px) {
    .project {
        flex-direction: column;
        align-items: flex-start;
    }
    .project-header {
        display: flex;
        justify-content: space-between;
        max-width: 100%;
    }
    .project p {
        padding: 0;
    }
    .project-links {
        width: 100%;
        margin-top: 0.5rem;
    }
    .project-links a.button {
        margin: 0.25rem 1rem;
        width: 100%;
        max-width: 175px;
    }
}

/* Contact Section ----------------- */

#contact ul {
    display: flex;
    justify-content: center;

    margin: auto;
    padding: 0;
    list-style-type: none;
}

#contact li {
    margin: 0 0.5rem;
}

.contact-link {
    color: black;
    /* 125% brings back to original 100% from footers 80% */
    font-size: 125%;
}

/* Wrap contact link list before the link text wraps too much */
@media screen and (max-width: 800px) {
    #contact ul {
        flex-direction: column;
    }
    #contact li {
        margin: 0 0 1rem;
    }
}

/* --------------------------------- */
/* Footer -------------------------- */

footer {
    padding: 1rem;
    text-align: center;
    font-size: 80%;
}