:root {
    /* Light mode colors */
    --background-color: #f0f0f0;
    --text-color: #000;
    --green : #58b884;
    --teal: #51b5b5;
    --blue: #7491ca;
    --purple: #b280c7;
    --pink-shadow: #ffb3c9;
    --medium-pink: #d78ca0;
    --light-pink: #ffe5ed;
    --card-background: #ffe4ef;
    --card-accent: #931a3e;
    --card-text: #754a57;
    --subtitle: #696969;
    --light-accent: #fff9fb;
    --tag-text: #000;
}

[data-theme="dark"] {
    --background-color: #1a1a1a;
    --text-color: #ffffff;
    --green: #7ad4a7;
    --teal: #6cd9d9;
    --blue: #8ba8e6;
    --purple: #c99bde;
    --pink-shadow: #ff99b7;
    --medium-pink: #e6a3b7;
    --light-pink: #4a2830;
    --card-background: #2d1f24;
    --card-accent: #ff6b96;
    --card-text: #e6b3bf;
    --subtitle: #b3b3b3;
    --light-accent: #2d2d2d;
    --tag-text: #ffffff;
}

/* Reset some default browser styles */
html, body, h1, h2, p, ul, li, a {
    margin: 0;
    margin-top: 2.5rem;
    padding: 0;
    scroll-behavior: smooth;
}

/* Apply a basic font and background color to the entire page */
body {
    font-family: Hack;
    background-color: var(--background-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background 0.2s linear;
}

.mobile-only {
    display: none;
}

.header_text {
    color: var(--text-color);
    font-size: 32px;
    display: flex; 
    font-weight: bold;
    letter-spacing: 2px;
}

#header {
    display: flex;
    margin-bottom:
    height: 300px;
    justify-content: space-between;
    align-items: flex-start;
}

#left_header {
    flex: 2;
    min-width: 55%;
    height: 100%;
    flex-direction: column;
    display: flex;
    gap: 1rem;
}

#right_header {
    flex: 2;
    flex-direction: column;
    display: flex;
    height: 100%;
    position: relative;
}

#portrait {
    width: 100%;
    margin: auto;
    height: auto;
}

#resume_link {
    position: relative;
    margin: auto;
    margin-top: 50px;
}

.subtitle_text {
    height: fit-content;
    position: relative;
    color:var(--subtitle);
    font-size:22px;
    margin-top: 10px;
}

#center {
    margin-left:auto;
    margin-right:auto;
    width:800px;
    height: fit-content;
}

.main_section {
    margin-bottom: 50px;
}

#blurb {
    position: relative;
    top: -3px;
    line-height: 25px;
    text-align: left;
    display: inline-block;
    overflow-wrap: normal;
    word-wrap: normal;
}

#projects_header {
    color:var(--text-color);
    font-weight: bold;
    font-size: 28px;
    letter-spacing: 0px;
    margin: auto;
    width: fit-content;
}

#projects_subtitle {
    color: var(--subtitle);
    font-size: 18px;
    font-weight: lighter;
    margin: auto;
    width: fit-content;
}

#projects_section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
}

.project_container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.project_image img {
    max-width: 100%;
    height: auto;
    margin-top: 10px;
}

.project_video {
    border-radius: 8px;
    overflow: hidden;
    margin-top: 10px;
}

.project_video video {
    width: 100%;
    height: auto;
    z-index: 1000;
}

.project_card {
    background: var(--card-background);
    border: 2px solid var(--card-accent);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    cursor: pointer;
    transition: 0.3s;
    position: relative;
}

.project_title {
    font-size: 18px;
    font-weight: bold;
    color: var(--card-accent);
    margin-bottom: 10px;
}

.project_description {
    font-size: 16px;
    color: var(--card-text);
    line-height: 20px;
    padding-right: 0.5rem;
}

.project_content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 1s ease-out, opacity 1s ease-out;
    margin-bottom: 2.5rem;
}

.project_content.active {
    max-height: 1000px;
    opacity: 1;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    margin-bottom: 10px;
    height: auto;
}

.repo_link {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
}

.repo_link img {
    width: 2.1rem;
    height: auto;
    margin-top: 10px;
}

.tag {
    background: var(--light-accent);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 14px;
}

.layered_button::before {
    box-sizing: border-box;
}

.layered_button {
    width: 200px;
    position: relative;
    display: inline-block;
    cursor: pointer;
    outline: none;
    border: 0px;
    vertical-align: middle;
    text-decoration: none;
    font-size: inherit;
    font-family: inherit;
    font-weight: 600;
    padding: 1.15em 2em;
    text-transform: uppercase;
    border-radius: 0.75em;
    transform-style: preserve-3d;
    transition: transform 0.25s ease-out, background 0.25s ease-out;
}

.layered_button::before {
    position: absolute;
    content: "";
    width: 100%;
    height: 100%;
    inset: 0px;
    border-radius: inherit;
    transform: translate3d(0px, 0.7em, -1em);
    transition: transform 0.25s ease-out, box-shadow 0.2s ease-out;
}

.layered_button:hover {
    transform: translateY(0.25em);
}

.layered_button:hover::before {
    transform: translate2d(0px, 0.5em, -1em);
}

.layered_button--pink {
    color: var(--card-accent);
    background: var(--light-pink);
    border: 2px solid var(--card-accent);
}

.layered_button--pink::before {
    background: var(--pink-shadow);
    box-shadow: var(--card-accent) 0px 0px 0px 2px;
}

.layered_button--white {
    color: var(--teal);
    background: var(--light-accent);
    border: 2px solid var(--teal);
}

.layered_button--white::before {
    background: var(--light-accent);
    box-shadow: var(--teal) 0px 0px 0px 2px;
}

.back_to_top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    cursor: pointer;
    width: fit-content;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.back_to_top.visible {
    opacity: 1;
}

.layered_button--small {
    font-size: 12px;
    padding: 0.75em 1.5em;
    width: auto;
}

#theme-toggle {
    z-index: 100;
    position: fixed;
    cursor: pointer;
    bottom: 2%;
    right: 2%;
    font-size: 1.2em;
}

#theme-toggle * {
    box-sizing: border-box;
}

.mode_checkbox {
    opacity: 0;
    right: 0px;
    position: relative;
}

.mode_checkbox-label {
    background-color: var(--teal);
    width: 50px;
    height: 26px;
    border-radius: 50px;
    position: relative;
    padding: 5px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mode_checkbox-label .ball {
    background-color: #fff;
    width: 22px;
    height: 22px;
    position: absolute;
    left: 2px;
    top: 2px;
    border-radius: 50%;
    transition: transform 0.2s linear;
}

.mode_checkbox:checked + .mode_checkbox-label .ball {
    transform: translateX(24px);
}

.fa-moon {color: #FFD86E;}

.fa-sun {color: #ffb770;}

code {
    background: var(--light-accent);
    padding: 10px 10px 10px 10px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    line-height: 1.2;
    vertical-align: middle;
    display: inline-block;
    margin-top: 10px;
    margin-bottom: 10px;
}

.links {
    position: relative;
    margin-bottom: 30px;
    display: flex;
    width:320px;
    justify-content: space-between;
}

#footer_link  {
    position: relative;
    display: inline-block;
    margin: auto;
    margin-bottom: 10px;
    height: 2.5rem;
}

#footer {
    position: relative;
    width: 100%;
    text-align: center;
    margin-top: 100px;
}

.link_float {
    transition: margin 0.2s ease-in-out;
}

.link_float:hover {
    margin-top: -2px;
    margin-bottom: 2px;
    font-weight:bold;
    text-decoration:underline;
}

.link_bold:hover {
    font-weight:bold;
    text-decoration:underline;
}

#blurb_email {
    margin-top: 30px;
    display: inline-block;
    white-space: nowrap;
}

#about_me::after {
    position: relative;
    top:3px;
    left:-5px;
    content: "";
    width: 6px;
    height: 20px;
    background: #ec7fff;
    display: inline-block;
    white-space: nowrap;

    animation: cursor-blink 1.5s steps(2) infinite;
}

@keyframes cursor-blink {
    0% {
      opacity: 0;
    }
}


@media (max-width: 768px) {
    .mobile-only {
        display: inline;
    }

    .back_to_top {
        right: 2%;
    }

    #projects_list {
        width: 90%;
        height: auto;
        margin: auto;
    }

    #header {
        flex-direction: column-reverse;
        align-items: center;
    }

    #portrait {
        width: 200px;
        margin-bottom: 20px;
    }

    #left_header {
        width: 100%;
        align-items: center;
        text-align: center;
    }

    #center {
        width: 90%;
    }

    .links {
        width: 100%;
        display: flex;
        justify-content: center;
        gap: 20px;
        margin: 40px auto;
    }

    #name {
        font-size: 28px;
        text-align: center;
    }

    #subtitle {
        text-align: center;
    }

    #resume_link {
        margin-top: 20px;
        margin-bottom: 15px;
        position: relative;
    }

    #about_me {
        position: relative;
    }

    #about_me::after {
        position: relative;
        display: inline-block;
        vertical-align: middle;
    }

    #blurb_email {
        white-space: normal;
        width: 100%;
    }
}
