/* Full-bleed layered Heroes. Media stays at its native aspect ratio; a single
   still supplies the scene extension so videos need only one decoder. */
.research-page .project-hero {
  position: relative; isolation: isolate; overflow: hidden;
  width: 100%; max-width: none; margin: 0; border: 0;
  background: var(--hero-scene, #f5f4f2); color: var(--hero-ink, #17191c);
}
.research-page .project-hero :is(.hero-media-background,.hero-media-primary) {
  position: absolute; inset: 0; z-index: -2; pointer-events: none;
}
.research-page .project-hero .hero-media-background {
  background: var(--hero-poster) center / cover no-repeat;
  filter: blur(70px); transform: scale(1.12); opacity: var(--hero-fill-opacity,.6);
}
.research-page .project-hero .hero-media-primary { z-index: -1; }
.research-page .project-hero .hero-media-primary :is(img,video) {
  display: block; width: 100%; height: 100%; max-width: none; max-height: none;
  border: 0; border-radius: 0; object-fit: contain; object-position: var(--hero-focal,50% 40%);
  margin: 0; transform: none;
  mask-image: linear-gradient(90deg,transparent,#000 12%,#000 88%,transparent);
}
.research-page .project-hero .hero-overlay {
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  position: relative; width: 100%; min-height: var(--hero-height,780px);
  gap: var(--hero-clearance,240px); padding: clamp(40px,4vw,76px) var(--page-gutter) 40px;
  background: var(--hero-scrim); text-align: center;
}
.research-page .project-hero .hero-headline { width: min(100%,1120px); margin: 0; padding: 0; }
.research-page .project-hero h1 {
  margin: 0; max-width: none; color: inherit;
  font-size: clamp(32px,3.5vw,62px); font-weight: 500;
  line-height: 1.13; letter-spacing: -.045em; text-wrap: balance;
}
.research-page .project-hero .research-publication {
  width: min(100%,980px); margin: 0; padding: 0; gap: 18px; color: inherit;
}
.research-page .project-hero .research-publication .hero-paper-title {
  max-width: 850px; color: inherit; font-size: clamp(20px,1.5vw,26px); line-height: 1.35;
}
.research-page .project-hero .research-publication > .text-sm { font-size: 13px; max-width: 900px; }
.research-page[data-project="bim2robot"] .project-hero {
  --hero-scene: #eeebeb;
  --hero-poster: url('./bim2workface/videos/white_side.jpg');
  --hero-height: clamp(720px,52vw,960px);
  --hero-scrim: linear-gradient(#fff9,transparent 30%,transparent 48%,#fffffff0 80%,#fff);
}
.research-page[data-project="bim-laser"] .project-hero {
  --hero-scene: #000; --hero-ink: #fff;
  --hero-poster: url('./bim-laser/assets/bim-laser/projector_rotation-poster.jpg');
  --hero-fill-opacity: .22; --hero-height: clamp(660px,44vw,820px); --hero-clearance: 180px;
  --hero-focal: 50% 40%;
  --hero-scrim: linear-gradient(#0004,transparent 28%,#0003 47%,#000c 90%,#000d);
}
@media (max-width:600px) {
  .research-page .project-hero--academic .hero-overlay { --hero-clearance: 220px; padding-block: 32px; }
  .research-page .project-hero--academic { --hero-video-height: 320px; }
  .research-page .project-hero--academic .hero-media-primary { bottom: auto; top: 105px; height: 320px; }
  .research-page .project-hero--academic .hero-media-primary :is(img,video) { object-position: center; mask-image: linear-gradient(transparent,#000 16%,#000 80%,transparent); }
  .research-page .project-hero--academic .hero-media-background { opacity: .18; }
  .research-page[data-project="bim2robot"] .project-hero { --hero-scrim: linear-gradient(#fff9,transparent 25%,#fff5 45%,#fff 65%); }
  .research-page .project-hero--academic h1 br { display: none; }
}
/* Keep the horizontal feather on the actual video edges, including ultrawide. */
.research-page .project-hero--academic .hero-media-primary { display: grid; place-items: center; grid-template: minmax(0,1fr) / minmax(0,1fr); }
.research-page .project-hero--academic .hero-media-primary video {
  width: min(100%,calc(var(--hero-video-height,var(--hero-height)) * 1.7777778));
  max-width: 100%; height: auto; min-width: 0; min-height: 0;
}

/* Page settings describe the safe text region and framing for each source. */
.research-page[data-project="mobile-sar-copilot"] .project-hero {
  --hero-scene: #84847e; --hero-ink: #15191b;
  --hero-poster: url('./mobile-sar-copilot/media/hero_mobile_copilot.webp');
  --hero-height: clamp(640px,53vw,940px); --hero-focal: 50% 100%;
  --hero-media-top: clamp(125px,9vw,180px); --hero-aspect: 1.333;
  --hero-scrim: linear-gradient(#d8d8d0c9,transparent 38%,transparent 80%,#17191c38);
}
.research-page .project-hero--scene .hero-overlay { gap: 0; min-height: var(--hero-height); padding-top: clamp(40px,4vw,76px); }
.research-page .project-hero--scene .hero-media-primary {
  display: grid; place-items: end center; top: var(--hero-media-top);
  grid-template: minmax(0,1fr) / minmax(0,1fr);
}
/* Resolve the media width from the available height and its original ratio.
   This bounds intrinsic grid sizing and feathers the actual image edges. */
.research-page .project-hero--scene .hero-media-primary img {
  width: min(100%,calc((var(--hero-height) - var(--hero-media-top)) * var(--hero-aspect)));
  height: auto; max-width: 100%; max-height: none; min-width: 0; min-height: 0;
  mask-image: linear-gradient(90deg,transparent,#000 7%,#000 96%,transparent),linear-gradient(transparent,#000 9%,#000 98%,transparent);
  mask-composite: intersect;
}
.research-page .sar-story > .hero-byline { padding-block: var(--section-space); }
.research-page[data-project="lunar-construction"] .project-hero {
  --hero-scene: #090d13; --hero-ink: #edf1f5;
  --hero-poster: url('./projects/lunar-construction/media/lunar-simulation-scene.png');
  --hero-height: clamp(760px,57vw,1040px); --hero-fill-opacity: .32;
  --hero-media-top: clamp(240px,calc(15vw + 100px),360px); --hero-aspect: 1.665;
  --hero-scrim: linear-gradient(#090d13d9,transparent 36%,transparent 90%,#090d1366);
}
.research-page .lunar-page .project-hero h1 { max-width: 24ch; margin-inline: auto; font-size: clamp(36px,4.3vw,76px); }
.research-page .lunar-hero .lunar-identity { margin: 0 0 16px !important; }
.research-page .lunar-hero .lunar-subtitle { max-width: 660px; margin: 20px auto 0; font-size: clamp(16px,1.25vw,19px); color: #c3cfdb; }
.research-page[data-project="fire-investigation"] .project-hero {
  --hero-scene: #282824; --hero-ink: #fff;
  --hero-poster: url('./fire-investigation/projects/fire-investigation/postfire_scene.png');
  --hero-height: clamp(620px,47vw,880px); --hero-fill-opacity: .65;
  --hero-media-top: 80px; --hero-aspect: 2.006;
  --hero-scrim: linear-gradient(#181918d9,transparent 52%,#18191850);
}
.research-page[data-project="fire-investigation"] .project-hero h1 { font-size: clamp(36px,4.1vw,72px); }
.research-page .project-hero .hero-eyebrow { margin: 0 0 20px; color: #ede8dc; font-size: 12px; letter-spacing: .16em; }
.research-page .hero-scene-caption { display: flex; justify-content: space-between; gap: 20px; padding-top: 16px; color: var(--research-secondary); font-size: 13px; line-height: 1.6; }
.research-page .hero-scene-note > .hero-byline { padding-block: 36px var(--section-space); }
.research-page .hero-scene-note .hero-paper-title { max-width: 820px; font-size: clamp(20px,2vw,28px); }
.research-page .hero-scene-note .header-authors { color: var(--research-primary); }
.research-page .hero-scene-note .header-authors > div > div + div { font-size: 14px; color: var(--research-secondary); }
/* Preserve the reference Hero's original 1200px foreground and all focal rules. */
.research-page .ss .ss-hero .ss-wrap { width: min(calc(100% - 2 * var(--page-gutter)),1200px); }
@media (max-width: 700px) {
  .research-page[data-project="mobile-sar-copilot"] .project-hero {
    --hero-height: clamp(500px,91.43vw,640px);
    --hero-scrim: linear-gradient(#d8d8d0e6,transparent 54%);
  }
  .research-page[data-project="lunar-construction"] .project-hero {
    --hero-height: clamp(580px,110vw,760px); --hero-media-top: 260px;
  }
  .research-page .lunar-hero .lunar-subtitle { margin-top: 16px; }
  .research-page[data-project="fire-investigation"] .project-hero {
    --hero-height: clamp(490px,88.57vw,620px); --hero-media-top: 160px;
    --hero-scrim: linear-gradient(#181918ed,transparent 70%);
  }
  .research-page .hero-scene-caption { display: block; }
  .research-page .hero-scene-caption span { display: block; }
}

/* Keep phone-height negative space proportional to the smaller native scene. */
@media (max-width:390px) {
  .research-page[data-project="mobile-sar-copilot"] .project-hero { --hero-height: calc(100vw + 110px); }
  .research-page[data-project="lunar-construction"] .project-hero { --hero-height: calc(85.714vw + 245.714px); }
  .research-page[data-project="fire-investigation"] .project-hero { --hero-height: calc(57.143vw + 267.143px); }
}
