/* global section */

:root {
    --primary: #f1f1a1;
    --secondary: #343D8D;
    --font: 'Lato', sans-serif;
}

html {
    scroll-behavior: smooth;
}

/* We'll set this as needed rather than relying on the default values. */
h1,
h2,
h3 {
    margin: 0;
    padding: 0;
}

body {
    background: black;
    color: white;
    font-family: var(--font);
}

ul {
    list-style: none;
    padding: 0;
}

/* header section */

.header {
    position: relative;
    margin-bottom: 3rem;
}

.header-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    color: black;
}

.about-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    width: 100%;
    height: 10vh;
    background: var(--primary);
}

@media (min-width: 768px) {
    .triangle {
        position: absolute;
        top: 0;
        right: 0;
        left: 0;
        /* This works around an issue where about-header visibly extends 1px beyond the triangle. */
        bottom: -1px;
        background: var(--primary);
        clip-path: polygon(0% 0%, 0% 100%, 30% 100%, 40% 0%, 40% 0%)
    }
    .header {
        background: black;
    }
    .header-content {
        margin: auto;
        width: 90vw;
    }
    .about-header {
        width: auto;
    }
}

.about-header a {
    color: black;
}

.about-header a:hover {
    color: var(--secondary);
}

.header-nav {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: 1rem;
    width: 100%;
    color: gray;
    font-weight: bold;
    font-size: clamp(1.5rem, 1rem + 1vw, 3rem);
}

.header-nav a {
    color: white;
}

.header-nav a:hover {
    color: var(--secondary);
}

.header-content .nav {
    flex-direction: column;
    align-items: center;
}

@media (min-width: 768px) {
    .header-nav {
        margin-top: 0;
    }

    .header-nav,
    .header-nav .nav-item {
        width: auto;
    }

    .header-content {
        flex-direction: row;
        align-items: center;
    }

    .header-content .nav {
        flex-direction: row;
        align-items: center;
    }
}

.header h1 {
    display: inline;
    /* see: https://css-tricks.com/simplified-fluid-typography/ */
    font-size: clamp(1.5rem, 1rem + 2vw, 6rem);
}

.nav .nav-item {
    margin-right: 1rem;
}

.nav .nav-item:last-child {
    margin-right: 0;
}

.nav .btn:hover {
    filter: grayscale(50%);
}

/* about section */

.hero-header {
    position: relative;
    background: black;
}

@media (min-width: 768px) {
    .hero-header {
        height: 100vh;
    }
}

.about-box {
    padding: 1rem;
    height: 15vh;
    margin-bottom: 2rem;
    background: var(--primary);
    color: black;
    overflow: hidden;
    transition-property: height;
    transition-duration: 1s;
}

.about-text {
    margin-top: 3rem;
    font-size: clamp(1rem, 1rem + 1vw, 3rem);
    /* font-size: 5rem; */
    visibility: hidden;
}

@media (min-width: 768px) {
    .about-box {
        /* see https://stackoverflow.com/questions/485827/css-100-height-with-padding-margin */
        position: absolute;
        top: 0;
        right: 0;
        left: 0;
        bottom: 0;
        margin: 2rem;
        padding: 2rem;
        height: auto;
        /* see: https://stackoverflow.com/questions/31149144/how-to-use-clip-path-with-text-inside-the-div */
        clip-path: polygon(0% 0%, 0% 100%, 100% 0%);
    }

    .about-text {
        visibility: visible;
    }
}

.about-header button {
    margin: auto;
    font-size: 1rem;
    font-style: bold;
}

.about-header img {
    display: inline;
    height: 80%;
    border-radius: 50%;
}

@media (min-width: 768px) {
    .triangle-border {
        float: right;
        width: 100vw;
        height: 70vh;
        /* this resource helped: https://www.youtube.com/watch?v=sifXs4XVK7g */
        /* shape-outside: polygon(5.49% 96.56%, 5.49% 96.56%, 84.98% -11.59%); */
        /* shape-outside: polygon(5.54% 96.56%, 5.54% 99.33%, 87.27% -10.80%); */
        shape-outside: polygon(6.11% 102.07%, 5.49% 107.45%, 90.24% -5.87%);
        shape-margin: 2rem;
    }
}

.about-nav {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

@media (min-width: 768px) {
    .about-nav {
        position: absolute;
        display: inline-block;
        bottom: 20vh;
        right: 20vw;
    }
}

.about-nav a {
    color: white;
    font-size: clamp(1.5rem, 1rem + 2vw, 6rem);
}

.about-nav a:hover {
    color: var(--secondary);
}

/* projects section */

.main {
    width: 90vw;
    margin: auto;
}

.main > h2 {
    margin: 3rem;
    text-align: center;
    font-size: clamp(1.5rem, 1rem + 2vw, 6rem);
}

.projects-container {
    display: flex;
    flex-direction: column;
    grid-gap: 3rem;
    margin: 3rem 0;
}

@media (min-width: 768px) {
    .projects-container {
        display: grid;
        grid-template-rows: repeat(2, 1fr);
        grid-template-columns: repeat(3, 1fr);
    }
}

.project-card {
    padding: 1rem;
    border: 6px solid var(--primary);
    border-radius: 5px;
    background: black;
}

a .project-card {
    color: white;
}

.project-card img {
    width: 100%;
}

.project-card h3 {
    text-align: center;
    margin-top: 1rem;
}

.to-top {
    position: absolute;
    right: 0;
    bottom: 0;
    font-weight: bold;
    font-size: 2rem;
    color: white;
}
.to-top:hover {
    color: var(--primary);
}

/* main section */

.main-content-box {
    position: relative;
    padding: 1rem;
    background: var(--secondary);
    border-radius: 10px;
}

@media (min-width: 768px) {
    .main-content-box {
        padding: 2rem;
    }
}

.main-content-box h2 {
    margin-bottom: 3rem;
    text-align: center;
    font-size: clamp(1.5rem, 1rem + 2vw, 6rem);
    font-weight: bold;
}

.main-content-box h3 {
    margin: 3rem 0;
    font-size: clamp(1.5rem, 1rem + 1vw, 3rem);
    font-weight: bold;
}

.main-content-box p {
    font-size: 1.5rem;
}

.socials img {
    margin-right: 1rem;
    width: 3rem;
    filter: invert(100%);
}
.socials img:hover {
    filter: invert(80%);
}

.main-content-box input:focus,
.main-content-box textarea:focus {
    outline: 3px solid var(--primary);
}

.submit-box {
    display: flex;
    justify-content: flex-end;
}

.submit-box > .btn {
    background: var(--primary);
    color: black;
    font-weight: bold;
}

.cert-carousel {
    display: flex;
    justify-content: space-between;
}

.cert-carousel > button {
    font-weight: bold;
    font-size: 2rem;
    color: white;
}
.cert-carousel > .btn:hover {
    color: var(--primary);
}

/* Thanks to Jordan Wallace for reminding us of all of these while debugging */
.cert-carousel > .btn:hover,
.cert-carousel > .btn:active,
.cert-carousel > .btn:focus {
        outline: 2px solid var(--primary);
}

.cert-carousel > button:active {
    outline-color: var(--primary);
}

.cert-carousel img {
    margin: auto;
}

/* footer section */

.footer {
    width: 90vw;
    margin: auto;
    padding: 1rem 0;
    text-align: right;
}
