:root {
  color-scheme: dark;
  --ink: #071016;
  --ink-2: #101b1f;
  --paper: #f5f7f5;
  --white: #ffffff;
  --text: #f8fbfb;
  --muted: #bdc9c7;
  --muted-dark: #4c5b5d;
  --line: rgba(255, 255, 255, 0.18);
  --line-dark: rgba(7, 16, 22, 0.12);
  --cyan: #5ccfff;
  --gold: #f6bc5f;
  --red: #e7654f;
  --green: #75d4a8;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
  --radius: 8px;
  --header-height: 72px;
  --max-width: 1160px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.52;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
canvas,
video {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 30;
  transform: translateY(-150%);
  background: var(--paper);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: var(--radius);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 52px);
  border-bottom: 1px solid transparent;
  transition: background 180ms ease, border-color 180ms ease, backdrop-filter 180ms ease;
}

.site-header.scrolled {
  background: rgba(7, 16, 22, 0.82);
  border-color: var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-weight: 800;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.brand-text,
.nav-links a {
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(10px, 2vw, 24px);
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.92rem;
  white-space: nowrap;
}

.nav-links a {
  position: relative;
  flex: 0 0 auto;
  padding: 8px 0;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 2px;
  transform: scaleX(0);
  transform-origin: left;
  background: var(--cyan);
  transition: transform 180ms ease;
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after {
  transform: scaleX(1);
}

.hero {
  min-height: 88vh;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  align-items: center;
  padding: calc(var(--header-height) + 48px) clamp(18px, 6vw, 72px) 42px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -5%;
  z-index: -5;
  background-image: url("assets/research/hero-cluster-photo.jpg");
  background-size: cover;
  background-position: 58% 50%;
  transform: scale(1.04);
  animation: hero-drift 18s ease-in-out infinite alternate;
}

.hero-cluster,
.hero-scrim {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-cluster {
  z-index: -3;
  opacity: 0.42;
  mix-blend-mode: screen;
}

.hero-scrim {
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(7, 16, 22, 0.98) 0%, rgba(7, 16, 22, 0.78) 43%, rgba(7, 16, 22, 0.28) 84%),
    linear-gradient(180deg, rgba(7, 16, 22, 0.82), rgba(7, 16, 22, 0.22) 48%, rgba(7, 16, 22, 0.9));
}

.hero-content {
  width: min(780px, 100%);
}

.eyebrow,
.section-kicker,
.project-tag,
.tool-label {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 860px;
  margin: 0;
  font-size: clamp(3rem, 8vw, 7.4rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.hero-copy {
  width: min(640px, 100%);
  margin: 24px 0 0;
  color: rgba(248, 251, 251, 0.86);
  font-size: clamp(1.05rem, 2vw, 1.28rem);
}

.hero-actions,
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 12px 18px;
  font-weight: 800;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
}

.button.primary {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #071016;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.section {
  padding: clamp(70px, 9vw, 118px) clamp(18px, 6vw, 72px);
  scroll-margin-top: calc(var(--header-height) + 18px);
}

.section-heading {
  width: min(var(--max-width), 100%);
  margin: 0 auto clamp(30px, 5vw, 52px);
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(280px, 0.72fr);
  gap: clamp(24px, 6vw, 76px);
  align-items: end;
}

.section-heading.compact {
  grid-template-columns: minmax(280px, 0.9fr) minmax(280px, 0.68fr);
}

.section h2 {
  margin: 0;
  font-size: clamp(2rem, 4.8vw, 4.35rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.section p {
  color: var(--muted);
  font-size: 1rem;
}

.narrative,
.cosmo-section,
.lensing-section,
.finance-section,
.contact-section {
  background: #071016;
}

.lab-section,
.teaching-section {
  background: var(--paper);
  color: var(--ink);
}

.lab-section p,
.teaching-section p {
  color: var(--muted-dark);
}

.lab-section .section-kicker,
.teaching-section .section-kicker {
  color: #b45527;
}

.section > .section-kicker {
  width: min(var(--max-width), 100%);
  margin-inline: auto;
}

.research-arc,
.paper-highlights,
.highlight-grid,
.teaching-grid {
  width: min(var(--max-width), 100%);
  margin: 0 auto;
}

.research-arc {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.arc-panel,
.paper-card,
.text-card,
.image-card,
.finance-band,
.contact-band {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.055);
}

.arc-panel {
  min-height: 230px;
  padding: 26px;
}

.arc-number {
  color: var(--cyan);
  font-weight: 900;
}

.arc-panel h3,
.paper-card h3,
.text-card h3,
.image-card h3 {
  margin: 12px 0 0;
  line-height: 1.12;
}

.arc-panel p,
.paper-card p,
.text-card p,
.image-card p {
  margin-bottom: 0;
}

.interactive-grid {
  width: min(var(--max-width), 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(360px, 1.28fr);
  gap: clamp(26px, 5vw, 68px);
  align-items: center;
}

.interactive-grid.reverse {
  grid-template-columns: minmax(360px, 1.28fr) minmax(280px, 0.72fr);
}

.interactive-grid.reverse .section-copy {
  order: 2;
}

.interactive-grid.reverse .phase-lab {
  order: 1;
}

.section-copy h2 {
  margin-bottom: 20px;
}

.phase-lab {
  overflow: hidden;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 22px 60px rgba(7, 16, 22, 0.14);
}

.lab-controls {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line-dark);
}

.slider-control {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: end;
}

.slider-control label {
  display: grid;
  gap: 8px;
}

.control-end {
  color: #657073;
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--red);
}

#phase-canvas,
#cosmo-canvas {
  width: 100%;
  aspect-ratio: 920 / 620;
}

#phase-canvas {
  background: #fbfcfc;
}

#cosmo-canvas {
  background: #fbfcfc;
}

.metric-row {
  display: grid;
  grid-template-columns: 1fr;
  background: var(--line-dark);
  border-top: 1px solid var(--line-dark);
}

.metric-row > div {
  min-height: 76px;
  padding: 16px 18px;
  background: #fff;
}

.metric-row span {
  display: block;
  color: #657073;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric-row strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: clamp(1.05rem, 1.7vw, 1.3rem);
}

.paper-highlights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: clamp(26px, 4vw, 48px);
}

.paper-card {
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
  background: #fff;
  color: var(--ink);
  border-color: var(--line-dark);
}

.paper-card img {
  width: 100%;
  height: clamp(350px, 38vw, 460px);
  min-height: 0;
  padding: 8px;
  object-fit: contain;
  object-position: center;
  background: #fff;
  border-bottom: 1px solid var(--line-dark);
}

.paper-card:first-child img {
  object-position: center;
}

.paper-card > div,
.image-card > div {
  padding: 22px;
}

.paper-card:nth-child(3) {
  grid-column: 1 / -1;
  grid-template-columns: minmax(360px, 0.7fr) minmax(280px, 0.3fr);
  align-items: center;
}

.paper-card:nth-child(3) img {
  border-bottom: 0;
  border-right: 1px solid var(--line-dark);
}

.paper-card p,
.image-card p,
.text-card p {
  color: var(--muted-dark);
}

.paper-card a,
.text-card a {
  display: inline-flex;
  margin-top: 18px;
  color: #116d91;
  font-weight: 900;
}

.paper-citation {
  margin-top: 18px;
  color: var(--muted-dark);
  font-weight: 900;
}

.dark-citation {
  color: var(--muted);
}

.lensing-section .image-card p,
.lensing-section .text-card p {
  color: var(--muted);
}

.lensing-section .text-card a {
  color: var(--cyan);
}

.highlight-grid {
  display: grid;
  grid-template-columns: minmax(520px, 1.45fr) minmax(320px, 0.75fr);
  gap: 14px;
  align-items: stretch;
}

.image-card {
  overflow: hidden;
}

.image-card img {
  width: 100%;
  object-fit: contain;
  object-position: center;
  background: #05080b;
}

.macs-card img {
  height: clamp(520px, 48vw, 720px);
  padding: 0;
}

.nuclear-card img {
  height: clamp(420px, 42vw, 620px);
  padding: 12px;
  background: #ffffff;
}

.text-card {
  padding: 24px;
}

.teaching-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.teaching-grid .text-card {
  background: #fff;
  border-color: var(--line-dark);
}

.figure-card img {
  width: 100%;
  margin-top: 18px;
  border-radius: var(--radius);
  object-fit: cover;
}

.mini-photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.mini-photo-grid img {
  width: 100%;
  height: 190px;
  margin-top: 0;
  border-radius: var(--radius);
  object-fit: cover;
}

.finance-band,
.contact-band {
  width: min(var(--max-width), 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  padding: clamp(26px, 5vw, 48px);
  background:
    linear-gradient(135deg, rgba(92, 207, 255, 0.12), rgba(231, 101, 79, 0.12)),
    rgba(255, 255, 255, 0.055);
}

.finance-band h2,
.contact-band h2 {
  font-size: clamp(1.75rem, 4vw, 3.4rem);
}

.finance-band p {
  width: min(700px, 100%);
}

.contact-links {
  margin: 0;
  justify-content: flex-end;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 560ms ease, transform 560ms ease;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1040px) {
  .paper-highlights,
  .highlight-grid,
  .teaching-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .paper-card {
    grid-template-columns: 1fr;
  }

  .paper-card:nth-child(3) {
    grid-template-columns: 1fr;
  }

  .paper-card img {
    height: clamp(320px, 42vw, 390px);
  }

  .paper-card:nth-child(3) img {
    border-right: 0;
    border-bottom: 1px solid var(--line-dark);
  }
}

@media (max-width: 820px) {
  :root {
    --header-height: 66px;
  }

  .site-header {
    align-items: flex-start;
  }

  .brand-text {
    display: none;
  }

  .nav-links {
    max-width: calc(100vw - 90px);
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 4px;
  }

  .hero {
    min-height: 84vh;
    padding-inline: 18px;
    padding-top: calc(var(--header-height) + 42px);
  }

  .section-heading,
  .section-heading.compact,
  .interactive-grid,
  .interactive-grid.reverse,
  .finance-band,
  .contact-band {
    grid-template-columns: 1fr;
  }

  .interactive-grid.reverse .section-copy,
  .interactive-grid.reverse .phase-lab {
    order: initial;
  }

  .research-arc {
    grid-template-columns: 1fr;
  }

  .contact-links {
    justify-content: flex-start;
  }
}

@media (max-width: 600px) {
  .nav-links {
    gap: 16px;
    font-size: 0.86rem;
  }

  .hero h1 {
    font-size: clamp(2.45rem, 12.5vw, 3.7rem);
  }

  .hero-copy {
    font-size: 1rem;
  }

  .button {
    width: 100%;
  }

  .section {
    padding-inline: 16px;
  }

  .paper-highlights,
  .highlight-grid,
  .teaching-grid {
    grid-template-columns: 1fr;
  }

  .slider-control {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .control-end:last-child {
    text-align: right;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .hero::before {
    animation: none;
  }
}

@keyframes hero-drift {
  from {
    transform: scale(1.04) translate3d(-1.2%, -0.8%, 0);
  }

  to {
    transform: scale(1.12) translate3d(1.3%, 0.8%, 0);
  }
}
