:root {
  --bg: #f4f5f3;
  --surface: #ffffff;
  --ink: #0f172a;
  --ink-soft: #334155;
  --line: #dbe2ea;
  --primary: #c2410c;
  --primary-strong: #9a3412;
  --accent: #0ea5a0;
  --panel: #f7f8fa;
  --hero-soft: #f5f6f7;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.08);
  --shadow-md: 0 8px 20px rgb(15 23 42 / 0.08);
  --radius: 14px;
  --radius-lg: 18px;
  --speed: 0.2s ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
}

h1,
h2,
h3,
h4 {
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -0.015em;
}

a {
  color: inherit;
}

main {
  overflow: hidden;
}

section[id] {
  scroll-margin-top: 1.2rem;
}

.hero-main {
  background: var(--hero-soft);
  color: var(--ink);
  position: relative;
  border-bottom: 1px solid #e2e8f0;
}

.hero-main .hero-body {
  padding: 5.4rem 1.5rem 4.6rem;
  position: relative;
  z-index: 1;
}

.quick-nav-wrap {
  background: #ffffff;
  border-bottom: 1px solid #e5eaf1;
}

.quick-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.95rem 0;
}

.quick-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.36rem 0.72rem;
  font-size: 0.84rem;
  border-radius: 999px;
  color: #475569;
  text-decoration: none;
  border: 1px solid #d8e1ec;
  background: #fff;
  transition: background var(--speed), border-color var(--speed), color var(--speed);
}

.quick-nav a:hover {
  background: #f8fafc;
  border-color: #b9c5d3;
  color: #1f2937;
}

.quick-nav a.is-active {
  background: #eef2f7;
  border-color: #bec9d7;
  color: #1e293b;
}

.badge-track {
  display: inline-block;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #f8fafc;
  border: 1px solid #dbe4ee;
  color: #64748b;
  border-radius: 999px;
  padding: 0.42rem 0.85rem;
  margin-bottom: 1.2rem;
  font-weight: 600;
}

.page-title {
  color: #1f2937;
  font-size: clamp(2rem, 5.2vw, 3.45rem);
  line-height: 1.1;
  margin-bottom: 1rem !important;
}

.page-subtitle {
  color: #475569;
  max-width: 940px;
  margin: 0 auto 1.7rem !important;
  font-size: clamp(1rem, 2.25vw, 1.24rem);
}

.authors {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-bottom: 0.6rem;
  font-weight: 700;
  color: #0f172a;
}

.authors a {
  color: #0f172a;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--speed), border-color var(--speed);
}

.authors a:hover {
  color: #b45309;
  border-color: rgb(180 83 9 / 0.5);
}

.affils {
  color: #5f6f84;
  margin-bottom: 0.15rem !important;
}

.equal-note {
  color: #5f6f84;
  font-style: italic;
  margin-bottom: 1.4rem;
}

.cta-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.62rem;
}

.button {
  border-radius: 10px !important;
  font-weight: 600 !important;
  border-width: 2px !important;
  transition: background var(--speed), color var(--speed), border-color var(--speed) !important;
}

.button.is-dark {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
  box-shadow: none;
}

.button.is-dark:hover {
  background: var(--primary-strong) !important;
  border-color: var(--primary-strong) !important;
}

.button.is-light {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
  box-shadow: none;
}

.button.is-light:hover {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
}

.teaser-block .hero-body {
  padding-top: 2.6rem;
  padding-bottom: 2rem;
}

.teaser-block img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgb(148 163 184 / 0.25);
}

.teaser-caption {
  text-align: center;
  margin-top: 0.9rem;
  color: var(--ink-soft);
  font-size: 1rem;
}

.metric-section {
  padding-top: 1.25rem;
  padding-bottom: 1.3rem;
  border-top: 1px solid #eef2f7;
}

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

.metric-card {
  border: 1px solid #dbe3ec;
  border-radius: 12px;
  background: #fff;
  padding: 0.9rem 1rem;
}

.metric-value {
  margin: 0 0 0.25rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.18rem;
  color: #c2410c;
}

.metric-card p {
  margin: 0;
  color: #4b5563;
  font-size: 0.88rem;
  line-height: 1.45;
}

.section {
  padding: 3.5rem 1.5rem;
}

.section-paper {
  background: var(--surface);
}

.section-panel {
  background: var(--panel);
  border-top: 1px solid rgb(148 163 184 / 0.12);
  border-bottom: 1px solid rgb(148 163 184 / 0.12);
}

.title.is-3 {
  margin-bottom: 1.8rem !important;
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.abstract-text {
  color: #334155;
  font-size: 1.01rem;
  line-height: 1.85;
}

.card-panel {
  background: #fff;
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: none;
}

.card-panel img {
  border-radius: 12px;
}

.figure-note {
  margin-top: 0.75rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.contrib-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem;
  height: 100%;
  box-shadow: none;
  transition: border-color var(--speed), background var(--speed);
}

.contrib-card:hover {
  border-color: #cbd5e1;
  background: #fcfcfd;
}

.contrib-card h3 {
  margin: 0 0 0.6rem;
  font-size: 1.07rem;
  color: #1e293b;
}

.contrib-card p {
  margin: 0;
  color: #475569;
}

.table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: none;
}

.result-table {
  margin: 0;
  min-width: 920px;
}

.result-table thead th {
  background: #0f172a;
  color: #f8fafc;
  border-color: #334155 !important;
  font-size: 0.92rem;
  white-space: nowrap;
}

.result-table td,
.result-table th {
  vertical-align: middle;
}

.group-row td {
  background: #fff7ed !important;
  color: #9a3412;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.table-hint {
  margin-top: 0.6rem;
  margin-bottom: 0;
  font-size: 0.82rem;
  color: #6b7280;
  text-align: right;
}

.framed-figure {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 0.55rem;
  box-shadow: none;
}

.framed-figure img {
  border-radius: 11px;
}

.framed-figure.compact {
  padding: 0.35rem;
}

.mini-note {
  margin-top: 0.56rem;
  color: #475569;
  font-size: 0.88rem;
}

.takeaway-list {
  margin-top: 0;
  margin-bottom: 0;
}

.takeaway-list li {
  margin-bottom: 0.65rem;
}

.bib-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.copy-btn {
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  padding: 0.58rem 1.1rem;
  cursor: pointer;
  transition: background var(--speed);
  box-shadow: none;
}

.copy-btn:hover {
  background: var(--primary-strong);
}

.copy-btn.copied {
  background: #0f766e;
}

pre {
  background: #0f172a !important;
  border-radius: 14px !important;
  border: 1px solid #1e293b !important;
  color: #dbeafe !important;
  box-shadow: var(--shadow-sm);
}

code {
  background: transparent !important;
  color: inherit !important;
  font-family: 'SF Mono', 'Monaco', 'Menlo', monospace !important;
  font-size: 0.88rem;
}

.footer {
  background: #0f172a;
  color: #cbd5e1;
  padding: 2.6rem 1.5rem;
}

.footer a {
  color: #fda04d;
}

.visitor-map-section {
  border-top: 1px solid #e5eaf1;
  padding-top: 2.2rem;
  padding-bottom: 2rem;
}

.visitor-map-note {
  margin-top: -0.35rem;
  margin-bottom: 0.9rem;
  color: #64748b;
}

.visitor-map-wrap {
  display: flex;
  justify-content: center;
}

.visitor-map-wrap img {
  max-width: min(520px, 100%);
  height: auto;
  border: 1px solid #dbe3ec;
  border-radius: 12px;
}

.scroll-to-top {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  width: 45px;
  height: 45px;
  border: none;
  border-radius: 50%;
  background: #1f2937;
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity var(--speed), visibility var(--speed), transform var(--speed);
  z-index: 1300;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.resource-fab {
  position: fixed;
  top: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  z-index: 1000;
}

.resource-btn {
  background: #ffffff;
  color: #334155;
  border: 2px solid #dbe2ea;
  border-radius: 14px;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.75rem 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform var(--speed), box-shadow var(--speed), background var(--speed), border-color var(--speed), color var(--speed);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.resource-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #c2410c;
  flex-shrink: 0;
}

.resource-btn .dropdown-arrow {
  font-size: 0.72rem;
  line-height: 1;
  transition: transform var(--speed);
}

.resource-btn.active .dropdown-arrow {
  transform: rotate(180deg);
}

.resource-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgb(15 23 42 / 0.12);
  background: #f8fafc;
  border-color: #c2410c;
  color: #1f2937;
}

.resource-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  width: 400px;
  max-width: 90vw;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 20px 38px rgb(15 23 42 / 0.16);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity var(--speed), visibility var(--speed), transform var(--speed);
  max-height: 70vh;
  overflow-y: auto;
}

.resource-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.resource-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 0.85rem 1rem;
}

.resource-head h4 {
  margin: 0;
  font-size: 1rem;
}

.resource-close {
  border: none;
  background: #fff;
  font-size: 1rem;
  cursor: pointer;
  color: #64748b;
}

.resource-item {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 0.8rem;
  padding: 0.8rem 1rem;
  text-decoration: none;
  color: inherit;
  border-top: 1px solid #eef2f7;
  transition: background var(--speed);
}

.resource-item:first-of-type {
  border-top: none;
}

.resource-item:hover {
  background: #f8fafc;
}

.resource-item.is-disabled {
  background: #f8fafc;
  color: #64748b;
  cursor: not-allowed;
}

.resource-item.is-disabled:hover {
  background: #f8fafc;
}

.resource-item.is-disabled span {
  font-size: 0.76rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.resource-item strong {
  display: block;
  margin-bottom: 0.2rem;
}

.resource-item p {
  margin: 0;
  font-size: 0.87rem;
  color: #64748b;
}

/* Figure swiper */
.figure-swiper {
  border: 1px solid #dde5ef;
  border-radius: 14px;
  background: #fff;
  padding: 0.9rem;
}

.figure-swiper-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.9rem;
  margin-bottom: 0.75rem;
}

.figure-swiper-header .title {
  margin: 0 !important;
  font-size: 1.02rem;
}

.figure-swiper-header .title::after {
  display: none !important;
}

.figure-swiper-header p {
  margin: 0;
  color: #64748b;
  font-size: 0.84rem;
}

.figure-swiper-viewport {
  overflow: hidden;
  border-radius: 12px;
  transition: height 0.28s ease;
}

.figure-swiper-track {
  display: flex;
  align-items: flex-start;
  transition: transform 0.35s ease;
  will-change: transform;
}

.figure-swiper-slide {
  flex: 0 0 100%;
  min-width: 100%;
  padding: 0.1rem;
}

.figure-swiper-slide .mini-note {
  margin-top: 0.6rem;
}

.figure-swiper-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  margin-top: 0.7rem;
}

.swiper-btn {
  border: 1px solid #ced9e6;
  background: #fff;
  color: #334155;
  border-radius: 8px;
  width: 40px;
  height: 34px;
  cursor: pointer;
  transition: background var(--speed), border-color var(--speed), color var(--speed);
}

.swiper-btn:hover {
  background: #f8fafc;
  border-color: #9fb0c6;
}

.swiper-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex: 1;
}

.swiper-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: none;
  background: #c9d5e2;
  cursor: pointer;
  transition: transform var(--speed), background var(--speed);
}

.swiper-dot.is-active {
  background: #64748b;
  transform: scale(1.2);
}

/* Subtle scroll reveal */
.reveal-item {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.45s ease, transform 0.45s ease;
  backface-visibility: hidden;
}

.reveal-item.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1024px) {
  .section {
    padding: 3rem 1.1rem;
  }

  .hero-main .hero-body {
    padding: 4.5rem 1rem 3.9rem;
  }
}

@media (max-width: 768px) {
  .page-title {
    font-size: 1.9rem;
  }

  .quick-nav {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding: 0.75rem 0.1rem;
    scrollbar-width: thin;
  }

  .quick-nav a {
    white-space: nowrap;
  }

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

  .abstract-text {
    font-size: 0.95rem;
    line-height: 1.72;
  }

  .resource-fab {
    top: auto;
    bottom: 2rem;
    right: 1rem;
  }

  .resource-dropdown {
    position: absolute;
    right: -1rem;
    top: auto;
    bottom: calc(100% + 0.5rem);
    width: calc(100vw - 2rem);
  }

  .figure-swiper {
    padding: 0.68rem;
  }

  .figure-swiper-header {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 0.55rem;
  }

  .table-wrap {
    border-radius: 12px;
  }

  .bib-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }

  .scroll-to-top {
    right: 1rem;
    bottom: 5.2rem;
  }
}

@media (max-width: 480px) {
  .authors {
    font-size: 0.98rem;
  }

  .affils {
    font-size: 0.9rem;
  }

  .button {
    width: 100%;
    max-width: 260px;
  }

  .cta-row {
    flex-direction: column;
    align-items: center;
  }

  .table-hint {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }

  .reveal-item,
  .reveal-item.reveal-visible {
    opacity: 1 !important;
    transform: none !important;
  }
}
