:root {
  color-scheme: light;
  --bg: #ffffff;
  --paper: #f4fbff;
  --surface: #ffffff;
  --surface-soft: #f4f9fb;
  --line: rgba(24, 50, 63, 0.14);
  --line-strong: rgba(24, 50, 63, 0.24);
  --text: #182a33;
  --muted: #4b5e68;
  --accent: #177e9c;
  --accent-2: #0f9f6e;
  --accent-soft: rgba(23, 126, 156, 0.1);
  --shadow: 0 18px 48px rgba(24, 50, 63, 0.1);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 999px;
  --max: 960px;
  --wide: 1120px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 92px; }
html, body { overflow-x: hidden; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background:
    radial-gradient(circle at 12% 8%, rgba(126, 207, 230, 0.24), transparent 28rem),
    radial-gradient(circle at 88% 18%, rgba(15, 159, 110, 0.13), transparent 24rem),
    linear-gradient(rgba(24, 50, 63, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 50, 63, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, #ffffff 0%, #f4fbff 44%, #ffffff 100%);
  background-size: auto, auto, 76px 76px, 76px 76px, auto;
  color: var(--text);
  letter-spacing: -0.01em;
}
body.modal-open { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p { color: var(--muted); font-size: 1.16rem; line-height: 1.82; }

.page-shell { width: min(100%, 1440px); margin: 0 auto; }
.nav {
  position: sticky;
  top: 16px;
  z-index: 10;
  width: min(calc(100% - 32px), var(--wide));
  margin: 16px auto 0;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 30px rgba(24, 50, 63, 0.07);
}
.brand, .nav-links { display: flex; align-items: center; gap: 10px; }
.brand { font-weight: 780; letter-spacing: -0.035em; }
.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #62c6df);
  color: white;
  box-shadow: 0 10px 28px rgba(23, 126, 156, 0.24);
  font-size: 0.76rem;
  letter-spacing: -0.05em;
}
.nav-links a {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.92rem;
  transition: color 160ms ease, background 160ms ease;
}
.nav-links a:hover, .nav-links a.is-active { color: #0f5f75; background: var(--accent-soft); }

.section-pad { width: min(calc(100% - 32px), var(--wide)); margin: 0 auto; padding: 78px 0; }
.hero {
  min-height: 680px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.hero-copy { width: min(100%, var(--max)); margin: 0 auto; }
.hero-copy h1 {
  margin: 20px auto;
  max-width: 1020px;
  color: var(--text);
  font-size: clamp(2.45rem, 5vw, 4.45rem);
  line-height: 1.03;
  letter-spacing: -0.072em;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 6px rgba(15, 159, 110, 0.1), 0 0 20px rgba(15, 159, 110, 0.42);
}
.author-block { width: fit-content; max-width: 100%; margin: 22px auto 0; }
.author-block p { margin: 0; color: var(--text); }
.author-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(15, 159, 110, 0.22);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.18em;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}
.author-link:hover,
.author-link:focus-visible {
  color: #0f6f50;
  text-decoration-color: rgba(15, 159, 110, 0.78);
  outline: none;
}
.affiliations, .publication-line { color: var(--muted) !important; font-size: 0.98rem; }
.publication-line { margin-top: 8px !important; }
.cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }
.button {
  display: inline-flex;
  min-height: 42px;
  min-width: 106px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font-weight: 730;
  box-shadow: 0 6px 18px rgba(24, 50, 63, 0.07);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.button:hover, .button:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(23, 126, 156, 0.38);
  box-shadow: 0 12px 26px rgba(24, 50, 63, 0.11);
  outline: none;
}
.button-primary { border-color: transparent; background: #12303b; color: white; }

.paper-section, .citation { width: min(calc(100% - 32px), var(--max)); margin: 0 auto; padding: 64px 0; }
.paper-section + .paper-section, .paper-section + .section-pad, .section-pad + .paper-section { border-top: 1px solid rgba(24, 50, 63, 0.08); }
.paper-section h2, .citation h2 {
  margin: 12px auto 28px;
  max-width: 940px;
  color: var(--text);
  text-align: center;
  font-size: clamp(2rem, 3.4vw, 3.15rem);
  line-height: 1.18;
  letter-spacing: -0.045em;
}
.paper-section p, .citation > p { max-width: 900px; margin: 0 auto 18px; text-align: left; text-wrap: pretty; }


.project-figure { position: relative; width: 100%; margin: 0 auto 58px; }
.project-figure:last-child { margin-bottom: 0; }
.project-figure-wide { width: min(900px, calc(100vw - 48px)); margin-left: 50%; transform: translateX(-50%); }
.project-figure img {
  width: 100%;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: white;
  box-shadow: var(--shadow);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.paper-table-figure { width: min(496px, calc(100vw - 56px)); margin-left: 50%; transform: translateX(-50%); }
.paper-table-figure-narrow { width: min(416px, calc(100vw - 56px)); }
.paper-table-figure img { border-radius: 10px; }
#method-overview { width: min(620px, calc(100vw - 48px)); }
.figure-pair-primary { max-width: 440px; }
.project-figure figcaption {
  max-width: 920px;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.74;
  text-align: left;
}
.project-figure figcaption strong { color: var(--text); font-weight: 780; }
.project-figure::after {
  content: "⌕ Inspect";
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: inline-flex;
  padding: 7px 11px;
  border: 1px solid rgba(24, 50, 63, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: rgba(24, 50, 63, 0.68);
  box-shadow: 0 10px 24px rgba(24, 50, 63, 0.08);
  font-size: 0.82rem;
  font-weight: 760;
  pointer-events: none;
  opacity: 0.76;
  transition: opacity 160ms ease, transform 160ms ease;
}
.project-figure:hover::after, .project-figure:focus-within::after { opacity: 1; transform: translateY(-1px); }
.zoomable-figure { cursor: zoom-in; }
.project-figure:hover img, .project-figure:focus-within img {
  border-color: rgba(23, 126, 156, 0.25);
  box-shadow: 0 24px 60px rgba(24, 50, 63, 0.14);
}
.zoomable-figure:focus-visible { outline: 3px solid rgba(23, 126, 156, 0.42); outline-offset: 4px; }

.citation pre {
  margin: 0 auto;
  max-width: 900px;
  overflow-x: auto;
  padding: 58px 24px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #f7fbfd;
  color: #12303b;
  font-family: var(--mono);
  font-size: 0.92rem;
  line-height: 1.65;
  box-shadow: 0 10px 28px rgba(24, 50, 63, 0.06);
}
.bibtex-card { position: relative; max-width: 900px; margin: 0 auto; }
.copy-bibtex {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1;
  padding: 9px 14px;
  border: 1px solid rgba(23, 126, 156, 0.24);
  border-radius: 999px;
  background: #12303b;
  color: #ffffff;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 760;
  box-shadow: 0 10px 24px rgba(24, 50, 63, 0.18);
  transition: background 160ms ease, transform 160ms ease;
}
.copy-bibtex:hover, .copy-bibtex:focus-visible { background: var(--accent); outline: none; transform: translateY(-1px); }
.copy-status { min-height: 1.4em; margin: 10px 0 0; color: var(--accent); font-size: 0.9rem; font-weight: 700; text-align: right; }

.footer {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto 28px;
  padding: 28px 0 44px;
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
}
.footer p, .footer a { margin: 0; color: var(--muted); font-size: 0.92rem; }
.footer a:hover { color: var(--accent); }
.back-to-top-floating {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(24, 50, 63, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.86);
  color: #12303b;
  box-shadow: 0 14px 36px rgba(24, 50, 63, 0.12);
  backdrop-filter: blur(10px);
  transition: transform 160ms ease, background 160ms ease;
}
.back-to-top-floating:hover, .back-to-top-floating:focus-visible { background: #ffffff; outline: none; transform: translateY(-2px); }

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(12, 18, 27, 0.72);
  backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}
.image-modal.is-open { opacity: 1; pointer-events: auto; }
.image-modal-card {
  width: min(1180px, 94vw);
  max-height: 90vh;
  margin: 0;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.42);
  transform: scale(0.985) translateY(8px);
  transition: transform 180ms ease;
}
.image-modal.is-open .image-modal-card { transform: scale(1) translateY(0); }
.image-modal-close {
  position: fixed;
  top: 18px;
  right: 20px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  cursor: pointer;
  font-size: 2rem;
  line-height: 1;
}
.image-modal-close:hover, .image-modal-close:focus-visible { background: rgba(255, 255, 255, 0.22); outline: none; }
.image-modal-controls {
  position: fixed;
  top: 18px;
  right: 76px;
  z-index: 102;
  display: inline-flex;
  gap: 8px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(12px);
}
.image-modal-control {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #12303b;
  cursor: pointer;
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1;
}
.image-modal-reset { width: auto; min-width: 58px; padding: 0 12px; border-radius: 999px; font-size: 0.92rem; }
.image-modal-control:disabled { cursor: not-allowed; opacity: 0.42; }
.image-modal-hint { margin: 0 0 8px; color: rgba(24, 50, 63, 0.62); font-size: 0.9rem; font-weight: 650; text-align: center; }
.image-modal-viewport {
  width: 100%;
  max-height: 78vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: auto;
  border: 1px solid rgba(24, 50, 63, 0.14);
  border-radius: 18px;
  background: #ffffff;
  cursor: zoom-in;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  touch-action: none;
}
.image-modal-viewport.is-zoomed { justify-content: flex-start; cursor: grab; }
.image-modal-viewport.is-panning { cursor: grabbing; user-select: none; }
.image-modal-img {
  display: block;
  flex: 0 0 auto;
  width: auto;
  max-width: none;
  margin: 0 auto;
  max-height: none;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  user-select: none;
  -webkit-user-drag: none;
}
.image-modal-caption { color: #1f2937; font-size: 1.04rem; line-height: 1.55; text-align: center; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 700px) {
  body { background-size: auto, auto, 56px 56px, 56px 56px, auto; }
  html { scroll-padding-top: 76px; }
  .nav { position: relative; top: auto; flex-wrap: wrap; gap: 8px; align-items: flex-start; border-radius: 24px; }
  .nav-links { width: 100%; justify-content: space-between; gap: 2px; }
  .nav-links a { padding: 8px 7px; font-size: 0.82rem; }
  .section-pad { padding: 56px 0; }
  .hero { min-height: auto; padding-top: 72px; }
  .hero-copy h1 { font-size: clamp(2.25rem, 11vw, 3.15rem); line-height: 1.05; letter-spacing: -0.055em; }
  .paper-section, .citation { padding: 46px 0; }
  .paper-section h2, .citation h2 { margin-bottom: 22px; font-size: clamp(1.9rem, 8vw, 2.4rem); }
  .paper-section p, .citation > p { font-size: 1.08rem; }
  .project-figure { margin-bottom: 42px; }
  .project-figure::after { top: 10px; right: 10px; padding: 6px 9px; font-size: 0.74rem; opacity: 0.86; }
  .project-figure figcaption { font-size: 1.02rem; }
  .footer { flex-direction: column; align-items: flex-start; }
  .back-to-top-floating { right: 14px; bottom: 14px; width: 42px; height: 42px; }
  .image-modal { padding: 18px; }
  .image-modal-card { width: 96vw; padding: 12px; }
  .image-modal-controls { top: 14px; right: 68px; }
  .image-modal-control { width: 36px; height: 36px; font-size: 1.28rem; }
  .image-modal-reset { min-width: 52px; padding: 0 10px; font-size: 0.82rem; }
  .image-modal-viewport { max-height: 72vh; border-radius: 14px; }
  .image-modal-caption { font-size: 0.96rem; text-align: left; }
  .citation pre { padding-top: 54px; font-size: 0.82rem; }
  .copy-bibtex { top: 12px; right: 12px; padding: 8px 12px; font-size: 0.82rem; }
}
