/* PV 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, #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; }

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

code { color: var(--punch); font: inherit; font-weight: 600; }

}

/* An experiment */
.exp { margin-top: 72px; scroll-margin-top: 24px; }
.exp > h2 { font-size: clamp(26px, 4vw, 38px); }
.exp > .intro { color: #b9b9c2; margin: 4px 0 0; max-width: 80ch; }
.findings { margin: 18px 0 0; padding: 0; list-style: none; max-width: 92ch; }
.findings li { position: relative; padding-left: 20px; margin: 7px 0; }
.findings li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 0.62em;
    width: 7px;
    height: 7px;
    background: var(--punch);
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

.group { margin-top: 30px; }
.group > h3 {
    margin: 0 0 10px;
    font: 600 12px/1 ui-monospace, "SF Mono", Menlo, monospace;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #8d8d97;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 10px;
}
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.card {
    display: flex;
    flex-direction: column;
    text-align: left;
    background: rgba(0, 0, 0, 0.22);
    clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
    transition: background 0.15s;
    min-width: 0;
}
.card:hover { background: rgba(255, 252, 0, 0.12); }
.card:focus-visible { outline: 2px solid var(--punch); outline-offset: -2px; }

.media {
    position: relative;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    overflow: hidden;
}
.grid.wide .media { aspect-ratio: 3 / 2; }
.media img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.media img.px { image-rendering: pixelated; position: absolute; inset: 7%; width: 86%; height: 86%; max-width: none; max-height: none; object-fit: contain; }

.card .label { padding: 7px 9px 9px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.card .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .meta { color: #9a9aa4; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card.input .name { color: var(--punch); }
.card.error .media { color: #ff6a6a; padding: 14px; font-size: 11px; line-height: 1.4; text-align: center; place-items: center; }

/* Before and after, above an experiment's runs. */
.showcase { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-top: 26px; }
.pair { display: contents; }
.card.big .media { aspect-ratio: 3 / 4; }

/* Backgrounds behind transparent results, switched from the bar. */
.see { background-color: #3a3a41; }
body.checker .see {
    background-color: #c9c9cf;
    background-image: conic-gradient(#e9e9ee 25%, #c9c9cf 0 50%, #e9e9ee 0 75%, #c9c9cf 0);
    background-size: 16px 16px;
}
body.light .see { background-color: #eceae4; }

/* The detail window */
#detail {
    position: fixed;
    inset: 0;
    z-index: 3;
    display: grid;
    place-items: center;
    padding: 12px;
    background: rgba(10, 10, 14, 0.55);
}
#detail[hidden] { display: none; }
#detail .window {
    width: min(1180px, 100%);
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    display: flex;
}
#detail .inner {
    padding: 26px 28px 24px;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 26px;
    font: 400 13px/1.5 ui-monospace, "SF Mono", Menlo, monospace;
    -webkit-user-select: text;
    user-select: text;
    width: 100%;
    box-sizing: border-box;
}
@media (max-width: 820px) {
    #detail .inner { grid-template-columns: 1fr; padding: 20px 18px; }
}

#detail .big { display: grid; place-items: center; min-height: 280px; max-height: 64vh; }
#detail .big img { max-width: 100%; max-height: 64vh; object-fit: contain; }
#detail .big img.px { image-rendering: pixelated; }
#detail .views { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
#detail .views button {
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.06);
    clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px);
}
#detail .views button.on { background: var(--punch); color: #000; }
#detail .strip { margin-top: 12px; overflow-x: auto; }
#detail .strip img { height: 96px; display: block; }

#detail h2 { font-size: 26px; line-height: 1.1; margin-right: 30px; word-break: break-word; }
#detail .facts { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; margin: 14px 0; }
#detail .facts dt { color: #8d8d97; }
#detail .facts dd { margin: 0; }
#detail .prompt {
    white-space: pre-wrap;
    background: rgba(0, 0, 0, 0.3);
    padding: 12px 14px;
    margin: 6px 0 0;
    max-height: 30vh;
    overflow: auto;
}
#detail .head { display: flex; justify-content: space-between; align-items: baseline; margin-top: 16px; color: #8d8d97; }
#detail .head button { color: var(--punch); }
#detail pre.req { margin: 6px 0 0; padding: 10px 14px; background: rgba(0, 0, 0, 0.3); font-size: 11px; overflow: auto; max-height: 26vh; }
#detail .ins { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
#detail .ins img { height: 96px; max-width: 200px; object-fit: contain; }
#detail .err { color: #ff8080; margin-top: 12px; }
#detail .close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: #aaa;
}
#detail .close:hover { color: var(--punch); }
#detail .close svg { width: 16px; height: 16px; fill: currentColor; }
#detail .nav { position: absolute; bottom: 12px; right: 18px; display: flex; gap: 14px; color: #8d8d97; }
#detail .nav button { color: inherit; }
#detail .nav button:hover { color: var(--punch); }

#section-menu { gap: 2px; padding: 10px 8px; max-height: 60vh; overflow-y: auto; }
#section-menu button { text-align: left; padding: 8px 10px; }
#section-menu button:hover { color: var(--punch); }

/* Figures under an experiment's findings */
.figure { margin: 26px 0 0; max-width: 1100px; }
.figure img { display: block; max-width: 100%; height: auto; }
.figure figcaption { color: #9a9aa4; margin-top: 6px; font-size: 12px; max-width: 92ch; }


/* Animations above the animation runs */
.loops { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 26px; }
.loops .media { aspect-ratio: 1; }
.media .count { position: absolute; right: 6px; bottom: 4px; font-size: 11px; color: #fff; text-shadow: 0 1px 0 #000; }

#detail .inner { overflow-y: auto; }
#detail .big { overflow: hidden; }

/* A slow parade of transparent sprites under the title */
#parade { margin-top: 30px; overflow: hidden; max-width: none; mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
#parade .belt { display: flex; gap: 18px; width: max-content; animation: parade 160s linear infinite; }
#parade:hover .belt { animation-play-state: paused; }
#parade button { flex: none; height: 150px; padding: 0; transition: transform 0.2s; }
#parade button:hover { transform: translateY(-6px); }
#parade img { height: 100%; width: auto; display: block; }
@keyframes parade { to { transform: translateX(-50%); } }
@media (max-width: 600px) { #parade button { height: 104px; } }

/* Its own thinking, under the request */
#detail .thoughts { margin: 6px 0 0; padding: 10px 14px; background: rgba(0, 0, 0, 0.3); max-height: 30vh; overflow: auto; color: #b9b9c2; }
#detail .thoughts p { margin: 0 0 8px; }
#detail .thoughts b { color: #ddd; }
#detail .note { color: var(--punch); margin: 12px 0 0; }
