:root {
    font-size: 12pt;
    font-family: heliotrope_3;
    --bg: #eee;
    --purple: slateblue;
    --fg: #444;
    --muted: #777;
    --red: #a33;
    --input-bg: #fff;
}

@media screen and (prefers-color-scheme: dark) {
    :root {
        --bg: #222;
        --fg: #eee;
        --muted: #aaa;
        --input-bg: #16161d;
    }
}

body {
    background: var(--bg);
    color: var(--fg);
    margin: 3rem;
}

main,
footer {
    max-width: 60ch;
    grid-column: 1;
}

footer {
    font-size: 1rem;
}

footer::before {
    content: "* * *";
    font-size: 1.2rem;
    display: block;
    color: var(--muted);
    text-align: center;
    margin-top: 1rem;
}

body {
    display: grid;
    grid-template-columns: 60ch auto;
    gap: 1rem;
}

body>* {
    grid-column: 1;
}

h1 {
    font-weight: normal;
    font-size: calc(3 * 21px);
    margin-bottom: 1rem;
    grid-column: 1;
}

h2 {
    font-size: 1.2rem;
    margin-bottom: 0;
}

a {
    color: var(--purple);
    text-decoration: none;
}

a:hover,
a:focus {
    text-decoration: underline;
}

input,
label {
    display: block;
    font-family: inherit;
    font-size: 1.2rem;
    width: 100%;
    box-sizing: border-box;
}

input~label {
    margin-top: 1rem;
}

input {
    background-color: var(--input-bg);
    border: none;
    border-bottom: 2px solid var(--fg);
    padding: 4pt;
    color: var(--fg);
}

input:focus {
    border-bottom-color: var(--purple);
}

input:user-invalid,
input[aria-invalid=true] {
    background-color: hsl(from var(--red) h s 90);
    border-bottom-color: var(--red);
}

input::placeholder {
    text-align: right;
    color: var(--muted);
}

span.invalid-hint {
    display: none;
    background: var(--red);
    color: var(--bg);
    font-weight: 600;
    padding: 2pt;
    z-index: 5;
    margin: 4pt 0 0 0;
}

input[aria-invalid=true]+span.invalid-hint,
input:user-invalid+span.invalid-hint {
    display: inline;
}

#toolbar {
    margin: 1rem 0;
}

#toolbar button {
    font-family: heliotrope_3;
    font-size: 1.2rem;
    background: var(--purple);
    color: #eee;
    padding: 8pt;
    border: none;
    box-sizing: border-box;
    margin-bottom: 8pt;
}

#toolbar button:hover,
#toolbar button:focus {
    box-shadow: 3px 3px 0px var(--muted);
    font-weight: 600;
    cursor: pointer;
}

#qr-result-box {
    width: 30ch;
    background: var(--input-bg);
    align-content: center;
    grid-column: 2;
    grid-row: 2;
}


@media screen and (max-width: 90ch) {
    body {
        margin: 0.3rem;
        font-size: 0.9rem;
        grid-template-columns: 60ch;
        row-gap: 0;
    }

    h1 {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }

    #qr-result-box {
        margin: 3rem auto 0 auto;
        grid-column: 1;
        grid-row: unset;
    }
}

@media screen and (max-width: 65ch) {
    body {
        grid-template-columns: auto;
    }

    #toolbar button {
        display: block;
        font-size: 1rem;
    }
}



@font-face {
    font-family: heliotrope_3;
    font-style: normal;
    font-weight: normal;
    font-stretch: normal;
    font-display: auto;
    src: url("heliotrope_3_regular.woff2") format("woff2");
}

@font-face {
    font-family: heliotrope_3;
    font-style: italic;
    font-weight: normal;
    font-stretch: normal;
    font-display: auto;
    src: url("heliotrope_3_italic.woff2") format("woff2");
}

@font-face {
    font-family: heliotrope_3;
    font-style: normal;
    font-weight: bold;
    font-stretch: normal;
    font-display: auto;
    src: url("heliotrope_3_bold.woff2") format("woff2");
}

@font-face {
    font-family: heliotrope_3;
    font-style: italic;
    font-weight: bold;
    font-stretch: normal;
    font-display: auto;
    src: url("heliotrope_3_bold_italic.woff2") format("woff2");
}