:root {
  --ink: #172033;
  --muted: #5f6d7c;
  --soft: #eef3f7;
  --line: #d8e2ea;
  --paper: #ffffff;
  --mist: #f7fafc;
  --blue: #1f6feb;
  --cyan: #1c8b95;
  --green: #377f56;
  --coral: #c65f46;
  --shadow: 0 16px 34px rgba(23, 32, 51, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(239, 245, 249, 0.92) 0, rgba(255, 255, 255, 0) 480px),
    var(--paper);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

a {
  color: inherit;
}

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

.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid rgba(216, 226, 234, 0.82);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
}

.nav-inner {
  width: min(1180px, calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 750;
  letter-spacing: 0;
}

.brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 650;
  text-decoration: none;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--ink);
  background: var(--soft);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--ink);
}

#content-container {
  min-height: calc(100vh - 220px);
}

.lab-hero,
.research-section,
.empty-state {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.lab-hero {
  min-height: 430px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.48fr);
  align-items: center;
  gap: 40px;
  padding: 52px 0 34px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-copy h1 {
  max-width: 760px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(3rem, 5vw, 4.8rem);
  line-height: 1.04;
  font-weight: 820;
  letter-spacing: 0;
}

.hero-lede {
  max-width: 680px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 1.18rem;
}

.hero-actions,
.project-actions,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.hero-actions {
  margin-top: 34px;
}

.button-primary,
.button-secondary,
.project-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border-radius: 6px;
  font-weight: 750;
  text-decoration: none;
}

.button-primary,
.button-secondary {
  padding: 0 16px;
}

.button-primary {
  color: #fff;
  background: var(--ink);
}

.button-secondary {
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.68);
}

.hero-visual {
  border: 1px solid rgba(216, 226, 234, 0.94);
  border-radius: 8px;
  background: #f7fafc;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-visual img {
  width: 100%;
  height: auto;
}

.research-section {
  padding: 42px 0;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(280px, 0.64fr);
  gap: 24px;
  align-items: end;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.9rem, 3vw, 2.7rem);
  line-height: 1.08;
  font-weight: 820;
  letter-spacing: 0;
}

.section-heading p:last-child {
  margin: 0;
  color: var(--muted);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 12px;
}

.project-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 154px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.project-card:hover {
  transform: translateY(-2px);
  border-color: rgba(31, 111, 235, 0.36);
  box-shadow: 0 10px 24px rgba(23, 32, 51, 0.08);
}

.project-image {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: var(--soft);
  overflow: hidden;
  padding: 6px;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 220ms ease;
}

.project-card:hover .project-image img {
  transform: scale(1.018);
}

.project-content {
  padding: 16px 18px;
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 0;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.project-meta span + span::before {
  content: "/";
  margin-right: 8px;
  color: #9aa7b3;
}

.project-content h3 {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.12;
  font-weight: 820;
}

.project-content h3 a {
  text-decoration: none;
}

.project-title {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.project-content p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.48;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-list span {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #405064;
  background: var(--mist);
  font-size: 0.72rem;
  font-weight: 700;
}

.project-actions {
  margin-top: 2px;
}

.project-link {
  min-height: 30px;
  padding: 0 9px;
  color: var(--ink);
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.8rem;
}

.project-link:first-child {
  color: #fff;
  border-color: var(--ink);
  background: var(--ink);
}

.loading,
.empty-state {
  min-height: 54vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  color: var(--muted);
  text-align: center;
}

.empty-state i {
  color: var(--coral);
  font-size: 2.2rem;
}

.project-detail {
  animation: fadeIn 320ms ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.project-detail .hero {
  background: transparent;
}

.project-detail .hero-body {
  padding-top: 64px;
  padding-bottom: 32px;
}

.project-detail .container.is-max-desktop {
  max-width: 980px !important;
}

.publication-title {
  font-family: inherit;
  color: var(--ink);
  line-height: 1.08;
  letter-spacing: 0;
}

.publication-authors {
  font-family: inherit;
  color: #3b4859;
}

.publication-authors a {
  color: var(--blue) !important;
}

.publication-authors a:hover {
  text-decoration: underline;
}

.author-block {
  display: inline-block;
}

.publication-venue {
  color: #555;
  width: fit-content;
  font-weight: bold;
}

.publication-awards {
  color: #ff3860;
  width: fit-content;
  font-weight: bolder;
}

.publication-links .button {
  border-radius: 6px !important;
}

.project-detail .section {
  padding-top: 56px;
  padding-bottom: 56px;
}

.project-detail h2.title {
  color: var(--ink);
  font-weight: 800;
}

.project-detail figure {
  margin: 24px 0;
}

.project-detail figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.94rem;
  text-align: left;
}

.project-detail pre {
  border-radius: 8px;
  background: #101827;
  color: #eef3f7;
  white-space: pre-wrap;
}

.teaser .hero {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.teaser .hero-body {
  padding-top: 0;
  padding-bottom: 3rem;
}

.publication-video {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%;
  overflow: hidden;
  border-radius: 8px !important;
}

.publication-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.results-carousel {
  overflow: hidden;
}

.results-carousel .item {
  margin: 5px;
  overflow: hidden;
  border: 1px solid #bbb;
  border-radius: 8px;
  padding: 0;
  font-size: 0;
}

.interpolation-panel {
  background: #f5f5f5;
  border-radius: 8px;
}

.interpolation-panel .interpolation-image,
#interpolation-image-wrapper img {
  width: 100%;
  border-radius: 6px;
}

.interpolation-panel .slider {
  margin: 0 !important;
}

.site-footer {
  margin-top: 48px;
  border-top: 1px solid var(--line);
  background: #0f1724;
  color: #dfe7ef;
}

.footer-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 22px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.footer-inner p,
.template-credit {
  color: #aeb9c6;
}

.footer-links a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(223, 231, 239, 0.24);
  border-radius: 6px;
  text-decoration: none;
}

.template-credit {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 28px;
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 72px;
    left: 16px;
    right: 16px;
    display: none;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
  }

  .nav-links.is-open {
    display: grid;
  }

  .nav-link {
    justify-content: flex-start;
  }

  .lab-hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 24px;
    padding-top: 42px;
  }

  .section-heading {
    grid-template-columns: 1fr;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .project-card {
    grid-template-columns: 150px minmax(0, 1fr);
    min-height: 136px;
  }

  .project-content {
    padding: 12px;
  }

  .tag-list {
    display: none;
  }
}

@media (max-width: 560px) {
  .nav-inner,
  .lab-hero,
  .research-section,
  .empty-state,
  .footer-inner,
  .template-credit {
    width: min(100% - 24px, 1180px);
  }

  .brand span {
    font-size: 0.98rem;
  }

  .hero-copy h1 {
    font-size: 3rem;
  }

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

  .project-content {
    padding: 18px;
  }

  .research-section {
    padding: 52px 0;
  }

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

  .project-image {
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .tag-list {
    display: flex;
  }
}
