/* Pixel Art Lab: a long scrolling report inside the shell. */

#lab {
    position: fixed;
    inset: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: max(72px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 140px max(16px, env(safe-area-inset-left));
    box-sizing: border-box;
    background: radial-gradient(ellipse at 50% -10%, #34343b, var(--bg) 55%) fixed;
    font: 400 13px/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    -webkit-user-select: text;
    user-select: text;
}

#lab > * { max-width: 1400px; margin-left: auto; margin-right: auto; }

#top h1, #lab h2, #lab h3, #detail h2 {
    font-family: "Chakra Petch", sans-serif;
    font-weight: 700;
    letter-spacing: 0.01em;
    margin: 0;
}

#top h1 { font-size: clamp(40px, 8vw, 88px); line-height: 0.95; }
#totals { color: var(--punch); margin: 10px 0 0; font-weight: 600; }

.px { image-rendering: pixelated; image-rendering: crisp-edges; }

/* The bench */
#bench { margin-top: 32px; }
#bench .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#bench .pane {
    margin: 0;
    height: min(52vh, 520px);
    display: grid;
    place-items: center;
    background: #3a3a41;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    overflow: hidden;
}
#bench.over .pane { outline: 3px solid var(--punch); outline-offset: -3px; }
#bench .controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin-top: 12px; }
#bench select, #bench input { accent-color: var(--punch); }
#bench select {
    font: inherit;
    color: #fff;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #55555e;
    padding: 6px 8px;
}
#bench label { display: flex; align-items: center; gap: 8px; color: #aaa; }
#bench label input { width: 120px; }
#bench output { color: #fff; min-width: 3.5em; }
#bench-facts { margin: 0 0 0 auto; color: var(--punch); }

/* Rich's own */
#rich { margin-top: 72px; }
#rich .games { display: flex; flex-wrap: wrap; gap: 28px 40px; margin-top: 18px; }
#rich .pics { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; margin-top: 10px; }
#rich .pics img { max-width: 100%; height: auto; }

#lab h2 { font-size: clamp(26px, 4vw, 40px); }
#lab h3 { font-size: 17px; }
#lab h3 span { color: #8a8a92; font: 400 12px ui-monospace, Menlo, monospace; margin-left: 10px; }
.intro { color: #bbb; max-width: 80ch; margin: 6px 0 0; }

.recipe {
    margin-top: 56px;
    padding: 20px 24px;
    border-left: 3px solid var(--punch);
    background: rgba(0, 0, 0, 0.18);
}
.recipe h2 { font-size: 22px !important; margin-bottom: 10px !important; }
.recipe ol { margin: 0; padding-left: 1.3em; max-width: 90ch; }
.recipe li { margin: 6px 0; padding-left: 0.3em; }
.recipe li::marker { color: var(--punch); font-weight: 700; }
.recipe b { color: #fff; }

/* Experiments */
.experiment { margin-top: 84px; }
.findings { max-width: 90ch; margin: 14px 0 0; padding-left: 1.2em; }
.findings li { margin: 5px 0; }
.findings li::marker { color: var(--punch); }

.groups { display: flex; flex-wrap: wrap; gap: 34px 40px; margin-top: 30px; }
.group.scene { flex-basis: 100%; }
.group .row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; }

.card { margin: 0; cursor: pointer; }
.card .pic {
    display: grid;
    place-items: center;
    background: #3a3a41;
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.card.sprite .pic { width: 260px; height: 260px; }
.card.sheet .pic { width: 420px; height: 280px; }
.card.scene .pic { width: 640px; height: 480px; max-width: calc(100vw - 32px); }
.card img { display: block; max-width: 100%; max-height: 100%; height: auto; }
.card .pic.none { color: #8a8a92; }
.card:hover .pic { outline: 2px solid var(--punch); outline-offset: -2px; }
.card figcaption { margin-top: 6px; color: #ddd; }
.card figcaption span { color: #8a8a92; margin-left: 10px; }

/* One picture in detail */
#detail {
    position: fixed;
    inset: 0;
    z-index: 3;
    display: grid;
    place-items: center;
    background: rgba(10, 10, 14, 0.6);
    padding: 16px;
}
#detail[hidden] { display: none; }
#detail .window { width: min(1320px, 100%); max-height: calc(100dvh - 120px); }
#detail .inner { font: 400 13px/1.5 ui-monospace, Menlo, Consolas, monospace; }
#detail header { display: flex; align-items: baseline; gap: 14px; }
#detail h2 { font-size: 30px; }
#detail .model { color: var(--punch); }
#detail .stages { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 16px; }
#detail .stages figure { margin: 0; }
#detail .stages figure > :first-child {
    display: block;
    background: #3a3a41;
}
#detail .stages img { max-width: 300px; }
#detail figcaption { color: #aaa; margin-top: 4px; }
#detail .palettes { margin-top: 16px; display: grid; gap: 6px; }
.swatches { display: flex; flex-wrap: wrap; gap: 2px; }
.swatches i { width: 18px; height: 18px; display: block; }
#detail .facts { display: grid; grid-template-columns: max-content 1fr; gap: 2px 16px; margin: 16px 0 0; }
#detail dt { color: #8a8a92; }
#detail dd { margin: 0; }
#detail .prompt { color: #bbb; max-width: 100ch; margin: 14px 0; }
#detail button.text {
    font: 700 15px "Chakra Petch", sans-serif;
    color: #000;
    background: var(--punch);
    border: 0;
    padding: 8px 18px;
    cursor: pointer;
    clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}

@media (max-width: 720px) {
    #bench .pair { grid-template-columns: 1fr; }
    #bench .pane { height: 40vh; }
    .card.sprite .pic { width: calc(50vw - 24px); height: calc(50vw - 24px); }
    .card.sheet .pic { width: calc(100vw - 32px); height: 60vw; }
    .card.scene .pic { height: auto; aspect-ratio: 4 / 3; }
}
