/* Style Definitions */

/* colors: light scheme by default, dark scheme from OS/browser settings */
:root {
    color-scheme: light dark;
    --bg: #F5F3D7;
    --fg: #000000;
    --link: #2E5A80;
    --visited: #646D7E;
    --visited-line: #900000;
    --hover-bg: #7D7D7D;
    --hover-fg: #000000;
    --active-bg: #7D7D7D;
    --active-fg: #000000;
    --focus-bg: #555555;
    --focus-fg: #FFF9EE;
    --focus-ring: #000000;
    --muted: color-mix(in srgb, var(--fg) 70%, var(--bg));
    --line: color-mix(in srgb, var(--fg) 30%, var(--bg));
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #000000;
        --fg: #F5F3D7;
        --link: #5CB3FF;
        --visited: #707885;
        --visited-line: currentcolor;
        --focus-ring: #F88017;
    }
}

/* page */
html {
    -webkit-text-size-adjust: 100%;
}

body {
    max-width: 44rem;
    margin: 0 auto;
    padding: 2rem 1rem 3rem;
    background-color: var(--bg);
    color: var(--fg);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
}

[hidden] {
    display: none !important;
}

h1 {
    margin: 0 0 0.5rem;
    font-size: 2rem;
    line-height: 1.2;
}

h2 {
    margin: 2.5rem 0 1rem;
    font-size: 1.25rem;
    line-height: 1.3;
}

h3 {
    margin: 0 0 0.25rem;
    font-size: 1.125rem;
    line-height: 1.3;
}

p {
    margin: 0 0 1rem;
}

.lead {
    font-size: 1.125rem;
}

/* links and buttons */
a {
    color: var(--link);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
}

a:visited {
    color: var(--visited);
    text-decoration-color: var(--visited-line);
}

.button,
.button:visited {
    display: inline-block;
    padding: 0.5rem 1.1rem;
    border: 1px solid var(--link);
    border-radius: 0.375rem;
    background-color: var(--link);
    color: var(--bg);
    font-weight: 600;
    text-decoration: none;
}

button.copy {
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--link);
    border-radius: 0.375rem;
    background-color: transparent;
    color: var(--link);
    font: inherit;
    font-size: 0.875rem;
    cursor: pointer;
}

a:hover,
.button:hover,
button.copy:hover {
    background-color: var(--hover-bg);
    color: var(--hover-fg);
    text-decoration: none;
}

a:focus-visible,
.button:focus-visible,
button.copy:focus-visible,
summary:focus-visible {
    background-color: var(--focus-bg);
    color: var(--focus-fg);
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
    text-decoration: none;
}

a:active,
.button:active,
button.copy:active {
    background-color: var(--active-bg);
    color: var(--active-fg);
    text-decoration: none;
}

/* download cards */
.card {
    margin: 0 0 1rem;
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: 0.5rem;
}

.card p {
    margin: 0 0 0.75rem;
}

.meta {
    color: var(--muted);
    font-size: 0.9375rem;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.25rem;
    margin: 0 0 0.75rem;
}

.hash {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

.hash .label {
    color: var(--muted);
    font-size: 0.875rem;
}

.hash code {
    flex: 1 1 18rem;
    min-width: 0;
    overflow-wrap: anywhere;
}

/* verification */
details {
    margin: 0 0 0.75rem;
    padding: 0 1rem;
    border: 1px solid var(--line);
    border-radius: 0.5rem;
}

summary {
    padding: 0.75rem 0;
    cursor: pointer;
    font-weight: 600;
}

details[open] summary {
    margin-bottom: 0.25rem;
}

.snippet {
    margin: 0 0 1rem;
}

pre {
    margin: 0 0 0.5rem;
    padding: 0.75rem 1rem;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

pre:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

code,
pre {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

code {
    font-size: 0.9em;
}

pre code {
    font-size: inherit;
}

/* footer */
footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.9375rem;
}

footer p {
    margin: 0 0 0.5rem;
}

@media (max-width: 30rem) {
    h1 {
        font-size: 1.625rem;
    }

    .card {
        padding: 1rem;
    }
}
