/* Style of the site of the project. The colors follow the color scheme of the system (light or dark). */

:root {
    color-scheme: light dark;
    --bg: #f4eee2;
    --bg-hero: #e8dcc5;
    --surface: #fffaf0;
    --surface-alt: #efe5d3;
    --text: #2a241d;
    --muted: #675c4e;
    --border: #d9cab1;
    --accent: #2f6b3f;
    --accent-hover: #24552f;
    --accent-text: #ffffff;
    --link: #275e37;
    --pre: #8a5a12;
    --pre-text: #ffffff;
    --mark-pole: #7a5a3a;
    --mark-flag: #2f6b3f;
    --radius: 10px;
    --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-title: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
    --font-mono: ui-monospace, "Cascadia Code", SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #191713;
        --bg-hero: #221f19;
        --surface: #221f1a;
        --surface-alt: #2c2822;
        --text: #ece5d8;
        --muted: #a99e8c;
        --border: #3b352c;
        --accent: #86bd8c;
        --accent-hover: #9fcfa4;
        --accent-text: #10200f;
        --link: #9fd0a5;
        --pre: #e0ac5f;
        --pre-text: #1d1407;
        --mark-pole: #b08d67;
        --mark-flag: #86bd8c;
    }
}

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

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 1rem/1.6 var(--font-body);
}

a {
    color: var(--link);
    text-underline-offset: 0.15em;
}

a:hover {
    text-decoration-thickness: 2px;
}

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

code,
tt {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--surface-alt);
    padding: 0.1em 0.35em;
    border-radius: 4px;
}

.wrap {
    max-width: 60rem;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 40rem) {
    .wrap {
        padding: 0 1.5rem;
    }
}

.skip {
    position: absolute;
    top: -4rem;
    left: 1rem;
    z-index: 1;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    background: var(--accent);
    color: var(--accent-text);
}

.skip:focus {
    top: 1rem;
}

/* Header */

.hero {
    padding: 1rem 0 2.5rem;
    background: var(--bg-hero);
    border-bottom: 1px solid var(--border);
}

.topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem 1rem;
    font-size: 0.95rem;
}

.languages {
    display: flex;
    gap: 0.25rem;
}

.languages a {
    padding: 0.2rem 0.65rem;
    border: 1px solid transparent;
    border-radius: 999px;
    text-decoration: none;
}

.languages a:hover {
    border-color: var(--border);
}

.languages a[aria-current] {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
    font-weight: 600;
}

h1 {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 1.5rem 0 0.5rem;
    font-family: var(--font-title);
    font-size: clamp(2.4rem, 8vw, 3.6rem);
    line-height: 1.1;
}

.mark {
    flex: none;
    width: 0.85em;
    height: 0.85em;
}

.mark-pole {
    fill: var(--mark-pole);
}

.mark-flag {
    fill: var(--mark-flag);
}

.tagline {
    margin: 0 0 0.75rem;
    font-family: var(--font-title);
    font-size: clamp(1.2rem, 3.5vw, 1.5rem);
    line-height: 1.35;
}

.intro {
    max-width: 42rem;
    margin: 0 0 1.5rem;
    color: var(--muted);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0;
}

.button {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.6rem;
    padding: 0.6rem 1.1rem;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    background: var(--accent);
    color: var(--accent-text);
    font-weight: 600;
    text-decoration: none;
}

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

.button-secondary {
    border-color: var(--border);
    background: transparent;
    color: var(--text);
}

.button-secondary:hover {
    border-color: var(--muted);
    background: var(--surface);
}

/* Sections */

main {
    padding-bottom: 3rem;
}

section {
    margin-top: 2.5rem;
}

h2 {
    margin: 0 0 1rem;
    font-family: var(--font-title);
    font-size: 1.8rem;
    line-height: 1.2;
}

h3 {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
    line-height: 1.3;
}

/* Downloads */

.latest {
    margin: 0;
    font-size: 1.05rem;
}

.requirements {
    margin: 0.25rem 0 1.25rem;
    color: var(--muted);
}

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

.card {
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

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

.card p:last-child {
    margin-bottom: 0;
}

.card ol {
    margin: 0;
    padding-left: 1.4rem;
}

.card li + li {
    margin-top: 0.35rem;
}

.file-list {
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
}

.file-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
}

.file-list li:last-child {
    border-bottom: 0;
}

.file-list a {
    font-family: var(--font-mono);
    font-size: 0.92rem;
    overflow-wrap: anywhere;
}

.size {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.button .size {
    color: inherit;
    font-weight: 400;
    opacity: 0.85;
}

.button .file-name {
    overflow-wrap: anywhere;
}

.more {
    margin: 1rem 0 0;
    color: var(--muted);
}

/* Release notes */

.note {
    margin: 0 0 1rem;
    color: var(--muted);
    font-style: italic;
}

.release {
    margin-bottom: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.release > details > summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.75rem;
    padding: 0.9rem 1.25rem;
    cursor: pointer;
    list-style: none;
}

.release > details > summary::-webkit-details-marker {
    display: none;
}

.release > details > summary::before {
    content: "";
    align-self: center;
    width: 0.5em;
    height: 0.5em;
    margin-right: 0.2rem;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: rotate(-45deg);
    transition: transform 0.15s ease;
}

.release > details[open] > summary::before {
    transform: rotate(45deg);
}

.release h3 {
    margin: 0;
}

.release time {
    color: var(--muted);
    font-size: 0.95rem;
}

.badge {
    align-self: center;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.badge-latest {
    background: var(--accent);
    color: var(--accent-text);
}

.badge-pre {
    background: var(--pre);
    color: var(--pre-text);
}

.notes {
    padding: 0.25rem 1.25rem 0;
    border-top: 1px solid var(--border);
    overflow-wrap: anywhere;
}

.notes h4,
.notes h5,
.notes h6 {
    margin: 1rem 0 0.5rem;
    font-size: 1rem;
}

.notes details {
    margin: 1rem 0;
}

.notes summary {
    color: var(--muted);
    cursor: pointer;
}

.notes .table {
    margin: 1rem 0;
    overflow-x: auto;
}

.notes table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    overflow-wrap: normal;
}

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

.notes th {
    background: var(--surface-alt);
}

.notes td:first-child,
.notes td:last-child {
    white-space: nowrap;
}

.release-link {
    margin: 0;
    padding: 0.5rem 1.25rem 1rem;
}

/* Footer */

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

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin: 0 0 0.5rem;
    padding: 0;
    list-style: none;
}

.site-footer p {
    margin: 0;
}

@media (prefers-reduced-motion: reduce) {
    .release > details > summary::before {
        transition: none;
    }
}
