/***************
 *  Variables  *
 ***************/

:root {
    --primary-100: #e9f5db;
    --primary-200: #cfe1b9;
    --primary-300: #b5c99a;
    --primary-400: #97a97c;
    --primary-500: #87986a;
    --primary-600: #718355;
    --body-font-weight: 500;
    --body-font-family: 'Instrument Sans', system-ui, sans-serif;
}

@media (prefers-color-scheme: light) {
    :root {
        --body-color: #111;
        --body-bg: #fefefe;
        --primary: #cfe1b9;
        --secondary: #eee;
        --primary-other: #f5e9d6;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --body-color: #caccca;
        --body-bg: #232321;
        --primary: #33392d;
        --secondary: #444;
        --border-color: #666;
        --primary-other: #f5e9d6;
    }
}

/*********************
 *  Other utilities  *
 *********************/

body {
    @media screen and (width < 500px) {
        font-size: 15px;
    }
}

ul,
ol {
    padding-left: 0;
    list-style: none;
}

input,
textarea {
    color: inherit;
    border: none;
    background-color: var(--secondary);
}

a,
a:visited {
    color: inherit;
    border-radius: 4px;

    &:hover {
        opacity: 0.85;
    }

    &:active {
        opacity: 0.7;
    }
}

a[rel='noreferrer']::after {
    content: ' ↗';
    padding: 0.2em;
    vertical-align: text-top;
    opacity: 0.6;
    font-size: 0.7em;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid light-dark(#111, #eee);
}

a.button,
a.link,
header a {
    text-decoration: none;

    &:active {
        text-decoration: underline;
    }
}

button,
.button {
    display: inline-flex;
    align-items: center;
    padding: 0.25em 1em;
    column-gap: 0.6em;
    border: none;
    border-radius: 0.2em;
    background-color: var(--primary);
    text-wrap: nowrap;

    &.idle {
        background-color: var(--color-idle);
    }

    &:hover,
    &:focus,
    &:active {
        background-color: var(--primary);
    }
}

.container {
    position: relative;
    width: 100%;
    max-width: 80ch;
    min-height: 100dvh;
    margin: auto;
    padding-inline: 2em;
}

.list-styled {
    list-style: initial;
}

.min-content {
    width: min-content;
}

.flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.inline-flex {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
}

.center {
    max-width: 100%;
    width: max-content;
    margin: auto;
}

.muted {
    color: #888;
}

.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.with-background {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3em;
    padding: 4em 2em 6em 2em;
    border-top-right-radius: 10em;
    background-color: var(--primary);
}

/***********
 *  Fonts  *
 ***********/

/* @font-face {
    font-family: "Instrument Sans";
    font-style: normal;
    font-display: swap;
    font-weight: 400;
    src: url("../fonts/instrument-sans-latin-400-normal-7-RDbvM.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
        U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
        U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
} */

@font-face {
    font-family: 'Instrument Sans';
    font-style: normal;
    font-display: swap;
    font-weight: 500;
    src: url("../fonts/instrument-sans-latin-500-normal-VVB9NwE.woff2") format('woff2');
    unicode-range:
        U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
        U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Instrument Sans';
    font-style: normal;
    font-display: swap;
    font-weight: 600;
    src: url("../fonts/instrument-sans-latin-600-normal-0wurhj4.woff2") format('woff2');
    unicode-range:
        U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
        U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Instrument Sans';
    font-style: normal;
    font-display: swap;
    font-weight: 700;
    src: url("../fonts/instrument-sans-latin-700-normal-btBlRfk.woff2") format('woff2');
    unicode-range:
        U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
        U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
