:root {
    color-scheme: light dark;
    --bg: #ffffff;
    --bg-alt: #f4f6f9;
    --fg: #1d2330;
    --muted: #5a6475;
    --border: #d9dee6;
    --accent: #2f6fd0;
    --accent-fg: #ffffff;
    --code-bg: #eef1f5;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #14171c;
        --bg-alt: #1b1f26;
        --fg: #e4e8ef;
        --muted: #9aa4b4;
        --border: #2e3440;
        --accent: #7fb0ff;
        --accent-fg: #0d1420;
        --code-bg: #232833;
    }
}

* {
    box-sizing: border-box;
}

/* Links to the web app stay hidden until it is on the site
   (tools/place-web-app.py); a class's display must not show them. */
[hidden] {
    display: none !important;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    line-height: 1.6;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", "Noto Sans",
        "Noto Sans CJK JP", sans-serif;
}

a {
    color: var(--accent);
}

code,
pre {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Noto Sans Mono CJK JP", monospace;
    font-size: 0.9em;
    background: var(--code-bg);
    border-radius: 4px;
}

code {
    padding: 0.1em 0.3em;
}

pre {
    padding: 0.8em 1em;
    overflow-x: auto;
    line-height: 1.4;
}

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

img {
    max-width: 100%;
    height: auto;
}

.wrap {
    max-width: 68rem;
    margin: 0 auto;
    padding: 0 16px;
}

/* Header */

.topbar {
    border-bottom: 1px solid var(--border);
}

.topbar .wrap {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 3.5rem;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: var(--fg);
    text-decoration: none;
    margin-right: auto;
}

.topbar nav {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.topbar nav a {
    color: var(--muted);
    text-decoration: none;
}

.topbar nav a:hover {
    color: var(--fg);
}

/* Hero */

.hero {
    text-align: center;
    padding: 3rem 0 2rem;
}

.hero h1 {
    font-size: 2.6rem;
    margin: 0.5rem 0 0.25rem;
}

.hero .tagline {
    font-size: 1.2rem;
    color: var(--muted);
    max-width: 44rem;
    margin: 0 auto 1.5rem;
}

.buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.button {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    color: var(--fg);
    text-decoration: none;
    font-weight: 600;
}

.button.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-fg);
}

.button:hover {
    filter: brightness(1.08);
}

.platforms {
    color: var(--muted);
    font-size: 0.9rem;
    margin-top: 0.75rem;
}

.screenshot {
    margin: 2rem auto 0;
    text-align: center;
}

.screenshot img {
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 6px 24px #0002;
}

/* Sections */

section {
    padding: 2.5rem 0;
}

section.alt {
    background: var(--bg-alt);
}

/* Sections alternate their background; two alike in a row (the web app's
   section, shown only with the app) get a rule between them. */
section:not(.alt) + section:not(.alt),
section.alt + section.alt {
    border-top: 1px solid var(--border);
}

section h2 {
    margin-top: 0;
    font-size: 1.7rem;
}

.lead {
    color: var(--muted);
    max-width: 48rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
    gap: 1rem;
}

.card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.2rem;
}

.card h3 {
    margin: 0 0 0.4rem;
    font-size: 1.1rem;
}

.card p {
    margin: 0;
    color: var(--muted);
}

.card a.more {
    display: inline-block;
    margin-top: 0.5rem;
}

.two {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
    gap: 1.5rem;
    align-items: start;
}

/* Two screenshots per row, one on narrow screens. */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr));
    gap: 1.5rem;
}

figure {
    margin: 0;
}

figure img {
    border: 1px solid var(--border);
    border-radius: 6px;
}

figcaption {
    color: var(--muted);
    font-size: 0.9rem;
    margin-top: 0.3rem;
}

.formats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0;
    list-style: none;
}

.formats li {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.2rem 0.8rem;
    background: var(--bg);
}

.table-scroll {
    overflow-x: auto;
}

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

th,
td {
    border: 1px solid var(--border);
    padding: 0.4rem 0.7rem;
    text-align: left;
    vertical-align: top;
}

th {
    background: var(--bg-alt);
}

.docs-list {
    columns: 2 18rem;
    padding-left: 1.2rem;
}

.docs-list li {
    break-inside: avoid;
    margin-bottom: 0.4rem;
}

/* Download page */

.download-hero {
    padding: 2.5rem 16px 1.5rem;
}

.download-hero h1 {
    font-size: 2.2rem;
    margin: 0 0 0.5rem;
}

.release-info {
    color: var(--muted);
}

.recommended-box {
    border: 2px solid var(--accent);
    border-radius: 10px;
    padding: 1rem 1.2rem;
    margin-top: 1.5rem;
}

.recommended-box h2 {
    margin: 0 0 0.75rem;
    font-size: 1.3rem;
}

.recommended-box .badge {
    display: none;
}

.recommended-box .file {
    border: none;
    padding: 0;
    background: none;
}

.arch-note {
    border-left: 4px solid #d08a2f;
    padding: 0.2rem 0.8rem;
}

.other-files {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 0;
}

h3.group {
    margin: 1.5rem 0 0.5rem;
    font-size: 1.1rem;
}

.files {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
    gap: 1rem;
}

.file {
    display: flex;
    flex-direction: column;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.2rem;
}

.file.recommended {
    border: 2px solid var(--accent);
}

.file .file-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.file h3 {
    margin: 0;
    font-size: 1.1rem;
}

.badge {
    display: none;
    background: var(--accent);
    color: var(--accent-fg);
    border-radius: 999px;
    padding: 0 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.file.recommended .badge {
    display: inline-block;
}

.file .file-meta {
    margin: 0.3rem 0 0;
    color: var(--muted);
    font-size: 0.85rem;
    overflow-wrap: anywhere;
}

.file-size {
    white-space: nowrap;
}

.file p {
    margin: 0.5rem 0;
}

.file .button {
    margin-top: auto;
    align-self: flex-start;
}

/* An asset the release does not have: still listed, but greyed out. */
.file.missing {
    opacity: 0.6;
}

footer {
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.9rem;
    padding: 1.5rem 0;
}

@media (max-width: 600px) {
    .hero h1 {
        font-size: 2rem;
    }
}
