:root {
    color-scheme: light dark;
}

body {
    font-family: sans-serif;
    line-height: 1.5;
    max-width: 46rem;
    margin: 0 auto;
    padding: 1rem;
    color: #000000;
    background-color: #ffffff;
    -webkit-font-smoothing: antialiased;
}

header {
    display: flex;
    flex-wrap: wrap;
}

h1 {
    font-size: 2.5rem;
    line-height: 1.25;
    margin-block: 0;
}

header h1 {
    flex: auto;
    white-space: nowrap;
}

h2 {
    font-size: 1.75rem;
    line-height: 1.25;
    margin-block: 3rem 0;
}

h3 {
    font-size: 1.25rem;
    line-height: 1.25;
    margin-block: 2rem 0.5rem;
}

a, summary {
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    color: #9a0606;
    background-color: #faf4f4;
}

a {
    display: inline-block;
    text-decoration: none;
}

summary {
    width: fit-content;
    cursor: pointer;
}

details[open] summary {
    margin-block-end: 0.5rem;
}

a:hover, a:focus-visible, summary:hover, summary:focus-visible {
    background-color: #f5e8e8;
}

a:focus-visible, summary:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.contact {
    flex: none;
    display: grid;
    grid-template-columns: auto auto;
    gap: 0.25rem;
    align-content: start;
}

.contact a {
    display: grid;
    grid-column: span 2;
    grid-template-columns: subgrid;
    column-gap: 1rem;
}

.contact span:last-child {
    text-align: right;
}

.contents ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.contents > ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 0.75rem;
    margin-block: 2rem 0;
    padding: 0.75rem;
    border-radius: 4px;
    background-color: #faf4f4;
}

.contents p {
    margin-block: 0 0.25rem;
    font-size: 0.75rem;
    color: #555555;
}

.contents a {
    margin-inline: -0.5rem;
    background-color: transparent;
}

.contents a:hover, .contents a:focus-visible {
    background-color: #f5e8e8;
}

h3 a, h3 a:hover, h3 a:focus-visible {
    display: inline;
    padding: 0;
    color: inherit;
    background-color: transparent;
}

pre {
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 0.875rem;
    line-height: 1.4;
    padding: 0.75rem;
    border-radius: 4px;
    color: #000000;
    background-color: #f6f6f6;
}

:not(pre) > code {
    font-family: monospace, monospace;
    font-size: 0.875em;
}

.prompt {
    color: #af5f00;
    user-select: none;
}

figure {
    margin-inline: 0;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.pixelated {
    image-rendering: pixelated;
}

footer {
    margin-block-start: 3rem;
    font-size: 0.875rem;
    color: #555555;
}

@media screen and (prefers-color-scheme: dark) {
    body {
        color: #dddddd;
        background-color: #1b1b1b;
    }

    a, summary {
        color: #ffa8a8;
        background-color: #2e2020;
    }

    a:hover, a:focus-visible, summary:hover, summary:focus-visible {
        background-color: #3d2828;
    }

    .contents > ul {
        background-color: #2e2020;
    }

    .contents p {
        color: #aaaaaa;
    }

    .contents a:hover, .contents a:focus-visible {
        background-color: #3d2828;
    }

    pre {
        color: #dddddd;
        background-color: #262626;
    }

    .prompt {
        color: #ffff60;
    }

    footer {
        color: #aaaaaa;
    }
}

@media print {
    body {
        max-width: none;
    }

    a, summary {
        padding: 0;
        color: inherit;
        background-color: transparent;
    }

    main a[href^="http"]::after {
        content: " (" attr(href) ")";
    }

    .contents {
        display: none;
    }

    details::details-content {
        content-visibility: visible;
    }
}
