:root {
    /* Primary Blues */
    --blue-100: #E6F2FF;
    --blue-200: #99CAFF;
    --blue-300: #66A8FF;
    --blue-400: #3B9EFF;
    --blue-500: #007BFF;
    --blue-600: #0062CC;
    --blue-700: #004999;
    --blue-800: #003166;

    /* Accent Oranges */
    --orange-100: #FFF0E6;
    --orange-200: #FFCCA3;
    --orange-300: #FFAD70;
    --orange-400: #FF8F2D;
    --orange-500: #FF6F00;
    --orange-600: #CC5A00;
    --orange-700: #994400;
    --orange-800: #662E00;

    /* Complementary Colors */
    --purple: #7B00FF;
    --teal: #00D1B2;
    --gold: #FFD700;
    --coral: #FF6B6B;

    /* Extended Neutrals */
    --white: #FFFFFF;
    --gray-100: #F8F9FA;
    --gray-200: #E9ECEF;
    --gray-300: #DEE2E6;
    --gray-400: #CED4DA;
    --gray-500: #ADB5BD;
    --gray-600: #6C757D;
    --gray-700: #495057;
    --gray-800: #343A40;
    --gray-900: #212529;
    --black: #000000;

    /* Semantic Colors */
    --success: #39D98A;
    --warning: #FFCC00;
    --error: #FF3B30;
    --info: #17A2B8;

    /**
    Primary Color: Electric Blue

    Represents technology, trust, and innovation. This vibrant blue will give a modern and energetic feel to the brand.
    */
    --primary-color: var(--blue-500);
    /**
    Secondary Color: Dark Gray

    A sophisticated, neutral color that pairs well with electric blue, adding a sense of professionalism and stability.
    */
    --secondary-color: var(--gray-800);
    /**
    Accent Color: Bright Orange

    Orange adds a touch of energy and creativity. It can be used for call-to-action buttons or highlights to draw attention.
    */
    --accent-color: var(--orange-500);
    /**
    Neutral Color: Light Gray

    Used as a background or for less prominent elements, it keeps the design clean and minimalistic while ensuring the primary colors stand out.
    */
    --neutral-color: var(--gray-100);
    /**
    Highlight Color: Lime Green

    Green suggests growth and success. This can be used sparingly for positive indicators, success messages, or subtle highlights.
    */
    --highlight-color: var(--success);
}

@media (prefers-color-scheme: dark) {
    :root {
        /* Dark mode overrides for primary colors */
        --primary-color: var(--blue-400);
        --secondary-color: var(--gray-200);
        --accent-color: var(--orange-400);
        --neutral-color: var(--gray-900);
        --highlight-color: #4AE99E;

        /* Adjust semantic colors for dark mode if needed */
        --success: #4AE99E;
        --warning: #FFD633;
        --error: #FF5147;
        --info: #3BBFD4;
    }
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--neutral-color);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

a {
    color: var(--accent-color);
    text-decoration: none;

    &[href^="mailto:"]:not(:has(button))::after {
        content: " ✉️";
    }
}

button {
    padding: 16px;
    margin: 7px;
    border-radius: .25rem;
    background-color: var(--highlight-color);
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

time {
    display: block;
    font-size: .8rem;
    margin-bottom: 1rem;
}

h1,
h2,
h3,
h4, h1 > a, .site-title, .site-title a {
    margin: 0;
    font-family: "Iceland", sans-serif;
    font-weight: 400;
    font-style: normal;
    color: var(--primary-color);
}

h1 {
    font-size: 4em;
}

.site-title {
    font-size: 2em;
}

h3 {
    margin-bottom: .5rem;
}

h4 {
    color: var(--accent-color);
}

header {
    margin-bottom: 5rem;
}

q {
    display: inline;
    padding: .01rem .3rem;
    background-color: var(--neutral-color);
    border: 1px solid hsl(0, 0%, 85%);
    border-radius: .24rem;

    p > & {
        line-height: 1.02rem;
    }
}

table {
    margin: 0 auto;
    border-collapse: collapse;

    thead {
        font-weight: bold;

        tr {
            border-bottom: 2px solid var(--secondary-color);
        }
    }

    tr {
        border-bottom: 1px solid var(--gray-300);
    }

    td {
        text-align: center;
        min-width: 10rem;
        padding: .3rem;
    }
}

article {
    > q {
        display: block;
        padding: .3rem;
        background-color: var(--neutral-color);
        border: 1px solid hsl(0, 0%, 85%);
        border-radius: .24rem;
    }

    figure {
        text-align: center;
        max-width: 50%;
        margin: 0 auto 1rem;

        img {
            width: 100%;
        }

        figcaption {
            font-size: .8rem;
        }
    }
}

p {
    pre {
        display: inline-block;
        margin: 0;
    }
}

dl {
    dt {
        font-weight: bold;
    }

    dd {
        pre {
            display: inline-block;
            margin: 0;
        }
    }
}

a[href^="#footnote-"] {
    vertical-align: super;
    font-size: .75rem;
}

.footnotes {
    li::marker {
        content: "[" counter(list-item) "] ";
    }
}

.page-content {
    margin: 0 auto;
    min-width: 50%;
    max-width: 800px;
    padding: 0 16px;
    color: var(--secondary-color);

    & > h2 {
        margin-top: 3rem;
        margin-bottom: 1.5rem;
    }

    & > header {
        text-align: center;
        color: var(--accent-color);
    }

    article.teaser {
        margin-bottom: 2rem;

        > div {
            display: flex;
            flex-direction: row;
            gap: 2rem;
            > img {
                height: fit-content;
                max-width: 100%;
                max-height: 10rem;
            }
        }
    }
}

.socials {
    display: flex;
    position: fixed;
    top: 0;
    right: 0;

    & > a {
        & > svg {
            height: 24px;
            margin: .5rem .5rem .5rem 0;
            color: var(--secondary-color);

            :hover > & {
                color: var(--accent-color);
            }
        }
    }
}

.services {
    display: flex;
    flex-direction: row;
    width: 100%;
    gap: 2rem;

    @media only screen and (max-width: 600px) {
        flex-direction: column;
    }

    .service {
        flex-grow: 1;
        text-align: center;
        max-width: 33%;

        @media only screen and (max-width: 600px) {
            max-width: 100%;
        }

        img {
            height: 5rem;
            margin: 2rem;
        }

        p {
            text-align: justify;
        }
    }
}

.cta {
    width: 80%;
    margin: 4rem auto;
    padding: 1rem;
    color: var(--secondary-color);
    border: 1px solid var(--primary-color);
    background-color: var(--neutral-color);
    text-align: justify;
    border-radius: .25rem;
}

div.center {
    width: 100%;
    display: flex;
    justify-content: center;
}

div.tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;

    & > details {
        display: contents;

        div {
            order: 1;
            display: block;
            width: 100%;
            padding: 12px 15px;
            border-top: 2px solid var(--accent-color);
            z-index: 1;
            text-align: justify;

            & > h3 {
                width: 100%;
                display: flex;
                flex-direction: row;
                justify-content: space-between;
                align-items: center;

                > small {
                    font-size: 1rem;
                }
            }

            @media only screen and (max-width: 600px) {
                & > h3 {
                    flex-direction: column;
                    align-items: flex-start;
                }
            }
        }

        /* Required for chrome */
        &::details-content {
            order: 1;
        }

    }

    /* ideally, the summary can be added as child of details, but safari doesn't like it */
    summary {
        order: 0;
        display: block;
        z-index: 0;
        max-height: 50px;
        min-width: 10%;
        margin-left: -1px;
        margin-top: 12px;
        padding: 12px 15px;
        background-color: var(--neutral-color);;
        border: 1px solid var(--secondary-color);
        border-bottom: 0;
        text-align: center;
        cursor: pointer;

        > svg {
            height: 100%;
            min-width: 50px;
            max-width: 100%;
            color: var(--accent-color);
        }

        /* no markers on the summary */
        &::-webkit-details-marker,
        &::marker {
            display: none;
        }

        /* the first tab has the top left corner rounded */
        :first-of-type > & {
            border-radius: .25rem 0 0 0;
        }

        /* the last tab has the top right corner rounded */
        :last-of-type > & {
            border-radius: 0 .25rem 0 0;
        }

        /* the open tab is bigger, has an orange border with rounded top corners */
        [open] > & {
            pointer-events: none;
            border-radius: .25rem .25rem 0 0;
            border-width: 2px 2px 0 2px;
            border-color: var(--accent-color);
            margin-top: 1px;
            margin-bottom: -3px;
            z-index: 2;
            max-height: 63px;
            min-width: 19%;
        }
    }
}

.skills {
    > li {
        display: inline-block;

        &::after {
            content: ", ";
        }

        &:last-of-type::after {
            content: "";
        }
    }
}

fieldset {
    padding: 1.5rem;
    border-color: var(--accent-color);

    legend{
        padding: 0 1rem;
    }
}

.error-image {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    display: block;
}

.notification {
    padding: 1rem;
    margin: 2rem 0;
    border-left: 4px solid var(--primary-color);
    background-color: color-mix(in srgb, var(--neutral-color) 90%, var(--primary-color) 10%);
    border-radius: 0.25rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);

    code {
        display: inline-block;
        background-color: var(--neutral-color);
        padding: .25rem;
        border-radius: 0.25rem;
        white-space: pre-wrap;
        font-size: 0.9rem;
        border: 1px solid var(--secondary-color);
    }
}

.twitter-tweet {
    margin: 0 auto;
}

footer {
    text-align: center;
    font-size: 0.8rem;
    margin-top: 2rem;
    padding: 1rem 0;
}

/* Thumbnail popover images */
.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
}

.img-popover {
    max-width: 220px;
    height: auto;
    cursor: zoom-in;
    border: 1px solid var(--gray-300);
    border-radius: .25rem;
    background: var(--white);
}

.img-popover-trigger {
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.img-popover-dialog {
    --backdrop-color: color-mix(in srgb, var(--neutral-color) 88%, var(--primary-color) 12%);

    max-width: 90vw;
    max-height: 90vh;
    padding: .75rem;
    border: 1px solid var(--secondary-color);
    background-color: var(--neutral-color);
    border-radius: .35rem;
    box-shadow: 0 12px 24px rgba(0, 0, 0, .2);

    &::backdrop {
        background-color: var(--backdrop-color);
        opacity: 0.8;
    }

    & > .close {
        position: absolute;
        top: .25rem;
        right: .35rem;
        background: var(--accent-color);
        color: var(--white);
        border: none;
        border-radius: .25rem;
        padding: .15rem .5rem;
        font-size: 1.2rem;
        line-height: 1;
        cursor: pointer;
    }

    & > div {
        overflow: scroll;
    }
}

@media (prefers-color-scheme: dark) {
    .img-popover-dialog {
        --backdrop-color: color-mix(in srgb, var(--neutral-color) 88%, var(--primary-color) 12%);

        border-color: var(--primary-color);
        box-shadow: 0 12px 24px rgba(0,0,0,.6);
    }
}


.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.project-card {
    background-color: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;

    @media (prefers-color-scheme: dark) {
        background-color: var(--gray-800);
        border-color: var(--gray-700);
    }

    &:hover {
        transform: translateY(-4px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    img {
        width: 100%;
        height: 150px;
        object-fit: cover;
        border-bottom: 1px solid var(--gray-200);

        @media (prefers-color-scheme: dark) {
            border-bottom-color: var(--gray-700);
        }
    }
}

.project-card-content {
    padding: 1rem;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;

    h3 {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }

    a {
        font-size: 0.9rem;
    }
}
