/* Compact cards share a layout; category color distinguishes their surfaces. */
.research-grid,.current-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:28px;align-items:start}
.research-grid>.project{display:block;height:auto;min-height:0}
.research-grid>.project>.project-body{display:block;flex:none}
.research-grid .project-summary{margin-bottom:0}
.research-grid .research-details{margin-top:24px}
.current-grid>.current-project,.current-grid>.current-project:last-child{display:block;padding:0;margin:0;gap:0;border:1px solid #c9c1da;border-radius:28px;overflow:hidden;background:#f0edf6;box-shadow:var(--elevation-1)}
:root[data-theme=dark] .current-grid>.current-project{background:#292632;border-color:#51465f}
.current-grid .current-copy{padding:28px}
.current-grid .current-copy h3{font-size:25px;line-height:1.18}
.current-grid .current-copy .project-meta{color:#70598a;margin:10px 0 0}
:root[data-theme=dark] .current-grid .current-project .project-meta{color:#c9b2e8}
.current-grid .current-description{margin-top:14px;line-height:1.7}
.current-grid .current-collaboration{margin-top:20px;font-size:12px;line-height:1.7}
.current-grid .current-figure{margin:0;min-width:0}
.current-grid .current-visual{border-radius:0;box-shadow:none;aspect-ratio:16/9;display:flex;align-items:center;justify-content:center;overflow:hidden;background:#fff}
.current-grid .current-visual--terrain{background:var(--soft)}
.current-grid .current-visual img{display:block;width:100%;height:100%;max-height:none;object-fit:contain}
.current-grid .film-preview .research-film{width:100%;height:100%}
.current-grid .current-visual video,.current-grid .current-visual iframe{width:100%;height:100%;object-fit:contain}
.research-masonry.is-masonry{grid-auto-rows:1px;row-gap:0}
.research-masonry>.project,.research-masonry>.current-project{position:relative;transition:transform 220ms ease-out,box-shadow 280ms,border-color 280ms}
.research-masonry>.project:hover,.research-masonry>.current-project:hover{transform:none}
@media(max-width:640px){
 .research-grid,.current-grid{grid-template-columns:1fr;gap:24px}
 .research-masonry.is-masonry{grid-auto-rows:auto;row-gap:24px}
 .research-masonry>*{grid-row:auto!important}
 .current-grid .current-copy{padding:24px}
 .current-grid>.current-project,.current-grid>.current-project:last-child{border-radius:24px}
}
@media(prefers-reduced-motion:reduce){.research-masonry>.project,.research-masonry>.current-project{transition:none;transform:none!important}}

/* Preview crops are presentation-only; full figures remain in the project details. */
#drones .project-image.film-preview{aspect-ratio:4/3}
#drones .research-film img{object-fit:cover;object-position:center;transform:none;background:#472463}
#fish .project-image.film-preview{aspect-ratio:4/3}
#fish .research-film img{object-fit:cover;object-position:center 55%;transform:none}
#spiders .research-film img{object-fit:cover;object-position:center;transform:none}
.preview-credit{position:absolute;right:10px;bottom:9px;max-width:55%;padding:3px 6px;border-radius:4px;background:#1020199c;color:#fff;font-size:8px;line-height:1.3;z-index:1}

/* Compact figures use their own proportions rather than a letterboxed frame. */
.current-grid .current-visual--compact{aspect-ratio:auto}
.current-grid .current-visual--compact img{height:auto;object-fit:contain}


/* Research context follows the title in ordinary text. */
.research-grid .project-meta{font-size:12px;font-weight:500;letter-spacing:0;text-transform:none;margin:10px 0 0;line-height:1.5}

/* Mouse hover adds only a small lift and a soft shadow. */
@media(hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference){
 .research-masonry>.project:hover,.research-masonry>.current-project:hover{transform:translateY(-2px);box-shadow:var(--elevation-2)}
}

/* A faint green surface echoes the target color in completed research. */
:root{--past-surface:#edf2e7;--past-border:#ccd9c2}
:root[data-theme=dark]{--past-surface:#1f2c23;--past-border:#3b4c3d}
.research-grid>.project{background:var(--past-surface);border-color:var(--past-border)}
.research-grid>.project .project-meta{color:var(--green)}

.research-publications{display:flex;align-items:center;justify-content:space-between;gap:20px;padding-block:20px;border-top:1px solid var(--line);margin-top:4px}
.research-publications>span{font-size:15px;font-weight:600;color:var(--ink)}
.research-publications .text-link{gap:12px;color:var(--green);white-space:nowrap}
@media(max-width:640px){.research-publications{gap:12px;padding-block:16px}.research-publications>span{font-size:13px}.research-publications .text-link{font-size:13px}}

@media(min-width:641px){.research-publications{justify-content:flex-start;gap:20px}}

/* A focused project grows across the grid, with a bounded video area. */
.research-masonry>.video-focused{grid-column:1/-1;width:100%;max-width:960px;justify-self:center;box-shadow:var(--elevation-2)}
.research-masonry>.video-focused:hover{transform:none}
.research-masonry>.video-focused .project-image.film-preview,
.research-masonry>.video-focused .current-visual{aspect-ratio:var(--video-ratio,16/9)!important;height:auto;max-height:min(64vh,540px);position:relative;background:#111916}
.research-masonry>.video-focused .project-image video,
.research-masonry>.video-focused .project-image iframe,
.research-masonry>.video-focused .current-visual video,
.research-masonry>.video-focused .current-visual iframe{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;border:0}
.video-size-toggle{position:absolute;z-index:2;top:12px;right:12px;min-height:44px;padding:8px 14px;border:1px solid var(--line);border-radius:14px;background:var(--surface);color:var(--ink);font:inherit;font-size:12px;font-weight:600;cursor:pointer;box-shadow:var(--elevation-1)}
.video-size-toggle:hover{background:var(--soft)}
.video-size-toggle:focus-visible{outline:2px solid var(--green);outline-offset:3px}
.current-visual{position:relative}
@media(max-width:640px){.video-size-toggle{top:8px;right:8px;padding-inline:12px}.research-masonry>.video-focused{max-width:none}}

.video-size-toggle{display:grid;place-items:center;width:44px;height:44px;padding:0!important}.video-size-toggle svg{pointer-events:none}

/* Single-column screens keep the fitted video focus without a redundant resize control. */
@media(max-width:640px){.video-size-toggle{display:none}}

/* Center the disclosure icon geometrically, independent of font metrics. */
.research-details summary>span{flex:none;line-height:0}
.research-details summary>span>svg{display:block;width:18px;height:18px}

:root[data-theme=light] .hero-portrait,:root[data-theme=light] .hero-portrait figcaption{background:var(--past-surface)}
