:root {
  --bg: #06111f;
  --bg2: #0a1a2e;
  --panel: rgba(12, 27, 46, 0.78);
  --panel-2: rgba(9, 23, 41, 0.88);
  --ink: #dbe9ff;
  --ink-soft: #9eb6d8;
  --line: rgba(123, 167, 224, 0.26);
  --cyan: #37d7ff;
  --blue: #6ca3ff;
  --violet: #9b7cff;
  --mint: #37efc7;
  --shadow: 0 18px 40px rgba(0, 7, 16, 0.35);
  --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 10% 8%, rgba(65, 146, 255, 0.18), transparent 30%),
    radial-gradient(circle at 82% 0%, rgba(91, 68, 255, 0.15), transparent 25%),
    linear-gradient(145deg, var(--bg), var(--bg2));
}

html {
  scroll-behavior: smooth;
}

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

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(140, 191, 255, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140, 191, 255, 0.16) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at center, black 20%, 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;
  border-bottom: 1px solid rgba(88, 142, 209, 0.35);
  background: rgba(5, 16, 31, 0.84);
  backdrop-filter: blur(12px);
}

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

.brand {
  text-decoration: none;
  color: #eef5ff;
  font-family: Manrope, Inter, sans-serif;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  letter-spacing: 0.01em;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(120deg, var(--cyan), var(--mint));
  box-shadow: 0 0 0 5px rgba(55, 215, 255, 0.16), 0 0 28px rgba(55, 215, 255, 0.45);
}

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

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

.nav nav a:hover {
  color: #e7f3ff;
  background: rgba(90, 147, 214, 0.2);
}

.nav nav a.active {
  color: #091222;
  background: linear-gradient(120deg, #53ddff, #8fcbff);
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  color: #0a1426;
  background: linear-gradient(125deg, #57dbff, #78adff 50%, #9a82ff);
  box-shadow: 0 10px 22px rgba(79, 155, 255, 0.3);
}

.btn-soft {
  background: rgba(10, 28, 49, 0.9);
  color: #c5daf8;
  border: 1px solid rgba(127, 171, 225, 0.32);
  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: Manrope, Inter, sans-serif;
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  letter-spacing: -0.02em;
}

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

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: 34px 0 16px;
}

.pill {
  display: inline-flex;
  margin: 0 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(115, 173, 236, 0.42);
  background: rgba(56, 125, 198, 0.16);
  color: #bfe3ff;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 5px 11px;
}

.subtitle {
  font-size: 1.05rem;
  max-width: 740px;
}

.author-hero {
  margin-top: 12px;
  border: 1px solid rgba(126, 170, 230, 0.28);
  border-radius: 12px;
  background: linear-gradient(150deg, rgba(20, 44, 73, 0.72), rgba(14, 34, 60, 0.8));
  padding: 10px 12px;
}

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

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

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

.hero-highlight {
  margin-top: 10px;
  border-left: 3px solid var(--cyan);
  padding: 6px 0 6px 10px;
  background: linear-gradient(90deg, rgba(28, 64, 106, 0.35), transparent);
  border-radius: 0 8px 8px 0;
}

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

.card {
  background: linear-gradient(160deg, 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, box-shadow 0.24s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(117, 194, 255, 0.44);
  box-shadow: 0 20px 44px rgba(0, 6, 16, 0.4);
}

.hero-figure {
  padding: 10px;
}

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

.metrics article {
  border-radius: 14px;
  border: 1px solid rgba(128, 176, 236, 0.25);
  background: rgba(14, 32, 57, 0.8);
  padding: 10px 8px;
  text-align: center;
}

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

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

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

.figure-card img {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 620px;
  object-fit: contain;
  display: block;
  border-radius: 12px;
  border: 1px solid rgba(118, 171, 231, 0.35);
  background: rgba(4, 14, 27, 0.75);
  cursor: zoom-in;
}

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

.figure-card figcaption {
  margin-top: 8px;
  border-top: 1px dashed rgba(120, 165, 218, 0.28);
  padding: 8px 4px 2px;
  color: #aac8ec;
  font-size: 0.9rem;
}

.method-flow {
  margin-top: 16px;
}

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

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

.method-interactive p {
  margin-top: 0;
}

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

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

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

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

.stat-card p {
  margin: 5px 0;
}

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

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

.table-scroll {
  margin-top: 10px;
  overflow-x: auto;
  border: 1px solid rgba(123, 167, 224, 0.22);
  border-radius: 12px;
  background: rgba(7, 20, 36, 0.72);
}

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

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

.wide-table th,
.wide-table td {
  border-bottom: 1px solid rgba(123, 167, 224, 0.2);
  padding: 8px 10px;
  text-align: left;
  font-size: 0.88rem;
  color: #b8d4f6;
}

.wide-table thead th {
  position: sticky;
  top: 0;
  background: rgba(13, 31, 56, 0.96);
  color: #d8ecff;
}

.wide-table th:first-child,
.wide-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: rgba(11, 28, 49, 0.98);
  box-shadow: 1px 0 0 rgba(123, 167, 224, 0.28);
}

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

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

.wide-table tbody tr:hover td {
  background: rgba(56, 120, 194, 0.12);
}

.authors {
  margin-top: 0;
  font-weight: 500;
}

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

.chips span {
  border-radius: 999px;
  border: 1px solid rgba(126, 170, 230, 0.35);
  background: rgba(19, 40, 69, 0.84);
  color: #b8d4f6;
  padding: 4px 10px;
  font-size: 0.82rem;
}

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

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

pre {
  margin: 0;
  border-radius: 12px;
  border: 1px solid rgba(128, 176, 236, 0.3);
  background: rgba(7, 20, 36, 0.86);
  color: #bcdbff;
  padding: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.84rem;
}

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

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

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

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

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

.method-link {
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.method-link.is-linked {
  border-color: rgba(87, 219, 255, 0.62);
  box-shadow: 0 24px 42px rgba(0, 23, 45, 0.5);
}

.method-link.is-linked figcaption {
  color: #d3ecff;
}

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

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

.lightbox.show {
  display: flex;
}

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

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

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