:root {
  color-scheme: light;
  --ink: #132234;
  --muted: #4b6175;
  --accent: #006f66;
  --accent-strong: #00544d;
  --accent-soft: #dcf3ee;
  --cyan: #6ce5fb;
  --navy: #061120;
  --navy-card: #0d2136;
  --navy-line: #233e58;
  --surface: #ffffff;
  --pale: #f3f7fa;
  --line: #d9e4ec;
  --shell: 1140px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --display: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --shadow-sm: 0 2px 10px rgba(19, 34, 52, 0.05);
  --shadow-md: 0 14px 36px rgba(19, 34, 52, 0.09);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; }
body {
  margin: 0;
  font: 16px/1.66 var(--font);
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}
strong, table { font-variant-numeric: tabular-nums; }
a { color: var(--accent); text-underline-offset: 0.2em; transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease; }
a:focus-visible, button:focus-visible, .scroll-table:focus-visible { outline: 3px solid #3996d4; outline-offset: 3px; border-radius: 5px; }
a:hover { text-decoration-thickness: 2px; }
[hidden] { display: none !important; }
img { display: block; max-width: 100%; height: auto; }

.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  z-index: 30;
  background: linear-gradient(90deg, #006f66, #14968c, #c95d7a);
  transition: width 0.08s linear;
}

.wrap { width: min(var(--shell), calc(100% - 48px)); margin-inline: auto; }
.skip { position: absolute; top: 0.6rem; left: 0.6rem; color: var(--ink); background: #fff; padding: 0.55rem 0.9rem; border-radius: 8px; transform: translateY(-180%); z-index: 40; }
.skip:focus { transform: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); }

/* Sticky frosted-light nav matching alabaster editorial hero */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(217, 228, 236, 0.85);
}
.nav-content { display: flex; align-items: center; justify-content: space-between; min-height: 66px; gap: 1rem; }
.nav nav { display: flex; align-items: center; gap: 22px; }
.nav nav a { color: var(--muted); text-decoration: none; font-size: 0.9rem; font-weight: 600; position: relative; padding: 0.25rem 0; }
.nav nav a:hover, .nav nav a.active { color: var(--accent); }
.nav nav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.2rem;
  height: 2px;
  border-radius: 99px;
  background: var(--accent);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.wordmark span:not(.mark) { color: var(--accent); }
.mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 1.15rem;
  color: #ffffff;
  background: linear-gradient(135deg, #00756b, #0c9488);
  box-shadow: 0 3px 10px rgba(0, 111, 102, 0.25);
  line-height: 1;
}
.nav-github {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.85rem !important;
  border-radius: 999px;
  background: var(--pale);
  border: 1px solid var(--line);
  color: var(--ink) !important;
}
.nav-github:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong) !important; }

/* Hero */
.hero {
  padding: 58px 0 54px;
  color: var(--ink);
  background:
    radial-gradient(ellipse 62% 52% at 88% 12%, rgba(0, 128, 118, 0.09), transparent 58%),
    radial-gradient(ellipse 52% 48% at 10% 94%, rgba(201, 93, 122, 0.07), transparent 58%),
    linear-gradient(180deg, #f6f9fc 0%, #f1f5f9 100%);
  border-bottom: 1px solid var(--line);
}
.pill-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.72rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.cyan-pill {
  font-family: var(--mono);
  background: var(--accent-soft);
  color: var(--accent-strong);
  border: 1px solid #b4dfd6;
}
.dark-pill {
  background: rgba(255, 255, 255, 0.85);
  color: var(--muted);
  border: 1px solid var(--line);
}
.hero-layout { display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr); gap: 38px; align-items: center; }
h1, h2, h3, p { margin-top: 0; }
.hero-copy h1 {
  font-family: var(--display);
  margin-bottom: 18px;
  font-size: clamp(2.1rem, 4.1vw, 3.45rem);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.045em;
  color: var(--ink);
}
.hero-copy h1 > span {
  display: block;
  color: var(--accent);
  margin-bottom: 0.16em;
  font-size: 0.78em;
}
.authors { margin: 0 0 0.25rem; font-weight: 550; font-size: 0.96rem; color: #24384d; }
.authors span { white-space: nowrap; }
.affiliation { color: var(--muted); margin-bottom: 1.65rem; font-size: 0.92rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.65rem; }
.button {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  border: 1px solid #c6d6e2;
  border-radius: 10px;
  padding: 0.65rem 1.08rem;
  background: #ffffff;
  color: var(--ink);
  text-decoration: none;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 650;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.button:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); transform: translateY(-1px); }
.button.primary {
  background: linear-gradient(135deg, #006f66, #0d8d82);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(0, 111, 102, 0.24);
}
.button.primary:hover { background: linear-gradient(135deg, #005851, #006f66); color: #ffffff; }

.hero-illustration {
  margin: 0;
  overflow: hidden;
  border: 1px solid #d4e0e8;
  border-radius: 16px;
  background: #f3f6fa;
  box-shadow: 0 20px 44px rgba(19, 34, 52, 0.1), 0 0 0 4px rgba(0, 111, 102, 0.05);
}
.hero-img-wrap { overflow: hidden; cursor: zoom-in; }
.hero-illustration img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1); }
.hero-illustration:hover img { transform: scale(1.02); }
.hero-illustration figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0;
  padding: 0.62rem 1rem;
  color: var(--muted);
  background: #f7fafc;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  font-weight: 500;
}
.zoom-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  white-space: nowrap;
}

/* Metrics */
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 40px; }
.metrics article {
  padding: 20px 20px 18px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.metrics article:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.metric-top { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
.metrics strong {
  font-family: var(--display);
  color: var(--accent);
  font-size: clamp(1.32rem, 2.3vw, 2.05rem);
  letter-spacing: -0.04em;
  line-height: 1.1;
}
.metric-tag {
  font-family: var(--mono);
  font-size: 0.71rem;
  font-weight: 600;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid #b5ded5;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}
.metrics p { color: var(--muted); margin: 0.6rem 0 0; font-size: 0.89rem; line-height: 1.48; }

/* Content sections */
.content-section { padding-block: 64px; }
.kicker {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-weight: 650;
  font-size: 0.74rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--accent);
}
.intro { display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr); gap: 36px; align-items: end; margin-bottom: 28px; }
h2 {
  font-family: var(--display);
  margin-bottom: 0.65rem;
  font-size: clamp(1.7rem, 3.1vw, 2.45rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.14;
}
.intro h2, .intro > p { margin-bottom: 0; }
.intro > p, .method-grid p, figcaption, .small, .cite-sub { color: var(--muted); }

.figure {
  border: 1px solid var(--line);
  border-radius: 15px;
  margin: 0;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}
.figure:hover { box-shadow: var(--shadow-md); }
.figure img { width: auto; max-width: 100%; max-height: 340px; margin-inline: auto; padding: 16px 20px 14px; object-fit: contain; }
.zoomable { cursor: zoom-in; }
.figure-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.2rem;
  background: var(--pale);
  border-top: 1px solid var(--line);
  font-size: 0.83rem;
  color: var(--muted);
}
.zoom-hint {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  border: 1px solid #b9ccd9;
  color: var(--ink);
  background: #fff;
  white-space: nowrap;
}

/* Method stage cards */
.method-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 24px; }
.method-grid article {
  padding: 20px 19px 20px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--stage);
  border-radius: 13px;
  background: var(--stage-bg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.method-grid article:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stage-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 0.45rem; }
.stage-num {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--stage);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid currentColor;
  padding: 0.14rem 0.48rem;
  border-radius: 999px;
  opacity: 0.85;
}
.method-prune { --stage: #157a6e; --stage-bg: #f1faf8; }
.method-reconstruct { --stage: #9e7521; --stage-bg: #fcf8ef; }
.method-recover { --stage: #a84567; --stage-bg: #fdf3f7; }
h3 { font-family: var(--display); margin-bottom: 0.42rem; font-size: 1.07rem; font-weight: 700; line-height: 1.35; }
.method-grid p { margin: 0; font-size: 0.92rem; }
.stage-mark { display: block; position: relative; color: var(--stage); width: 48px; height: 36px; }
.method-prune .stage-mark {
  background: radial-gradient(circle, currentColor 2px, transparent 3px) 0 0 / 12px 12px;
  clip-path: polygon(0 0, 100% 0, 100% 65%, 66% 65%, 66% 100%, 0 100%);
}
.method-reconstruct .stage-mark::after, .method-reconstruct .stage-mark::before {
  content: ""; position: absolute; left: 11px; top: 4px; width: 26px; height: 21px;
  border: 1px solid currentColor; border-radius: 3px; transform: skewY(-18deg);
  background: repeating-linear-gradient(90deg, transparent 0 6px, rgba(158, 117, 33, 0.3) 6px 7px), var(--stage-bg);
}
.method-reconstruct .stage-mark::after { top: 10px; left: 15px; }
.method-recover .stage-mark { background: radial-gradient(ellipse at center, currentColor 8%, transparent 11%) 0 0 / 48px 36px; }
.method-recover .stage-mark::after, .method-recover .stage-mark::before {
  content: ""; position: absolute; border: 1.4px solid currentColor;
  inset: 4px 9px; border-radius: 50%; transform: rotate(-27deg);
}
.method-recover .stage-mark::after { inset: 10px 15px; }

/* Experiments & interactive tabs */
.results { background: var(--pale); border-block: 1px solid var(--line); }
.exp-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.32rem;
  border-radius: 12px;
  background: #e7eff4;
  border: 1px solid var(--line);
  margin-bottom: 18px;
}
.exp-tabs button {
  cursor: pointer;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 650 0.87rem/1.1 var(--font);
  padding: 0.56rem 0.95rem;
  border-radius: 8px;
  transition: all 0.16s ease;
}
.exp-tabs button:hover { color: var(--ink); background: rgba(255, 255, 255, 0.65); }
.exp-tabs button[aria-selected="true"] {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 111, 102, 0.22);
}

.data-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 24px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.6rem 1rem; margin-bottom: 14px; }
.card-head h3 { margin: 0; }
.chip-link, .meta-pill {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.72rem;
  border-radius: 999px;
  background: var(--pale);
  border: 1px solid var(--line);
  color: var(--muted);
  text-decoration: none;
}
.chip-link { color: var(--accent-strong); }
.chip-link:hover { background: var(--accent-soft); border-color: var(--accent); }
.scroll-table { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: clamp(0.78rem, 1.05vw, 0.89rem); }
th, td { padding: 0.6rem clamp(0.35rem, 0.85vw, 0.78rem); border-bottom: 1px solid #e7eff4; text-align: end; white-space: nowrap; }
th:first-child, td:nth-child(2), th:nth-child(2) { text-align: start; }
thead th { background: var(--pale); font-size: clamp(0.68rem, 0.9vw, 0.76rem); text-transform: uppercase; letter-spacing: 0.02em; color: var(--muted); font-weight: 650; white-space: normal; line-height: 1.22; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8fbfd; }
tbody tr.ref-row { background: #fafcfd; color: var(--muted); }
tbody th { font-weight: 640; }
tbody strong { background: var(--accent-soft); color: var(--accent-strong); padding: 0.16rem 0.45rem; border-radius: 6px; font-weight: 750; }
.delta {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 650;
  color: #0b685e;
  background: #e4f6f2;
  padding: 0.14rem 0.48rem;
  border-radius: 999px;
}
.small { font-size: 0.83rem; }
.data-card .small { margin: 0.85rem 0 0; }
.figure.inline { border: 0; box-shadow: none; }
.figure.inline img { padding: 4px 0 0; width: auto; max-width: 100%; max-height: 340px; margin-inline: auto; object-fit: contain; }
.figure.inline figcaption { margin-top: 0.9rem; font-size: 0.86rem; text-align: center; }

/* Citation */
.cite-layout { display: grid; grid-template-columns: minmax(11rem, 0.56fr) minmax(0, 1.44fr); gap: 2rem; align-items: start; }
.cite-sub { font-size: 0.93rem; }
.citation-box {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--pale);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.citation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.62rem 0.95rem;
  background: #e9f0f5;
  border-bottom: 1px solid var(--line);
}
.code-label { font-family: var(--mono); font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font: 600 0.82rem/1 var(--font);
  padding: 0.45rem 0.8rem;
  border-radius: 8px;
  border: 1px solid #b9ccd9;
  background: #fff;
  color: var(--ink);
  transition: all 0.16s ease;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.copy-btn.copied { background: var(--accent); border-color: var(--accent); color: #fff; }
pre { margin: 0; padding: 1.15rem; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 0.82rem/1.68 var(--mono); color: var(--ink); }

/* Footer */
.footer { padding: 24px 0; background: #f7fafc; border-top: 1px solid var(--line); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.8rem 1.5rem; }
.footer-brand { font-family: var(--display); font-weight: 800; margin-bottom: 0.15rem; }
.footer p { margin: 0; }
.suite-links { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; }
.suite-label { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.08em; margin-right: 0.35rem; color: var(--muted); }
.suite-links a {
  padding: 0.28rem 0.72rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--muted);
  border: 1px solid transparent;
}
.suite-links a:hover { color: var(--accent); border-color: var(--line); background: #fff; }
.suite-links a[aria-current="page"] { color: var(--accent-strong); background: var(--accent-soft); border-color: #a8dbd0; }

/* Lightbox */
.lightbox {
  max-width: min(94vw, 1200px);
  max-height: 92vh;
  padding: 0;
  border: 1px solid rgba(108, 229, 251, 0.22);
  border-radius: 16px;
  background: #071322;
  color: #e4f2ff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.6);
}
.lightbox::backdrop { background: rgba(4, 10, 20, 0.82); backdrop-filter: blur(8px); }
.lightbox-inner { position: relative; padding: 1.1rem; display: grid; gap: 0.8rem; }
.lightbox img { max-height: 76vh; width: auto; max-width: 100%; margin-inline: auto; border-radius: 8px; background: #fff; }
.lightbox p { text-align: center; font-size: 0.86rem; color: #b5cadb; margin: 0; }
.lightbox-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(7, 19, 34, 0.85);
  color: #fff;
  cursor: pointer;
}
.lightbox-close:hover { background: var(--cyan); color: #061526; }

/* Reveal */
.reveal { opacity: 1; transform: none; transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1); }
.js-anim .reveal:not(.is-visible) { opacity: 0; transform: translateY(18px); }

@media (max-width: 860px) {
  .hero-layout, .intro, .cite-layout { grid-template-columns: 1fr; gap: 22px; }
  .method-grid, .metrics { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .wrap { width: calc(100% - 28px); }
  .nav-content { min-height: 58px; }
  .nav nav { gap: 14px; }
  .nav-github { display: none; }
  .hero { padding: 40px 0 38px; }
  .content-section { padding-block: 44px; }
  .data-card { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js-anim .reveal:not(.is-visible) { opacity: 1; transform: none; }
}
