:root {
    color-scheme: dark;
    --bg-color: black;
    --primary: #fcd718;
    --secondary-bg-1: #161616;
    --secondary-bg-2: #2e2e2e;
    --secondary-bg-3: #d8fc18;
    --secondary-outline: #3b3b3b;
    --text-color: white;
    --secondary-text-color: rgb(160, 160, 160);
}
* { box-sizing: border-box }
html {
    font-family: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,Ubuntu,"Helvetica Neue",sans-serif;
}
body, h1, h2, h3, div, i, img, p, span, a {
    margin: 0 }
h1, h2, h3 {
    line-height: 1.1 }
body {
    scroll-behavior: smooth;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
}
h1 {
    font-weight: 100;
    font-size: 3rem;
}
h2 {
    font-size: 1.75rem;
    font-weight: 400;
}
h3 {
    font-size: 1.3rem;
    font-weight: 500;
}
h4 {
    font-size: 1.2em }
img { vertical-align: middle }
button, select, textarea, input {
    font: inherit }

/* Background elements */
#bg {
    position: absolute;
    width: 102%;
    height: 350%;
    background-image: url("img/bg.png");
    background-repeat: repeat;
    background-size: 22rem;
}
.bg-streak-container {
    transform: rotate(var(--angle));
    width: 120%;
    margin-top: var(--top);
    margin-left: -10%;
}
.bg-streak {
    border-radius: 50em;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary-bg-3) 100%);
    margin-top: 5px;
    margin-right: 5px;
    height: 12px;
}
.row { display: flex }
.cell { flex-grow: 1 }
.cell-2 { flex-basis: 20% }
.cell-3 { flex-basis: 30% }
.cell-4 { flex-basis: 40% }
.cell-5 { flex-basis: 50% }
.cell-6 { flex-basis: 60% }
.cell-7 { flex-basis: 70% }
.cell-9 { flex-basis: 90% }

/* Header elements */
.header-center-box {
    background-color: var(--secondary-bg-1);
    width: min(70%, 26rem);
    margin: 125px auto 5px auto;
    text-align: center;
    padding: 10px;
    border: 1px solid var(--primary);
    border-radius: 1rem;
}
.header-center-box a img {
    width: 2rem;
    height: 2rem;
    margin-top: -1rem;
    margin-bottom: 0.5rem;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
}
#header-image {
    width: min(15rem, 70%);
    height: min(15rem, 70%);
    margin-top: -6rem;
    border: 2px solid var(--secondary-outline);
    border-radius: 50%;
}
#header-text {
    color: var(--primary);
    padding-bottom: 1rem;
    font-size: 2.5em;
    font-weight: 100;
    font-style: italic;
}
.header-sub-title {
    opacity: 0;
    animation-duration: 0.5s;
    animation-fill-mode: forwards;
    width: min(17rem, 70vw);
    background-color: var(--secondary-bg-2);
    border-radius: 1rem;
    margin: 1rem auto;
    padding: 12px 0;
    text-align: center;
    overflow: auto;
}
.header-sub-title div {
    margin: 0 auto;
    width: fit-content;
}
.header-sub-title div img {
    float: left;
    width: 2rem;
    height: 2rem;
}
.header-sub-title div h2 {
    margin-left: 1rem;
    padding: 0;
    font-size: 1.5em;
    float: left;
}

#btn-light {
    position: absolute;
    right: 10px;
    top: 5px;
    width: max(30px, min(45px, 5vw));
    height: max(30px, min(45px, 5vw));
    background-image: url("img/colorMode.png");
    background-size: contain;
    background-repeat: no-repeat;
    border: none;
    background-color: transparent;
    background-position: center;
    background-size: 100%;
    transition: 0.2s;
}
#btn-light:hover {
    background-size: 95%;
}

/* Body elements */
.styled-box {
    width: min(90%, 35rem);
    border: 2px solid var(--secondary-outline);
    background-color: var(--secondary-bg-1);
    border-radius: 1rem;
    text-align: center;
    padding: 1rem;
    margin: 0 auto;
}

.section-anim {
    opacity: 0;
    animation-name: slideInBottom;
    animation-duration: 0.75s;
    animation-fill-mode: forwards;
    margin-top: 70px;
}
.section {
    margin-top: 75px;
}
.title-box {
    background-color: var(--secondary-bg-1);
    width: min(70%, 30rem);
    margin: 0.8rem auto;
    text-align: center;
    padding: 10px;
    border: 1px solid var(--primary);
    border-radius: 1rem;
}

#portfolio-section {
    margin-top: 1.5rem;
    display: grid;
    justify-items: center;
    justify-content: center;
    gap: 0.8rem;
    grid-template-columns: 1fr;
}
.portfolio-item {
    border-radius: 1rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}
.portfolio-item-header {
    display: grid;
    grid-template-columns: 0.11fr 0.89fr;
    text-align: left;
    font-size: 0.7em;
}
.portfolio-item-header img {
    height: 1em;
    width: 1em;
    margin: auto 0;
    transition: rotate 0.5s;
}
.portfolio-item-content {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.5s;
}
.portfolio-item-content > div {
    overflow: hidden;
    grid-row: 1 / span 2;
}
.portfolio-item-content div h3 {
    display: none }

.portfolio-item-content img {
    width: min(95%, 28rem);
    margin: 1rem auto 0.5rem auto;
    border: 5px solid var(--secondary-outline);
    border-radius: 1rem;
}
.portfolio-item-content p {
    margin: 1rem auto;
    color: var(--secondary-text-color);
}

/* Mobile panel open styling */
.portfolio-item.open .portfolio-item-content {
    grid-template-rows: 1fr }
.portfolio-item.open .portfolio-item-header img {
    rotate: 90deg }

.project-link {
    display: inline-block;
    color: var(--text-color);
    background-color: var(--secondary-bg-2);
    text-decoration: none;
    font-size: larger;
    padding: 0.5rem 0.9rem;
    margin: 0.6rem 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--primary);
    transition: 0.25s;
}
.experience .project-link {
    border: none;
}
a.project-link:hover {
    padding: 0.45rem 0.8rem;
    margin: 0.65rem 0.6rem;
    color: var(--primary);
}
button.project-link:hover {
    color: var(--primary);
    cursor: pointer;
}

@media (min-width: 900px) {
    .bg-streak-container {
        margin-top: calc(var(--top) + 550px);
    }
    .portfolio-item div div h3 {
        display: block;
    }
    .portfolio-item-header {
        display: none;
    }
    .portfolio-item-content {
        grid-template-rows: 1fr;
    }
    #portfolio-section {
        margin: 0 15px 0 15px;
        row-gap: 2rem;
        grid-template-columns: repeat(2, minmax(450px, 550px));
    }
    #btn-light {
        right: 15px;
        top: 15px;
    }
    #form {
        display: grid;
        padding: 15px;
    }
}
@media (min-width: 1500px) {
    #portfolio-section:not(.col-2) {
        grid-template-columns: repeat(3, minmax(450px, 625px));
    }
    h3 {
        font-size: 1.5rem }
}
.languages-box div div {
    background-size: 90%;
    background-repeat: no-repeat;
    background-position: center;
}
.languages-box div img {
    width: 18%;
    padding: 6px;
}
.languages-box div picture img {
    width: 100%;
    margin: 0 0;
}
.languages-box > div:nth-child(2) {
    width: 85%;
    margin: 15px auto
}
.languages-box > div:nth-child(2) > img, .languages-box > div:nth-child(2) > picture {
    margin: 0 5px;
}
.languages-box > div:nth-child(3) {
    width: 70%;
    margin: 15px auto
}
.languages-box > div:nth-child(3) > img, .languages-box > div:nth-child(3) > picture {
    margin: 0 6px;
}

#form {
    padding: 5px;
    column-gap: 10px;
}
#form input, textarea {
    width: 100%;
    margin-bottom: 15px;
    resize: none;
}
#form div {
    text-align: start;
}
#form label {
    font-size: 80%;
}
#form button {
    width: 40%;
    margin: 0 auto;
}
#message {
    height: 10em;
}

#expand-arrow {
    margin-top: 10px;
    color: white;
    font-size: 70%;
    width: 30px;
    background: none;
    border: none;
}

/* Light mode styles */
.light-mode {
    color-scheme: light;
    --bg-color: white;
    --primary: #f39965;
    --secondary-bg-1: #f9f9f9;
    --secondary-bg-2: #f3f3f3;
    --secondary-bg-3: #fc7318;
    --secondary-outline: #e2e2e2;
    --text-color: black;
    --secondary-text-color: rgb(91, 91, 91);
}
.light-mode #ue {
    content: url("img/ue_dark.png");
}
.light-mode #css {
    content: url("img/css_dark.png");
}
.light-mode #wp {
    content: url("img/wp_dark.png");
}
.light-mode #js {
    content: url("img/js_dark.png");
}
.light-mode #html {
    content: url("img/html_dark.png");
}
.light-mode #py {
    content: url("img/python_dark.png");
}
.light-mode #phone {
    content: url("img/phone_dark.png");
}
.light-mode #env {
    content: url("img/envelope_dark.png");
}
.light-mode #cam {
    content: url("img/camera_dark.png");
}
.light-mode #bg {
    background-image: url("img/bg_light.png");
}
.light-mode #btn-light {
    background-image: url("img/colorMode_dark.png");
}
.light-mode .header-sub-title {
    border: 2px solid var(--secondary-outline);
    padding: 10px 0;
}
.light-mode .portfolio-item-header img {
    filter: invert(1) }

/* Other elements */
.no-space {
    height: 0;
    overflow: visible;
}

@keyframes slideInBottom {
    0% {transform: translateY(50%);opacity: 0;}
    100% {transform: translateY(0%);opacity: 1;}
}
@keyframes slideInLeft {
    0% {transform: translateX(-50%);opacity: 0;}
    100% {transform: translateX(0%);opacity: 1;}
}
@keyframes slideInRight {
    0% {transform: translateX(50%);opacity: 0;}
    100% {transform: translateX(0%);opacity: 1;}
}