:root {
    color-scheme: light;
    --accent: #c74634;
    --accent-hover: #ae3829;
    --accent-active: #923022;
    --accent-pale: #fff0ee;
    --accent-text: #8c3327;
    --focus: var(--accent);
    --error-text: #892f22;
    --success-surface: #ecfdf3;
    --success-text: #166534;
    --ink: #151b2a;
    --muted: #5b6472;
    --line: #838fa0;
    --divider: #e2e6eb;
    --content-width: 46rem;
    --surface: #fff;
    --surface-subtle: #f8fafc;
    --surface-hover: #f1f4f7;
    --skeleton: #e8edf2;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--surface);
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --accent-pale: #3a2327;
    --accent-text: #ffb4a7;
    --focus: #ff9e8a;
    --error-text: #ffb4a7;
    --success-surface: #18352b;
    --success-text: #9ae7b9;
    --ink: #f1f4f9;
    --muted: #aeb9ca;
    --line: #69788d;
    --divider: #343e50;
    --surface: #10151e;
    --surface-subtle: #191f2b;
    --surface-hover: #252e3e;
    --skeleton: #2c3749;
}

* {
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
}

main {
    flex: 1;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

:where(a, button, summary):focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

h1,
h2,
p {
    margin: 0;
}

h1 {
    font-size: clamp(2rem, 5vw, 2.625rem);
    font-weight: 780;
    letter-spacing: -.04em;
    line-height: 1.12;
    text-wrap: balance;
}

.site-header {
    border-bottom: 1px solid var(--divider);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: min(100% - 2rem, 70rem);
    min-height: 3.5rem;
    margin-inline: auto;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    color: var(--ink);
    font-size: 1.3125rem;
    font-weight: 750;
    letter-spacing: -.04em;
    text-decoration: none;
}

.brand-mark {
    width: 1.75rem;
    height: 1.75rem;
    flex: none;
}

.header-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: .625rem;
    font-size: .9375rem;
    font-weight: 600;
}

.header-link,
.language-switcher summary {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding-inline: .5rem;
    border-radius: .5rem;
    color: var(--ink);
    line-height: 1.25;
    text-decoration: none;
}

.header-link:hover,
.language-switcher summary:hover,
.language-switcher[open] summary {
    background: var(--surface-hover);
}

.header-link[aria-current="page"] {
    color: var(--accent-text);
    text-decoration: underline;
    text-underline-offset: .2em;
}

.theme-toggle {
    position: relative;
    display: grid;
    place-items: center;
    flex: none;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ink);
}

.theme-toggle::before {
    position: absolute;
    inset: .25rem;
    border-radius: inherit;
    background: var(--surface-subtle);
    content: "";
}

.theme-toggle:hover::before {
    background: var(--surface-hover);
}

.theme-toggle:active::before {
    background: var(--accent-pale);
}

.theme-toggle svg {
    position: relative;
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

:root[data-theme="dark"] .theme-toggle {
    color: var(--accent-text);
}

.theme-sun,
:root[data-theme="dark"] .theme-moon {
    display: none;
}

:root[data-theme="dark"] .theme-sun {
    display: block;
}

.site-footer {
    border-block-start: 1px solid var(--divider);
    background: var(--surface-subtle);
    color: var(--muted);
    font-size: .875rem;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    column-gap: 1rem;
    padding-block: .375rem;
}

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

.footer-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    color: inherit;
    text-decoration: none;
    text-underline-offset: .2em;
}

.footer-nav a:hover {
    text-decoration: underline;
}

.footer-nav a[aria-current="page"] {
    color: var(--accent-text);
    text-decoration: underline;
}

.footer-disclaimer {
    flex-basis: 100%;
    margin-block-end: .5rem;
    line-height: 1.5;
}

.footer-inner,
.not-found,
.information-page {
    width: min(100% - 2rem, var(--content-width));
    margin-inline: auto;
}

.language-switcher {
    position: relative;
}

.language-switcher summary {
    gap: .4375rem;
    list-style: none;
    cursor: pointer;
}

.language-switcher summary::-webkit-details-marker {
    display: none;
}

.language-switcher summary::after {
    width: .375rem;
    height: .375rem;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-.1rem) rotate(45deg);
    content: "";
}

.language-switcher[open] summary::after {
    transform: translateY(.1rem) rotate(225deg);
}

.language-switcher ul {
    position: absolute;
    z-index: 1;
    inset-block-start: calc(100% + .5rem);
    inset-inline-end: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .25rem;
    inline-size: min(20rem, calc(100vw - 2.5rem));
    max-block-size: min(26rem, 65vh);
    max-block-size: min(26rem, 65dvh);
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
    margin: 0;
    padding: .5rem;
    border: 1px solid var(--divider);
    border-radius: .875rem;
    background: var(--surface);
    box-shadow: 0 .75rem 2rem rgb(0 0 0 / 15%);
    font-size: .875rem;
    list-style: none;
}

.language-switcher a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .375rem;
    min-height: 2.5rem;
    padding: .375rem .625rem;
    border-radius: .5rem;
    color: var(--ink);
    overflow-wrap: anywhere;
    text-decoration: none;
}

.language-switcher a:hover {
    background: var(--surface-hover);
}

.language-switcher a:focus-visible {
    outline-offset: -2px;
}

.language-switcher a[aria-current] {
    background: var(--accent-pale);
    color: var(--accent-text);
}

.language-switcher a[aria-current]::after {
    flex: none;
    width: .35rem;
    height: .625rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-.1rem) rotate(45deg);
    content: "";
}

@media (max-width: 37rem) {
    .header-inner {
        flex-wrap: wrap;
        gap: .375rem 0;
        padding-block: .25rem .5rem;
    }

    .brand {
        min-height: 2.75rem;
    }

    .header-nav {
        position: relative;
        flex-basis: 100%;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: clamp(.25rem, 1.25vw, .5rem);
        font-size: clamp(.8125rem, 3.5vw, .9375rem);
    }

    .header-link,
    .language-switcher {
        flex: 1 1 auto;
        min-inline-size: 0;
    }

    .header-link,
    .language-switcher summary {
        justify-content: center;
        padding: .25rem clamp(0px, calc(5vw - 1rem), .5rem);
        background: var(--surface-subtle);
        text-align: center;
    }

    .header-link:hover,
    .language-switcher summary:hover,
    .language-switcher[open] summary {
        background: var(--surface-hover);
    }

    .header-link[aria-current="page"] {
        background: var(--accent-pale);
    }

    .header-link:focus-visible,
    .language-switcher summary:focus-visible {
        outline-offset: -2px;
    }

    .language-switcher {
        position: static;
    }

    .language-switcher summary {
        display: flex;
        height: 100%;
        gap: .3125rem;
    }

    .language-switcher summary::after {
        flex: none;
    }

    .theme-toggle {
        align-self: center;
    }
}

@media (max-width: 23.5rem) {
    .header-inner {
        width: calc(100% - 1.25rem);
    }
}

@media (max-width: 22rem) {
    .header-inner {
        width: calc(100% - 1rem);
    }

    .header-nav {
        gap: .1875rem;
    }
}

.not-found {
    padding-block: clamp(2.375rem, 5.5vw, 3.5rem);
    text-align: center;
}

.not-found p {
    margin-block: .75rem;
    color: var(--muted);
}

.not-found a {
    color: var(--accent-text);
}

.information-page {
    padding-block: clamp(2rem, 6vw, 3.5rem);
    color: var(--muted);
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.information-page h1,
.information-page h2 {
    color: var(--ink);
}

.information-page h1 {
    text-wrap: balance;
}

.information-page h2 {
    margin-block-end: .5rem;
    font-size: 1.125rem;
    line-height: 1.35;
}

.information-page > * + * {
    margin-block-start: 1.25rem;
}

.information-page ol,
.information-page ul {
    padding-inline-start: 1.5rem;
}

.information-page li + li {
    margin-block-start: .5rem;
}

.information-page a {
    color: var(--accent-text);
    text-underline-offset: .2em;
}
