@font-face {
    font-family: "Inter";
    src: url("./fonts/inter.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
    font-style: normal;
}

@font-face {
    font-family: "Gaegu";
    src: url("./fonts/gaegu.woff2") format("woff2");
    font-weight: 700;
    font-display: swap;
}

:root {
    color-scheme: dark;

    --bg: #19292b;
    --text: #f5f2f0;
    --muted: #8e9596;
    --muted2: #8e959630;
    --link: #ff692e;
    --link-hover: var(--link);

    --flower: var(--link);
    --flower-line: var(--text);
    --flower-ground: var(--bg);
    --flower-ground-border: var(--text);

    --display-light: none;
    --display-dark: initial;

    --main-width: 900px;
    --indent: 1.5rem;
    --small: false;

    --font-heading: serif;
    --font-regular: inter, sans-serif;
    --font-accent: monospace;

    --font-size: 24px;

    --font-size-heading: 2rem;
    --font-size-h1: 0.85rem;
    --font-size-h2: 1.35rem;
    --font-size-h3: 1.15rem;
    --font-size-small: 0.75rem;
    --font-size-accent: 1em;

    --font-weight: 400;
    --font-heading-weight: 400;
    --font-accent-weight: 400;

    --font-line-height: 150%;
    --font-indent: 1rem;
}

:root[data-theme="light"] {
    color-scheme: light;

    --bg: #F8E9DE;
    --text: #003c4d;
    --muted: #003c4dc0;
    --muted2: #003c4d30;
    --link: #ff5745;

    --flower-ground: var(--text);
    --flower-ground-border: var(--text);

    --display-light: initial;
    --display-dark: none;

    --font-accent-weight: 400;
}

* {
    box-sizing: border-box;
    scroll-margin-top: 4rem;
    font-size: 1em;
    font-family: var(--font-regular);
    transition: 0.3s color ease-out;
    transition: 0.3s background-color ease-out;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

html,
body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    min-height: 100%;
    color: var(--text);

    font-size: var(--font-size);
}

main {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding-left: var(--indent);
    max-width: var(--main-width);
    padding-bottom: 10rem;
    gap: 3rem;
}

h1,
h2,
h3 {
    font-family: var(--font-regular);
    font-weight: 400;
}

h1 {
    font-size: var(--font-size-h1);
    color: var(--muted);
    border-bottom: 1px solid var(--muted2);
    font-weight: normal;
    width: 100%;
    padding: 0 0rem .25rem 0;
}

article:first-of-type h1:first-of-type {
    display: none;
}

h2 {
    font-size: var(--font-size-h2);
    margin: 2rem 0 1rem 0;
}

h3 {
    font-size: var(--font-size-h3);
    margin: 1.5rem 0 1rem 0;
}

p {
    margin: .75rem 0;
    line-height: var(--font-line-height);
}

article > *:first-child {
    margin-top: .75rem;
}

#h-hello > p:first-of-type {
    font-size: var(--font-size-heading);
    margin: 1rem 0 .5rem 0;
    font-family: var(--font-heading);
}

ul {
    margin-left: 2rem;
}

svg {
    width: 1em;
    height: 1em;
    min-width: 1em;
    max-width: 1em;
    padding: 0;
    margin: 0;
    vertical-align: middle;
    display: inline-block;
    fill: var(--text);
}

.dark-only {
    display: var(--display-dark);
}

.light-only {
    display: var(--display-light);
}

article:first-child {
    margin: 0.5 0 0 0;
}

section > *:not(:first-child) {
    padding-left: var(--indent);
}

a {
    color: var(--link);
    text-decoration: underline solid;
    font-family: var(--font-accent);
    font-size: var(--font-size-accent);
    font-weight: var(--font-accent-weight);
    cursor: pointer;
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline wavy;
}

nav {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: row-reverse;
    padding: 0.5rem 1.5rem 0.5rem 1.5rem;
    background-color: var(--bg);
    border-bottom: 6px solid var(--link);
    flex-wrap: wrap;
    max-width: 100%;
}

.nav-items {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
    margin-right: auto;
}

a.samesite::before {
    padding-right: 0.25rem;
    content: "#";
}

a:has(svg){
    text-decoration: none;
}

a:hover:has(svg){
    text-decoration: none;
}

canvas {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100lvw;
    height: 100lvh;
    z-index: 9999;
    pointer-events: none;
}

footer {
    flex: 1;
    padding-left: 1rem;
}

.muted,
em {
    color: var(--muted);
    font-weight: normal;
    font-size: var(--font-size-small);
}

.tags {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    align-items: center;
}

#offscreen {
    display: none;
}

.margin-left {
    margin-left: auto;
}

#h-favorite {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
}

#h-favorite > *:first-child {
    flex: 0 0 100%;
    margin-bottom: 0;
}

#h-favorite > section {
    padding: 0;
    margin: 0;
    min-width: 0;
}

#h-favorite section {
    flex: 0 1 calc(50% - 1rem);
}

#h-favorite > section > * {
    margin: 0 0 0.5rem 0;
    padding: 0;
    list-style: none;
}

#h-favorite > section li {
    margin: 0 0 0.25rem 0;
}

#h-projects {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
}

#h-projects > *:first-child {
    flex: 0 0 100%;
    margin: 0;
}

#h-projects section {
    flex: 0 1 calc(50% - 1rem);
    margin: 0;
    padding: 0;
}

#h-projects section * {
    margin: 0.25rem 0 0 0;
    padding: 0;
}

nav label, nav input {
    display: none;
}

.hidden {
    display: none;
}

@media (max-width: 500px) {
    :root {
        --small: true;
        --font-size: 16px;
        --indent: 0;
    }
    main {
        max-width: unset;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    canvas {
        height: 20vh;
        margin-bottom: 5px;
    }
    #offscreen {
        display: block;
        position: fixed;
        height: 50px;
        bottom: -40px;
        width: 100%;
        background-color: var(--flower-ground);
        border-top: 5px solid var(--flower-ground-border);
    }

    nav {
        flex-direction: row;
    }

    nav > div:first-of-type {
        flex: 0 0 100%;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: .25rem;
    }

    nav > div:first-of-type > *:first-child {
        margin-left: auto;
    }

    nav label {
        display: inline-block;
        cursor: pointer;
    }

    nav svg {
        display: inline-block;
        width: 1.5em;
        height: 1.5em;
        min-width: 1.5em;
        max-width: 1.5em;
    }

    .nav-items {
        display: none;
    }

    nav input:checked~.nav-items {
        display: flex;
    }

    nav input {
        display: none;
    }

    nav input:hover {
        cursor: pointer;
    }

    nav > a#theme {
        margin-left: 0;
    }
}
