/* The look is deliberately the browser default. This file only keeps things from breaking. */

img,
video,
iframe {
    max-width: 100%;
}

img {
    height: auto;
}

iframe {
    border: 0;
}

/* Homepage work list: hovering a title shows a picture of the work */
.hover_img a span {
    position: fixed;
    display: none;
    z-index: 99;
    top: 50%;
    right: 10%;
    transform: translateY(-50%);
    pointer-events: none;
}

.hover_img a:hover span,
.hover_img a:focus-visible span {
    display: block;
}

.hover_img a span img {
    width: auto;
    max-width: 45vw;
    max-height: 70vh;
}

@media (max-width: 600px) {
    .hover_img a span {
        right: 5%;
    }

    .hover_img a span img {
        max-width: 90vw;
    }
}

/* Image boxes on the work pages */
div.gallery {
    margin: 5px;
    border: 1px solid #ccc;
    float: left;
    width: 360px;
    max-width: calc(100% - 12px);
}

div.gallery:hover {
    border-color: #777;
}

div.gallery img {
    display: block;
    width: 100%;
}

div.desc {
    padding: 15px;
    text-align: center;
}

.credit {
    font-size: small;
    color: #555;
}

.clear {
    clear: both;
}

/* Images on the "other stuff" page, one below the other like in the old google doc */
img.work {
    display: block;
    width: auto;
    max-width: min(100%, 700px);
    max-height: 90vh;
    margin: 1em 0;
}

.video {
    width: 100%;
    max-width: 960px;
    aspect-ratio: 16 / 9;
}

.environment {
    width: 100%;
    height: 80vh;
}

/* assets/updater.js: the terminal that shows an update while it happens */
#update-terminal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
    background: black;
    color: #00ff00;
    font: 14px/1.4 'Courier New', monospace;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

#update-terminal .info { color: #00aaff; }
#update-terminal .warning { color: #ffaa00; }
#update-terminal .code-line { color: #888; }

#update-terminal button {
    margin: 1em 0 2em;
    padding: 5px 10px;
    border: 0;
    background: #00ff00;
    color: black;
    font: inherit;
    cursor: pointer;
}

@media (max-width: 768px) {
    #update-terminal {
        padding: 10px;
        font-size: 12px;
    }
}

/* assets/snake.js */
#snake {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    pointer-events: none;
}
