@font-face {
    font-family: "Research Sans";
    src: url("/styles/fonts/instrument-latin.woff2") format("woff2");
    font-display: swap;
}

@font-face {
    font-family: "Research Serif";
    src: url("/styles/fonts/fraunces-latin.woff2") format("woff2");
    font-display: swap;
}

:root {
    --research-ink: #19231f;
    --research-muted: #62706a;
    --research-paper: #f4f2e9;
    --research-panel: #fcfbf6;
    --research-line: #d7d8cc;
    --research-green: #285c4d;
    --research-mint: #b9d6c9;
    --research-coral: #d8755f;
    --research-yellow: #e1b955;
}

body.research-body {
    min-height: 100vh;
    margin: 0;
    color: var(--research-ink);
    background:
        radial-gradient(
            circle at 88% 7%,
            rgb(185 214 201 / 38%),
            transparent 27rem
        ),
        var(--research-paper);
    font-family: "Research Sans", system-ui, sans-serif;
}

.research-body h1,
.research-body h2,
.research-body h3 {
    color: var(--research-ink);
    font-family: "Research Serif", Georgia, serif;
    letter-spacing: -0.025em;
}

.research-body a {
    color: var(--research-green);
}

.research-body button:not(.secondary),
.research-body a[role="button"]:not(.secondary) {
    border-color: var(--research-green);
    color: #fff;
    background: var(--research-green);
}

.research-body button.secondary,
.research-body a[role="button"].secondary {
    border-color: #50675e;
    color: #fff;
    background: #50675e;
}

.research-header button.secondary.outline {
    color: var(--research-green);
    background: transparent;
}

.research-header {
    position: sticky;
    z-index: 20;
    top: 0;
    border-bottom: 1px solid rgb(25 35 31 / 14%);
    background: rgb(244 242 233 / 92%);
    backdrop-filter: blur(14px);
}

.research-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 5rem;
    gap: 2rem;
}

.research-header nav,
.research-header nav form {
    display: flex;
    align-items: center;
    margin: 0;
    gap: 1.1rem;
}

.research-header nav button {
    width: auto;
    margin: 0;
    padding: 0.45rem 0.8rem;
}

.research-wordmark {
    display: flex;
    align-items: baseline;
    text-decoration: none;
    gap: 0.6rem;
}

.research-wordmark span {
    font-family: "Research Serif", Georgia, serif;
    font-size: 1.5rem;
    font-weight: 650;
}

.research-wordmark strong {
    padding-left: 0.6rem;
    border-left: 1px solid var(--research-line);
    color: var(--research-muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.research-main {
    padding-block: clamp(2.4rem, 6vw, 5rem);
}

.research-login-shell {
    display: grid;
    min-height: calc(100vh - 6rem);
    place-items: center;
}

.research-login-card {
    width: min(100%, 34rem);
    padding: clamp(2rem, 6vw, 4rem);
    border: 1px solid var(--research-line);
    border-radius: 0.6rem;
    background: var(--research-panel);
    box-shadow: 0 1.5rem 5rem rgb(25 35 31 / 10%);
}

.research-login-card h1 {
    margin-top: 0.3rem;
    font-size: clamp(2.25rem, 6vw, 4rem);
    line-height: 0.95;
}

.research-alert {
    padding: 0.8rem 1rem;
    border-left: 3px solid var(--research-coral);
    background: rgb(216 117 95 / 10%);
}

.research-eyebrow {
    margin: 0 0 0.35rem;
    color: var(--research-green);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.research-hero {
    display: grid;
    align-items: end;
    margin-bottom: 3rem;
    grid-template-columns: minmax(0, 1.5fr) minmax(16rem, 0.75fr);
    gap: 3rem;
}

.research-hero h1 {
    max-width: 14ch;
    margin: 0;
    font-size: clamp(3rem, 7vw, 6.6rem);
    line-height: 0.88;
}

.research-hero > p {
    max-width: 38rem;
    color: var(--research-muted);
    font-size: 1.08rem;
}

.research-count-grid {
    display: grid;
    margin-bottom: 3rem;
    border-top: 1px solid var(--research-line);
    border-left: 1px solid var(--research-line);
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
}

.research-count-card {
    display: flex;
    min-height: 9rem;
    padding: 1.1rem;
    flex-direction: column;
    justify-content: space-between;
    border-right: 1px solid var(--research-line);
    border-bottom: 1px solid var(--research-line);
    color: var(--research-ink) !important;
    text-decoration: none;
}

.research-count-card:hover {
    background: var(--research-panel);
}

.research-count-card span {
    color: var(--research-muted);
    font-size: 0.82rem;
}

.research-count-card strong {
    font-family: "Research Serif", Georgia, serif;
    font-size: 2.8rem;
    font-weight: 500;
}

.research-callouts,
.research-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.2rem;
}

.research-callouts article,
.research-meta-grid article,
.research-scene-block,
.research-patch-list article {
    margin: 0;
    border: 1px solid var(--research-line);
    background: var(--research-panel);
    box-shadow: none;
}

.research-callouts article h2 {
    margin-top: 0;
    font-size: 2.4rem;
}

.research-callouts article > p:not(.research-eyebrow) {
    color: var(--research-muted);
}

.research-section-heading {
    display: grid;
    align-items: end;
    margin: 0 0 1.4rem;
    grid-template-columns: minmax(0, 1fr) minmax(15rem, 0.65fr);
    gap: 2rem;
}

.research-section-heading h1,
.research-section-heading h2 {
    margin: 0;
    font-size: clamp(2.1rem, 5vw, 4rem);
}

.research-section-heading > p {
    margin: 0;
    color: var(--research-muted);
}

.research-filter-grid {
    display: grid;
    align-items: end;
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid var(--research-line);
    background: rgb(252 251 246 / 70%);
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: 0.8rem;
}

.research-filter-grid label,
.research-filter-grid input,
.research-filter-grid select,
.research-filter-grid button {
    margin: 0;
}

.research-clear {
    align-self: center;
    text-align: center;
}

.research-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--research-line);
}

.research-table-wrap table {
    min-width: 58rem;
    margin: 0;
    background: var(--research-panel);
}

.research-table-wrap td a {
    display: flex;
    flex-direction: column;
    text-decoration: none;
}

.research-table-wrap td a small {
    color: var(--research-muted);
}

.research-status {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border: 1px solid currentColor;
    border-radius: 10rem;
    color: var(--research-green);
    font-size: 0.65rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    line-height: 1.4;
    text-transform: uppercase;
    white-space: nowrap;
}

.research-status[data-status="failed"],
.research-status[data-status="error"],
.research-status[data-status="canceled"] {
    color: #9a4233;
}

.research-status[data-status="live"],
.research-status[data-status="current"] {
    color: #8c6412;
}

.research-pagination {
    display: grid;
    margin-top: 1.5rem;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
}

.research-pagination > :last-child {
    text-align: right;
}

.research-image-grid {
    display: grid;
    border-top: 1px solid var(--research-line);
    grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
}

.research-image-card {
    display: grid;
    min-height: 16rem;
    padding: 1.2rem;
    border-right: 1px solid var(--research-line);
    border-bottom: 1px solid var(--research-line);
    color: var(--research-ink) !important;
    text-decoration: none;
    grid-template-rows: auto 1fr auto;
    gap: 1rem;
}

.research-image-card:hover {
    background: var(--research-panel);
}

.research-image-card-number {
    font-family: "Research Serif", Georgia, serif;
    font-size: 2.4rem;
}

.research-image-card div:nth-child(2) {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.research-image-card span,
.research-image-card time,
.research-image-card small {
    color: var(--research-muted);
}

.research-back {
    margin-bottom: 2rem;
}

.research-record-heading,
.research-scene-heading,
.research-patch-list header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
}

.research-record-heading {
    margin-bottom: 2rem;
}

.research-record-heading h1 {
    margin: 0;
    font-size: clamp(3rem, 7vw, 6rem);
    line-height: 0.95;
}

.research-meta-grid {
    margin-bottom: 1rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.research-meta-grid article {
    padding: 1rem;
}

.research-meta-grid span,
.research-meta-grid p {
    color: var(--research-muted);
}

.research-meta-grid strong {
    display: block;
    font-family: "Research Serif", Georgia, serif;
    font-size: 2.5rem;
}

.research-export-bar {
    display: flex;
    align-items: center;
    margin: 1rem 0 4rem;
    padding: 0.9rem 1rem;
    border-top: 1px solid var(--research-line);
    border-bottom: 1px solid var(--research-line);
    flex-wrap: wrap;
    gap: 0.8rem 1.5rem;
}

.research-export-bar span {
    margin-left: auto;
    color: var(--research-muted);
}

.research-scene-block {
    margin-bottom: 2rem;
    padding: clamp(1rem, 3vw, 2rem);
}

.research-scene-archive {
    margin-top: 5rem;
}

.research-scene-archive .research-scene-block {
    margin-bottom: 0.8rem;
    padding: 1rem 1.2rem;
}

.research-scene-archive .research-scene-block > p {
    margin: 0.7rem 0 0;
    color: var(--research-muted);
}

.research-scene-heading h2 {
    margin: 0;
}

.research-scene-links {
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    gap: 0.35rem;
}

.research-base-preview {
    width: 100%;
    max-height: 32rem;
    border: 1px solid var(--research-line);
    object-fit: contain;
    background: #111;
}

.research-player {
    width: min(96vw, 100rem);
    margin: 1.5rem 50% 0;
    overflow: hidden;
    border-radius: 0.45rem;
    color: #e9eee9;
    background: #14201b;
    box-shadow: 0 1.2rem 3.5rem rgb(6 15 11 / 22%);
    transform: translateX(-50%);
}

.research-player-loading,
.research-player-error,
.research-player-empty {
    padding: 2rem;
}

.research-player-error {
    color: #ffd2ca;
}

.research-player-toolbar,
.research-player-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem;
    gap: 1rem;
}

.research-player-toolbar {
    border-bottom: 1px solid rgb(255 255 255 / 12%);
}

.research-player-toolbar [role="group"],
.research-player-buttons {
    display: flex;
    align-items: center;
    margin: 0;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.research-player-toolbar-controls,
.research-player-scope {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.research-player-scope {
    margin: 0;
    color: #a9bbb3;
    font-size: 0.74rem;
    font-weight: 700;
}

.research-player-scope select {
    max-width: min(24rem, 42vw);
}

.research-player button,
.research-player select {
    width: auto;
    margin: 0;
    padding: 0.45rem 0.7rem;
    font-size: 0.78rem;
}

.research-player button.secondary.outline {
    color: #dce8e2;
    background: transparent;
}

.research-player-stage {
    position: relative;
    display: grid;
    overflow: hidden;
    aspect-ratio: 2 / 1;
    background: #080c0a;
    place-items: center;
}

.research-player-stage canvas {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.research-player-stage [data-player-overlay] {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.research-player-stage [data-player-missing] {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgb(8 12 10 / 82%);
}

.research-player-stage [data-player-missing][hidden] {
    display: none;
}

.research-player-story {
    display: grid;
    min-height: 15rem;
    padding: 1rem;
    border-top: 1px solid rgb(255 255 255 / 12%);
    border-bottom: 1px solid rgb(255 255 255 / 12%);
    grid-template-columns: minmax(10rem, 0.4fr) minmax(0, 1fr);
    gap: 1.3rem;
}

.research-player-crop canvas {
    display: block;
    width: 100%;
    max-height: 12rem;
    margin-top: 0.4rem;
    object-fit: contain;
    background: rgb(255 255 255 / 5%);
}

.research-player-copy h3 {
    margin: 0.2rem 0 0.5rem;
    color: #fff;
    font-family: "Research Serif", Georgia, serif;
}

.research-player-scene {
    margin: 0.1rem 0;
    color: #d9b85d;
    font-size: 0.76rem;
    font-weight: 700;
}

.research-player-copy small,
.research-player-crop small {
    color: #a9bbb3;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.research-player-copy [data-player-audio-block],
.research-player-copy [data-player-prompt-block],
.research-player-copy [data-player-enhancement-block] {
    margin-top: 0.7rem;
}

.research-player-copy p {
    margin: 0.15rem 0;
}

.research-player-copy audio {
    width: min(100%, 30rem);
    height: 2.2rem;
    margin-top: 0.4rem;
}

.research-player-copy [data-player-patch] {
    width: min(100%, 18rem);
    max-height: 9rem;
    margin-top: 0.7rem;
    object-fit: contain;
}

.research-player-controls {
    flex-wrap: wrap;
}

.research-player-download-note {
    margin: 0;
    padding: 0 0.9rem 0.9rem;
    color: #a9bbb3;
    font-size: 0.78rem;
}

.research-player-scrubber {
    display: flex;
    min-width: min(100%, 24rem);
    margin: 0;
    align-items: center;
    gap: 0.7rem;
}

.research-player-scrubber input {
    margin: 0;
}

.research-player:fullscreen {
    width: 100%;
    margin: 0;
    overflow-y: auto;
    border-radius: 0;
    transform: none;
}

.research-player:fullscreen .research-player-stage canvas {
    max-height: 58vh;
    object-fit: contain;
}

.research-activity-section {
    margin-top: 5rem;
}

.research-activity-list {
    padding: 0;
    list-style: none;
}

.research-activity-list li {
    display: grid;
    padding: 1rem 0;
    border-top: 1px solid var(--research-line);
    grid-template-columns: minmax(10rem, 0.35fr) minmax(12rem, 1fr) minmax(
            10rem,
            0.6fr
        );
    gap: 1rem;
}

.research-activity-list li > div {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 0.4rem;
}

.research-activity-list li > span,
.research-activity-list time {
    color: var(--research-muted);
    font-size: 0.78rem;
}

.research-activity-list details {
    grid-column: 2 / -1;
}

.research-activity-list pre {
    max-height: 20rem;
    overflow: auto;
    font-size: 0.7rem;
}

.research-activity-patch {
    width: 9rem;
    max-height: 6rem;
    object-fit: contain;
    grid-column: 2;
}

.research-patch-list {
    display: grid;
    gap: 1rem;
}

.research-patch-list article {
    padding: 1rem;
}

.research-patch-list header {
    margin-bottom: 1rem;
    padding: 0 0 0.8rem;
    border-bottom: 1px solid var(--research-line);
    background: transparent;
}

.research-patch-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
}

.research-patch-columns small {
    color: var(--research-muted);
    font-weight: 700;
    text-transform: uppercase;
}

.research-patch-columns img,
.research-missing-asset {
    width: 100%;
    max-height: 15rem;
    object-fit: contain;
    background: #111;
}

.research-missing-asset {
    display: grid;
    min-height: 8rem;
    color: #ddd;
    place-items: center;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

[hidden] {
    display: none !important;
}

@media (max-width: 760px) {
    .research-header-inner,
    .research-record-heading,
    .research-scene-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .research-header-inner {
        padding-block: 0.8rem;
    }

    .research-header nav {
        width: 100%;
        overflow-x: auto;
    }

    .research-hero,
    .research-section-heading,
    .research-callouts,
    .research-meta-grid,
    .research-player-story,
    .research-patch-columns {
        grid-template-columns: 1fr;
    }

    .research-activity-list li {
        grid-template-columns: 1fr;
    }

    .research-activity-list details,
    .research-activity-patch {
        grid-column: 1;
    }

    .research-player-toolbar,
    .research-player-controls {
        align-items: stretch;
        flex-direction: column;
    }

    .research-player-toolbar-controls {
        align-items: flex-start;
        flex-direction: column;
    }

    .research-player-scope,
    .research-player-scope select {
        width: 100%;
        max-width: none;
    }

    .research-scene-links {
        align-items: flex-start;
    }
}
