*, *::before, *::after {
    box-sizing: border-box;
}

:root{
    scroll-behavior: smooth;
    line-height: 1.6rem;

    /* variabelen*/
    --header_background: oklch(0.89 0 0);
    --background: oklch(0.9 0 0);
    --transparant_background: oklch(0.9 0 0 /.9);
    --header_color: oklch(0.4 0 0);

    --text_lightness: 0.22; /* change with main color */
    --main_color: rgb(calc(var(--text_lightness) * 255) calc(var(--text_lightness) * 255) calc(var(--text_lightness) * 255));
    --accent: oklch(0.7 0 0);

    --shadow_color: oklch(0 0 0 / .15);

    --logo_height: 4em;

    color: var(--main_color);
}

/* Add external link icon to all links containing "http" */
a[href^="http"]::after {
    /* from developers.mozilla.org */
    display: inline-block;

    width: 1em;
    height: 1em;

    margin-left: 0.25em;

    vertical-align: text-top;

    /*
      Unicode zero width space as `<content replacement>` to expose the alt text in the a11y tree.
      See: https://bugzilla.mozilla.org/show_bug.cgi?id=1976574
    */
    content: "\200b"  " (external)";
    content: "\200b" / " (external)";

    background-color: currentcolor;

    -webkit-mask-image: url("../img/icons/external-link.svg");

    mask-image: url("../img/icons/external-link.svg");
    -webkit-mask-size: cover;
    mask-size: cover;
}

a.expand{
    padding: 0.5rem;
    margin: 0 -0.5rem;
}

/* Remove icon from visually-hidden links */
a[href^="http"].visually-hidden::after,
a[href^="http"].sr-only::after,
a[href^="http"].screen-reader-only::after,
a[href^="http"][aria-hidden="true"]::after,
a[href^="http"].hidden::after {
    content: none;
    display: none;
}

/* Ensure the icon doesn't get underlined */
a[href^="http"]::after {
    text-decoration: none;
}

/* Prevent the icon from being selectable */
a[href^="http"]::after {
    user-select: none;
}

/* Keep icon with link text when wrapping */
a[href^="http"]::after {
    white-space: nowrap;
}

img {
    width: 100%;
    border-radius: 1em;
}

html {
    background: var(--background);
    color: var(--main_color);
    overflow-x: clip;
    #detach-button-host { /* this disables the video tools for opera */
        display: none;
    }
}


.visually-hidden {
    position: relative;
    width: 1px;
    height: 1px;
    margin: -1px;
    border: 0;
    padding: 0;

    white-space: nowrap;
    clip-path: inset(100%);
    clip: rect(0 0 0 0);
    overflow: hidden;
}

h1:not(.visually-hidden), h2:not(.visually-hidden) {
    text-align: center;
}

body {
    font-family: Inter, sans-serif;
    margin: 0;
    line-height: 1.6rem;
    display: flex;
    min-height: calc(100dvh - 2px);
    flex-direction: column;
    overflow-x: clip;
    padding: 0;

    a:is(.link){
        padding: 0.8rem;
        margin: 0 -0.8rem;
    }
}

main {
    flex: 1;
    justify-content: flex-start;
    .container > * {
        margin: 3em 0;
    }
}

.container {
    max-width: min(80rem,85vw);
    margin: auto;
}

.icon {
    padding: 0;
    margin: 0;
    filter:  invert(1) brightness(var(--text_lightness));
    border-radius: 0;
}

.projects {
    display: flex;
    align-content: center;
    flex-direction: column;
}

.no-wrap {
    white-space: nowrap;
}

.socials {
    ul {
        margin: 0;
        padding: 0 20%;
        display: flex;
        list-style: none;
        gap: 1em;
        width: 100%;
        justify-content: space-evenly;
        li {
            flex-grow: 0;
            position: relative;
            img {
                padding: 0;
                margin: 0;
                width: 2em;
                filter:  invert(1) brightness(var(--text_lightness));
                border-radius: 0;
            }
        }
    }
}

.cards {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    list-style: none;
    padding: 0;

    li {
        flex: 1;
        min-width: 10em;
        position: relative;
        display: flex;
        flex-direction: column;
        border-radius: 1em;
        overflow: hidden;
        box-shadow: 0 0 2rem var(--shadow_color, oklch(0 0 0 / .2));
        background-color: var(--background);
        transition: scale 200ms ease-in-out;

        &:hover {
            scale: 104%;
        }

        picture {
            order: -1;
            height: clamp(9em, 18vw, 15em);
            overflow: hidden;

            img {
                width: 100%;
                height: 100%;
                object-fit: cover;
                object-position: center;
            }
        }

        div {
            margin: 1rem;
            display: flex;
            flex-direction: column;
            flex-grow: 1;

            p {
                margin-top: 0;
                color: oklch(0 0 0);
            }

            a {
                margin-top: auto;
            }
        }
    }
}

footer {
    background-color: var(--header_background);
    p {
        margin: 0;
        padding: 0;
    }
}



.overlay-link {
    position: absolute;
    overflow: hidden;
    inset: 0;
    text-indent: 100%;
    white-space: nowrap;
    height: auto;
}

.name {
    font-weight: bold;
    text-decoration: underline;
}

.button {
    background-color: transparent;
    border-radius: 0.5rem;
    margin: 1.5rem;
    padding: 0.5rem;
    border: 2px solid var(--accent);
    color: inherit;
    text-decoration: none;
    transition: background-color .2s;

    &:hover {
        background: var(--accent);
    }
}

.buttons {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;

}

/* Animated gradient border modifier */
@property --border-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

.button.animated-border {
    --border-angle: 0deg;
    border: 4px solid transparent;
    background:
            linear-gradient(var(--background), var(--background)) padding-box,
            conic-gradient(
                    from var(--border-angle),
                    oklch(0.63 0.2389 275.68),
                    oklch(0.83 0.0894 284.28),
                    oklch(0.63 0.2389 275.68)
            ) border-box;
    animation: border-angle-rotate 3s infinite linear;
    transition: ease-in-out scale .1s, ease-in-out rotate .1s;

    &:hover {
        scale: 110%;
        rotate: 0.5deg;
    }
}

main {
    .welcome {
        margin: 7em 1em;
    }

    .title {
        justify-self: center;
        margin: 6em 1em;
        position: relative;
        white-space: nowrap;

        h1 {
            margin: 1.5rem 1.5rem 2rem;
            font-size: clamp(2em, 10vw, 3em);
        }
        .padded_background {
            background-color: var(--background);
            box-shadow: inset 0 0.3rem 1rem var(--shadow_color);;
            width: fit-content;
            margin: auto;
        }


        .video-background {
            filter: blur(2px);
            opacity: 100%;
            backdrop-filter: unset;
        }
    }
}

.right-image {
    display: grid;
    justify-items: center;
    text-align: center;
    gap: 0;
    background-color: var(--background);

    > *:not(img):not(picture) {
        order:  2;
    }

    > *:first-child {
        order: 1;
    }

    img, picture {
        order:  2;
        object-fit: cover;
        max-width:  min(70%, 20rem);
        border-radius: 1em;
        box-shadow: 0 0 1rem var(--shadow_color);
    }
}

.padded_background {
    background-color: var(--background);
    margin-left: -1rem;
    margin-right: -1rem;
    padding: 1rem;
    border-radius: 1em;
}

@media screen and (min-width: 700px) {
    main .right-image {
        grid-template-columns: 1fr auto;
        grid-template-rows: auto 1fr auto;
        grid-auto-flow:  dense;
        text-align: start;
        justify-items: start;
        align-items: start;

        > :not(picture):not(img) {
            grid-column:  1;
            margin-left: 0;
            margin-right: 1rem;
        }

        h1, h2, h3 {
            text-align: start;
        }

        > img, > picture {
            grid-column:  2;
            /* Span a large number of rows to cover all content */
            grid-row: 1 / span 3;
            width:  clamp(17em, 30vw, 25em);
            max-width: unset;
            min-height: 100%;
            order: unset;
            justify-self: end;
        }
    }
}

@media screen and (max-width: 700px){
    main .cards {
        flex-direction: column;

        li {
            width: 100%;
        }
    }
}

@media screen and (max-width: 500px){
    main .buttons {
        flex-direction: column;
        gap: 0;
    }
}



@keyframes border-angle-rotate {
    from { --border-angle: 0deg; }
    to { --border-angle: 360deg; }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}