/* Prometheus Soundpack site. Aims at WCAG 2.2 AAA: text contrast at least 7 to 1 in both
   themes, visible focus, targets at least 44 by 44 pixels, reflow at 400% zoom, respects
   people's own text spacing, Windows high contrast, and "reduce motion". */

:root {
    color-scheme: light dark;
    --bg: #ffffff;
    --text: #111111;
    --muted: #333333;
    --link: #0a3a8c;
    --link-visited: #5b1a7a;
    --focus: #000000;
    --focus-ring: #ffbf00;
    --button-bg: #0a3a8c;
    --button-text: #ffffff;
    --rule: #555555;
    --panel: #f2f2f2;
    --error: #8a0000;
    --error-bg: #fff0f0;
    --ok: #0b5d1e;
    --ok-bg: #effaf1;
    --field-border: #333333;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #121212;
        --text: #f2f2f2;
        --muted: #d6d6d6;
        --link: #9cc8ff;
        --link-visited: #e0b3ff;
        --focus: #ffffff;
        --focus-ring: #ffbf00;
        --button-bg: #9cc8ff;
        --button-text: #000000;
        --rule: #aaaaaa;
        --panel: #1e1e1e;
        --error: #ffb3b3;
        --error-bg: #2a1414;
        --ok: #a8e6b4;
        --ok-bg: #132619;
        --field-border: #d6d6d6;
    }
}

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

html {
    font-size: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 1.125rem;
    line-height: 1.6;
}

header.site, main, footer.site {
    max-width: min(48rem, 60ch);
    margin: 0 auto;
    padding: 0 1rem;
}

header.site { padding-top: 1rem; border-bottom: 2px solid var(--rule); }
footer.site { margin-top: 3rem; padding-top: 1rem; padding-bottom: 2rem; border-top: 2px solid var(--rule); color: var(--muted); }

.site-name { font-size: 1.5rem; font-weight: 700; margin: 0 0 0.5rem; }
.site-name a { color: var(--text); text-decoration: none; }
.site-name a:hover { text-decoration: underline; }

nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    min-width: 44px;
    padding: 0 0.25rem;
}
nav a[aria-current="page"] { font-weight: 700; text-decoration-thickness: 3px; }

h1 { font-size: 2rem; line-height: 1.25; margin: 1.5rem 0 1rem; }
h2 { font-size: 1.5rem; line-height: 1.3; margin: 2rem 0 0.75rem; }
h3 { font-size: 1.25rem; margin: 1.5rem 0 0.5rem; }
p, ul, ol { margin: 0 0 1rem; }
li { margin-bottom: 0.5rem; }
/* Never limit text-spacing overrides: no fixed heights on text. */
/* Long unbroken words (installer file names, fingerprints) wrap instead of making the page
   scroll sideways at high zoom (WCAG 1.4.10 Reflow). */
h1, h2, h3, p, li, label, legend, dt, dd, .success, .error-summary, .notice { overflow-wrap: anywhere; }
fieldset { min-width: 0; }
/* WCAG 1.4.8: lines no longer than 80 characters, and clear space between paragraphs. */
p, ul, ol { margin-bottom: 1.5em; }
a.button, button { max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-align: center; }

a { color: var(--link); text-decoration: underline; text-underline-offset: 0.15em; }
a:visited { color: var(--link-visited); }
a:hover { text-decoration-thickness: 3px; }

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
    box-shadow: 0 0 0 6px var(--focus-ring);
}
main:focus { outline: none; box-shadow: none; }

a.button, button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
    padding: 0.5rem 1.25rem;
    border: 2px solid var(--button-bg);
    border-radius: 0.375rem;
    background: var(--button-bg);
    color: var(--button-text);
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
a.button:visited { color: var(--button-text); }
a.button:hover, button:hover { text-decoration: underline; }

.skip {
    position: absolute;
    left: 1rem;
    top: -10rem;
    padding: 0.75rem 1rem;
    background: var(--bg);
    color: var(--link);
    border: 3px solid var(--focus);
    z-index: 10;
}
.skip:focus { top: 1rem; }

code { font-family: Consolas, "Courier New", monospace; background: var(--panel); padding: 0 0.2em; }

/* Forms */
.field { margin: 0 0 1.5rem; }
label, legend { display: block; font-weight: 700; margin-bottom: 0.25rem; }
fieldset { border: 2px solid var(--rule); border-radius: 0.375rem; padding: 0.75rem 1rem; margin: 0 0 1.5rem; }
legend { padding: 0 0.25rem; }
.help { margin: 0 0 0.5rem; color: var(--muted); }
input[type="text"], input[type="password"], input[type="email"], input[type="number"], select, textarea {
    display: block;
    width: 100%;
    max-width: 40rem;
    min-height: 44px;
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--field-border);
    border-radius: 0.25rem;
    background: var(--bg);
    color: var(--text);
    font: inherit;
}
textarea { max-width: 100%; resize: vertical; }
.monospace { font-family: Consolas, "Courier New", monospace; font-size: 1rem; }
.choice { display: flex; align-items: center; min-height: 44px; gap: 0.5rem; }
.choice input { width: 1.5rem; height: 1.5rem; margin: 0; flex: none; }
.choice label { display: inline; font-weight: 400; margin: 0; padding: 0.5rem 0; }
.error { color: var(--error); font-weight: 700; margin: 0 0 0.5rem; }
.has-error input, .has-error textarea, .has-error select { border-color: var(--error); border-width: 3px; }
.error-summary, .success {
    border: 3px solid var(--error);
    background: var(--error-bg);
    padding: 0.75rem 1rem;
    margin: 0 0 1.5rem;
    border-radius: 0.375rem;
}
.error-summary h2 { margin-top: 0; font-size: 1.25rem; }
.error-summary a { color: var(--error); font-weight: 700; }
.error-summary a.button, .error-summary a.button:visited { color: var(--button-text); }
.success { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); font-weight: 700; }
.success p { margin: 0; }
button.secondary { background: var(--bg); color: var(--link); border-color: var(--link); }
form.inline { display: inline; }
.who { margin: 0.5rem 0; }

/* Reports */
pre.output {
    font-family: Consolas, "Courier New", monospace;
    font-size: 1rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    background: var(--panel);
    border: 2px solid var(--rule);
    padding: 0.75rem;
    max-height: 40rem;
    overflow-y: auto;
}
.entry { border-top: 2px solid var(--rule); padding-top: 0.5rem; margin-top: 1rem; }
.entry h3 { font-size: 1.125rem; margin-top: 0; }
dl.review dt { font-weight: 700; margin-top: 1rem; }
dl.review dd { margin: 0.25rem 0 0; }
.buttons button { margin: 0 0.5rem 0.5rem 0; }
.notice { border: 2px solid var(--rule); padding: 0.5rem 1rem; }
kbd { font-family: Consolas, "Courier New", monospace; font-weight: 700; background: var(--panel); border: 1px solid var(--rule); padding: 0 0.25em; border-radius: 0.2em; }
/* The robot trap: hidden from everyone, and from screen readers (aria-hidden). */
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
form.filter { margin-bottom: 1rem; }

/* Tables: scroll sideways inside their own box at high zoom (allowed for data tables). */
.table-wrap { overflow-x: auto; margin: 0 0 1.5rem; }
table { border-collapse: collapse; width: 100%; }
caption { text-align: left; font-weight: 700; padding: 0.5rem 0; }
th, td { border: 1px solid var(--rule); padding: 0.5rem; text-align: left; vertical-align: top; }
thead th { background: var(--panel); }
td form, td button { margin: 0; }
.pager { list-style: none; padding: 0; display: flex; gap: 1rem; flex-wrap: wrap; }
.pager a { display: inline-flex; align-items: center; min-height: 44px; }

/* Windows high contrast and other forced colours: let the system decide, keep outlines. */
@media (forced-colors: active) {
    a.button, button { border: 2px solid ButtonText; }
    :focus-visible { outline: 3px solid Highlight; box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
.note { margin-top: 0.25rem; font-weight: 700; }
