@font-face {
    font-family: "SourceSerif4";
    src: url("/web-fonts/SourceSerif4-Regular.otf.woff2") format("woff2");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "SourceSerif4";
    src: url("/web-fonts/SourceSerif4-It.otf.woff2") format("woff2");
    font-weight: normal;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "SourceSerif4";
    src: url("/web-fonts/SourceSerif4-Bold.otf.woff2") format("woff2");
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "SourceSerif4";
    src: url("/web-fonts/SourceSerif4-BoldIt.otf.woff2") format("woff2");
    font-weight: bold;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "SourceSerif4Display";
    src: url("/web-fonts/SourceSerif4Display-Regular.otf.woff2") format("woff2");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "SourceSerif4Display";
    src: url("/web-fonts/SourceSerif4Display-It.otf.woff2") format("woff2");
    font-weight: normal;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "SourceSerif4Display";
    src: url("/web-fonts/SourceSerif4Display-Bold.otf.woff2") format("woff2");
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "SourceSerif4Display";
    src: url("/web-fonts/SourceSerif4Display-BoldIt.otf.woff2") format("woff2");
    font-weight: bold;
    font-style: italic;
    font-display: swap;
}

/* basic reset */

* {
    box-sizing: border-box;

    margin: unset;

    line-height: calc(1em + 0.75rem);
}

img {
    display: block;
    max-width: 100%;
}

/* elements */

:root {
    color-scheme: light dark;

    --scale: 1.3;
    --sm: 14px;
    --md: calc(var(--sm) * var(--scale));
    --lg: calc(var(--md) * var(--scale));
    --xl: calc(var(--lg) * var(--scale));
    --xxl: calc(var(--xl) * var(--scale));

    --lighter: oklch(100% 0% 0);
    --light: oklch(90% 0% 0);
    --dark: oklch(40% 0% 0);
    --darker: oklch(30% 0% 0);

    --highlight: oklch(50% 50% 250);

    background-color: var(--lighter);
    color: var(--dark);

    font-family: "SourceSerif4", serif;
    font-size: var(--md);

    overflow-wrap: break-word;
    text-rendering: optimizeLegibility;

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.composition>*:not(:first-child, hr),
:is(figure, details, blockquote)>*:not(:first-child) {
    margin-top: 1em;
}

path {
    fill: currentColor;
}

nav {
    display: flex;
    flex-wrap: wrap;
    column-gap: 2em;
    row-gap: 1em;

    justify-content: start;
    align-items: center;

    margin-top: 2em;

    white-space: nowrap;
}

figure {
    grid-column: 2 / -2;

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

figcaption {
    margin-left: 1em;
    margin-right: 1em;
}

summary {
    font-weight: bold;

    cursor: default;
}

img {
    object-fit: cover;
    aspect-ratio: 4 / 3;

    height: auto;
}

h1,
h2 {
    color: var(--darker);

    font-family: "SourceSerif4Display", serif;
}

h1 {
    font-size: var(--xxl);
}

h2 {
    font-size: var(--xl);
}

blockquote {
    margin-left: 1em;
    margin-right: 1em;

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

mark {
    background-color: unset;
    color: var(--highlight);

    font-weight: bold;
}

hr {
    background-color: var(--light);

    border: unset;

    margin-top: 2em;

    height: 0.25em;
}

a {
    color: var(--highlight);

    text-decoration-line: unset;
}

button {
    background-color: var(--lighter);
    color: unset;

    border: 1px solid var(--light);
    border-radius: 0.25em;

    padding: 0.5em 1em;

    font-family: unset;
    font-size: var(--sm);
}

/* classes */

.wrapper {
    display: grid;
    grid-template-columns: 1fr minmax(0, 2em) min(100% - 2em, 70ch) minmax(0, 2em) 1fr;

    margin-top: 2em;
    margin-bottom: 2em;
}

.wrapper>:not(figure) {
    grid-column: 3;
}

.siteName {
    font-family: "SourceSerif4Display", serif;
    font-size: var(--xl);
    font-weight: bold;
}

.articles {
    display: grid;
    gap: 2em;

    margin-top: 2em;
}

.date {
    font-size: var(--sm);
}

.toTop {
    /* keep display none in case JavaScript is disabled */
    display: none;

    margin: 1em;

    position: fixed;
    bottom: 0;
    right: 0;
}

.emailProtection {
    display: none;
}

/* media queries */
/* https://tailwindcss.com/docs/responsive-design */

@media screen and (min-width: 768px) {
    :root {
        --sm: 16px;
    }

    .articles {
        grid-template-columns: 1fr 1fr;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --lighter: oklch(30% 5% 250);
        --light: oklch(40% 5% 250);
        --dark: oklch(90% 5% 250);
        --darker: oklch(100% 5% 250);

        --highlight: oklch(80% 50% 250);
    }
}