:root {
  --bg: #f7fbfc;
  --bg-soft: #eef6f8;
  --surface: #ffffff;
  --surface-strong: #e6f1f4;
  --text: #0f2430;
  --muted: #4f6671;
  --primary: #0d718d;
  --primary-strong: #075f77;
  --accent: #ef8a34;
  --border: #cfe2e9;
  --shadow: 0 16px 40px rgba(8, 47, 64, 0.12);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 12% -4%, #d9f0f7 0%, var(--bg) 38%),
    radial-gradient(circle at 95% 4%, #f5efe3 0%, rgba(245, 239, 227, 0) 40%),
    var(--bg);
  line-height: 1.65;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(
      rgba(13, 113, 141, 0.03) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(13, 113, 141, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  z-index: -1;
}

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

.container {
  width: min(1200px, calc(100% - 3rem));
  margin: 0 auto;
}

.section {
  position: relative;
  padding: 5.5rem 0;
}

.section-soft {
  background: linear-gradient(180deg, rgba(12, 108, 134, 0.06), rgba(12, 108, 134, 0));
}

.section-title {
  margin: 0 0 1.2rem;
  font-family: "Source Serif 4", serif;
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  line-height: 1.2;
}

.section-note {
  margin: 0 0 1.7rem;
  color: var(--muted);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(10px);
  background: rgba(247, 251, 252, 0.9);
  border-bottom: 1px solid rgba(13, 113, 141, 0.15);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  gap: 1rem;
}

.brand {
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--primary-strong);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.1rem;
  margin: 0;
  padding: 0;
}

.nav-link {
  color: var(--muted);
  font-weight: 600;
  position: relative;
  padding-bottom: 0.2rem;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.2rem;
  width: 100%;
  height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

.nav-link.active {
  color: var(--primary-strong);
}

.nav-toggle {
  display: none;
  border: 0;
  background: transparent;
  padding: 0.2rem;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  margin: 5px 0;
  background: var(--primary-strong);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.hero {
  overflow: hidden;
  padding-top: 7rem;
  padding-bottom: 6rem;
}

.hero-glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(45px);
  opacity: 0.28;
  pointer-events: none;
}

.hero-glow-a {
  width: 300px;
  height: 300px;
  right: -30px;
  top: 30px;
  background: #95d4e7;
}

.hero-glow-b {
  width: 260px;
  height: 260px;
  left: -40px;
  bottom: 40px;
  background: #f4c193;
}

.hero-content {
  position: relative;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--primary-strong);
  text-transform: uppercase;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  background: rgba(13, 113, 141, 0.12);
}

#paper-title {
  margin: 1.2rem auto 1rem;
  max-width: 980px;
  font-family: "Source Serif 4", serif;
  font-size: clamp(2rem, 4.7vw, 3.5rem);
  line-height: 1.08;
}

.hero-subtitle {
  margin: 0 auto 1.1rem;
  max-width: 900px;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.2rem);
}

.hero-authors,
.hero-affiliations {
  margin: 0 auto;
  max-width: 900px;
}

.hero-authors {
  margin-bottom: 0.45rem;
  font-weight: 600;
}

.hero-authors a {
  color: var(--primary-strong);
  transition: color 0.2s ease;
}

.hero-authors a:hover {
  color: var(--accent);
}

.hero-affiliations {
  color: var(--muted);
}

.hero-actions {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.7rem 1.1rem;
  border-radius: 12px;
  font-weight: 700;
  border: 1px solid transparent;
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff;
  box-shadow: 0 12px 24px rgba(13, 113, 141, 0.22);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--primary-strong);
}

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

.highlight-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.3rem;
  box-shadow: var(--shadow);
}

.highlight-metric {
  margin: 0;
  font-size: clamp(1.5rem, 3.1vw, 2.2rem);
  color: var(--primary-strong);
  font-weight: 800;
}

.highlight-label {
  margin: 0.35rem 0;
  font-weight: 700;
}

.highlight-detail {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.abstract-text {
  margin: 0;
  color: #29414b;
}

.contribution-grid {
  margin-top: 1.6rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.contribution-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: 0 12px 26px rgba(7, 39, 52, 0.1);
}

.contribution-card p {
  margin: 0;
}

.method-overview {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.method-copy,
.method-visual {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 12px 28px rgba(7, 39, 52, 0.1);
}

.method-copy h3 {
  margin: 0 0 0.7rem;
  font-family: "Source Serif 4", serif;
  font-size: 1.6rem;
}

.method-copy p {
  margin: 0.6rem 0 0;
}

.method-visual img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
}

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

.figure-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(7, 39, 52, 0.1);
}

.figure-media,
.figure-placeholder {
  width: 100%;
  min-height: 185px;
  max-height: 260px;
}

.figure-media img {
  width: 100%;
  height: 100%;
  min-height: 185px;
  object-fit: cover;
  display: block;
}

.figure-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #d9edf4, #f6f3ea);
  color: #30515e;
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  padding: 1rem;
}

.figure-content {
  padding: 1rem;
}

.figure-content h3 {
  margin: 0;
  font-size: 1.03rem;
}

.figure-content p {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.table-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.table-tab {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--primary-strong);
  border-radius: 999px;
  font-weight: 700;
  padding: 0.55rem 1rem;
  cursor: pointer;
}

.table-tab.active {
  background: var(--primary-strong);
  color: #fff;
  border-color: var(--primary-strong);
}

.table-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}

.table-controls label {
  font-weight: 700;
  font-size: 0.95rem;
}

.table-controls input {
  width: min(420px, 100%);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-height: 40px;
  padding: 0 0.75rem;
  font: inherit;
}

.table-controls input:disabled {
  background: #ecf2f4;
  color: #7b8d96;
}

.table-wrapper {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

#results-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

#results-table th,
#results-table td {
  padding: 0.78rem 0.72rem;
  border-bottom: 1px solid #dfeaf0;
  text-align: left;
  vertical-align: middle;
  font-size: 0.93rem;
}

#results-table th {
  background: linear-gradient(180deg, #e7f3f7, #f4f9fb);
  color: #123847;
  font-weight: 800;
  white-space: nowrap;
}

#results-table th button {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  cursor: pointer;
  padding: 0;
}

#results-table tbody tr:hover {
  background: #f2f8fb;
}

#results-table tbody tr.ours-row {
  background: rgba(12, 137, 158, 0.12);
  font-weight: 800;
}

.table-caption {
  margin: 0.9rem 0 0;
  color: var(--muted);
}

.video-group {
  margin-bottom: 2.1rem;
}

.video-group h3 {
  margin: 0 0 0.9rem;
  font-family: "Source Serif 4", serif;
  font-size: 1.65rem;
}

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

.video-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.video-card video {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  background: #d5e4ea;
}

.video-meta {
  padding: 0.9rem;
}

.video-meta h4 {
  margin: 0;
  font-size: 1rem;
}

.video-meta p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

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

.download-card {
  display: block;
  padding: 1.2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.download-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.download-card h3 {
  margin: 0;
}

.download-card p {
  margin: 0.45rem 0 0;
  color: var(--muted);
}

.citation-box {
  position: relative;
  background: #0f2d3a;
  color: #dceef4;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 22px 38px rgba(7, 39, 52, 0.25);
}

.citation-box pre {
  margin: 0;
  padding: 1.4rem;
  overflow-x: auto;
  font-size: 0.92rem;
  line-height: 1.6;
}

.copy-btn {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  border: 0;
  border-radius: 8px;
  min-height: 36px;
  padding: 0 0.8rem;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: #1e819d;
  cursor: pointer;
}

.copy-btn:hover {
  background: #126b84;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0 2.2rem;
  text-align: center;
  color: var(--muted);
}

.site-footer p {
  margin: 0.35rem 0;
}

.footer-muted {
  font-size: 0.9rem;
}

.toast {
  position: fixed;
  right: 1.3rem;
  bottom: 1.3rem;
  max-width: min(340px, calc(100% - 2rem));
  background: #163d4d;
  color: #fff;
  border-radius: 10px;
  padding: 0.75rem 0.95rem;
  font-size: 0.92rem;
  box-shadow: 0 14px 30px rgba(6, 30, 40, 0.26);
  transform: translateY(22px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 50;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

[data-reveal].visible {
  opacity: 1;
  transform: translateY(0);
}

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

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

  .method-overview,
  .figure-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .container {
    width: min(1200px, calc(100% - 1.2rem));
  }

  .section {
    padding: 4.4rem 0;
  }

  .navbar {
    min-height: 64px;
  }

  .nav-toggle {
    display: inline-block;
  }

  .nav-links {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(247, 251, 252, 0.98);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: center;
    padding: 0.8rem 0 1rem;
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.24s ease, opacity 0.24s ease;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .hero {
    padding-top: 6.4rem;
  }

  .highlights-grid,
  .contribution-grid,
  .video-grid,
  .download-grid {
    grid-template-columns: 1fr;
  }

  .table-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .copy-btn {
    position: static;
    margin: 0 1.3rem 1rem;
  }
}
