@font-face {
    font-family: "Cooper Hewitt";
    font-style: normal;
    font-weight: normal;
    font-display: swap;
    src: url("/CooperHewitt-Book.3039577802.woff2") format("woff2");
}
@font-face {
    font-family: "Cooper Hewitt";
    font-style: italic;
    font-weight: normal;
    font-display: swap;
    src: url("/CooperHewitt-BookItalic.2585276678.woff2") format("woff2");
}
@font-face {
    font-family: "Cooper Hewitt";
    font-style: normal;
    font-weight: bold;
    font-display: swap;
    src: url("/CooperHewitt-Bold.465664220.woff2") format("woff2");
}
@font-face {
    font-family: "Cooper Hewitt";
    font-style: italic;
    font-weight: bold;
    font-display: swap;
    src: url("/CooperHewitt-BoldItalic.2635387927.woff2") format("woff2");
}

@view-transition {
    navigation: auto;
}

:root {
    color-scheme: light dark;
    --bg: light-dark(#fafafa, #171717);
    --fg: light-dark(#171717, #e5e5e5);
    --muted: light-dark(#525252, #a3a3a3);
    --link: light-dark(#0066cc, #2997ff);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-family:
        "Cooper Hewitt",
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        "Helvetica Neue",
        Arial,
        "Noto Sans",
        sans-serif;
    font-size: 16px;
    line-height: 1.4;
    background: var(--bg);
    color: var(--fg);
}

body {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

main {
    width: 100%;
}

figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    a,
    picture {
        display: contents;
    }

    img {
        display: block;
        width: 100%;
        height: auto;
        max-height: calc(100dvh - 3rem);
        object-fit: contain;
        object-position: top;
    }
}

figcaption {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: center;
    gap: 0.25rem 0.75rem;
    color: var(--muted);
    font-size: 0.875rem;
    position: relative;
    text-align: center;
    line-height: 1.4;

    b {
        color: var(--fg);
    }

    p {
        flex-basis: 100%;
        margin: 0;
    }

    details {
        flex-basis: 100%;

        summary {
            list-style: none;
            cursor: pointer;

            &::marker,
            &::-webkit-details-marker {
                display: none;
            }

            &:hover {
                color: var(--fg);
            }
        }

        &[open] > p {
            position: absolute;
            top: 100%;
            left: 0;
            z-index: 10;
            background: var(--bg);
            border: 1px solid var(--muted);
            border-radius: 0.25rem;
            padding: 0.5rem 0.75rem;
            margin-top: 0.25rem;
            white-space: nowrap;
        }
    }
}

main.about {
    text-align: left;
    max-width: 40rem;
    padding: 2rem 0.5rem;
    margin: 0 auto;
    font-size: 1.125rem;
    line-height: 1.4;

    h1 {
        font-size: 1.5rem;
        margin-bottom: 2rem;

        a {
            color: inherit;
            text-decoration: none;
        }
    }

    h2 {
        font-size: 1rem;
        font-weight: 600;
        margin-top: 1.5rem;
        margin-bottom: 0.5rem;
    }

    p {
        margin-bottom: 1rem;
    }

    img {
        float: right;
        margin: 0 0 1rem 1.5rem;
        max-width: 40%;
        height: auto;
    }
}

nav {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-size: 1rem;
    line-height: 1.5;
    margin: 16px;

    a {
        color: var(--link);
        text-decoration: none;

        &:hover {
            text-decoration: underline;
        }

        &.disabled {
            color: var(--muted);
            pointer-events: none;
        }
    }
}

details {
    margin-top: 0.25rem;
}

summary {
    color: var(--muted);
    cursor: pointer;
    list-style: none; /* Hides default browser arrow */
    font-size: 0.875rem;

    &::-webkit-details-marker {
        display: none;
    }

    &:hover {
        text-decoration: underline;
    }
}

.exif-details {
    display: grid;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition:
        max-height 0.3s ease-out,
        opacity 0.3s ease-out,
        margin-top 0.3s ease-out;
    color: var(--muted);
    font-size: 0.8rem;
    background: color-mix(in srgb, var(--bg) 92%, white 8%);
    border: 1px solid color-mix(in srgb, var(--muted) 35%, transparent);
    border-radius: 0.4rem;
    box-shadow:
        0 2px 2px 0 rgb(0 0 0 / 0.14),
        0 3px 1px -2px rgb(0 0 0 / 0.2),
        0 1px 5px 0 rgb(0 0 0 / 0.12);
    padding: 0 0.75rem;
}

.exif-table {
    margin: 0 auto;
    border-collapse: collapse;

    th,
    td {
        padding: 0.125rem 0.5rem;
    }

    th {
        text-align: right;
        font-weight: 600;
        white-space: nowrap;
    }

    td {
        text-align: left;
    }
}

details[open] .exif-details {
    max-height: 100px;
    opacity: 1;
    margin-top: 0.5rem;
    padding: 0.6rem 0.75rem;
}

footer {
    margin-top: auto;
    padding-top: 1.5rem;
    color: var(--muted);
    text-align: center;
    font-size: 1rem;
    line-height: 1.4;

    p {
        margin: 0;
    }
    .links {
        margin-left: 1em;
    }

    .divider {
        margin: 0 0.7em;
        opacity: 0.35;
    }

    a {
        color: var(--muted);
        text-decoration: none;

        &:hover {
            text-decoration: underline;
        }
    }
}

@media (max-width: 600px) {
    footer .copyright,
    footer .links {
        display: block;
    }
}
