:root {
  --bg: #f4fbff;
  --bg2: #eef7f4;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-2: rgba(249, 254, 251, 0.94);
  --ink: #10203a;
  --ink-soft: #42536f;
  --line: rgba(89, 129, 178, 0.2);
  --cyan: #46c5d9;
  --teal: #3aa88f;
  --blue: #5e8dff;
  --mint: #63dfbf;
  --shadow: 0 14px 34px rgba(93, 126, 168, 0.14);
  --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 4% 7%, rgba(96, 211, 229, 0.2), transparent 25%),
    radial-gradient(circle at 94% 1%, rgba(120, 186, 255, 0.18), transparent 22%),
    linear-gradient(145deg, var(--bg), var(--bg2));
}

html {
  scroll-behavior: smooth;
}

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

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.25;
  background:
    linear-gradient(rgba(78, 165, 214, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(78, 165, 214, 0.14) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(circle at center, black 30%, transparent 85%);
}

.container {
  width: min(1180px, calc(100% - 44px));
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(10px);
  background: rgba(242, 250, 255, 0.82);
  border-bottom: 1px solid rgba(103, 149, 201, 0.22);
}

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

.brand {
  text-decoration: none;
  color: #0f2747;
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(120deg, var(--cyan), var(--mint));
  box-shadow: 0 0 0 5px rgba(70, 197, 217, 0.2), 0 0 24px rgba(70, 197, 217, 0.45);
}

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

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

.nav nav a:hover {
  color: #17365f;
  background: rgba(105, 166, 225, 0.2);
}

.nav nav a.active {
  color: #fff;
  background: linear-gradient(125deg, #46c5d9, #5e8dff);
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(125deg, #46c5d9, #5e8dff);
  box-shadow: 0 9px 22px rgba(92, 141, 211, 0.22);
}

.btn-soft {
  background: rgba(236, 246, 255, 0.9);
  color: #31537d;
  border: 1px solid rgba(112, 158, 208, 0.28);
  box-shadow: none;
}

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

h1 {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: clamp(2rem, 4.8vw, 3.45rem);
  letter-spacing: -0.02em;
}

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

h3 {
  font-size: 1.04rem;
}

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

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

.hero-bottom {
  grid-column: 1 / -1;
}

.pill {
  display: inline-flex;
  margin: 0 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(93, 164, 215, 0.4);
  background: rgba(112, 212, 223, 0.18);
  color: #1b5872;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 5px 11px;
}

.subtitle {
  font-size: 1.03rem;
}

.author-hero {
  margin-top: 12px;
  border: 1px solid rgba(116, 161, 208, 0.3);
  border-radius: 12px;
  background: linear-gradient(150deg, rgba(234, 247, 255, 0.9), rgba(243, 253, 248, 0.92));
  padding: 10px 12px;
}

.author-hero-names {
  margin: 0;
  color: #20486e;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.5;
}

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

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

.hero-highlight {
  margin-top: 10px;
  border-left: 3px solid var(--teal);
  border-radius: 0 8px 8px 0;
  background: linear-gradient(90deg, rgba(83, 197, 177, 0.16), transparent);
  padding: 6px 0 6px 10px;
}

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

.card {
  background: linear-gradient(165deg, var(--panel), var(--panel-2));
  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;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(93, 155, 209, 0.34);
}

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

.figure-card img {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 680px;
  object-fit: contain;
  display: block;
  border-radius: 12px;
  border: 1px solid rgba(126, 170, 212, 0.35);
  background: rgba(255, 255, 255, 0.75);
  cursor: zoom-in;
}

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

.figure-card figcaption {
  margin-top: 8px;
  border-top: 1px dashed rgba(118, 158, 205, 0.3);
  padding: 8px 4px 2px;
  color: #516d92;
  font-size: 0.9rem;
}

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

.metrics article {
  border: 1px solid rgba(114, 156, 202, 0.28);
  border-radius: 14px;
  background: rgba(245, 252, 255, 0.9);
  text-align: center;
  padding: 10px 8px;
}

.metrics h3 {
  margin-bottom: 2px;
  color: #21466f;
  font-size: clamp(0.98rem, 1.45vw, 1.26rem);
}

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

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

.grid2,
.grid3,
.grid5 {
  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));
}

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

.gain-grid .card {
  text-align: center;
  padding: 12px 10px;
}

.gain-grid h3 {
  color: #1e4f78;
}

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

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

.table-scroll {
  margin-top: 10px;
  overflow-x: auto;
  border: 1px solid rgba(112, 156, 203, 0.24);
  border-radius: 12px;
  background: rgba(248, 253, 255, 0.82);
}

.result-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 10px;
}

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

.result-panel.show {
  display: block;
  animation: fadeIn 0.2s ease;
}

.result-toggle.active {
  color: #fff;
  background: linear-gradient(125deg, #46c5d9, #5e8dff);
  border-color: transparent;
}

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

.wide-table.compact {
  min-width: 700px;
}

.wide-table th,
.wide-table td {
  border-bottom: 1px solid rgba(118, 160, 205, 0.2);
  padding: 8px 10px;
  text-align: left;
  font-size: 0.85rem;
  color: #35557e;
  white-space: nowrap;
}

.wide-table th {
  white-space: normal;
}

.wide-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: rgba(232, 245, 255, 0.97);
  color: #1d4573;
}

.wide-table th:first-child,
.wide-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: rgba(240, 249, 255, 0.98);
  box-shadow: 1px 0 0 rgba(123, 166, 209, 0.24);
}

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

.wide-table .best-row td {
  background: rgba(95, 205, 179, 0.22);
  color: #1a5b66;
  font-weight: 700;
}

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

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

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

.tab-btn {
  border: 1px solid rgba(120, 165, 212, 0.35);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 600;
  cursor: pointer;
  background: rgba(240, 249, 255, 0.9);
  color: #3c5e89;
}

.tab-btn.active {
  color: #fff;
  background: linear-gradient(125deg, #46c5d9, #5e8dff);
}

.tab-panel {
  display: none;
}

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

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

.contact-card {
  margin-top: 14px;
}

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

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

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

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

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(17, 34, 56, 0.75);
}

.lightbox.show {
  display: flex;
}

.lightbox img {
  max-width: min(1220px, 95vw);
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 16px 42px rgba(16, 34, 56, 0.42);
}

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

@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));
  }

  .grid5 {
    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,
  .grid5 {
    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;
  }
}
