/* ============================================
   Research Highlights page (loaded only by research-highlights.html)
   ============================================ */

/* ---------- Hero: dark image header, matches the homepage ---------- */
.rh-hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: clamp(460px, 74vh, 720px);
  padding: 7rem 0 4rem;
  overflow: hidden;
  background: #0a0e14;
  color: #f8fafc;
  text-align: center;
}

/*
 * Header photo: assets/research-hero.webp (web copy of "Research highlights.png").
 * The scrim keeps the title readable: darker at the top (under the nav), lighter in the
 * middle so the robots show, darker at the bottom to settle into the page.
 */
/* Photo layer: moved by assets/js/parallax.js (data-parallax) as the page scrolls */
.rh-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: url('../research-hero.webp') center 40% / cover no-repeat, #0a0e14;
  transform: translate3d(0, 0, 0) scale(1.08);
  will-change: transform;
}

/* Static scrim above the photo, so the readable shading never scrolls away */
.rh-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 60% at 50% 50%, rgba(10, 14, 20, 0.45) 0%, rgba(10, 14, 20, 0) 75%),
    linear-gradient(180deg, rgba(10, 14, 20, 0.55) 0%, rgba(10, 14, 20, 0.2) 35%, rgba(10, 14, 20, 0.25) 65%, rgba(10, 14, 20, 0.85) 100%);
}

.rh-hero-content {
  position: relative;
  z-index: 1;
  will-change: transform, opacity;
}

.rh-hero-title {
  margin-bottom: 1rem;
  font-size: clamp(2.25rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  color: #f8fafc;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.55);
  animation: fadeInUp 0.8s ease-out both;
}

.rh-hero-title .accent {
  color: var(--accent-primary);
}

.rh-hero-subtitle {
  max-width: 620px;
  margin: 0 auto 2rem;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.7;
  color: #e2e8f0;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.7);
  animation: fadeInUp 0.8s ease-out 0.1s both;
}

/* Jump links to the two research areas */
.rh-jump {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

.rh-jump a {
  padding: 0.55rem 1.1rem;
  border: 1px solid rgba(248, 250, 252, 0.3);
  border-radius: 100px;
  background: rgba(10, 14, 20, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 0.85rem;
  font-weight: 600;
  color: #f8fafc;
  text-decoration: none;
  transition: var(--transition-fast);
}

.rh-jump a:hover,
.rh-jump a:focus-visible {
  border-color: var(--accent-primary);
  background: rgba(59, 99, 204, 0.18);
}

/* Keep section tops clear of the fixed nav when jumped to */
.rh-area {
  scroll-margin-top: 80px;
}

/* ---------- Projects ---------- */
.rh-projects {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.rh-project-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
}

.rh-project {
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

[data-theme="light"] .rh-project {
  border-color: #e2e8f0;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}

.rh-project:hover {
  border-color: var(--border-accent);
}

.rh-project-head {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.rh-project-num {
  flex-shrink: 0;
  padding-top: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-primary);
}

.rh-project-title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
}

.rh-project-summary {
  margin: 0;
  max-width: 70ch;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

/* ---------- Figures: whole poster visible, click to enlarge ---------- */
.rh-figures {
  display: grid;
  gap: 1.25rem;
}

.rh-figures--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rh-figures--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.rh-figure {
  margin: 0;
}

.rh-figure-media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0.5rem;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  cursor: zoom-in;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.rh-figure-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.rh-figure-media:hover,
.rh-figure-media:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}

.rh-figure-media:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
}

.rh-zoom {
  position: absolute;
  right: 0.6rem;
  bottom: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(10, 14, 20, 0.75);
  color: #fff;
  font-size: 0.8rem;
  opacity: 0;
  transform: scale(0.8);
  transition: var(--transition-fast);
}

.rh-figure-media:hover .rh-zoom,
.rh-figure-media:focus-visible .rh-zoom {
  opacity: 1;
  transform: scale(1);
}

.rh-figure figcaption {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.rh-chip {
  display: inline-block;
  margin-right: 0.5rem;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--border-accent);
  border-radius: 100px;
  background: var(--accent-glow);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: 1px;
  color: var(--accent-primary);
}

[data-theme="light"] .rh-chip {
  color: var(--accent-deep);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .rh-project-pair,
  .rh-figures--3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .rh-hero {
    min-height: clamp(400px, 62vh, 520px);
  }

  .rh-figures--2 {
    grid-template-columns: 1fr;
  }

  .rh-project {
    padding: 1.25rem;
  }

  .rh-project-head {
    gap: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rh-figure-media:hover,
  .rh-figure-media:focus-visible {
    transform: none;
  }
}
