:root {
  --ink: #171717;
  --muted: #5f666d;
  --subtle: #8a929b;
  --paper: #ffffff;
  --wash: #f5f7f8;
  --line: #dde3e8;
  --teal: #087f8c;
  --teal-dark: #05606a;
  --coral: #b23a2f;
  --green: #2f7d57;
  --shadow-sm: 0 1px 2px rgb(17 24 39 / 0.08);
  --shadow-md: 0 12px 32px rgb(17 24 39 / 0.10);
  --radius: 8px;
  --transition: 180ms ease;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--teal);
  text-decoration: none;
}

a:hover {
  color: var(--teal-dark);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  background: rgb(255 255 255 / 0.78);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
  box-shadow: 0 8px 28px rgb(17 24 39 / 0.06);
}

.topbar a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  color: #5d646b;
  font-size: 0.92rem;
  font-weight: 700;
  transition: color var(--transition), background var(--transition), box-shadow var(--transition), transform var(--transition);
}

.topbar a:hover {
  color: var(--ink);
  background: rgb(8 127 140 / 0.08);
}

.topbar a.active {
  color: var(--teal-dark);
  background: rgb(8 127 140 / 0.12);
  box-shadow: inset 0 0 0 1px rgb(8 127 140 / 0.18);
}

.topbar a.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0.22rem;
  width: 1.25rem;
  height: 2px;
  border-radius: 999px;
  background: var(--teal);
  transform: translateX(-50%);
}

.hero-body {
  position: relative;
  z-index: 2;
  padding: 4.5rem 1.5rem 3.75rem;
}

.publication-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    linear-gradient(180deg, #ffffff 0%, #f8faf9 100%);
  border-bottom: 1px solid var(--line);
}

.particle-field {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.publication-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 24%, rgb(255 255 255 / 0.78), transparent 31%),
    linear-gradient(90deg, rgb(255 255 255 / 0.86) 0%, rgb(255 255 255 / 0.62) 42%, rgb(255 255 255 / 0.32) 100%);
}

.publication-title {
  margin-bottom: 1.25rem !important;
  color: var(--ink) !important;
  font-family: "Inter", sans-serif !important;
  font-size: clamp(2.2rem, 5vw, 4.6rem) !important;
  font-weight: 800 !important;
  letter-spacing: 0;
  line-height: 1.04 !important;
}

.venue,
.eyebrow {
  margin-bottom: 0.75rem;
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.publication-authors {
  margin-bottom: 1.25rem;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 700;
}

.hero-summary {
  max-width: 680px;
  margin-bottom: 1.5rem;
  color: var(--muted);
  font-size: 1.12rem;
}

.publication-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.link-block {
  display: inline-flex;
}

.button {
  min-height: 2.75rem;
  border-radius: var(--radius) !important;
  font-weight: 800 !important;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition) !important;
}

.button.is-dark {
  border: 1px solid var(--ink) !important;
  background: var(--ink) !important;
  color: white !important;
  box-shadow: var(--shadow-sm);
}

.button.is-dark:hover {
  background: var(--teal) !important;
  border-color: var(--teal) !important;
  color: white !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.hero-figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow-md);
}

.hero-figure img {
  display: block;
  width: 100%;
  max-height: 560px;
  height: auto;
  object-fit: contain;
}

.section {
  padding: 4.5rem 1.5rem;
}

.band {
  background: var(--wash);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 2rem;
}

.section-heading.is-centered {
  margin-right: auto;
  margin-left: auto;
  text-align: center;
}

.title.is-3 {
  margin-bottom: 0 !important;
  color: var(--ink);
  font-family: "Inter", sans-serif !important;
  font-size: clamp(1.7rem, 3vw, 2.45rem) !important;
  font-weight: 800 !important;
  letter-spacing: 0;
  line-height: 1.15 !important;
}

.abstract-text {
  max-width: 900px;
  color: var(--muted);
  font-size: 1.08rem;
}

.abstract-text p,
.result-text p {
  margin-bottom: 1.25rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.feature-card {
  position: relative;
  min-height: 100%;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transform: translateY(0);
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease, background 220ms ease;
}

.feature-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--teal), var(--green));
  opacity: 0;
  transform: scaleX(0.35);
  transform-origin: left center;
  transition: opacity 220ms ease, transform 220ms ease;
}

.feature-card:hover {
  border-color: rgb(8 127 140 / 0.34);
  background: #ffffff;
  box-shadow: 0 20px 48px rgb(17 24 39 / 0.16);
  transform: translateY(-10px) scale(1.018);
}

.feature-card:hover::before {
  opacity: 1;
  transform: scaleX(1);
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  background: #e8f5f4;
  color: var(--teal);
  font-size: 1rem;
  transition: transform 220ms ease, box-shadow 220ms ease, background 220ms ease, color 220ms ease;
}

.feature-card:hover .feature-icon {
  color: white;
  background: var(--teal);
  box-shadow: 0 10px 26px rgb(8 127 140 / 0.28);
  transform: translateY(-2px) scale(1.08);
}

.feature-card:nth-child(2) .feature-icon {
  background: #f8ecea;
  color: var(--coral);
}

.feature-card:nth-child(2)::before {
  background: linear-gradient(90deg, var(--coral), #d97757);
}

.feature-card:nth-child(2):hover {
  border-color: rgb(178 58 47 / 0.34);
}

.feature-card:nth-child(2):hover .feature-icon {
  background: var(--coral);
  color: white;
  box-shadow: 0 10px 26px rgb(178 58 47 / 0.24);
}

.feature-card:nth-child(3) .feature-icon {
  background: #edf5ef;
  color: var(--green);
}

.feature-card:nth-child(3)::before {
  background: linear-gradient(90deg, var(--green), #78a65a);
}

.feature-card:nth-child(3):hover {
  border-color: rgb(47 125 87 / 0.34);
}

.feature-card:nth-child(3):hover .feature-icon {
  background: var(--green);
  color: white;
  box-shadow: 0 10px 26px rgb(47 125 87 / 0.24);
}

.feature-card:nth-child(4) .feature-icon {
  background: #f2f0e7;
  color: #8a6d1d;
}

.feature-card:nth-child(4)::before {
  background: linear-gradient(90deg, #8a6d1d, #c49a32);
}

.feature-card:nth-child(4):hover {
  border-color: rgb(138 109 29 / 0.34);
}

.feature-card:nth-child(4):hover .feature-icon {
  background: #8a6d1d;
  color: white;
  box-shadow: 0 10px 26px rgb(138 109 29 / 0.22);
}

.feature-card h3 {
  margin: 0 0 0.5rem;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 800;
  transition: color 220ms ease;
}

.feature-card:hover h3 {
  color: var(--teal-dark);
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  transition: color 220ms ease;
}

.feature-card:hover p {
  color: #3f4852;
}

.architecture-figure {
  margin: 0;
}

.architecture-figure a {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow-md);
}

.architecture-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.architecture-figure figcaption {
  max-width: 900px;
  margin: 1rem auto 0;
  color: var(--muted);
  font-size: 0.98rem;
  text-align: center;
}

.demo-heading {
  max-width: 760px;
  margin: 2.75rem auto 1.25rem;
  text-align: center;
}

.demo-heading h3 {
  margin: 0 0 0.5rem;
  color: var(--ink);
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.2;
}

.demo-heading p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.demo-videos {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0;
}

.demo-video {
  padding: 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow-sm);
}

.demo-video h3 {
  margin: 0 0 0.5rem;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 800;
}

.demo-video video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  background: #111;
}

.result-figure {
  margin: 0;
}

.result-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow-md);
}

.result-figure figcaption {
  max-width: 820px;
  margin: 1rem auto 0;
  color: var(--muted);
  font-size: 0.98rem;
  text-align: center;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric {
  padding: 1.25rem;
  border-left: 4px solid var(--teal);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.metric:nth-child(2) {
  border-left-color: var(--coral);
}

.metric:nth-child(3) {
  border-left-color: var(--green);
}

.metric:nth-child(4) {
  border-left-color: #8a6d1d;
}

.metric-value {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--ink);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.result-text {
  color: var(--muted);
  font-size: 1.02rem;
}

.small-caps {
  font-variant: small-caps;
  font-weight: 700;
}

.bibtex-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.copy-bibtex-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--teal);
  border-radius: var(--radius);
  background: var(--teal);
  color: white;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.copy-bibtex-btn:hover {
  background: var(--teal-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.copy-bibtex-btn.copied {
  background: var(--green);
  border-color: var(--green);
}

pre {
  overflow-x: auto;
  padding: 1.25rem !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  background: #f6f8fa !important;
  color: var(--ink) !important;
  font-size: 0.92rem !important;
  box-shadow: var(--shadow-sm);
}

code {
  background: transparent !important;
  color: var(--ink) !important;
  font-family: "SF Mono", "Cascadia Code", "Roboto Mono", Consolas, monospace !important;
}

.scroll-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: none;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition), transform var(--transition), background var(--transition);
}

.scroll-to-top:hover {
  background: var(--teal);
  transform: translateY(-2px);
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.footer {
  padding: 2.5rem 1.5rem;
  border-top: 1px solid var(--line);
  background: var(--wash);
}

.footer .content {
  color: var(--muted);
  font-size: 0.94rem;
}

.footer p {
  margin-bottom: 0;
}

.button:focus,
.copy-bibtex-btn:focus,
a:focus {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

@media screen and (max-width: 1024px) {
  .feature-grid,
  .metrics-grid,
  .demo-videos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media screen and (max-width: 768px) {
  .topbar {
    justify-content: flex-start;
    gap: 1rem;
    overflow-x: auto;
  }

  .hero-body {
    padding: 3rem 1rem 2.5rem;
  }

  .section {
    padding: 3rem 1rem;
  }

  .publication-links {
    flex-direction: column;
    align-items: stretch;
  }

  .link-block,
  .button {
    width: 100%;
  }

  .button {
    justify-content: center;
  }

  .feature-grid,
  .metrics-grid,
  .demo-videos {
    grid-template-columns: 1fr;
  }

  .bibtex-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media print {
  .topbar,
  .scroll-to-top,
  .copy-bibtex-btn {
    display: none;
  }

  .hero-body,
  .section {
    padding: 1.25rem 0;
  }

  .button {
    border: 1px solid var(--ink) !important;
    background: transparent !important;
    color: var(--ink) !important;
    box-shadow: none !important;
  }
}
