@font-face {
    font-family: "Open Runde fallback";
    src: local("SF Pro"), local("-apple-system"), local("Segoe UI");
    font-weight: 500;
}

:root {
    color-scheme: dark;
    --background: #000000;
    --accent: #e9e9e9;
    --body: #a2a2a2;
    --sub: #6e6e6e;
    --highlight: #222222;
    --ring: #e9e9e9;

    color: var(--body);
    font-family: "Onest", "Open Runde fallback", SF Pro, -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: -0.3px;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@media print {
    :root {
        --background: #ffffff;
        --accent: #000000;
        --body: #000000;
        --sub: #4f4f4f;
        --highlight: #e0e0e0;
    }
}

* {
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

*::-webkit-scrollbar {
    display: none;
}

::selection {
    background-color: var(--highlight);
}

html {
    background-color: #000000;
    transition: background-color 0.3s ease;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

html,
body {
    margin: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    --pad: 20px;
    --pad-y: max(var(--pad), env(safe-area-inset-top), env(safe-area-inset-bottom));
    --pad-x: max(var(--pad), env(safe-area-inset-left), env(safe-area-inset-right));
    padding: var(--pad-y) var(--pad-x);
}

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

h2 {
    color: var(--accent);
    font-size: 20px;
    font-weight: 600;
    margin: 12px 0;
    letter-spacing: -0.5px;
    text-wrap: balance;
}

p {
    font-size: 16px;
    margin: 0 0 14px;
}

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

p.sub {
    color: var(--sub);
    font-size: 14px;
    margin-top: 18px;
}

a {
    color: inherit;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
    transition: text-underline-offset 0.15s ease, color 0.15s ease;
}

@media (hover: hover) {
    a:hover {
        text-underline-offset: 3px;
        color: var(--accent);
    }
}

main {
    max-width: 500px;
    width: 100%;
    margin: auto;
    overflow-wrap: break-word;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

main.loaded {
    opacity: 1;
    visibility: visible;
}

/* staggered entrance */
main.loaded .heading,
main.loaded .copy > * {
    animation: rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

main.loaded .heading { animation-delay: 0.02s; }
main.loaded .copy > *:nth-child(1) { animation-delay: 0.08s; }
main.loaded .copy > *:nth-child(2) { animation-delay: 0.14s; }
main.loaded .copy > *:nth-child(3) { animation-delay: 0.2s; }
main.loaded .copy > *:nth-child(4) { animation-delay: 0.26s; }

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.heading h2 {
    margin: 0;
}

@media (prefers-reduced-motion: reduce) {
    main.loaded .heading,
    main.loaded .copy > * {
        animation: none;
    }
}

.print {
    display: none;
    margin-top: 32px;
}

#space {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

@media screen and (max-width: 532px) {
    :root {
        line-height: 1.45;
        letter-spacing: -0.2px;
    }
    h2 {
        font-size: 19px;
    }
}

@media print {
    html {
        background: #ffffff;
    }
    body {
        min-height: 0;
        padding: 0;
        display: block;
    }
    #space {
        display: none;
    }
    .print {
        display: block;
    }
    main {
        margin: 0;
        max-width: none;
        opacity: 1 !important;
        visibility: visible !important;
    }
}
