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

html,
body {
    margin: 0;
    padding: 0;
    background: #ffffff;
}

:root {
    color-scheme: only light;

    --bg: #ffffff;
    --fg: #000000;

    --page-margin: 16px;
    --page-content-width: 90rem;

    --footer-font-size: 8px;
    --footer-tracking: 0.02em;
    --footer-gap: 56px;
    --footer-pad-block: 20px;
}

@media (max-width: 400px) {
    :root {
        --footer-gap: 40px;
    }
}

@media screen and (min-width: 750px) {
    :root {
        --page-margin: 40px;
    }
}

body {
    background: var(--bg);
    color: var(--fg);
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-weight: 700;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;

    overscroll-behavior: none;
}

/* Home is a single fixed screen; the document pages still scroll. */
html.is-static,
html.is-static body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

html.is-static body {
    min-height: 0;
}


/* Layout */

/* Present to search engines and screen readers, absent from the design. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.page-width {
    width: 100%;
    max-width: calc(var(--page-content-width) + (var(--page-margin) * 2));
    margin-inline: auto;
    padding-inline: var(--page-margin);
}

.site-main {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* The portrait sits dead centre of the viewport, independent of the footer.
   It links home from every page. */
.portrait-link {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: block;
    line-height: 0;
    width: min(60vw, 31.5vh);
}

.portrait {
    display: block;
    width: 100%;
    border-radius: 50%;
}

.portrait-link:focus,
.doc-portrait-link:focus {
    outline: 2px solid var(--fg);
    outline-offset: 6px;
}

.portrait-link:focus:not(:focus-visible),
.doc-portrait-link:focus:not(:focus-visible) {
    outline: none;
}
/* Documents */

.site-main--doc {
    align-items: flex-start;
    padding-block: 20px 40px;
}

.doc {
    width: 100%;
    max-width: 480px;
    font-size: 12px;
    line-height: 14px;
    letter-spacing: -0.025em;
}

.doc-portrait-link {
    display: block;
    line-height: 0;
    width: min(165px, 41vw);
    margin: 0 auto 22px;
}

.doc-portrait {
    display: block;
    width: 100%;
    border-radius: 50%;
}

.doc h1 {
    margin: 0 0 7px;
    font-size: 14px;
    font-weight: 700;
    line-height: 14px;
    letter-spacing: -0.35px;
    text-align: center;
}

.doc p.doc-updated {
    margin: 0 0 11px;
    font-size: 14px;
    font-weight: 400;
    line-height: 14px;
    letter-spacing: -0.35px;
    text-align: center;
}

/* Sections are separated by a single blank line, as in the design. */
.doc h2 {
    margin: 14px 0 0;
    font-size: 12px;
    font-weight: 700;
    line-height: 14px;
}

.doc h2:first-of-type {
    margin-top: 0;
}

.doc p {
    margin: 0;
    font-size: 12px;
    font-weight: 400;
    line-height: 14px;
}

.doc a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 1px;
}
/* Footer */

.site-footer {
    flex: 0 0 auto;
}

.footer-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-block: var(--footer-pad-block);
    padding-bottom: max(var(--footer-pad-block), env(safe-area-inset-bottom));
}

.footer-nav {
    position: relative;
    width: 100%;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
}

/* Rows stack on the same spot and cross-fade between each other. */
.footer-group {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    transform: translateY(-50%);

    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--footer-gap);

    margin: 0;
    padding: 0;
    list-style: none;

}

.footer-group.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.footer-item {
    flex-shrink: 0;
}

.footer-link {
    display: inline-block;
    margin: 0;
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;

    font-family: inherit;
    font-weight: 700;
    font-size: var(--footer-font-size);
    line-height: 1;
    letter-spacing: var(--footer-tracking);
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    color: var(--fg);

}

.footer-link:hover,
.footer-link:focus {
    color: var(--fg);
    opacity: 0.7;
}

.footer-link:focus {
    outline: 2px solid var(--fg);
    outline-offset: 2px;
}

.footer-link:focus:not(:focus-visible) {
    outline: none;
}

/* Rows carrying a fifth item tighten up sooner than the four-item ones. */

@media (max-width: 500px) {
    .footer-group--tight { --footer-gap: 40px; }
}

@media (max-width: 420px) {
    .footer-group--tight { --footer-gap: 26px; }
}

@media (max-width: 350px) {
    .footer-group--tight { --footer-gap: 14px; }
}
