:root {
    font-size: 125%;
    font-family: system-ui, Arial, sans-serif;
    font-size-adjust: 0.528;
    font-size-adjust: from-font;
    text-underline-position: from-font;
}

code, pre, script.visible {
    font-family: ui-monospace, "Cascadia Code", monospace;
}

#skipnav {
    display: block;
    position: absolute;
    top: -2em;
}

#skipnav:focus {
    position: static;
    top: auto;
}

#masthead {
    display: grid;
    column-gap: 1ch;
    grid-template-columns: auto auto;
    align-items: baseline;
    justify-content: space-between;
}

#masthead h1 {
    font-size: 1em;
}

#masthead nav ul {
    display: inline;
    margin: 0;
    padding: 0;
}

#masthead nav li {
    display: inline;
    list-style-type: none;
}

#masthead nav img {
    vertical-align: text-bottom;
}

@media (min-width: 600px) {
    main {
        display: grid;
        row-gap: 0;
        column-gap: 1ch;
        grid-template-columns: auto auto;
        align-items: baseline;
    }
    article, figure {
        grid-row: 1;
    }
    section {
        grid-column: 1 / 3;
        max-width: 72ch;
    }
}

#demo {
    border: 1px solid black;
    margin-top: 1em;
    padding: 4px;
}

#demo h1 {
    margin-top: 0;
}

#demo p:last-child {
    margin-bottom: 0;
}

audio {
    display: block;
    margin: 0 auto;
}

script.visible {
    display: block;
    white-space: pre-wrap;
}

footer {
    text-align: right;
}

:root {
    background: white;
    color: black;
}

:link { color: blue; }
:visited { color: purple; }

#requirements {
    background: white;
    color: red;
    font-weight: bold;
}

::highlight(current) {
    background: yellow;
    color: black;
}

@media (prefers-color-scheme: dark) {
    :root {
        background: black;
        color: white;
    }

    :link { color: yellow; }
    :visited { color: gold; }

    #demo {
        border-color: white;
    }

    #requirements :link { color: blue; }
    #requirements :visited { color: purple; }

    ::highlight(current) {
        background: purple;
        color: white;
    }
}
