/* ============================================================
   NBS: No Bias Stereo — project page styles
   Accent palette derived from the magma colormap used in the paper.
   ============================================================ */

:root {
  --surface: #fcfcfb;
  --card: #ffffff;
  --ink: #17141f;
  --ink-2: #4e4960;
  --ink-3: #8b8699;
  --line: #e8e5ef;
  --accent: #b63679;        /* magma magenta */
  --accent-deep: #51127c;   /* magma purple  */
  --accent-warm: #e65164;   /* magma red     */
  --accent-hot: #fb8861;    /* magma orange  */
  --baseline-bar: #4e62a9;  /* validated companion for charts */
  --link: #9c2d67;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(23, 20, 31, .05), 0 8px 28px rgba(23, 20, 31, .07);
  --shadow-lg: 0 2px 6px rgba(23, 20, 31, .06), 0 18px 55px rgba(23, 20, 31, .13);
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-head: "Space Grotesk", var(--font-body);
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; font-size: clamp(16px, 0.86vw - 1.1px, 28px); }

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 66.25rem; margin: 0 auto; padding: 0 24px; }
.wrap.wide { max-width: 76.25rem; }

section { padding: 72px 0 8px; }

h2 {
  font-family: var(--font-head);
  font-size: clamp(1.625rem, 3.4vw, 2.125rem);
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin: 0 0 10px;
}

.kicker {
  font-family: var(--font-mono);
  font-size: 0.78125rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
}

.lede { color: var(--ink-2); max-width: 47.5rem; margin: 0 0 34px; }

.section-head { margin-bottom: 12px; }

/* ---------------- top nav ---------------- */

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(252, 252, 251, .82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease;
}
.topbar.scrolled { border-bottom-color: var(--line); }

.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 58px;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-head); font-weight: 700; font-size: 1.125rem;
  color: var(--ink); letter-spacing: -.01em;
}
.brand:hover { text-decoration: none; }

.brand-logo { height: 24px; width: auto; display: block; }

.topnav { display: flex; gap: 26px; }
.topnav a {
  color: var(--ink-2); font-size: 0.90625rem; font-weight: 500;
}
.topnav a:hover { color: var(--ink); text-decoration: none; }

.menu-btn {
  display: none;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  border: none; background: none; cursor: pointer;
  color: var(--ink);
  border-radius: 10px;
}
.menu-btn:active { background: rgba(23, 20, 31, .06); }
.menu-btn svg { width: 22px; height: 22px; }
.menu-btn .ic-close { display: none; }
.menu-btn[aria-expanded="true"] .ic-burger { display: none; }
.menu-btn[aria-expanded="true"] .ic-close { display: block; }

.mobile-menu {
  display: none;
  flex-direction: column;
  padding: 6px 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(252, 252, 251, .96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.mobile-menu a {
  color: var(--ink); font-size: 1rem; font-weight: 500;
  padding: 12px;
  border-radius: 10px;
}
.mobile-menu a:hover { text-decoration: none; background: rgba(23, 20, 31, .04); }

@media (max-width: 760px) {
  .topnav { display: none; }
  .menu-btn { display: flex; }
  .mobile-menu:not([hidden]) { display: flex; }
}

/* ---------------- hero ---------------- */

.hero {
  position: relative;
  padding: 64px 0 30px;
  overflow: hidden;
}

.hero-glow {
  position: absolute; inset: -40% -20% auto;
  height: 130%;
  background:
    radial-gradient(42% 55% at 28% 18%, rgba(81, 18, 124, .10), transparent 70%),
    radial-gradient(38% 50% at 72% 12%, rgba(251, 136, 97, .12), transparent 70%),
    radial-gradient(30% 45% at 52% 30%, rgba(182, 54, 121, .08), transparent 70%);
  pointer-events: none;
}

.hero-inner { position: relative; text-align: center; }

.conf-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 0.78125rem; font-weight: 500;
  letter-spacing: .06em;
  color: var(--accent-deep);
  background: rgba(81, 18, 124, .07);
  border: 1px solid rgba(81, 18, 124, .16);
  padding: 6px 14px; border-radius: 100px;
  margin-bottom: 26px;
}
.conf-badge .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-hot));
}

h1.title {
  font-family: var(--font-head);
  font-size: clamp(2.5rem, 7vw, 4.625rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin: 0 0 14px;
}

h1 .grad {
  background: linear-gradient(92deg, #51127c 0%, #b63679 38%, #e65164 66%, #fb8861 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  font-size: clamp(1.0625rem, 2.2vw, 1.3125rem);
  color: var(--ink-2);
  max-width: 45rem;
  margin: 0 auto 30px;
}

.authors {
  font-size: clamp(0.9375rem, 1.8vw, 1.09375rem);
  line-height: 1.9;
  max-width: 53.75rem;
  margin: 0 auto 6px;
}
.authors a { color: var(--ink); font-weight: 500; }
.authors a:hover { color: var(--link); }
.authors .sep { color: var(--ink-3); }

.authors sup {
  font-size: 0.75rem; font-weight: 600; color: var(--ink-2);
  margin-left: 1.5px;
}

.affil { color: var(--ink-2); font-size: 0.9375rem; margin: 6px 0 4px; }
.affil sup { font-size: 0.71875rem; font-weight: 600; color: var(--ink-2); }

.author-note { color: var(--ink-2); font-size: 0.84375rem; margin: 0 0 3px; }
.author-note sup { font-size: 0.71875rem; font-weight: 600; }

.author-note.lead-note { margin: 0 0 30px; }

.btn-row {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: center;
  margin-bottom: 52px;
}

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 0.9375rem; font-weight: 600;
  color: #fff; background: var(--ink);
  border: 1px solid var(--ink);
  padding: 10px 20px; border-radius: 100px;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn svg { width: 17px; height: 17px; flex: none; }

.btn.ghost {
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line);
}
.btn.ghost:hover { border-color: #d5d0e2; }

.btn.primary {
  background: linear-gradient(92deg, #7a2091, #b63679 55%, #e65164);
  border: none;
}

.btn .todo-flag {
  font-size: 0.65625rem; font-weight: 700; letter-spacing: .05em;
  background: rgba(255, 255, 255, .22);
  padding: 2px 7px; border-radius: 20px;
}
.btn.ghost .todo-flag { background: rgba(23, 20, 31, .07); color: var(--ink-2); }

/* ---------------- hero point-cloud viewer ---------------- */

.hero-viewer {
  position: relative;
  height: clamp(360px, 58vh, 620px);
  border-radius: var(--radius);
  overflow: hidden;
  background: radial-gradient(120% 130% at 50% 0%, #241b38 0%, #17121f 70%);
  box-shadow: var(--shadow-lg);
}

.hero-viewer .tag { position: absolute; top: 12px; left: 12px; z-index: 3; font-size: 0.78125rem; padding: 5px 12px; }

#heroCloud { position: absolute; inset: 0; }
#heroCloud canvas { width: 100%; height: 100%; display: block; cursor: grab; }
#heroCloud canvas:active { cursor: grabbing; }

.cloud-hint {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  z-index: 3; pointer-events: none;
  font-family: var(--font-mono); font-size: 0.71875rem; font-weight: 500;
  color: rgba(255, 255, 255, .85);
  background: rgba(15, 12, 24, .55);
  backdrop-filter: blur(4px);
  padding: 5px 13px; border-radius: 100px;
  opacity: 0; transition: opacity .5s ease .4s;
}
#heroCloud.ready + * .cloud-hint, #heroCloud.ready .cloud-hint { opacity: 1; }

#heroCloudFallback { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------------- reconstructions viewer + scene switcher ---------------- */
.cloud-single {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.cloud-switch {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}
.cloud-viewer-card {
  position: relative;
  height: clamp(360px, 56vh, 600px);
  border-radius: var(--radius);
  overflow: hidden;
  background: radial-gradient(120% 130% at 50% 0%, #241b38 0%, #17121f 70%);
  box-shadow: var(--shadow-lg);
}
.cloud-viewer { position: absolute; inset: 0; }
.cloud-viewer canvas { width: 100%; height: 100%; display: block; cursor: grab; }
.cloud-viewer canvas:active { cursor: grabbing; }
.cloud-viewer.ready .cloud-hint { opacity: 1; }

/* fine-detail crop strip under the viewer */
.crops-strip {
  display: flex; flex-wrap: wrap; gap: 12px 26px;
  justify-content: center;
  margin-top: 14px;
}
.crop-group { display: flex; gap: 12px; }
.crops-strip .crop { width: clamp(96px, 11vw, 148px); aspect-ratio: 1; }
.crops-strip .tag {
  font-size: 0.625rem; top: 6px; left: 6px; padding: 2px 7px;
  max-width: calc(100% - 12px);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.tag .tag-abbr { display: none; }
@media (max-width: 1150px) {
  .crops-strip .tag .tag-full { display: none; }
  .crops-strip .tag .tag-abbr { display: inline; }
}

@media (max-width: 640px) {
  .crop-group { gap: 8px; }
  .crops-strip { gap: 10px 18px; }
}

/* ---------------- crops & tags ---------------- */

.crop {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.crop img { width: 100%; height: 100%; object-fit: cover; }

.tag {
  position: absolute; top: 8px; left: 8px;
  font-family: var(--font-mono);
  font-size: 0.6875rem; font-weight: 500; letter-spacing: .02em;
  color: #fff; background: rgba(15, 12, 24, .72);
  backdrop-filter: blur(4px);
  padding: 3px 9px; border-radius: 6px;
  z-index: 2;
}
.tag.ours { background: linear-gradient(92deg, rgba(122, 32, 145, .92), rgba(182, 54, 121, .92)); }

.fig-note {
  text-align: center; color: var(--ink-3); font-size: 0.875rem;
  max-width: 51.25rem; margin: 18px auto 0;
}

/* ---------------- stats strip ---------------- */

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  margin-top: 56px;
}

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
  text-align: left;
}

.stat .num {
  font-family: var(--font-head);
  font-size: clamp(1.75rem, 3.4vw, 2.375rem);
  font-weight: 700; letter-spacing: -.02em; line-height: 1;
  background: linear-gradient(92deg, #51127c, #b63679 60%, #e65164);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 8px;
}
.stat .lbl { font-size: 0.875rem; color: var(--ink-2); line-height: 1.45; }

@media (max-width: 860px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------------- abstract ---------------- */

.abstract-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(26px, 4vw, 46px);
  font-size: clamp(1.03125rem, 1.9vw, 1.15625rem);
  line-height: 1.75;
  color: #2b2738;
}
.abstract-card p { margin: 0 0 1em; }
.abstract-card p:last-child { margin-bottom: 0; }
.abstract-card strong { color: var(--ink); }

/* ---------------- comparison slider ---------------- */

.compare-shell {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.compare-controls {
  display: flex; flex-wrap: wrap; gap: 10px 18px;
  align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}

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

.scene-tab {
  position: relative;
  width: 86px; height: 52px;
  border-radius: 8px; overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer; padding: 0; background: none;
  opacity: .62;
  transition: opacity .15s ease, border-color .15s ease;
}
.scene-tab img { width: 100%; height: 100%; object-fit: cover; }
.scene-tab:hover { opacity: .9; }
.scene-tab.active { opacity: 1; border-color: var(--accent); }
.scene-tab span {
  position: absolute; left: 0; right: 0; bottom: 0;
  font-size: 0.625rem; font-weight: 600; color: #fff;
  background: linear-gradient(transparent, rgba(15,12,24,.78));
  padding: 8px 4px 3px; text-align: center;
  letter-spacing: .02em;
}

.method-pills { display: flex; gap: 6px; flex-wrap: wrap; }

.pill {
  font-size: 0.8125rem; font-weight: 600;
  font-family: var(--font-body);
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all .15s ease;
}
.pill:hover { color: var(--ink); border-color: #d5d0e2; }
.pill.active {
  color: #fff; background: var(--ink); border-color: var(--ink);
}

.compare-stage {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 1207 / 739;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  background: #1a1626;
  cursor: ew-resize;
}

.compare-stage img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  pointer-events: none;
}

.compare-stage .img-left { clip-path: inset(0 calc(100% - var(--split, 50%)) 0 0); }

.divider {
  position: absolute; top: 0; bottom: 0;
  left: var(--split, 50%);
  width: 0; z-index: 5;
}
.divider::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: -1.25px;
  width: 2.5px; background: #fff;
  box-shadow: 0 0 12px rgba(0, 0, 0, .45);
}
.divider .knob {
  position: absolute; top: 50%; left: 0;
  transform: translate(-50%, -50%);
  width: 42px; height: 42px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .35);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink);
}
.divider .knob svg { width: 20px; height: 20px; }

.compare-stage .lbl {
  position: absolute; top: 12px; z-index: 4;
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500;
  color: #fff; background: rgba(15, 12, 24, .72);
  backdrop-filter: blur(4px);
  padding: 4px 11px; border-radius: 7px;
  pointer-events: none;
}
.compare-stage .lbl-left { left: 12px; }
.compare-stage .lbl-right {
  right: 12px;
  background: linear-gradient(92deg, rgba(122, 32, 145, .92), rgba(182, 54, 121, .92));
}

/* The overlay label chips ARE the method dropdowns */
.compare-stage select.lbl {
  appearance: none; -webkit-appearance: none;
  border: none;
  cursor: pointer;
  pointer-events: auto;
  padding: 4px 27px 4px 11px;
  line-height: 1.5;
  max-width: calc(50% - 14px);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  background-color: rgba(15, 12, 24, .82);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 11px;
}
.compare-stage select.lbl:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.compare-stage select.lbl-right {
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"),
    linear-gradient(92deg, rgba(122, 32, 145, .95), rgba(182, 54, 121, .95));
  background-repeat: no-repeat, no-repeat;
  background-position: right 9px center, center;
  background-size: 11px, cover;
}
.compare-stage select.lbl option { color: var(--ink); background: #fff; }
@media (max-width: 640px) {
  .compare-stage select.lbl {
    font-size: 0.66rem;
    padding: 3px 24px 3px 9px;
  }
}

.compare-hint {
  text-align: center; font-size: 0.84375rem; color: var(--ink-3);
  margin-top: 12px;
}

/* ---------------- method ---------------- */

.figure-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(14px, 2.5vw, 28px);
}
.figure-card img { width: 100%; }
.figure-card figcaption {
  color: var(--ink-3); font-size: 0.875rem; text-align: center;
  padding: 14px 18px 4px; line-height: 1.55;
}

.method-cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  margin-top: 20px;
}
.mcard {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.mcard .icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(81,18,124,.09), rgba(230,81,100,.10));
  color: var(--accent);
  margin-bottom: 14px;
}
.mcard .icon svg { width: 21px; height: 21px; }
.mcard h3 {
  font-family: var(--font-head); font-size: 1.15625rem; margin: 0 0 8px;
  letter-spacing: -.01em;
}
.mcard p { margin: 0; font-size: 0.9375rem; color: var(--ink-2); line-height: 1.6; }

@media (max-width: 860px) { .method-cards { grid-template-columns: 1fr; } }

/* ---------------- tables ---------------- */

.table-scroll {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

table.results {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  min-width: 760px;
}

table.results th, table.results td {
  padding: 9px 14px;
  text-align: center;
  white-space: nowrap;
}

table.results thead th {
  font-family: var(--font-body);
  font-weight: 600; font-size: 0.8125rem;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
}

table.results thead tr.groups th {
  font-family: var(--font-head);
  font-size: 0.84375rem; color: var(--ink);
  padding-top: 14px;
  border-bottom: none;
}
table.results thead tr.groups th:not(:first-child) {
  border-left: 1px solid var(--line);
}

table.results tbody td:first-child,
table.results thead th:first-child {
  text-align: left; font-weight: 500;
  position: sticky; left: 0;
  background: var(--card);
}

table.results tbody td { color: var(--ink-2); border-top: 1px solid #f1eff6; font-variant-numeric: tabular-nums; }
table.results tbody td.group-start { border-left: 1px solid var(--line); }

table.results tbody tr.ours td {
  background: #f7eef4;
  color: var(--ink);
  border-top: 1px solid rgba(182, 54, 121, .3);
}
table.results tbody tr.ours td:first-child {
  background: #f0e3ec;
  font-weight: 700;
}
/* best-in-column is shown by bold weight only; all text stays black */
table.results tbody tr.ours td.best { font-weight: 700; }

table.results td.best { font-weight: 700; color: var(--ink); }

.table-note { font-size: 0.8125rem; color: var(--ink-3); margin: 10px 4px 0; }

/* ---------------- efficiency ---------------- */

.eff-grid {
  display: grid; grid-template-columns: 1fr 1.15fr; gap: 14px;
  align-items: stretch;
}
@media (max-width: 960px) { .eff-grid { grid-template-columns: 1fr; } }

.eff-grid table.results { min-width: 600px; font-size: 0.84375rem; }
.eff-grid table.results th, .eff-grid table.results td { padding: 9px 10px; }

.chart-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 26px 26px 18px;
  display: flex; flex-direction: column;
}
.chart-card h3 {
  font-family: var(--font-head); font-size: 1.125rem; margin: 0 0 2px;
  letter-spacing: -.01em;
}
.chart-card .chart-sub { font-size: 0.84375rem; color: var(--ink-3); margin: 0 0 18px; }
.chart-card svg { width: 100%; height: auto; overflow: visible; }

.chart-tip {
  position: fixed; z-index: 90;
  background: var(--ink); color: #fff;
  font-size: 0.78125rem; line-height: 1.55;
  border-radius: 8px; padding: 9px 12px;
  pointer-events: none;
  opacity: 0; transform: translateY(4px);
  transition: opacity .12s ease, transform .12s ease;
  box-shadow: var(--shadow-lg);
  white-space: nowrap;
}
.chart-tip.show { opacity: 1; transform: translateY(0); }
.chart-tip b { font-weight: 600; }
.chart-tip .dim { color: #b9b3c9; }

/* ---------------- two-up small tables ---------------- */

.two-up { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 960px) { .two-up { grid-template-columns: 1fr; } }
.two-up > *, .eff-grid > * { min-width: 0; }

.two-up h3 {
  font-family: var(--font-head); font-size: 1.0625rem;
  margin: 0 0 10px 4px; letter-spacing: -.01em;
}
.two-up .table-scroll table.results { min-width: 520px; }

/* ---------------- placeholder panels ---------------- */

.placeholder {
  border: 2px dashed #d8d2e6;
  border-radius: var(--radius);
  background: repeating-linear-gradient(
    -45deg, rgba(81, 18, 124, .025), rgba(81, 18, 124, .025) 12px,
    transparent 12px, transparent 24px);
  padding: clamp(30px, 5vw, 54px);
  text-align: center;
}
.placeholder .ph-icon {
  width: 52px; height: 52px; margin: 0 auto 16px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(81,18,124,.10), rgba(251,136,97,.14));
  color: var(--accent);
}
.placeholder .ph-icon svg { width: 26px; height: 26px; }
.placeholder h3 {
  font-family: var(--font-head); font-size: 1.25rem; margin: 0 0 8px;
}
.placeholder p { color: var(--ink-2); font-size: 0.9375rem; max-width: 620px; margin: 0 auto; }
.placeholder code {
  font-family: var(--font-mono); font-size: 0.8125rem;
  background: rgba(81, 18, 124, .07);
  padding: 2px 7px; border-radius: 5px;
  color: var(--accent-deep);
}

/* ---------------- figure lightbox ---------------- */

.figure-card img.zoomable { cursor: zoom-in; }

.lightbox {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(12, 9, 20, .93);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.lightbox[hidden] { display: none; }

.lb-stage {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}
.lb-stage:active { cursor: grabbing; }
.lb-stage img {
  max-width: 92vw; max-height: 86vh;
  user-select: none; -webkit-user-select: none; -webkit-user-drag: none;
  will-change: transform;
  border-radius: 6px;
  background: #fff;
}

.lb-close {
  position: absolute; top: 16px; right: 16px; z-index: 2;
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .08);
  color: #fff; font-size: 1.0625rem; cursor: pointer;
}
.lb-close:hover { background: rgba(255, 255, 255, .16); }

.lb-hint {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  pointer-events: none;
  color: rgba(255, 255, 255, .78);
  font-family: var(--font-mono); font-size: 0.71875rem;
  background: rgba(255, 255, 255, .07);
  padding: 5px 13px; border-radius: 100px;
  white-space: nowrap; max-width: 92vw;
  overflow: hidden; text-overflow: ellipsis;
}

/* ---------------- bibtex ---------------- */

.bibtex-card {
  position: relative;
  background: #1a1626;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.bibtex-card pre {
  margin: 0; padding: 28px 30px;
  font-family: var(--font-mono);
  font-size: 0.84375rem; line-height: 1.7;
  color: #e8e4f2;
  overflow-x: auto;
}
.bibtex-card .tok { color: #fb8861; }
.bibtex-card .key { color: #c99cdd; }

.copy-btn {
  position: absolute; top: 14px; right: 14px;
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.78125rem; font-weight: 600; font-family: var(--font-body);
  color: #e8e4f2;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  padding: 7px 13px;
  cursor: pointer;
  transition: background .15s ease;
}
.copy-btn:hover { background: rgba(255, 255, 255, .15); }
.copy-btn svg { width: 14px; height: 14px; }

/* ---------------- footer ---------------- */

footer {
  margin-top: 90px;
  border-top: 1px solid var(--line);
  padding: 34px 0 46px;
  color: var(--ink-3);
  font-size: 0.875rem;
}
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------------- reveal animation ---------------- */

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

html.noanim .reveal { opacity: 1; transform: none; transition: none; }
