:root {
    /* --sans-font: Roboto, 'Noto Sans', 'Open Sans', sans-serif; */
    --sans-font: 'Noto Sans', 'Open Sans', sans-serif;
    /* --serif-font: Palatino, Georgia, Times, serif; */
    --serif-font: var(--sans-font);
    --main-width: 800px;
    --main-margin-vertical: 5rem;
    --main-padding-horizontal: auto;
    --background: #ffffff;
    --alt-background: #f3f3ee;
    --brand-color: #13584f;
    --line-height: 1.8;
    --card-bg: white;
    /* --font-color: var(--kinda-black); */
    --font-color: #000000;
    --kinda-black: #191919;
    --divider: rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    font-family: var(--sans-font);
    /* font-size: 14px; */
}

body {
    background-color: var(--background);
    margin: 0;
}

body {
    color: var(--font-color);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--serif-font);
    line-height: 1;
}

h1, .h1 {
    font-size: 2rem;
}

h2, .h2 {
    font-size: 1.6rem;
}

h3, .h3 {
    font-size: 1.2rem;
}

.p, p {
    /* font-size: 1.05rem; */
    line-height: var(--line-height);
    /* margin: 1.05rem 0; */
}

hr {
    margin: 2rem 0;
    border: 1px solid lightgrey;
}

details summary {
    cursor: pointer;
}
details summary::marker {
    color: var(--alt-background); /* Hides it */
}
.menu-icon {
    vertical-align: middle;
    margin-left: .3rem;
}

footer {
    width: 100%;
    height: 240px;
    padding: 2rem 0;
    /* border-top: 3px solid var(--divider); */
}

footer .about {
    display: flex;
    flex-direction: column;
    width: 240px;
}

footer .about span {
    margin-top: 2rem;
}

/* Main content */

main li {
    margin: .3rem 0;
    line-height: var(--line-height);
}

article {
    width: var(--main-width);
    margin: var(--main-margin-vertical) auto;
    padding: 0 var(--main-padding-horizontal);
}

/* Nav */

#desktop-menu {
    height: 80px;
    width: 100%;
    margin-left: 2rem;
}

#mobile-menu {
    display: none;
}

.top-nav {
    background: var(--alt-background);
}

.top-nav .nav-inner {
    display: flex;
    height: 80px;
    line-height: 80px;
    padding: 0 var(--main-padding-horizontal);
}

.top-nav a.site-title {
    display: flex;
    align-items: center;
}

/* Nav menu */

.top-nav nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.top-nav nav ul li {
    display: inline-block;
    margin: 0 .5rem;
}

.top-nav nav ul li:last-child {
    margin-right: 0;
}

.top-nav nav ul li.active a {
    color: var(--brand-color);
}

.top-nav nav ul li a {
    display: block;
    font-family: var(--sans-font);
    /* font-size: 16px; */
    font-weight: 500;
    text-decoration: none;
    color: var(--font-color);
}

.top-nav nav ul li a:hover {
    text-decoration: underline;
}

#desktop-menu .top-nav-search-input {
    padding: .5rem 0;
    background: none;
    border: none;
    border-radius: 0;
    color: white;
    border-bottom: 1px solid white;
}

/* Generic */

.page-width { width: var(--main-width); }
.page-center { margin: 0 auto; }
.page-center-pad {
    width: 100%;
    padding-left: calc((100vw - var(--main-width)) / 2);
    padding-right: calc((100vw - var(--main-width)) / 2);
}

.no-deco {
    text-decoration: none;
    color: inherit;
}

.grid {
    display: grid;
    grid-gap: 1rem;
}
.row-1 { grid-template-rows: repeat(1, 1fr); }
.row-2 { grid-template-rows: repeat(2, 1fr); }
.row-3 { grid-template-rows: repeat(3, 1fr); }
.row-4 { grid-template-rows: repeat(4, 1fr); }
.row-5 { grid-template-rows: repeat(5, 1fr); }
.col-1 { grid-template-columns: repeat(1, 1fr); }
.col-2 { grid-template-columns: repeat(2, 1fr); }
.col-3 { grid-template-columns: repeat(3, 1fr); }
.col-4 { grid-template-columns: repeat(4, 1fr); }
.col-5 { grid-template-columns: repeat(5, 1fr); }
.col-auto-2fr { grid-template-columns: auto 2fr; }
.col-start-1 { grid-column-start: 1; }
.col-start-2 { grid-column-start: 2; }
.col-start-3 { grid-column-start: 3; }
.col-start-4 { grid-column-start: 4; }
.col-end-1 { grid-column-end: 1; }
.col-end-2 { grid-column-end: 2; }
.col-end-3 { grid-column-end: 3; }
.col-end-4 { grid-column-end: 4; }
.col-span2 { grid-column: 1 / span 2; }
.col-span3 { grid-column: 1 / span 3; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-grow { flex-grow: 1; }

.gap-2 { gap: 2rem; }

.align-self-end { align-self: end; }

.margin-top { margin-top: 1rem; }
.margin-top-big { margin-top: 2rem; }
.margin-top-xl { margin-top: 6rem; }
.margin-left { margin-left: 1rem; }
.margin-left-big { margin-left: 2rem; }
.no-margin { margin: 0; }

.bg-none { background: none; }
.bg-dark { background: var(--kinda-black); }
.bg-good { background: var(--color-good); }
.bg-bad { background: var(--color-bad); }
.bg-alt { background: var(--alt-background); }

.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.bold { font-weight: bold; }
.italic { font-style: italic; }
.small-caps { font-variant: all-small-caps; }

/* This is a hack that prevents grid items from overflowing when they contain text with "white-space: nowrap" */
.min-width-0 {
    min-width: 0;
}

span.pill {
    padding: 4px 12px;
    background: #dfdfdf;
}

/* Card */

.card {
    min-height: 4rem;
    background-color: var(--card-bg);
    border-bottom: 3px solid var(--divider);
    padding: 1rem;
}

.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5,
.card-header h6 {
    margin: 0;
    font-weight: bold;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Card list */

ul.card-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Card list compact */

.card.compact {
    display: flex;
    justify-content: space-between;
    height: 4rem;
    padding: 0;
}

.card.compact .card-header,
.card.compact .card-content,
.card.compact .card-after {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 1rem;
}

.card.compact .card-header {
    min-width: 15rem;
}

.card.compact .card-content {
    flex-grow: 1;
}

/* Home */

.section-intro {
    width: 60%;
}

#profile-pic {
    width: auto;
    max-height: 330px;
}

section {
    padding: 60px 0;
}
section h1 {
    color: var(--brand-color);
    font-size: 64px;
    font-weight: bold;
    margin: 0;
    line-height: 2;
}
section > div {
    width: var(--main-width);
    margin: 0 auto;
}

.service {
    min-height: 100px;
    margin: 4rem 0;
    align-items: center;
}
.service-icon {
    min-width: 80px;
    display: flex;
    justify-content: center;
}
.service-title {
    min-width: 200px;
    font-size: 24px;
    font-weight: bold;
}
.service-title span {
    display: block;
}
.service-title span:last-child {
    color: var(--brand-color);
}

.job {
    display: flex;
    margin: 2rem 0;
}
.job .company {
    min-width: 300px;
}
.job .title {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}
.job p {
    margin: 0;
}

/* Misc */

.email {
    vertical-align: middle;
}

/* Responsiveness */

@media only screen and (max-width: 900px) {
    :root {
        --main-width: 100%;
        --main-padding-horizontal: 2rem;
    }

    section > div {
        padding: 0 var(--main-padding-horizontal);
    }

    /* Nav */
    #desktop-menu {
        display: none;
    }
    #mobile-menu {
        display: block;
        width: 100%;
    }
    #mobile-menu summary {
        text-align: right;
    }
    header.top-nav nav {
        position: absolute;
        display: block;
        width: 100%;
        height: fit-content;
        padding: 1rem;
        left: 0;
        z-index: 2;
        background: white;
    }
    header.top-nav nav ul li {
        width: 100%;
        height: 3rem;
        line-height: 3rem;
        margin: 0;
        padding: 0 1rem;
        border-radius: 0.2rem;
    }
    header.top-nav nav ul li a {
        color: var(--font-color);
    }
}

@media only screen and (max-width: 750px) {
    :root {
        --main-margin-vertical: 1rem;
        --main-padding-horizontal: 1rem;
    }

    .card.compact .card-header {
      min-width: 10rem;
    }

    footer {
        padding: 2rem;
    }

    section h1 {
        line-height: normal;
    }

    .section-intro {
        width: auto;
    }

    .service-title {
        text-align: center;
    }

    #profile-pic {
        margin-top: 4rem;
        max-height: 200px;
    }

    /* Generic */
    .mob-grid {
        display: grid;
        grid-gap: 1rem;
    }
    .mob-row-1 { grid-template-rows: repeat(1, 1fr); }
    .mob-row-2 { grid-template-rows: repeat(2, 1fr); }
    .mob-row-3 { grid-template-rows: repeat(3, 1fr); }
    .mob-row-4 { grid-template-rows: repeat(4, 1fr); }
    .mob-row-5 { grid-template-rows: repeat(5, 1fr); }
    .mob-col-1 { grid-template-columns: repeat(1, 1fr); }
    .mob-col-2 { grid-template-columns: repeat(2, 1fr); }
    .mob-col-3 { grid-template-columns: repeat(3, 1fr); }
    .mob-col-4 { grid-template-columns: repeat(4, 1fr); }
    .mob-col-5 { grid-template-columns: repeat(5, 1fr); }
    .mob-col-span2 { grid-column: 1 / span 2; }
    .mob-col-span3 { grid-column: 1 / span 3; }
    .mob-stack { flex-direction: column; }
}
