/* PanDWM project page. Nerfies-style layout: Bulma greys, one link blue, no brand color. */
:root {
  --title: #363636;
  --text: #4a4a4a;
  --muted: #7a7a7a;
  --rule: #dbdbdb;
  --rule-strong: #b5b5b5;
  --band: #f5f5f5;
  --footer: #fafafa;
  --link: #3273dc;
  --button: #363636;
  --button-hover: #2f2f2f;
  --font-title: "Google Sans", "Product Sans", "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #ffffff; color: var(--text); font: 400 16px/1.5 var(--font-body); }
h1, h2, h3, p, figure, pre { margin: 0; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
video, img, svg { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.container { max-width: 984px; margin: 0 auto; padding: 0 12px; }
.container.is-narrow { max-width: 744px; }

/* Title block */
.hero { padding: 48px 0 28px; text-align: center; }
.hero > .container { max-width: 1104px; }
.publication-title { max-width: 1080px; margin: 0 auto; font: 600 48px/1.125 var(--font-title); color: var(--title); text-wrap: balance; }
.publication-title-description { font-weight: 400; }
.publication-authors { margin-top: 16px; font: 400 20px/1.5 var(--font-title); }
.publication-authors a { color: inherit !important; }
.publication-affiliations { margin-top: 4px; font-size: 17px; }
.author-block { display: inline-block; margin: 0 4px; }
.publication-contributions { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin-top: 8px; font: 400 14px/1.5 var(--font-title); color: var(--muted); }
.publication-venue { margin: 16px auto 0; font: 600 30px/1.4 var(--font-title); color: var(--muted); text-align: center; }
.publication-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 24px; }

.button { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border: 1px solid transparent; border-radius: 9999px; background: var(--button); color: #ffffff; font: 400 15px/1 var(--font-body); white-space: nowrap; cursor: pointer; }
a.button:hover, button.button:hover { background: var(--button-hover); text-decoration: none; }
.button.is-light { background: #ededed; color: var(--title); }
a.button.is-light:hover { background: #dfdfdf; }
.button.is-small { height: 32px; padding: 0 14px; border-radius: 4px; font-size: 14px; }
.button.is-outlined { background: #ffffff; border-color: var(--rule); color: var(--title); }
button.button.is-outlined:hover { background: #ffffff; border-color: var(--rule-strong); }
.button small { font-size: 0.82em; }
.icon { width: 16px; height: 16px; flex: none; }
.nowrap { white-space: nowrap; }

/* Teaser */
.teaser { padding: 8px 0 44px; font-family: var(--font-body); }
.teaser img { width: 100%; height: auto; }
.teaser .subtitle { max-width: 820px; margin: 20px auto 0; font: 400 20px/1.4 var(--font-title); color: var(--text); text-align: center; text-wrap: balance; }
.teaser-note { max-width: 720px; margin: 10px auto 0; font-size: 14px; color: var(--muted); text-align: center; }

/* Sections */
.section { padding: 48px 0; }
.section.is-light { background: var(--band); }
.title { margin-bottom: 24px; font: 600 32px/1.125 var(--font-title); color: var(--title); text-align: center; }
.section-spec { max-width: 720px; margin: -12px auto 28px; font-size: 15px; color: var(--muted); text-align: center; }
.content p { text-align: justify; }
.content p + p { margin-top: 16px; }

/* Scene browser */
.scene-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; }
.scene-thumb { padding: 0; overflow: hidden; border: 1px solid var(--rule); border-radius: 4px; background: #ffffff; text-align: left; cursor: pointer; }
.scene-thumb:hover { border-color: var(--rule-strong); }
.scene-thumb[aria-pressed="true"] { border-color: var(--title); box-shadow: 0 0 0 1px var(--title); }
.scene-thumb img { width: 100%; aspect-ratio: 4114 / 256; object-fit: contain; }
.scene-thumb span { display: block; padding: 5px 7px; font-size: 12px; line-height: 1.3; color: var(--text); }
.scene-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 12px; }
.scene-title { font: 600 20px/1.3 var(--font-title); color: var(--title); }
.scene-setting { margin-top: 2px; font-size: 14px; color: var(--muted); }
.scene-arrows { display: flex; flex: none; gap: 6px; }
.scene-caption { margin: 0 0 24px; font-size: 15px; color: var(--text); }
.comparison-stack { display: grid; gap: 20px; }
.comparison-view { min-width: 0; }
.comparison-view figcaption { margin-bottom: 7px; font: 600 14px/1.4 var(--font-title); color: var(--title); }
.comparison-view video { display: block; width: 100%; height: auto; aspect-ratio: 4114 / 256; object-fit: contain; background: #000000; }
.video-magnifier { position: fixed; z-index: 1000; overflow: hidden; border-radius: 12px; background: #000; outline: 2px solid #fff; box-shadow: 0 8px 32px rgba(0, 0, 0, .24); pointer-events: none; }
.video-magnifier[hidden] { display: none; }
.video-magnifier canvas { display: block; width: 100%; height: 100%; }
.video-magnifier-scale { position: absolute; right: 8px; bottom: 8px; padding: 2px 7px; border-radius: 4px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 11px; line-height: 1.5; }
@media (hover: hover) and (pointer: fine) {
  .comparison-view video { cursor: crosshair; }
}
.comparison-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; margin-top: 20px; }
.comparison-controls button:disabled { opacity: .5; cursor: wait; }
.comparison-controls input { flex: 1; min-width: 100px; accent-color: var(--title); cursor: pointer; }
.comparison-controls output { flex: none; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--muted); }
.comparison-caption { margin: 12px 0 20px; }
.comparison-caption p { max-width: 760px; font-size: 14px; color: var(--text); }
.selection-note { margin-top: 16px; font-size: 13px; color: var(--muted); }
.video-status { margin-top: 8px; font-size: 13px; color: var(--muted); }

/* Method figure */
.method-figure img { width: 100%; height: auto; }
.method-figure figcaption { max-width: 720px; margin: 16px auto 0; font-size: 14px; color: var(--text); text-align: center; }
.geometry-figure { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); align-items: center; gap: 40px; max-width: 900px; margin: 48px auto 0; }
.geometry-figure img { width: 100%; height: auto; }
.geometry-figure figcaption { font-size: 16px; line-height: 1.65; color: var(--text); text-align: left; }
.geometry-figure h3 { margin-bottom: 18px; font: 600 20px/1.35 var(--font-title); color: var(--title); }
.geometry-figure p + p { margin-top: 14px; }
.geometry-equation { white-space: nowrap; }

/* Performance and efficiency */
.performance-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.performance-figure { min-width: 0; }
.performance-figure img { width: 100%; height: auto; aspect-ratio: 2.2; object-fit: contain; }
.performance-figure figcaption { margin-top: 16px; font-size: 14px; line-height: 1.6; color: var(--text); text-align: center; }
.bibtex { padding: 16px 20px; overflow-x: auto; background: var(--band); font-size: 13px; line-height: 1.5; }

.footer { padding: 40px 0 56px; background: var(--footer); }
.footer p { font-size: 14px; color: var(--text); text-align: center; }


@media (max-width: 768px) {
  .container, .container.is-narrow { padding: 0 16px; }
  .hero { padding: 32px 0 20px; }
  .publication-title { font-size: 28px; }
  .publication-venue { font-size: 24px; }
  .wide-break { display: none; }
  .publication-links { gap: 6px; }
  .button { gap: 6px; height: 34px; padding: 0 12px; font-size: 13px; }
  .icon { width: 14px; height: 14px; }
  .teaser { padding-bottom: 32px; }
  .teaser .subtitle { font-size: 17px; }
  .section { padding: 36px 0; }
  .title { margin-bottom: 20px; font-size: 26px; }
  .section-spec { margin-top: -10px; font-size: 14px; }
  .content p { text-align: left; }
  .scene-header { align-items: flex-start; }
  .geometry-figure { grid-template-columns: minmax(0, 1fr); gap: 24px; margin-top: 36px; }
  .geometry-figure img { max-width: 440px; margin: 0 auto; }
  .performance-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Interactive 3D Gaussian viewer under the comparison (height matches the original 3-card grid: 4:3 of ~391 px) */
.gs-view { margin-top: 20px; }
.gs-view-hint { font-weight: 400; color: var(--muted); }
.gs-frame { position: relative; width: 100%; height: 293px; overflow: hidden; border-radius: 12px; background: #eceff1;
  box-shadow: 0 1px 3px rgba(10, 10, 10, 0.10), 0 4px 14px rgba(10, 10, 10, 0.06); }
.gs-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.gs-loading { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); margin: 0; padding: 5px 12px;
  border-radius: 9999px; background: rgba(255, 255, 255, 0.9); color: var(--title); font-size: 13px; white-space: nowrap; }
.gs-frame iframe { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; border: 0; display: block; }
.gs-frame.is-loading iframe { visibility: hidden; }
.gs-frame.is-live .gs-preview, .gs-frame.is-live .gs-loading { display: none; }

@media (max-width: 480px) {
  .scene-picker { gap: 6px; }
  .scene-thumb span { padding: 4px 5px; font-size: 11px; }
  .scene-arrows .button { padding: 0 10px; }
  .comparison-controls input { order: 1; flex-basis: 100%; }
}

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