*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --font: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --type-size: 1.6rem;
    --radius: 0.5rem;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    transition: background-color 0.2s, color 0.2s;
}

a {
    color: var(--sub);
    text-decoration: none;
    transition: color 0.15s;
}

a:hover,
a:focus-visible {
    color: var(--text);
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    cursor: pointer;
}

h1, h2, h3 {
    font-weight: 400;
}

code,
kbd,
input {
    font-family: inherit;
    font-size: inherit;
}

/* Invisible input that receives keystrokes on the typing page (see shelltype.js). */
.key-sink {
    position: fixed;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

::selection {
    background: var(--main);
    color: var(--bg);
}

.muted {
    color: var(--sub);
}

.accent {
    color: var(--main);
}

/* ---------- Blazor boot / error UI ---------- */

#blazor-error-ui {
    background: var(--error);
    color: var(--bg);
    bottom: 0;
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

#blazor-error-ui a {
    color: inherit;
    text-decoration: underline;
}

.blazor-error-boundary {
    background: var(--error);
    padding: 1rem;
    color: var(--bg);
    border-radius: var(--radius);
}

.blazor-error-boundary::after {
    content: "Something went wrong.";
}

.boot {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--sub);
    font-size: 1.25rem;
}

.boot .prompt {
    color: var(--main);
}

.boot .bar {
    display: block;
    margin-top: 0.75rem;
    height: 3px;
    width: 12rem;
    background: var(--bg-alt);
    border-radius: 2px;
    overflow: hidden;
}

.boot .bar::after {
    content: "";
    display: block;
    height: 100%;
    width: var(--blazor-load-percentage, 0%);
    background: var(--main);
    transition: width 0.1s;
}
