:root {
    --color-bg: #121212;
    --color-surface: #1e1e1e;
    --color-text: #e0e0e0;
    --color-text-strong: #ffffff;
    --color-text-muted: #888888;
    --color-accent: #FFD5C4;
    --color-border: #333333;

    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-4xl: 2.25rem;

    --max-width: 960px;
}

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

html {
    font-size: 16px;
    background-color: var(--color-bg);
    scrollbar-gutter: stable;
    overflow-x: hidden;
}

body {
    font-family: sans-serif;
    font-size: var(--font-size-base);
    line-height: 1.7;
    overflow-wrap: anywhere;
    word-break: normal;
    line-break: strict;
    font-kerning: none;
    color: var(--color-text);

    margin: 0;
    padding: 0;
    min-width: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--color-accent);
    line-height: 1.25;
    font-kerning: normal;
    font-feature-settings: "palt";
    word-break: auto-phrase;
    text-wrap: pretty;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

h1 {
    color: var(--color-text-strong);
    font-size: var(--font-size-4xl);
    margin-bottom: 2rem;

    &:focus {
        outline: none;
    }
}

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

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

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

h5 {
    font-size: var(--font-size-base);
}

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

a {
    color: var(--color-text-strong);
    text-decoration: underline;
    transition: opacity 0.2s ease;

    &:active {
        opacity: 0.8;
    }
}

@media (hover: hover) {
    a:hover {
        opacity: 0.8;
    }
}

p {
    margin: 1rem 0;
}

/* Code */
code {
    color: var(--color-accent);
    background-color: var(--color-surface);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
}

pre {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 1rem;
    overflow-x: auto;
}

pre code {
    background: none;
    padding: 0;
    color: inherit;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

th,
td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

th {
    color: var(--color-text-strong);
    font-weight: bold;
}

/* Error UI */
#blazor-error-ui {
    color-scheme: dark only;
    background: #1a1a1a;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: var(--color-text);
    border-top: 1px solid var(--color-accent);
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
    color: var(--color-text-muted);
}

.blazor-error-boundary {
    background: #1a1a1a;
    padding: 1rem;
    color: #ff4444;
    border-left: 3px solid #ff4444;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* Loading */
.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto;
}

.loading-progress circle {
    fill: none;
    stroke: var(--color-surface);
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: var(--color-accent);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
    color: var(--color-text);
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}
