:root {
  color-scheme: light;
  --bg: #f7f8f5;
  --text: #171a1c;
  --muted: #5d666d;
  --line: #d9ded8;
  --panel: #ffffff;
  --soft-panel: #eef2ec;
  --accent: #1d5f56;
  --accent-strong: #123f39;
  --link: #154f8f;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

a {
  color: var(--link);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(20px, 5vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(247, 248, 245, 0.94);
  backdrop-filter: blur(12px);
}

.brand {
  color: var(--accent-strong);
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 0.95rem;
}

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

nav a:hover,
.brand:hover {
  color: var(--link);
}

main,
footer {
  width: min(1320px, calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 68vh;
  padding: clamp(46px, 7vh, 86px) 0 36px;
  text-align: center;
}

.logo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(22px, 5vw, 56px);
  margin-bottom: 38px;
}

.logo {
  width: auto;
  object-fit: contain;
}

.merlin-logo {
  height: clamp(82px, 10vw, 132px);
}

.venue,
.section-kicker {
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.venue {
  margin: 0 0 14px;
}

h1 {
  max-width: 1030px;
  margin: 0;
  font-size: clamp(2.35rem, 6vw, 5.25rem);
  line-height: 1;
  letter-spacing: 0;
}

.authors {
  max-width: 860px;
  margin: 24px 0 8px;
  color: #30363b;
  font-size: clamp(1.04rem, 1.8vw, 1.26rem);
}

.affiliation,
.contact-line {
  margin: 0;
  color: var(--muted);
}

.contact-line {
  margin-top: 8px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font-weight: 750;
  text-decoration: none;
}

.button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.button.disabled {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  cursor: default;
}

.video-section,
.content-section {
  padding: 54px 0;
  border-top: 1px solid var(--line);
}

.video-section {
  text-align: center;
}

.section-kicker {
  margin: 0 0 10px;
}

h2 {
  margin: 0 0 22px;
  font-size: clamp(1.7rem, 3.2vw, 2.65rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin: 34px 0 16px;
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  line-height: 1.15;
  letter-spacing: 0;
}

h4 {
  margin: 0 0 14px;
  color: var(--accent-strong);
  font-size: 1.02rem;
  letter-spacing: 0;
}

.video-frame {
  position: relative;
  width: min(1180px, 100%);
  aspect-ratio: 16 / 9;
  margin: 0 auto;
  border: 1px solid #263033;
  border-radius: 8px;
  background: #111718;
  overflow: hidden;
}

.video-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-fallback {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

figure {
  margin: 0;
}

figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.hero-figure {
  text-align: center;
}

.hero-figure img {
  width: min(1320px, 100%);
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.hero-figure figcaption {
  max-width: 880px;
  margin: 12px auto 0;
}

.hero-figure .pipeline-caption {
  width: min(1320px, 100%);
  max-width: none;
  text-align: left;
  line-height: 1.6;
}

.qualitative > h2 {
  display: block;
  width: 100%;
  max-width: none;
  white-space: nowrap;
}

.qualitative .section-copy {
  width: 100%;
  max-width: none;
}

.figure-stack {
  display: grid;
  gap: 22px;
}

.figure-grid,
.comparison-grid,
.object-media-grid {
  display: grid;
  gap: 14px;
}

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

.four-columns {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.comparison-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.object-media-grid.four-items {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.analysis-grid {
  margin-top: 22px;
}

.combined-figure {
  width: min(820px, 100%);
  margin: 0 auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.figure-pair img {
  width: 100%;
  height: auto;
  max-height: 540px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  object-fit: contain;
}

.figure-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.figure-card img {
  width: 100%;
  max-height: 340px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  object-fit: contain;
}

.figure-card.large img {
  max-height: 560px;
}

.results-overview {
  margin-bottom: 22px;
}

.results-overview img {
  max-height: none;
}

.four-columns .figure-card img {
  height: 260px;
  max-height: none;
}

.section-copy {
  max-width: 940px;
  margin-bottom: 26px;
}

.section-copy p,
.contact-section p {
  margin: 0;
  color: #30363b;
  font-size: 1.05rem;
}

.additional-group {
  margin-top: 26px;
}

.reconstruction-list {
  display: grid;
  gap: 26px;
}

.comparison-block {
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.qualitative-object h3 {
  margin-top: 0;
}

.qualitative-object .figure-card img {
  height: clamp(220px, 19vw, 300px);
  max-height: none;
}

pre {
  overflow-x: auto;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111718;
  color: #e8f1ed;
  font-size: 0.92rem;
  line-height: 1.5;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 0 38px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}

@media (max-width: 980px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    justify-content: flex-start;
  }

  .hero {
    min-height: auto;
  }

  .two-columns,
  .four-columns,
  .comparison-grid,
  .object-media-grid,
  .object-media-grid.four-items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  main,
  footer {
    width: min(100% - 28px, 1320px);
  }

  .logo-row {
    flex-direction: column;
    gap: 18px;
  }

  .merlin-logo {
    height: 72px;
  }

  h1 {
    font-size: 2.25rem;
  }

  .qualitative > h2 {
    white-space: normal;
  }

  .actions,
  footer {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .two-columns,
  .four-columns,
  .comparison-grid,
  .object-media-grid,
  .object-media-grid.four-items {
    grid-template-columns: 1fr;
  }

  .figure-card img,
  .four-columns .figure-card img,
  .figure-pair img,
  .qualitative-object .figure-card img {
    height: auto;
    max-height: none;
  }
}
