/* Additions to the GAIA template (style.css) for this page: figures and result tables. */

.n-title h1,
.n-byline ul.authors {
    text-wrap: balance;
}

@media (max-width: 480px) {
    .n-title h1 {
        font-size: 26px;
    }
}

.n-article > * {
    min-width: 0;
}

.nowrap {
    white-space: nowrap;
}

.links-buttons + .n-article {
    margin-top: 1.5rem;
}

.n-article h3 {
    margin: 2.5rem 0 1rem;
}

.n-article h2 + h3 {
    margin-top: 0;
}

/* keep superscripts and subscripts from opening up the line */
.n-article sub,
.n-article sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}

.n-article sup {
    top: -0.5em;
}

.n-article sub {
    bottom: -0.25em;
}

.hl {
    color: #76B900;
}

/* Same grey and green as the legends of the plots: without and with a semantic representation. */
.hl-gray,
.hl-green {
    padding: 0 3px;
    border-radius: 2px;
    color: rgb(33, 40, 53);
}

.hl-gray {
    background: #e8e8e8;
}

.hl-green {
    background: #e2f2c6;
}


/* figures */

.n-article figure {
    margin: 1.5rem 0 1rem;
}

.n-article figure img {
    display: block;
    width: 100%;
    height: auto;
}

.n-article figure.narrow img {
    max-width: 560px;
    margin: 0 auto;
}

/* the overview is too wide to read on a phone, so it scrolls sideways there */
.wide-scroll {
    overflow-x: auto;
}

.n-article figure .wide-scroll img {
    min-width: 640px;
}

.n-article figcaption {
    font-size: 14px;
    line-height: 1.55;
    margin-top: 0.75rem;
}

/* two plots: stacked, and side by side once the text column is wide enough to keep their labels readable */
.fig-pair {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: center;
}

.n-article figure .fig-pair img {
    max-width: 560px;
    margin: 0 auto;
}

@media (min-width: 1180px) {
    .fig-pair {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
}


/* result tables */

.table-scroll {
    overflow-x: auto;
}

table.results {
    border-collapse: separate;
    border-spacing: 0;
    margin: 0 auto;
    font-family: var(--paper-serif);
    font-size: 15px;
    line-height: 1.3;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

table.results th,
table.results td {
    padding: 4px 8px;
    text-align: center;
    font-weight: 400;
}

/* column heads are set in the regular weight, as in the paper */
table.results thead th {
    font-weight: 400;
}

table.results thead tr:first-child th {
    border-top: 2px solid rgb(33, 40, 53);
}

table.results thead th[colspan] {
    border-bottom: 1px solid #bdbdbd;
}

table.results tbody tr:first-child > * {
    border-top: 1px solid rgb(33, 40, 53);
}

table.results tbody tr:last-child > * {
    border-bottom: 2px solid rgb(33, 40, 53);
}

table.results tbody th[scope="row"] {
    text-align: left;
}

/* the first column and the block labels stay in view when a table scrolls sideways */
table.results thead tr:first-child th:first-child,
table.results tbody th[scope="row"] {
    position: sticky;
    left: 0;
    background: #fff;
}

table.results tr.group th span {
    display: inline-block;
    position: sticky;
    left: 9px;
}

table.results tr.group th {
    background: #e8e8e8;
    text-align: left;
    font-weight: 600;
    font-style: italic;
}

table.results tr.ours > *,
table.results tr.ours th[scope="row"] {
    background: #e2f2c6;
}

table.results b {
    font-weight: 700;
}

/* a rule to the left of each column group */
table.results .sep {
    border-left: 1px solid #bdbdbd;
}


/* legal links */

.legal {
    text-align: center;
    font-size: 8pt;
    color: gray;
    margin-top: 3rem;
}

/* The page is designed on white; say so, so that dark-themed viewers do not show dark text on a dark canvas. */
html {
    background: #fff;
    color-scheme: light;
}

/* ---------- text-to-image gallery ---------- */

.gal-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 0 auto 14px;
}

.gal-tab {
    font: inherit;
    font-size: 14px;
    line-height: 1;
    padding: 8px 14px;
    border: 1px solid #d5d9de;
    border-radius: 999px;
    background: #fff;
    color: rgb(33, 40, 53);
    cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s;
}

/* every tab is as wide as its bold (active) label, so selecting one never reflows the rows */
.gal-tab {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
}

.gal-tab::after {
    content: attr(data-label);
    font-weight: 600;
    height: 0;
    overflow: hidden;
    visibility: hidden;
    pointer-events: none;
}

.gal-tab:hover {
    border-color: #76B900;
}

.gal-tab:focus-visible,
.gal-tile:focus-visible,
.gal-v-btn:focus-visible {
    outline: 2px solid #76B900;
    outline-offset: 2px;
}

.gal-tab.is-active {
    background: #76B900;
    border-color: #76B900;
    color: #fff;
    font-weight: 600;
}

.gal-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 240px;
    overflow: hidden;
    border-radius: 4px;
}

.gal-row {
    overflow: hidden;
}

.gal-track {
    display: flex;
    width: max-content;
    will-change: transform;
}

/* moved by js/scroller.js: by itself, by dragging, or by a sideways wheel gesture */
.gal-row,
.mq-strip {
    touch-action: pan-y;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.gal-row.is-dragging,
.mq-strip.is-dragging {
    cursor: grabbing;
}

.gal-row.is-dragging .gal-tile,
.mq-strip.is-dragging .mq-tile {
    cursor: grabbing;
}

.gal-tile {
    display: block;
    flex: none;
    overflow: hidden;
    border-radius: 3px;
    background: #eef0f2;
    cursor: zoom-in;
}

.gal-tile img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .25s ease;
}


.gal-tile {
    position: relative;
}

/* the prompt, over the bottom of the tile */
.gal-cap {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 22px 8px 7px;
    color: #fff;
    font-size: 11.5px;
    line-height: 1.35;
    text-align: left;
    background: linear-gradient(to top, rgba(0, 0, 0, .78), rgba(0, 0, 0, 0));
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .18s ease, transform .18s ease;
    pointer-events: none;
}

/* whole lines only, ending in an ellipsis */
.gal-cap-text {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: anywhere;
}

.gal-tile:hover .gal-cap,
.gal-tile:focus-visible .gal-cap {
    opacity: 1;
    transform: none;
}

.gal-foot {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    font-size: 13px;
    color: #6b7280;
}

html.gal-lock {
    overflow: hidden;
}

.gal-viewer {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    background: rgba(12, 14, 17, .96);
}

.gal-viewer[hidden] {
    display: none;
}

.gal-v-stage {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 16px 64px 8px;
}

.gal-v-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: zoom-in;
    user-select: none;
    -webkit-user-drag: none;
}

.gal-v-stage.is-zoomed {
    display: block;
    overflow: auto;
    padding: 0;
    cursor: grab;
}

.gal-v-stage.is-zoomed .gal-v-img {
    max-width: none;
    max-height: none;
    margin: 0 auto;
    display: block;
    cursor: zoom-out;
}

.gal-v-caption {
    flex: none;
    max-height: 26vh;
    overflow: auto;
    padding: 10px 24px 18px;
    color: #e5e7eb;
    text-align: center;
}

.gal-v-meta {
    font-size: 12px;
    letter-spacing: .02em;
    color: #9ca3af;
    margin-bottom: 4px;
}

.gal-v-prompt {
    max-width: 900px;
    margin: 0 auto;
    font-size: 14px;
    line-height: 1.5;
}

.gal-v-btn {
    position: absolute;
    z-index: 2;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 28px;
    line-height: 44px;
    text-align: center;
    padding: 0;
    cursor: pointer;
}

.gal-v-btn:hover {
    background: rgba(255, 255, 255, .25);
}

.gal-v-close {
    top: 12px;
    right: 12px;
}

.gal-v-prev,
.gal-v-next {
    top: 45%;
    transform: translateY(-50%);
}

.gal-v-prev {
    left: 10px;
}

.gal-v-next {
    right: 10px;
}

@media (max-width: 600px) {
    .gal-v-stage {
        padding: 56px 8px 8px;
    }

    .gal-tab {
        font-size: 13px;
        padding: 7px 11px;
    }

    .gal-v-prev,
    .gal-v-next {
        top: auto;
        bottom: 30vh;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gal-tile img,
    .gal-tab {
        transition: none;
    }
}

/* ---------- figure interactions ---------- */

.n-article figure img.fig-live {
    cursor: zoom-in;
    border-radius: 4px;
}

.n-article figure img.fig-live:focus-visible {
    outline: 2px solid #76B900;
    outline-offset: 3px;
}

.fig-tip {
    position: fixed;
    z-index: 1200;
    pointer-events: none;
    min-width: 150px;
    max-width: 300px;
    padding: 8px 10px;
    border-radius: 6px;
    background: rgba(17, 24, 39, .95);
    color: #f3f4f6;
    font-size: 12.5px;
    line-height: 1.45;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
}

.fig-tip-panel {
    font-size: 11px;
    color: #9ca3af;
    margin-bottom: 2px;
}

.fig-tip-series {
    font-weight: 600;
    color: #a3e635;
    margin-bottom: 2px;
}

.fig-tip-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
}

.fig-tip-row span {
    color: #cbd5e1;
}

.fig-hl {
    position: fixed;
    z-index: 1190;
    pointer-events: none;
    overflow: visible;
}

.fig-tip-swatch {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 2px;
    margin-right: 6px;
}

.fig-view {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.fig-view[hidden],
.fig-tip[hidden] {
    display: none;
}

.fig-view-stage {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
}

.fig-view-img {
    display: block;
    flex: none;
    cursor: default;
}

.fig-view-cap {
    flex: none;
    max-width: 900px;
    max-height: 22vh;
    overflow: auto;
    margin: 0 auto;
    padding: 8px 24px 20px;
    font-size: 14px;
    line-height: 1.5;
    color: #374151;
    text-align: center;
}

.fig-view-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: #eef0f2;
    color: #111827;
    font-size: 28px;
    line-height: 44px;
    padding: 0;
    cursor: pointer;
}

.fig-view-close:hover {
    background: #dfe3e8;
}

/* result tables: the row under the cursor */
table.results tbody tr:not(.group):hover > * {
    background-color: #f3f8e6;
}



.fig-tip-text {
    color: #e5e7eb;
    max-width: 270px;
}

.fig-hl text {
    font-family: inherit;
    font-variant-numeric: tabular-nums;
}

/* the caption of the hovered tile of a sample grid */
.fig-lift {
    position: fixed;
    z-index: 1190;
    pointer-events: none;
    overflow: hidden;
}

.fig-lift[hidden] {
    display: none;
}

.fig-lift-cap {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 22px 8px 7px;
    color: #fff;
    font-size: 11.5px;
    line-height: 1.35;
    text-align: left;
    background: linear-gradient(to top, rgba(0, 0, 0, .78), rgba(0, 0, 0, 0));
}

.fig-lift-cap.is-short {
    font-size: 12.5px;
    padding-top: 16px;
}

/* the diagram's own SVG, kept off-screen for measuring and for its glyph definitions */
.fig-src {
    position: absolute;
    left: -10000px;
    top: 0;
    visibility: hidden;
    pointer-events: none;
}

.gal-v-img.is-fixed {
    max-width: none;
    max-height: none;
    cursor: default;
}

/* sample strips: rows that scroll sideways in a loop, alternate rows in opposite directions */
.marquee {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
    border-radius: 4px;
}

.mq-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.mq-name {
    flex: none;
    width: 132px;
    text-align: right;
    font-size: 14px;
    line-height: 1.25;
    color: #374151;
}

.mq-strip {
    /* fills the row; js/marquee.js sizes the tiles to it */
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    border-radius: 3px;
}

.mq-track {
    display: flex;
    width: max-content;
    will-change: transform;
}

.mq-tile {
    position: relative;
    flex: none;
    width: var(--mq-size, 128px);
    height: var(--mq-size, 128px);
    margin: 0 6px 0 0;
    padding: 0;
    border: 0;
    border-radius: 3px;
    overflow: hidden;
    background-color: #f3f4f6;
    background-repeat: no-repeat;
    cursor: zoom-in;
    font: inherit;
}

.mq-cap {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 18px 8px 7px;
    color: #fff;
    font-size: 12.5px;
    line-height: 1.3;
    text-align: left;
    background: linear-gradient(to top, rgba(0, 0, 0, .78), rgba(0, 0, 0, 0));
    opacity: 0;
    transition: opacity .18s ease;
    pointer-events: none;
}

.mq-tile:hover .mq-cap,
.mq-tile:focus-visible .mq-cap {
    opacity: 1;
}

@media (max-width: 700px) {
    .mq-name {
        width: 84px;
        font-size: 12px;
    }

    .mq-row {
        gap: 8px;
    }

}


/* a baseline in a table: its name leads to its paper */
table.results a.ref {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dotted #9aa1ab;
}

table.results a.ref:hover {
    color: #76B900;
    border-bottom-color: #76B900;
}

/* the tables are set as in the paper, in Times */
:root {
    --paper-serif: "Times New Roman", Times, "Nimbus Roman", "TeX Gyre Termes", serif;
}

/* captions stay in the page's typeface; only the tables are set in Times */
.n-article figcaption {
    font-size: 15px;
    line-height: 1.5;
}

/* values written into a plot on hover: the sans of the paper's plots */
.fig-hl text {
    font-family: "DejaVu Sans", Verdana, Geneva, sans-serif;
}

/* On wide screens the template's columns and type are a size larger. */
@media (min-width: 1400px) {
    html {
        font-size: 17.5px;
    }

    .base-grid,
    .n-header,
    .n-byline,
    .n-title,
    .n-article,
    .n-footer {
        grid-template-columns: [screen-start] 1fr [page-start kicker-start] 68px [middle-start] 68px [text-start kicker-end] 68px 68px 68px 68px 68px 68px 68px 68px [text-end gutter-start] 68px [middle-end] 68px [page-end gutter-end] 1fr [screen-end];
    }

    .n-article figcaption {
        font-size: 16px;
    }

    table.results {
        font-size: 16.5px;
    }

    .mq-name {
        font-size: 15px;
    }
}

/* A figure or a table beside the paragraph that describes it. A figure takes a little more than
   half of the text column; a table keeps its own width. Both sides are centred against each
   other, the caption stays under the figure or table, and `media-left` / `media-right` alternate
   down the page. On narrow screens the paragraph comes first and the figure follows. */
.side {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 0.5rem 0 1.5rem;
}

.side > p {
    order: 1;
    margin: 0;
}

.side > figure {
    order: 2;
    margin: 0;
}

.side:not(.is-table) > figure {
    width: 100%;
    max-width: 480px;
    align-self: center;
}

.n-article .side figure img {
    width: 100%;
    height: auto;
    max-width: none;
    margin: 0;
}

.side .fig-pair.is-stacked {
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 1000px) {
    .side {
        display: grid;
        column-gap: 32px;
        align-items: center;
    }

    /* the pair fills the text column; the figure takes a little more than half of it */
    .side.media-left {
        grid-template-columns: minmax(0, 11fr) minmax(0, 10fr);
    }

    .side.media-right {
        grid-template-columns: minmax(0, 10fr) minmax(0, 11fr);
    }

    .side.is-table.media-left {
        grid-template-columns: max-content minmax(0, 1fr);
    }

    .side.is-table.media-right {
        grid-template-columns: minmax(0, 1fr) max-content;
    }

    .side.media-left > figure,
    .side.media-right > p {
        order: 1;
    }

    .side.media-left > p,
    .side.media-right > figure {
        order: 2;
    }

    .side:not(.is-table) > figure {
        max-width: none;
    }

    /* the caption is as wide as the table, without widening its column */
    .side.is-table figcaption {
        width: 0;
        min-width: 100%;
    }
}


/* page head: the title on one line where it fits, larger author and affiliation lines */
.n-byline {
    font-size: 17px;
}

.n-byline .byline {
    grid-column: page;
}

@media (min-width: 1180px) {
    .n-title h1 {
        grid-column: screen;
        white-space: nowrap;
        font-size: 32px;
    }
}

@media (min-width: 1400px) {
    .n-byline {
        font-size: 18.5px;
    }

    .n-title h1 {
        font-size: 38px;
    }
}

/* the note of the overview diagram: a white card with a hairline border and a pointer */
.fig-tip.is-note {
    background: #fff;
    color: #1f2937;
    border: 1px solid #d5d9df;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .10);
    padding: 9px 12px;
    font-size: 13.5px;
}

.fig-tip.is-note .fig-tip-series {
    color: #76B900;
}

.fig-tip.is-note .fig-tip-text {
    color: #374151;
}

.fig-tip.is-note::before {
    content: "";
    position: absolute;
    top: -6px;
    left: var(--tip-arrow, 50%);
    width: 10px;
    height: 10px;
    margin-left: -5px;
    background: #fff;
    border-left: 1px solid #d5d9df;
    border-top: 1px solid #d5d9df;
    transform: rotate(45deg);
}

/* section headings stay centred at the template's size; subsection headings are set to the left */
.n-article h3 {
    text-align: left;
}

/* the ImageNet samples, in the gallery's last tab */
.gal-c2i[hidden],
.gal-grid[hidden] {
    display: none;
}

/* ---- the top of the page: title, authors and links over a wall of samples ---- */

/* the wall fills the first screen and turns white as it scrolls away */
.hero-over {
    position: relative;
    height: 100vh;
    height: 100svh;
    min-height: 560px;
    overflow: hidden;
    background: #0b1220;
    --wash: 0;
    --band: 0%;
}

/* columns of samples that drift up and down; built by js/wall.js */
.wall {
    position: absolute;
    inset: 0;
    display: flex;
    gap: 8px;
    justify-content: center;
    pointer-events: none;
}

.wall-col {
    flex: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 8px;
    backface-visibility: hidden;
    will-change: transform;
}

/* one period is the height of one copy of the column, in whole pixels, so the loop has no jump */
.wall .wall-col {
    animation: wall-drift 120s linear infinite;
}

.wall .wall-col.is-down {
    animation-direction: reverse;
}

.hero-over.is-covered .wall-col {
    animation-play-state: paused;
}

@keyframes wall-drift {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(0, calc(-1 * var(--period)), 0); }
}

@media (prefers-reduced-motion: reduce) {
    .wall .wall-col {
        animation: none;
    }
}

.wall-tile {
    flex: none;
    overflow: hidden;
    border-radius: 4px;
    background: #1b2433;
}

.wall-tile img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* darker behind the text and under the credit line, lighter towards the edges */
.hero-shade {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(to top, rgba(6, 10, 18, .72), rgba(6, 10, 18, 0) 15%),
        radial-gradient(ellipse 62% 46% at 50% 50%, rgba(6, 10, 18, .88), rgba(6, 10, 18, .62) 60%, rgba(6, 10, 18, .30) 100%);
}

/* at rest the wall is shown as it is. Scrolling away, its lower edge fades into the page (--band); once
   the abstract is fully on screen, white covers the rest (--wash), so it runs into the page without an edge */
.hero-over::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(255, 255, 255, var(--wash)), rgba(255, 255, 255, var(--wash))),
        linear-gradient(to bottom, rgba(255, 255, 255, 0) calc(100% - var(--band)), #fff 100%);
}

.hero-text {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    will-change: transform, opacity;
}

.hero-over .n-title {
    padding-top: 0;
}

.hero-over .n-title h1,
.hero-over ul.authors a,
.hero-over ul.authors li {
    color: #fff;
}

.hero-over ul.authors sup,
.hero-over ul.authors.affiliations li {
    color: rgba(255, 255, 255, .78);
}

.hero-over .n-byline {
    overflow: visible;
}

/* the rest of the page follows directly, on white */
.page-body {
    position: relative;
    background: #fff;
    padding-top: 0.5rem;
}

/* what the wall shows, as a small credit line at its lower edge */
.hero-note {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 22px;
    margin: 0;
    padding: 0 16px;
    text-align: center;
    font-size: 13.5px;
    color: rgba(255, 255, 255, .82);
    text-shadow: 0 1px 8px rgba(0, 0, 0, .6);
    will-change: opacity;
}

/* ---- section links, shown at the top once the title has scrolled away ---- */

.topnav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
    background: rgba(255, 255, 255, .92);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #e3e6ea;
    transform: translateY(-100%);
    transition: transform .2s ease;
}

.topnav.is-visible {
    transform: none;
}

.topnav-inner {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 0 12px;
    overflow-x: auto;
    white-space: nowrap;
}

.topnav a {
    padding: 13px 14px 11px;
    border-bottom: 2px solid transparent;
    color: #5b6472;
    font-size: 14.5px;
    text-decoration: none;
}

.topnav a:hover {
    color: #1f2937;
}

.topnav a.is-current {
    color: #1f2937;
    border-bottom-color: #76B900;
}

@media (max-width: 700px) {
    .topnav-inner {
        justify-content: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .topnav {
        transition: none;
    }
}

/* the template credit, one small line above the policy links */
.legal .credit {
    margin: 0 0 0.6rem;
}

/* ---- side-by-side comparison with other text-to-image models ---- */

.cmp-head,
.cmp-grid {
    display: grid;
    grid-template-columns: 1fr;
    column-gap: 32px;
}

.cmp-grid {
    row-gap: 22px;
}

/* the model names once above each column of cards */
.cmp-head > div {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 4px;
    margin-bottom: 6px;
    font-size: 14px;
    color: #374151;
    text-align: center;
}

.cmp-head > div + div {
    display: none;
}

.cmp-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 4px;
}

.cmp-row {
    cursor: zoom-in;
}

.n-article figure.cmp .cmp-row img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
    border-radius: 3px;
}

/* the prompt, whole lines only; the full text is in the viewer */
.cmp-prompt {
    margin: 6px 0 0;
    font-size: 13.5px;
    line-height: 1.4;
    color: #5b6472;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
}

@media (min-width: 1000px) {
    .cmp-head,
    .cmp-grid {
        grid-template-columns: 1fr 1fr;
    }

    .cmp-head > div + div {
        display: grid;
    }
}

/* the enlarged group: the three models side by side */
.cmp-view {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: rgba(10, 12, 16, .96);
}

.cmp-view[hidden] {
    display: none;
}

.cmp-view-row {
    flex: 0 1 auto;
    min-height: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 10px;
    padding: 16px 72px 4px;
}

/* each image as large as a third of the window allows, and never taller than the room above the prompt */
.cmp-view-cell {
    flex: 0 1 min(calc((100vw - 164px) / 3), calc(100vh - 230px));
    margin: 0;
    min-width: 0;
}

.cmp-view-cell figcaption {
    margin: 0 0 8px;
    text-align: center;
    font-size: 15px;
    color: #e5e7eb;
}

.cmp-view-cell img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 3px;
}

.cmp-view-caption {
    flex: none;
    max-height: 26vh;
    overflow: auto;
    padding: 12px 24px 18px;
    color: #e5e7eb;
    text-align: center;
}

/* on a phone three images in a row are too small: they are stacked, and the view scrolls */
@media (max-width: 700px) {
    .cmp-view {
        justify-content: flex-start;
        overflow-y: auto;
    }

    .cmp-view-row {
        flex: none;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        padding: 56px 12px 4px;
    }

    .cmp-view-cell {
        flex: none;
        width: min(86vw, 420px);
    }

    .cmp-view-cell figcaption {
        font-size: 13px;
        margin-bottom: 5px;
    }

    .cmp-view-caption {
        max-height: none;
        overflow: visible;
    }
}

/* phones */
@media (max-width: 700px) {
    .hero-over .n-title h1 {
        text-wrap: balance;
    }
}

/* the subsections of the section on screen, as a second, quieter row of the top bar */
.topnav-sub {
    display: flex;
    justify-content: center;
    gap: 2px;
    padding: 0 12px;
    overflow-x: auto;
    white-space: nowrap;
    border-top: 1px solid #eef0f2;
    background: rgba(250, 251, 252, .9);
    scrollbar-width: none;
}

.topnav-sub[hidden] {
    display: none;
}

.topnav-sub::-webkit-scrollbar {
    display: none;
}

.topnav .topnav-sub a {
    flex: none;
    padding: 8px 11px 7px;
    border-bottom: 0;
    font-size: 13px;
    color: #7b8494;
}

.topnav .topnav-sub a:hover {
    color: #1f2937;
}

.topnav .topnav-sub a.is-current {
    color: #76B900;
}

/* where the row is wider than the screen it starts at the left and scrolls sideways */
@media (max-width: 900px) {
    .topnav-sub {
        justify-content: flex-start;
    }
}

/* The first column stays in view when a table scrolls sideways. Superscripts are positioned, so they
   would paint over it as they pass underneath: the sticky cells sit a layer above. */
table.results thead tr:first-child th:first-child,
table.results tbody th[scope="row"],
table.results tr.group th span {
    z-index: 2;
}

/* ---- tiles of the wall are generated from noise, drawn on a canvas by js/wall.js ---- */

.wall-tile {
    position: relative;
}

/* the image itself shows once the canvas has reached it */
.wall-tile img {
    opacity: 0;
}

.wall-tile.is-sharp img {
    opacity: 1;
}

.wall-denoise {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transition: opacity .35s ease;
}

.wall-tile.is-sharp .wall-denoise {
    opacity: 0;
}

/* ---- motion on the page body (js/polish.js) ---- */

.polish .rise {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .65s ease, transform .65s cubic-bezier(.2, .7, .2, 1);
}

.polish .rise.is-in {
    opacity: 1;
    transform: none;
}

.plot-wrap {
    position: relative;
    display: block;
}

.plot-cover {
    position: absolute;
    background: #fff;
    pointer-events: none;
}

.plot-cover.is-lines {
    transform-origin: 100% 50%;
    transition: transform 1.3s cubic-bezier(.45, 0, .25, 1) .1s;
}

.plot-cover.is-bars {
    transform-origin: 50% 0;
    transition: transform .75s cubic-bezier(.3, .7, .2, 1) .1s;
}

.plot-cover.is-fade {
    transition: opacity 1s ease .1s;
}

/* annotations: the figure without them lies over the plot; each arrow shows through a window that
   opens from its tail, then its number fades in */
.plot-base {
    position: absolute;
    inset: 0;
    width: 100%;
    pointer-events: none;
}

.plot-note {
    position: absolute;
    overflow: hidden;
    pointer-events: none;
}

.plot-note img {
    position: absolute;
    max-width: none;
}

.plot-note.is-arrow {
    clip-path: inset(0 100% 0 0);
    transition: clip-path .55s cubic-bezier(.45, 0, .25, 1) .1s;
}

.plot-note.is-arrow.from-right {
    clip-path: inset(0 0 0 100%);
}

.plot-note.is-label {
    opacity: 0;
    transition: opacity .45s ease .1s;
}

.plot-note.is-box {
    opacity: 0;
    transition: opacity .7s ease .1s;
}

.wipe.is-in .plot-note.is-arrow {
    clip-path: inset(0 0 0 0);
}

.wipe.is-in .plot-note.is-label,
.wipe.is-in .plot-note.is-box {
    opacity: 1;
}

.wipe.is-in .plot-cover.is-lines {
    transform: scaleX(0);
}

.wipe.is-in .plot-cover.is-bars {
    transform: scaleY(0);
}

.wipe.is-in .plot-cover.is-fade {
    opacity: 0;
}

.read-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    z-index: 70;
    background: #76B900;
    transform-origin: 0 50%;
    transform: scaleX(0);
    pointer-events: none;
}

.polish .rise table.results tr.ours > * {
    background-color: #fff;
    transition: background-color .45s ease;
}

.polish .rise.is-in table.results tr.ours > * {
    background-color: #e2f2c6;
}
