/* ============================================================
   ProjectName — 3D Reconstruction Project Page
   Modern dark theme. Recolor the whole site via --accent-1/2.
   ============================================================ */

:root {
  /* Navy accent for the content below the hero */
  --accent-1: #1b3a6b;
  --accent-2: #2a6bb0;
  --on-accent: #ffffff;
  --grad: var(--accent-1);   /* kept as a name; resolves to the solid accent */
  --hero-ink: #0a1526;
  --hero-title: #f5f9ff;
  --hero-text: #cdd9e8;
  --hero-muted: #a8b7cb;
  --hero-accent: #6fa8d6;
  --nav-accent: #2a6bb0;
  --font-serif: 'Gilda Display', Georgia, 'Times New Roman', serif;   /* elegant display serif for headings */

  /* Layout */
  --radius:    18px;
  --radius-sm: 12px;
  --maxw:      1140px;
  --maxw-narrow: 900px;

  /* ---- Light theme (cool paper-blue) — DEFAULT ---- */
  --bg:        #f7f9fc;
  --bg-alt:    #eef2f8;
  --surface:   #ffffff;
  --surface-2: #e9eff7;
  --border:    rgba(20,40,80,.13);
  --border-2:  rgba(20,40,80,.20);

  --text:      #0f1b2d;
  --text-dim:  #44546b;
  --text-mute: #8493a8;

  --link:      var(--accent-1);
  --btn-fg: #3d5069; --btn-border: #c3d1e4; --btn-hover-bg: #e9eff7; --btn-hover-fg: #0f1b2d;
  --nav-bg:          #f7f9fc;
  --nav-bg-scrolled: #f7f9fc;
  --nav-mobile-bg:   #f7f9fc;
  --media-overlay:   rgba(247,249,252,.84);
  --title-grad: #0f1b2d;
  --shadow: none;
  --aurora-strength: 0;
}

/* ---- Dark theme (deep navy) ---- */
:root[data-theme="dark"] {
  --bg:        #0a1220;
  --bg-alt:    #0e1829;
  --surface:   #131f33;
  --surface-2: #1b2a42;
  --border:    rgba(200,222,255,.11);
  --border-2:  rgba(200,222,255,.17);

  --text:      #e8eef8;
  --text-dim:  #aebdd2;
  --text-mute: #7789a0;

  --accent-1: #cfe0f5; --accent-2: #cfe0f5; --on-accent: #0c1626;
  --link:      var(--accent-2);
  --btn-fg: var(--text-dim); --btn-border: rgba(200,222,255,.30); --btn-hover-bg: #1b2a42; --btn-hover-fg: var(--text);
  --nav-bg:          #0a1220;
  --nav-bg-scrolled: #0a1220;
  --nav-mobile-bg:   #0a1220;
  --media-overlay:   rgba(10,18,32,.66);
  --title-grad: #e8eef8;
  --shadow: none;
  --aurora-strength: .7;
  --nav-accent: #79ade2;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.65;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
  transition: background-color .3s ease, color .3s ease;
}
a { color: var(--link); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-1); }
code {
  font-family: 'JetBrains Mono', monospace; font-size: .85em;
  background: var(--surface-2); padding: 2px 7px; border-radius: 6px; color: var(--text);
}

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: var(--maxw-narrow); }

.grad-text {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; font-weight: 800;
}

/* ===================== NAVBAR ===================== */
.navbar {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: var(--nav-bg); border-bottom: 1px solid transparent;
  transition: background .3s, border-color .3s;
}
.navbar.scrolled { background: var(--nav-bg-scrolled); border-bottom: 1px solid var(--border); }
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 13px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.12rem; color: var(--text); letter-spacing: -.02em; }
.nav-brand:hover { color: var(--text); }
.brand-mark { height: 26px; width: 26px; display: block; }
:root[data-theme="dark"] .brand-mark { filter: invert(1); }  /* black logo -> white on espresso */
.nav-links { display: flex; gap: 26px; }
.nav-links a { color: var(--text-dim); font-size: .9rem; font-weight: 500; position: relative; padding: 4px 0; }
.nav-links a:hover { color: var(--nav-accent); }
.nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: ''; position: absolute; inset: auto 0 -2px 0; height: 2px;
  background: var(--nav-accent); border-radius: 2px;
}
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 6px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--text); margin: 5px 0; border-radius: 2px; transition: .3s; }
.nav-right { display: flex; align-items: center; gap: 22px; }
.theme-toggle {
  background: var(--surface-2); border: none; color: var(--text-dim);
  width: 36px; height: 36px; border-radius: 10px; cursor: pointer; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center; transition: color .2s, background .2s;
}
.theme-toggle:hover { color: var(--on-accent); background: var(--accent-1); }

/* ===================== HERO ===================== */
.hero {
  position: relative; min-height: calc(100vh - 63px); min-height: calc(100svh - 63px); padding: 96px 0 72px;
  display: flex; align-items: center; overflow: hidden; color: var(--hero-title); background: var(--hero-ink);
  text-align: left; isolation: isolate;
}
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg,
    rgba(6,14,28,.95) 0%, rgba(6,14,28,.84) 28%, rgba(6,14,28,.65) 48%,
    rgba(6,14,28,.28) 72%, rgba(6,14,28,.08) 100%);
}
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(180deg, rgba(6,14,28,.14) 0%, transparent 52%, rgba(6,14,28,.48) 100%);
  box-shadow: inset 0 0 120px rgba(6,14,28,.22);
}
.hero-media { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.hero-media img {
  width: 100%; height: 100%; display: block; object-fit: cover; object-position: center top;
  filter: saturate(.9) contrast(1.04) brightness(.88);
}
.aurora {
  display: block; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: none;
}
.hero-content { position: relative; z-index: 3; width: 100%; }
.badge {
  display: inline-flex; align-items: center; gap: 7px; margin-bottom: 22px;
  padding: 6px 15px; border-radius: 999px; font-size: .82rem; font-weight: 600;
  color: var(--text); background: var(--surface-2); border: 1px solid var(--border-2);
}
.badge i { color: var(--accent-2); }
.hero-title {
  max-width: 720px; font-family: var(--font-serif); font-weight: 400;
  font-size: clamp(4.2rem, 8vw, 7rem); letter-spacing: -.025em; line-height: .94;
  margin-bottom: 22px; color: var(--hero-title); text-shadow: 0 4px 32px rgba(18,16,14,.58);
}
.hero-subtitle { font-family: var(--font-serif); font-size: clamp(1.3rem,2.25vw,1.7rem); color: #eee9e2; max-width: 720px; margin: 0 0 28px; font-weight: 400; line-height: 1.38; letter-spacing: .005em; text-shadow: 0 3px 24px rgba(18,16,14,.72); }
.hero-subtitle strong { color: var(--hero-title); font-weight: 700; }
.hero-tagline { font-size: clamp(1rem,2vw,1.18rem); color: var(--text-dim); max-width: 760px; margin: 0 auto 30px; font-weight: 500; }
.authors { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-start; gap: 8px 24px; max-width: 760px; font-size: 1.08rem; margin-bottom: 8px; }
.authors span { position: relative; color: var(--hero-text); } /* containing block for the asterisk */
.authors sup {                                          /* asterisk taken out of flow so every name shares identical metrics */
  position: absolute; top: -.3em; right: -.7em; font-size: .6em; line-height: 1; color: var(--hero-text);
}
.authors a { color: var(--hero-text); font-weight: 600; text-shadow: 0 2px 18px rgba(6,14,28,.72); }
.authors a:hover { color: var(--hero-accent); }
.authors sup, .affiliations sup { color: var(--hero-text); }
.affiliations { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 6px 20px; color: var(--hero-muted); font-size: .92rem; font-weight: 400; letter-spacing: .02em; margin-bottom: 30px; text-shadow: 0 2px 16px rgba(6,14,28,.72); }

.hero-buttons { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 10px; max-width: 760px; }
.btn {
  display: inline-flex; align-items: center; gap: 9px; padding: 11px 22px; border-radius: 999px;
  font-weight: 600; font-size: .95rem; color: #0f1b2d;
  background: #ffffff; border: 1.5px solid rgba(0,0,0,.08);
  box-shadow: 0 2px 12px rgba(0,0,0,.14);
  cursor: pointer; transition: transform .18s, background .2s, color .2s, border-color .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); background: #ffffff; color: var(--accent-2); box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.btn i { color: inherit; }
.btn-primary { color: #0f1b2d; }
.btn-primary:hover { background: #ffffff; color: var(--accent-2); }
.hero .btn {
  color: var(--hero-text); background: rgba(18,16,14,.24); border: 1px solid rgba(216,211,204,.36);
  box-shadow: none;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.hero .btn:hover { color: var(--hero-title); background: rgba(6,14,28,.52); border-color: var(--hero-accent); box-shadow: 0 4px 16px rgba(6,14,28,.2); }
.hero .btn-primary { color: #0f1b2d; background: var(--hero-title); border-color: var(--hero-title); }
.hero .btn-primary i { color: #2a6bb0; }
.hero .btn-primary:hover { color: #0f1b2d; background: #e6eefa; border-color: var(--hero-accent); }
.ai-arxiv { display: none; } /* placeholder for academicons if you add it */

/* Teaser / media frame */
.hero-teaser { margin-top: 56px; margin-bottom: 8px; position: relative; z-index: 1; }
.media-frame {
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border);
  background: var(--surface); box-shadow: var(--shadow);
}
.media-frame.glow { position: relative; }   /* gradient edge removed */
.media-frame video, .media-frame img { display: block; width: 100%; height: auto; }
/* Overview teaser: the source is 4:3, so a full-width video runs taller than the viewport and
   gets cut off. Cap its height to the space left under the sticky nav; the frame shrinks to
   whatever width that leaves, so the video is never padded or cropped. */
.teaser-frame { width: fit-content; max-width: 100%; margin-inline: auto; }   /* frame hugs the video: no letterbox */
.teaser-video {
  display: block; width: auto; max-width: 100%;
  height: auto; max-height: calc(100vh - 150px);
  opacity: .9;
}
@media (max-width: 900px) { .teaser-video { max-height: calc(100vh - 110px); } }
.caption { color: var(--text-mute); font-size: .9rem; margin-top: 14px; text-align: center; }
.caption strong { color: var(--text-dim); }
.note { color: var(--text-mute); font-size: .85rem; text-align: center; margin-top: 16px; }
.note code { font-size: .8em; }

/* ===================== STATS BAND ===================== */
.stats { padding: 30px 0; background: var(--bg-alt); border-block: 1px solid var(--border); }
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; }
.stat { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; padding: 8px; }
.stat i { font-size: 1.5rem; margin-bottom: 6px; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat b { font-size: 1.02rem; }
.stat span { color: var(--text-mute); font-size: .86rem; }

/* ===================== SECTIONS ===================== */
.section { padding: 52px 0; }
.section.alt { background: var(--bg-alt); }
.section-title { font-family: var(--font-serif); font-size: clamp(1.9rem,4.2vw,2.7rem); font-weight: 400; letter-spacing: -.025em; line-height: 1.02; text-align: center; margin-bottom: 8px; }
.section-title::after { content: ''; display: block; width: 54px; height: 4px; margin: 14px auto 0; background: var(--grad); border-radius: 4px; }
.section-lead { text-align: center; color: var(--text-dim); margin-bottom: 36px; font-size: 1.02rem; }
.section-lead i { color: var(--accent-2); margin-right: 4px; }
.body-text { color: var(--text-dim); font-size: 1.08rem; }
.body-text em { color: var(--text); font-style: italic; }

/* Subsection heading inside a section */
.subsection-title { font-family: var(--font-serif); font-size: 1.55rem; font-weight: 400; letter-spacing: -.025em; line-height: 1.02; text-align: center; margin: 38px 0 6px; }
.subsection-title i { color: var(--accent-2); margin-right: 7px; }
.section-sub { text-align: center; color: var(--text-mute); font-size: .92rem; margin-bottom: 26px; }

/* ===================== METHOD STAGE CARDS ===================== */
.stage-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; margin-top: 40px; }
.stage-card {
  position: relative; padding: 24px 20px 22px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); transition: transform .25s, border-color .25s;
}
.stage-card:hover { transform: translateY(-4px); border-color: var(--accent-1); }
.stage-card-head { display: flex; align-items: center; gap: 13px; margin-bottom: 16px; }
.stage-num {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: 0 0 34px;
  border-radius: 10px; font-weight: 800; font-size: 1rem; color: var(--on-accent); background: var(--grad);
}
.stage-card h3 {
  margin: 0; font-family: var(--font-serif); font-size: 1.16rem; font-weight: 400;
  line-height: 1.28; text-wrap: balance;
}
.stage-card p { color: var(--text-dim); font-size: .9rem; line-height: 1.6; }

/* ===================== INTERACTIVE 3D ===================== */
/* Scene canvas on the left, object-spec panel on the right. */
.results-stage { display: grid; grid-template-columns: 1fr 300px; gap: 18px; align-items: stretch; }
.viewer-wrap {
  position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border);
  background: var(--surface); box-shadow: var(--shadow); height: 540px;
}
#sceneCanvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: pointer; }

/* Static Blender-render fallback view, toggled in place of the interactive canvas */
.render-view {
  display: none; position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; background: var(--surface);
}
.render-view.active { display: block; }
.view-toggle {
  position: absolute; bottom: 14px; right: 14px; z-index: 6;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .78rem; font-weight: 600; color: var(--text);
  background: var(--media-overlay); backdrop-filter: blur(6px);
  padding: 7px 13px; border-radius: 8px; border: 1px solid var(--border);
  cursor: pointer; transition: background .15s, color .15s;
}
.view-toggle:hover { background: var(--surface-2); }
.view-toggle.active { background: var(--accent-1); color: #fff; border-color: var(--accent-1); }
.view-toggle i { color: var(--accent-2); }
.view-toggle.active i { color: #fff; }

/* Mesh loading bar — thin fill across the top edge of the viewer */
.mv-progress { position: absolute; top: 0; left: 0; right: 0; height: 3px; z-index: 6; overflow: hidden; opacity: 0; transition: opacity .25s; pointer-events: none; }
.mv-progress.active { opacity: 1; }
.mv-bar { height: 100%; width: 0; background: var(--accent-1); transition: width .2s ease; }
.mv-progress.indeterminate .mv-bar { width: 35%; transition: none; animation: mvIndet 1.05s ease-in-out infinite; }
@keyframes mvIndet { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }

/* Selected-object side panel */
.object-panel {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow); padding: 20px 20px 8px; overflow-y: auto;
}
.object-panel h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 12px; color: var(--text); }
.op-empty { color: var(--text-mute); font-size: .9rem; line-height: 1.6; }
.op-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: .88rem; }
.op-row:last-child { border-bottom: 0; }
.op-row span { color: var(--text-mute); flex: 0 0 auto; }
.op-row b { color: var(--text); font-weight: 600; text-align: right; }
.op-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: middle; border: 1px solid var(--border); }
@media (max-width: 820px) {
  .results-stage { grid-template-columns: 1fr; }
  .viewer-wrap { height: 62vh; }
}
.viewer-hint {
  position: absolute; top: 14px; right: 14px; z-index: 5; pointer-events: none;
  font-size: .78rem; font-weight: 600; color: var(--text-dim);
  background: var(--media-overlay); backdrop-filter: blur(6px);
  padding: 6px 11px; border-radius: 8px; border: 1px solid var(--border);
}
.viewer-hint i { color: var(--accent-2); margin-right: 5px; }

/* Chips (mesh switcher, etc.) */
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 22px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 999px;
  font-family: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; color: var(--text-dim);
  background: var(--surface-2); border: none; transition: .2s;
}
.chip:hover { color: var(--text); transform: translateY(-2px); }
.chip i { color: var(--accent-1); font-size: .82rem; }
.chip.active { color: var(--on-accent); background: var(--grad); }
.chip.active i { color: var(--on-accent); }

/* ===================== RESULTS ===================== */
.result-stage { background: #000; }
.result-stage video { width: 100%; display: block; aspect-ratio: 16 / 10; object-fit: contain; background: #000; }
.scene-strip { display: flex; gap: 12px; overflow-x: auto; padding: 18px 2px 6px; scroll-snap-type: x mandatory; }
.scene-thumb {
  position: relative; flex: 0 0 auto; width: 138px; border-radius: var(--radius-sm); overflow: hidden;
  cursor: pointer; border: 2px solid var(--border); background: var(--surface); padding: 0; scroll-snap-align: start; transition: .2s;
}
.scene-thumb:hover { transform: translateY(-3px); border-color: var(--border-2); }
.scene-thumb.active { border-color: var(--accent-1); }
.scene-thumb img { display: block; width: 100%; height: 84px; object-fit: cover; }
.scene-thumb span { display: block; padding: 7px 8px; font-size: .82rem; color: var(--text-dim); font-weight: 500; text-align: left; }
.scene-thumb.active span { color: var(--text); }

/* ===================== COMPARISON / ABLATION GRID ===================== */
.cmp-view { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.cmp-input { width: 100%; max-width: 360px; }
.cmp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.cmp-grid.cmp-three { grid-template-columns: repeat(3, 1fr); width: 100%; }
.cmp-cell {
  border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); background: var(--surface); transition: border-color .2s;
}
.cmp-cell.ours { border-color: var(--border); }
.cmp-cell video, .cmp-cell img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; background: #000; }
.cmp-head { padding: 9px 13px; font-size: .85rem; font-weight: 600; color: var(--text-dim); display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.cmp-cell.ours .cmp-head { color: var(--text); }
.cmp-badge { font-size: .64rem; font-weight: 700; letter-spacing: .05em; padding: 3px 8px; border-radius: 6px; background: var(--grad); color: var(--on-accent); }

/* Placeholder filling a comparison/ablation cell */
.fig-placeholder.cell {
  aspect-ratio: 4/3; border-radius: 0; border: none; gap: 8px; padding: 10px;
  background: var(--surface-2);
}
.fig-placeholder.cell i { font-size: 1.3rem; }
.fig-placeholder.cell span { font-size: .72rem; text-align: center; line-height: 1.35; }

/* ===================== QUANTITATIVE TABLE ===================== */
.table-wrap { display: flex; justify-content: center; margin-top: 8px; }
.metrics-table {
  border-collapse: collapse; width: 100%; max-width: 560px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; font-variant-numeric: tabular-nums;
}
.metrics-table th, .metrics-table td { padding: 14px 22px; text-align: center; border-bottom: 1px solid var(--border); }
.metrics-table thead th { color: var(--text); font-weight: 700; font-size: .92rem; background: var(--surface-2); }
.metrics-table th:first-child, .metrics-table td:first-child { text-align: left; }
.metrics-table .arrow { color: var(--text-mute); font-weight: 400; }
.metrics-table tbody td { color: var(--text-dim); font-size: .95rem; }
.metrics-table tbody tr:last-child td { border-bottom: 0; }
.metrics-table .ours-row td { color: var(--text); font-weight: 700; background: color-mix(in srgb, var(--accent-1) 10%, transparent); }
.metrics-table .tag {
  display: inline-block; margin-left: 8px; font-size: .64rem; font-weight: 700; letter-spacing: .05em;
  padding: 2px 8px; border-radius: 6px; background: var(--grad); color: var(--on-accent); vertical-align: middle;
}

/* ===================== ABLATION NOTES ===================== */
.ablation-notes { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-top: 32px; }
.abl-note { padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.abl-note h4 { font-family: var(--font-serif); font-size: 1.12rem; font-weight: 400; margin-bottom: 8px; }
.abl-note h4 i { color: var(--accent-2); margin-right: 7px; }
.abl-note p { color: var(--text-dim); font-size: .88rem; line-height: 1.6; }
.abl-note em { color: var(--text); font-style: italic; }

/* ===================== COMPARE SLIDER ===================== */
.compare {
  position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border);
  user-select: none; cursor: ew-resize; box-shadow: var(--shadow); line-height: 0;
}
.compare img { display: block; width: 100%; height: auto; }
.compare-before-wrap { position: absolute; inset: 0; width: 50%; overflow: hidden; }
.compare-before-wrap img { width: auto; max-width: none; height: 100%; }
.compare-after { width: 100%; }
.compare-handle { position: absolute; inset: 0 auto 0 50%; width: 3px; background: var(--grad); transform: translateX(-50%); display: flex; align-items: center; justify-content: center; }
.compare-handle i { position: absolute; width: 42px; height: 42px; border-radius: 50%; background: var(--grad); color: var(--on-accent); font-size: 1rem; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 20px rgba(0,0,0,.5); }
.compare-label { position: absolute; bottom: 14px; padding: 5px 12px; border-radius: 8px; background: var(--media-overlay); backdrop-filter: blur(6px); font-size: .82rem; font-weight: 600; color: var(--text); line-height: 1.4; }
.label-left { left: 14px; } .label-right { right: 14px; }

/* ===================== BIBTEX ===================== */
.bibtex-box { position: relative; }
.bibtex-box pre {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 24px; overflow-x: auto; font-family: 'JetBrains Mono', monospace;
  font-size: .86rem; line-height: 1.7; color: var(--text-dim);
}
.copy-btn {
  position: absolute; top: 14px; right: 14px; background: var(--surface-2); border: none;
  color: var(--text-dim); padding: 8px 15px; border-radius: 8px; font-size: .82rem; font-weight: 600;
  cursor: pointer; transition: .2s; display: inline-flex; align-items: center; gap: 6px; font-family: 'Inter', sans-serif;
}
.copy-btn:hover { color: var(--on-accent); background: var(--accent-1); }
.copy-btn.copied { background: var(--grad); color: var(--on-accent); }

/* ===================== FOOTER ===================== */
.footer { padding: 24px 0; border-top: 1px solid var(--border); text-align: center; }
.footer h3 { font-size: 1.05rem; margin-bottom: 8px; }
.footer p { color: var(--text-dim); max-width: 580px; margin: 0 auto 6px; font-size: .95rem; }
.footer-fine { color: var(--text-mute); font-size: .82rem; }
.visitor-map { margin-top: 12px; display: flex; justify-content: center; }
/* The widget hardcodes a 708px-wide map. `zoom` shrinks it AND reflows the layout box,
   so the whole map stays visible (no clipping / no empty gap, unlike transform: scale). */
.visitor-map #mapmyvisitors-widget { zoom: .3; }

/* ===================== IMAGE PLACEHOLDER FALLBACK ===================== */
img.ph-broken {
  min-height: 280px; display: flex; align-items: center; justify-content: center;
}
.fig-placeholder {
  aspect-ratio: 21/9; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; color: var(--text-mute); border: 1.5px dashed var(--border-2); border-radius: var(--radius);
  background: var(--bg-alt);
}
.fig-placeholder i { font-size: 2rem; color: var(--text-dim); }
.fig-placeholder span { font-family: 'JetBrains Mono', monospace; font-size: .85rem; }

/* ===================== SCROLL REVEAL ===================== */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .aurora { animation: none; }
  html { scroll-behavior: auto; }
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 980px) {
  .stage-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 860px) {
  .ablation-notes { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-right { gap: 12px; }
  .nav-links {
    position: absolute; inset: 100% 0 auto 0; flex-direction: column; gap: 0;
    background: var(--nav-mobile-bg); border-bottom: 1px solid var(--border);
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .nav-links.open { max-height: 380px; }
  .nav-links a { padding: 14px 24px; border-top: 1px solid var(--border); }
  .stats-grid { grid-template-columns: repeat(2,1fr); gap: 24px 12px; }
  .stage-grid { grid-template-columns: 1fr; }
  model-viewer { height: 400px; }
  .hero { min-height: 720px; padding: 80px 0 64px; align-items: flex-end; }
  .hero::before {
    background: linear-gradient(90deg,
      rgba(6,14,28,.93) 0%, rgba(6,14,28,.79) 54%, rgba(6,14,28,.42) 100%);
  }
  .hero::after {
    background: linear-gradient(180deg, rgba(6,14,28,.08) 0%, rgba(6,14,28,.18) 36%, rgba(6,14,28,.82) 100%);
  }
  .hero-media img { object-position: 58% top; }
  .hero-title { font-size: clamp(3.65rem, 18vw, 4.65rem); margin-bottom: 18px; }
  .hero-subtitle { max-width: 620px; margin-bottom: 22px; font-size: 1.24rem; }
  .authors { gap: 7px 22px; font-size: 1rem; }
  .affiliations { margin-bottom: 24px; }
  .hero-buttons { gap: 8px; }
  .hero .btn { padding: 10px 16px; font-size: .92rem; }
  .hero-teaser { margin-top: 36px; }
}
.op-place { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.op-place span { color: var(--text-mute); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.op-place p { margin-top: 5px; font-size: .85rem; color: var(--text-dim); line-height: 1.55; }

.op-actions {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
}
.op-moved-tag { display: flex; align-items: center; gap: 7px; font-size: .8rem; color: var(--accent-2); }
.op-moved-tag.op-hint-tag { color: var(--text-mute); }
.op-moved-tag i { font-size: .78rem; }
.op-actions-btns { display: flex; gap: 6px; margin-left: auto; }
.op-rotate, .op-reset {
  display: inline-flex; align-items: center; gap: 5px;
  font: inherit; font-size: .76rem; font-weight: 600; color: var(--text-mute);
  background: none; border: 1px solid var(--border); border-radius: 6px; padding: 3px 9px; cursor: pointer;
  transition: background .15s, color .15s;
}
.op-rotate:hover, .op-reset:hover { background: var(--surface-2); color: var(--text); }

/* ===== Teaser build-up animation (inlined SVG, element-by-element) ===== */
.teaser-anim{position:relative;display:block;line-height:0}
.teaser-anim .ts-fallback{width:100%;display:block}
.teaser-anim.ready .ts-fallback{display:none}          /* hide raster once the SVG is live */
.teaser-anim svg{width:100%;height:auto;display:block}
/* animated element states (applied to draw.io cells) */
.teaser-anim .ts-cell{opacity:0;transform:translateY(10px);
  transition:opacity .5s ease, transform .5s cubic-bezier(.2,.7,.2,1)}
.teaser-anim .ts-cell.show{opacity:1;transform:none}
.teaser-anim .ts-draw{transition:stroke-dashoffset .55s ease}   /* arrow draw-on */
.ts-replay{position:absolute;right:10px;bottom:10px;z-index:3;border:none;cursor:pointer;
  font-family:inherit;line-height:1;font-size:.8rem;padding:.5em .8em;border-radius:999px;
  background:rgba(20,20,25,.62);color:#fff;opacity:0;transition:opacity .4s ease;
  backdrop-filter:blur(4px);display:inline-flex;align-items:center;gap:.4em}
.teaser-anim.done .ts-replay{opacity:.85}
.ts-replay:hover{opacity:1}
@media (prefers-reduced-motion: reduce){
  .teaser-anim .ts-cell{opacity:1;transform:none;transition:none}
  .teaser-anim .ts-draw{transition:none}
}

/* ===== Teaser sequence-authoring interface (only active with ?author) ===== */
.ts-auth-toggle{position:absolute;left:10px;top:10px;z-index:7;width:30px;height:30px;
  border:none;border-radius:8px;cursor:pointer;background:rgba(20,20,25,.62);color:#fff;font-size:15px}
.teaser-anim.authoring .ts-cell{opacity:1!important;transform:none!important}
.ts-auth-layer{position:absolute;inset:0;z-index:5;cursor:crosshair}
.teaser-anim:not(.authoring) .ts-auth-layer,
.teaser-anim:not(.authoring) .ts-auth-bar{display:none}
.ts-hi{position:absolute;box-sizing:border-box;display:none;pointer-events:none;
  border:2px solid #ff8000;background:rgba(255,128,0,.14)}
.ts-badges{position:absolute;inset:0;pointer-events:none}
.ts-badge{position:absolute;transform:translate(-50%,-50%);background:#23a06a;color:#fff;
  font-size:11px;font-weight:700;padding:1px 6px;border-radius:8px;line-height:16px;white-space:nowrap}
.ts-auth-bar{position:absolute;left:10px;bottom:10px;z-index:6;display:flex;gap:6px;align-items:center;
  flex-wrap:wrap;max-width:calc(100% - 20px);background:rgba(20,20,25,.86);color:#fff;
  font-size:12px;padding:6px 9px;border-radius:9px}
.ts-auth-bar b{margin-right:2px}.ts-auth-bar i{opacity:.8;margin-right:4px}
.ts-auth-bar button{font-family:inherit;font-size:11px;cursor:pointer;border:none;border-radius:6px;padding:3px 9px;background:#eee;color:#111}
.ts-auth-bar button:hover{background:#fff}

/* ===== Video-player-style controls: center play/pause + bottom progress bar ===== */
.teaser-anim.ready{cursor:pointer}          /* whole media is click-to-play/pause */
.ts-controls{position:absolute;inset:0;z-index:4;pointer-events:none}
.ts-center{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);
  width:62px;height:62px;border-radius:50%;border:none;cursor:pointer;pointer-events:auto;
  background:rgba(20,18,15,.55);color:#fff;font-size:1.25rem;line-height:1;
  display:flex;align-items:center;justify-content:center;
  backdrop-filter:blur(4px);transition:opacity .2s,background .2s,transform .08s}
.ts-center:hover{background:rgba(20,18,15,.78)}
.ts-center:active{transform:translate(-50%,-50%) scale(.94)}
.ts-center .fa-play{position:relative;left:2px}   /* optically center the play triangle */
.teaser-anim.ts-playing .ts-center{opacity:0}
.teaser-anim.ts-playing:hover .ts-center{opacity:1}

.ts-controlbar{position:absolute;left:0;right:0;bottom:0;z-index:5;pointer-events:auto;
  display:flex;align-items:center;gap:11px;padding:24px 14px 9px;line-height:1;
  background:linear-gradient(to top,rgba(8,6,4,.5),transparent);
  opacity:0;transition:opacity .25s}
.teaser-anim:hover .ts-controlbar,.teaser-anim:not(.ts-playing) .ts-controlbar{opacity:1}
.ts-scrub{position:relative;flex:1;height:14px;display:flex;align-items:center;cursor:pointer}
.ts-scrub::before{content:'';position:absolute;left:0;right:0;height:4px;border-radius:2px;background:rgba(255,255,255,.32)}
.ts-scrub-fill{position:relative;height:4px;border-radius:2px;width:0;background:#fff;pointer-events:none;transition:width .05s linear}
.ts-scrub:hover::before,.ts-scrub:hover .ts-scrub-fill{height:6px}
.ts-time{flex:0 0 auto;color:#fff;font-size:.74rem;font-family:'JetBrains Mono',monospace;
  font-variant-numeric:tabular-nums;text-shadow:0 1px 3px rgba(0,0,0,.55)}
.teaser-anim.authoring .ts-controls{display:none}
/* Force fixed (light) colors for the draw.io animation SVGs regardless of the
   visitor's dark-mode preference — otherwise light-dark() fills flip to dark. */
#teaserAnim, #pipelineAnim, #teaserAnim svg, #pipelineAnim svg{color-scheme:light only}

/* ===================== MULTI-ROOM APARTMENTS ===================== */
.mr-refs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.mr-ref { margin: 0; position: relative; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
.mr-ref img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.mr-ref figcaption {
  position: absolute; left: 8px; bottom: 8px; font-size: .74rem; font-weight: 600; color: var(--text);
  background: var(--media-overlay); backdrop-filter: blur(6px); padding: 3px 8px; border-radius: 6px; border: 1px solid var(--border);
}
/* The six photos double as room tabs: clicking one flies the viewer to that room. */
.mr-ref[data-room] { cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s; }
.mr-ref[data-room]:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.mr-ref[data-room]:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.mr-ref[data-room].active { border-color: var(--accent-1); box-shadow: 0 0 0 2px var(--accent-1) inset; }
.mr-ref[data-room].active figcaption { background: var(--accent-1); color: var(--on-accent); }

.mr-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; align-items: start; }
.mr-duo figure { margin: 0; }
.mr-duo .cmp-cell img { aspect-ratio: 5 / 4; object-fit: contain; background: #fff; }

/* Left cell: live apartment geometry, matching the still render's 5:4 frame. */
.mr-duo .mr-live .viewer-wrap { aspect-ratio: 5 / 4; height: auto; }
#mrCanvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#mrCanvas:active { cursor: grabbing; }
.mr-overview { bottom: 12px; left: 12px; right: auto; }
.mr-live .viewer-hint { font-size: .72rem; padding: 5px 9px; top: 12px; right: 12px; }

/* Right cell: the offline renders, one at a time. */
.mr-shot-frame {
  position: relative; aspect-ratio: 5 / 4; border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--border); background: #fff;
}
.mr-shots .mr-shot { display: none; width: 100%; height: 100%; aspect-ratio: auto; object-fit: contain; background: #fff; }
.mr-shots .mr-shot.active { display: block; }

/* Two-way view switch over the rendered still. */
.view-switch {
  position: absolute; bottom: 12px; right: 12px; z-index: 6; display: inline-flex;
  border-radius: 8px; overflow: hidden; border: 1px solid var(--border);
  background: var(--media-overlay); backdrop-filter: blur(6px);
}
.view-switch button {
  display: inline-flex; align-items: center; gap: 6px; border: 0; cursor: pointer;
  font-size: .78rem; font-weight: 600; font-family: inherit; color: var(--text);
  background: transparent; padding: 8px 14px; transition: background .15s, color .15s;
}
.view-switch button + button { border-left: 1px solid var(--border); }
.view-switch button:hover { background: var(--surface-2); }
.view-switch button.active { background: var(--accent-1); color: var(--on-accent); }
.view-switch button i { color: var(--accent-2); }
.view-switch button.active i { color: var(--on-accent); }

@media (max-width: 900px) { .mr-refs { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) {
  .mr-refs { grid-template-columns: repeat(2, 1fr); }
  .mr-duo { grid-template-columns: 1fr; }
  .view-switch button { padding: 8px 10px; }
}

/* ===================== HARMONY300 BENCHMARK ===================== */
.h3-lead { color: var(--text-dim); max-width: 78ch; margin: 0 0 22px; }

.h3-tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.h3-tier {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 18px; box-shadow: var(--shadow);
}
.h3-tier header { display: flex; align-items: baseline; gap: 9px; margin-bottom: 10px; }
.h3-badge {
  font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--on-accent); background: var(--accent-1); padding: 3px 9px; border-radius: 6px;
}
.h3-tier header b { font-family: var(--font-serif); font-size: 1.5rem; line-height: 1; }
.h3-n { font-size: .78rem; color: var(--text-mute); }
.h3-tier > p { font-size: .88rem; line-height: 1.55; color: var(--text-dim); margin: 0 0 14px; }

/* input → reconstruction, side by side */
.h3-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px; }
.h3-pair figure { margin: 0; position: relative; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); }
.h3-pair img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.h3-pair figcaption {
  position: absolute; left: 6px; bottom: 6px; font-size: .64rem; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; color: var(--text);
  background: var(--media-overlay); backdrop-filter: blur(6px);
  padding: 2px 6px; border-radius: 5px; border: 1px solid var(--border);
}

/* The supplementary statistics figure, on its own light card. */
.h3-stats { margin: 18px 0 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #fff; box-shadow: var(--shadow); }
.h3-stats img { display: block; width: 100%; height: auto; }
.h3-stats figcaption { padding: 10px 14px; background: var(--surface); border-top: 1px solid var(--border); }

/* Per-scene contents */
.h3-files { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 18px; margin: 20px 0 6px; }
.h3-files div { display: flex; align-items: baseline; gap: 10px; font-size: .86rem; color: var(--text-dim); }
.h3-files code {
  flex: none; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: .78rem;
  background: var(--surface-2); border: 1px solid var(--border); padding: 2px 7px; border-radius: 5px; color: var(--text);
}
.h3-cta { margin-top: 20px; }

@media (max-width: 900px) { .h3-tiers { grid-template-columns: 1fr; } .h3-files { grid-template-columns: 1fr; } }
