body{
    overflow: hidden;
    background: black;
    height: 150vh;
}

#svg, #animations, #stuff {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: contents;
}

::selection {
    color: rgba(0,0,0,.99);
    background: rgba(255,255,255,.99);
}

::-moz-selection {
    color: rgba(0,0,0,.99);
    background: rgba(255,255,255,.99);
}

/* The menu (scripts/menu.js): the site's pages drifting round an invisible loop inside the frame.
   Swiping anywhere spins them, so the page doesn't scroll or zoom under a finger. */
#menu {
    position: fixed;
    inset: 0;
    z-index: 4;
    touch-action: none;
    cursor: grab;
    -webkit-user-select: none;
    user-select: none;
}

#menu.dragging {
    cursor: grabbing;
}

#menu .word {
    position: absolute;
    left: 0;
    top: 0;
    padding: 0.3em 0.5em;
    border: 0;
    background: none;
    color: white;
    font: bold 26px/1 Arial, Helvetica, sans-serif;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    will-change: transform;
}

/* The pieces (bling, mosaic and the rest), between the three main words: smaller and lighter,
   so the three still lead */
#menu .word {
    opacity: var(--fade, 1);
}

#menu .word.piece {
    font-weight: normal;
    font-size: 17px;
    opacity: calc(0.72 * var(--fade, 1));
}

#menu .word.piece:hover,
#menu .word.piece:focus-visible {
    opacity: var(--fade, 1);
}

#menu .word:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
    border-radius: 6px;
}

/* The email address, in the middle, after "contact" */
#menu .message {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font: 15px/1.6 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    text-align: center;
    white-space: nowrap;
}

/* On a narrow screen the words roll through the middle, so the address goes at the bottom */
#menu.wheel .message {
    top: auto;
    bottom: 22%;
    transform: translate(-50%, 50%);
}

#menu .message a {
    color: white;
}

#menu .message span {
    display: block;
    font-size: 12px;
}

@media (max-width: 519px) {
    #menu .word {
        font-size: 22px;
    }

    #menu .word.piece {
        font-size: 15px;
    }
}
