/* Research topics paired with quiet illustrations beside the heading. */
#research .research-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr);
    align-items: center;
    gap: 40px;
}

#research .research-heading-copy {
    min-width: 0;
}

#research .research-heading-copy .research-scholar {
    margin-top: 14px;
    margin-bottom: 0;
}

.research-motion {
    width: 100%;
    max-width: 700px;
    justify-self: end;
}

.motion-pair {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr) minmax(0, 1.35fr);
    align-items: stretch;
    gap: 16px;
}

.motion-figure {
    display: grid;
    grid-template-rows: 1fr auto;
    align-items: center;
    min-width: 0;
    margin: 0;
    row-gap: 8px;
}

.motion-highdim-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.motion-highdim-visual {
    min-width: 0;
}

.motion-growth {
    min-height: 1.4em;
    margin: 6px 0 0;
    color: var(--site-muted);
    font-size: 10px;
    line-height: 1.4;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.motion-growth [data-growth-status] {
    white-space: nowrap;
}

.motion-growth-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 24px;
    align-items: center;
    gap: 8px;
    width: min(100%, 142px);
    margin: 0 auto;
}

.motion-growth-slider {
    appearance: none;
    -webkit-appearance: none;
    min-width: 0;
    width: 100%;
    height: 32px;
    margin: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
    touch-action: pan-y;
}

.motion-growth-slider::-webkit-slider-runnable-track {
    height: 2px;
    background: #b8c3b9;
    border-radius: 1px;
}

.motion-growth-slider::-moz-range-track {
    height: 2px;
    background: #b8c3b9;
    border-radius: 1px;
}

.motion-growth-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    margin-top: -5px;
    border: 2px solid var(--site-paper);
    border-radius: 50%;
    background: var(--site-accent);
}

.motion-growth-slider::-moz-range-thumb {
    width: 8px;
    height: 8px;
    border: 2px solid var(--site-paper);
    border-radius: 50%;
    background: var(--site-accent);
}

.motion-growth-slider:focus-visible {
    outline: 2px solid var(--site-accent);
    outline-offset: 2px;
    border-radius: 3px;
}

.motion-growth-resume {
    display: grid;
    place-items: center;
    width: 24px;
    height: 32px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--site-accent);
    cursor: pointer;
}

.motion-growth-resume svg {
    width: 10px;
    height: 10px;
    fill: currentColor;
}

.motion-growth-resume:disabled {
    opacity: 0.4;
    cursor: default;
}

.motion-figure figcaption {
    min-height: 2.9em;
    color: var(--site-text);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.45;
    text-align: center;
    text-wrap: balance;
}

.motion-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 17 / 13;
}

.motion-decisions .motion-frame {
    aspect-ratio: 24 / 13;
}

.motion-frame img,
.motion-frame canvas {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.motion-controls {
    display: flex;
    justify-content: flex-end;
    margin-top: 2px;
}

.motion-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 5px 2px;
    border: 0;
    background: transparent;
    color: var(--site-muted);
    font-size: 10px;
    line-height: 1.5;
    cursor: pointer;
}

.motion-toggle:hover {
    color: var(--site-accent);
}

.motion-toggle svg {
    width: 11px;
    height: 11px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
}

.motion-toggle .motion-play,
.motion-toggle[data-paused="true"] .motion-pause {
    display: none;
}

.motion-toggle[data-paused="true"] .motion-play {
    display: block;
}

.research-motion [hidden] {
    display: none !important;
}

@media (max-width: 900px) {
    #research .research-header {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .research-motion {
        justify-self: start;
    }

    .motion-toggle {
        min-height: 44px;
    }
}

@media (max-width: 480px) {
    .motion-pair {
        grid-template-columns: minmax(0, 1fr);
        gap: 4px;
    }

    .motion-figure {
        grid-template-columns: 128px minmax(0, 1fr);
        grid-template-rows: auto;
        column-gap: 20px;
    }

    .motion-highdim-pair {
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
    }

    .motion-growth {
        min-height: 2.8em;
    }

    .motion-decisions .motion-frame {
        aspect-ratio: 17 / 13;
    }

    .motion-figure figcaption {
        min-height: 0;
        font-size: 14px;
        text-align: left;
    }
}
