/* Fire Investigation only. Load after the shared research and editorial styles. */
html.research-page[data-project="fire-investigation"] {
  color-scheme: dark;
  --research-background: #0b0d12;
  --research-primary: #f5f5f5;
  --research-secondary: #b8bec8;
  --research-rule: rgba(255, 255, 255, .12);
  --research-blue: #dfb18e;
  --fire-accent: #dfb18e;
  --fire-charcoal: #151820;
  background: var(--research-background);
  color: var(--research-secondary);
}
html.research-page[data-project="fire-investigation"] body {
  --tw-prose-body: var(--research-secondary);
  --tw-prose-headings: var(--research-primary);
  --tw-prose-bold: var(--research-primary);
  --tw-prose-links: var(--fire-accent);
  background: var(--research-background);
  color: var(--research-secondary);
}
html.research-page[data-project="fire-investigation"] :is(h1, h2, h3, strong) { color: var(--research-primary); }
html.research-page[data-project="fire-investigation"] a { color: var(--fire-accent); }
html.research-page[data-project="fire-investigation"] :is(a, button):focus-visible {
  outline: 2px solid var(--fire-accent);
  outline-offset: 5px;
}
html.research-page[data-project="fire-investigation"] .fire-skip {
  background: var(--fire-charcoal);
  color: var(--research-primary);
}

/* Theme tokens adapt the shared editorial system without rebuilding its grid
   or typography. The Hero uses its own type rules outside .rp-section. */
html.research-page[data-project="fire-investigation"] .rp-editorial {
  --rp-text: var(--research-primary);
  --rp-muted: var(--research-secondary);
  --rp-index-color: var(--fire-accent);
  --rp-divider: var(--research-rule);
  --rp-strong-rule: rgba(255, 255, 255, .2);
}
html.research-page[data-project="fire-investigation"] .rp-editorial .rp-section {
  color: var(--research-secondary);
}

/* The original scene fills the Hero; desktop copy uses a viewport inset. */
html.research-page[data-project="fire-investigation"] .project-hero {
  --hero-height: 100vh;
  height: var(--hero-height);
  --hero-media-top: 0px;
  background: var(--research-background);
  color: var(--research-primary);
}
@supports (height: 100svh) {
  html.research-page[data-project="fire-investigation"] .project-hero { --hero-height: 100svh; }
}
html.research-page[data-project="fire-investigation"] .project-hero .hero-media-primary {
  display: block;
  inset: 0;
}
html.research-page[data-project="fire-investigation"] .project-hero .hero-media-primary img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 50% 50%;
  mask-image: none;
}
html.research-page[data-project="fire-investigation"] .project-hero .hero-overlay {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 40px max(var(--rp-gutter), calc((100% - var(--rp-content-max)) / 2)) calc(var(--hero-height) * .08);
  background: linear-gradient(90deg, rgba(11, 13, 18, .45), transparent 85%),
    linear-gradient(0deg, rgba(11, 13, 18, .96), rgba(11, 13, 18, .5) 45%, transparent 85%);
  text-align: left;
}
@media (min-width: 1200px) {
  html.research-page[data-project="fire-investigation"]
  .project-hero .hero-overlay {
    padding-left: clamp(60px, 5.5vw, 96px);
    padding-right: clamp(60px, 5.5vw, 96px);
  }
}
/* Auto margin keeps copy low and yields to scrolling when the viewport is short. */
html.research-page[data-project="fire-investigation"] .project-hero .hero-headline {
  width: min(100%, 800px);
  flex-shrink: 0;
  margin-top: auto;
}
html.research-page[data-project="fire-investigation"] .project-hero .hero-eyebrow {
  margin: 0 0 18px;
  color: var(--fire-accent);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: .16em;
}
html.research-page[data-project="fire-investigation"] .project-hero h1 {
  margin: 0;
  font-size: clamp(42px, 5vw, 76px);
  line-height: 1.04;
  letter-spacing: -.045em;
  font-weight: 650;
  text-wrap: wrap;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .2);
}
html.research-page[data-project="fire-investigation"] .project-hero h1 > span { display: block; }
html.research-page[data-project="fire-investigation"] .project-hero .fire-title-accent {
  color: var(--fire-accent);
  font-family: Georgia, serif;
  font-style: italic;
  font-weight: 400;
}
html.research-page[data-project="fire-investigation"] .project-hero .fire-hero-description {
  max-width: 560px;
  margin: 22px 0 0;
  color: #e0e3e8;
  font-size: clamp(16px, 1.35vw, 19px);
  line-height: 1.6;
}

/* Keep the shared subsection hierarchy; give each demonstration a full beat. */
html.research-page[data-project="fire-investigation"] .fire-demonstration + .fire-demonstration {
  margin-top: var(--rp-section-space);
}
html.research-page[data-project="fire-investigation"] .fire-direction {
  padding-top: 28px;
  border-top: 1px solid var(--rp-divider);
}
html.research-page[data-project="fire-investigation"] :is(.fire-comparison, .fire-video-figure) {
  width: min(100%, var(--media-standard));
  max-width: none;
  margin: var(--media-space) auto 0;
}
html.research-page[data-project="fire-investigation"] .fire-comparison-toolbar { margin-bottom: 16px; }
html.research-page[data-project="fire-investigation"] .fire-scene-controls {
  background: var(--fire-charcoal);
  border-color: var(--research-rule);
}
html.research-page[data-project="fire-investigation"] .fire-scene-controls button {
  color: var(--research-secondary);
  cursor: pointer;
}
html.research-page[data-project="fire-investigation"] .fire-scene-controls button[aria-pressed="true"] {
  background: var(--fire-accent);
  color: #151820;
  box-shadow: none;
}
html.research-page[data-project="fire-investigation"] .fire-scene-controls button:hover { border-color: var(--fire-accent); }
html.research-page[data-project="fire-investigation"] :is(.fire-scene-stage, .fire-video-figure video) {
  background: var(--fire-charcoal);
  border: 1px solid var(--research-rule);
  border-radius: 4px;
  box-shadow: none;
}
html.research-page[data-project="fire-investigation"] figcaption { color: var(--research-secondary); }

/* Compact team list using the page's existing body typography. */
html.research-page[data-project="fire-investigation"] .fire-team-members {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--research-primary);
  font-size: var(--rp-body-size);
  line-height: 1.7;
  text-align: left;
}
html.research-page[data-project="fire-investigation"] .fire-team-members li {
  margin: 0;
  padding: 0;
}
html.research-page[data-project="fire-investigation"] footer {
  margin-top: 24px;
  border-top: 1px solid var(--research-rule);
  color: var(--research-secondary);
}
@media (max-width: 767px) {
  html.research-page[data-project="fire-investigation"] .project-hero .hero-media-primary img { object-position: 46% 50%; }
  html.research-page[data-project="fire-investigation"] .project-hero .hero-overlay {
    padding-block: 40px;
    background: linear-gradient(0deg, rgba(11, 13, 18, .96), rgba(11, 13, 18, .65) 48%, transparent 90%);
  }
  html.research-page[data-project="fire-investigation"] .project-hero h1 { font-size: clamp(34px, 7.8vw, 48px); }
}
