:root {
  --bg: #0f1117;
  --bg2: #191f2b;
  --ink: #e6edf7;
  --ink-soft: #a8b5cb;
  --line: rgba(137, 166, 209, 0.24);
  --card: rgba(24, 32, 48, 0.82);
  --card2: rgba(19, 27, 41, 0.92);
  --teal: #3dd5c1;
  --amber: #f6b96c;
  --violet: #9a8bff;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
  --radius: 18px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 7% 6%, rgba(61, 213, 193, 0.15), transparent 26%),
    radial-gradient(circle at 92% 1%, rgba(246, 185, 108, 0.12), transparent 24%),
    linear-gradient(145deg, var(--bg), var(--bg2));
}

html {
  scroll-behavior: smooth;
}

body {
  line-height: 1.65;
  background-attachment: fixed;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(12px);
  background: rgba(13, 18, 29, 0.86);
  border-bottom: 1px solid rgba(141, 171, 217, 0.18);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: #f0f6ff;
  font-family: Sora, Inter, sans-serif;
  font-weight: 700;
}

.brand-mark {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--teal), var(--amber));
  box-shadow: 0 0 0 4px rgba(61, 213, 193, 0.16);
}

.nav nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.nav nav a {
  text-decoration: none;
  color: #adbbd2;
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 500;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav nav a:hover {
  color: #eef6ff;
  background: rgba(86, 117, 163, 0.25);
}

.nav nav a.active {
  color: #0f1728;
  background: linear-gradient(135deg, #4fe2c9, #86cbff);
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  color: #101525;
  background: linear-gradient(125deg, #4ce1c8, #f4c084);
  box-shadow: 0 10px 22px rgba(61, 213, 193, 0.2);
}

.btn-soft {
  background: rgba(20, 29, 46, 0.88);
  color: #c2d3ef;
  border: 1px solid rgba(136, 166, 210, 0.26);
  box-shadow: none;
}

.btn-sm {
  padding: 7px 11px;
  font-size: 0.88rem;
}

h1,
h2,
h3 {
  margin: 0 0 10px;
  line-height: 1.2;
}

h1 {
  font-family: Sora, Inter, sans-serif;
  font-size: clamp(2rem, 4.8vw, 3.5rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.45rem, 2.6vw, 2.1rem);
}

h3 {
  font-size: 1.04rem;
}

p,
li {
  color: var(--ink-soft);
}

.hero {
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  gap: 16px;
  align-items: center;
  padding: 36px 0 18px;
}

.hero-bottom {
  grid-column: 1 / -1;
  margin-top: 2px;
}

.hero-insight-card h3 {
  margin-bottom: 6px;
}

.hero-insight-card p {
  margin: 0;
}

.pill {
  display: inline-flex;
  margin: 0 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(112, 219, 202, 0.35);
  background: rgba(61, 213, 193, 0.14);
  color: #b9f2e8;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 5px 11px;
}

.subtitle {
  font-size: 1.04rem;
}

.author-hero {
  margin-top: 12px;
  border: 1px solid rgba(138, 169, 214, 0.22);
  border-radius: 12px;
  background: linear-gradient(150deg, rgba(35, 46, 70, 0.74), rgba(25, 34, 51, 0.88));
  padding: 9px 12px;
}

.author-hero-names {
  margin: 0;
  color: #d5e3f8;
  font-size: 0.92rem;
  font-weight: 600;
}

.author-hero-affils {
  margin: 6px 0 0;
  color: #a8bddf;
  font-size: 0.84rem;
}

.author-hero-affils span {
  display: block;
}

.hero-highlight {
  margin-top: 10px;
  border-left: 3px solid var(--amber);
  border-radius: 0 8px 8px 0;
  background: linear-gradient(90deg, rgba(246, 185, 108, 0.14), transparent);
  padding: 6px 0 6px 10px;
}

.cta {
  margin-top: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.card {
  background: linear-gradient(165deg, var(--card), var(--card2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 15px;
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(137, 176, 230, 0.42);
}

.hero-figure {
  padding: 10px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.metrics article {
  border: 1px solid rgba(144, 174, 217, 0.22);
  border-radius: 14px;
  background: rgba(24, 34, 53, 0.8);
  text-align: center;
  padding: 10px 8px;
}

.metrics h3 {
  margin-bottom: 1px;
  color: #eaf3ff;
  font-size: clamp(1rem, 1.7vw, 1.34rem);
}

.metrics p {
  margin: 0;
  font-size: 0.82rem;
}

.section {
  padding: 36px 0 8px;
  scroll-margin-top: 92px;
}

.grid2,
.grid3 {
  display: grid;
  gap: 16px;
  align-items: start;
}

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

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

.method-flow .card {
  position: relative;
}

.method-flow .card:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -14px;
  top: 50%;
  transform: translateY(-50%);
  color: #8ec8f8;
  opacity: 0.62;
  font-weight: 700;
}

ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.method-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.method-panel {
  display: none;
  margin-top: 10px;
}

.method-panel.show {
  display: block;
  animation: fadeIn 0.22s ease;
}

.figure-card {
  padding: 11px;
  overflow: hidden;
}

.figure-card img {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 640px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid rgba(143, 177, 224, 0.26);
  background: rgba(12, 18, 30, 0.6);
  display: block;
  cursor: zoom-in;
}

.hero-figure img {
  max-height: 800px;
}

.figure-card figcaption {
  margin-top: 8px;
  border-top: 1px dashed rgba(137, 169, 214, 0.28);
  padding: 8px 4px 2px;
  color: #b4c9e7;
  font-size: 0.9rem;
}

.full-width-table-card {
  margin-top: 16px;
}

.table-scroll {
  margin-top: 10px;
  overflow-x: auto;
  border: 1px solid rgba(137, 169, 214, 0.22);
  border-radius: 12px;
  background: rgba(16, 24, 39, 0.72);
}

.scroll-hint {
  margin: 0 0 8px;
  color: #94abd0;
  font-size: 0.82rem;
}

.wide-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.wide-table th,
.wide-table td {
  border-bottom: 1px solid rgba(137, 169, 214, 0.2);
  padding: 8px 10px;
  text-align: left;
  font-size: 0.86rem;
  color: #c1d2ea;
  white-space: nowrap;
}

.wide-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: rgba(22, 34, 54, 0.96);
  color: #e5f0ff;
}

.wide-table th:first-child,
.wide-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: rgba(22, 33, 52, 0.98);
  box-shadow: 1px 0 0 rgba(137, 169, 214, 0.24);
}

.wide-table thead th:first-child {
  z-index: 4;
}

.wide-table .best-row td {
  background: rgba(58, 117, 93, 0.22);
  color: #e9fff8;
  font-weight: 700;
}

.note {
  margin: 8px 0 0;
  font-size: 0.86rem;
  color: #9bb3d6;
}

.dataset-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.tab-btn {
  border: 1px solid rgba(136, 167, 210, 0.26);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 600;
  cursor: pointer;
  background: rgba(20, 30, 46, 0.92);
  color: #bfd2ee;
}

.tab-btn.active {
  color: #121a2b;
  background: linear-gradient(125deg, #4edec8, #ffc881);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeIn 0.22s ease;
}

.resource-card {
  min-height: 120px;
}

.resource-link {
  text-decoration: none;
}

.resource-link h3 {
  color: #ecf3ff;
}

.contact-link {
  color: #66dbc8;
  text-decoration: none;
  font-weight: 600;
}

.contact-link:hover {
  text-decoration: underline;
}

.bib-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

pre {
  margin: 0;
  border-radius: 12px;
  border: 1px solid rgba(137, 169, 214, 0.24);
  background: rgba(16, 24, 39, 0.82);
  color: #d0e1f8;
  padding: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.84rem;
}

.footer {
  margin-top: 24px;
  padding: 12px 0 24px;
}

.footer p {
  margin: 0;
  text-align: center;
  color: #8fa9cf;
  font-size: 0.9rem;
}

.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 80;
  background: rgba(6, 10, 16, 0.9);
}

.lightbox.show {
  display: flex;
}

.lightbox img {
  max-width: min(1240px, 95vw);
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 20px;
  border: 0;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.5rem;
  color: #111a2b;
  background: #d7e6ff;
}

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

@media (max-width: 1080px) {
  .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .method-flow .card::after {
    display: none;
  }
}

@media (max-width: 820px) {
  .hero,
  .grid2,
  .grid3 {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 560px) {
  .container {
    width: calc(100% - 26px);
  }

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

  .nav {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .nav nav {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
  }
}
