:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary-color: #64748b;
  --accent-color: #0ea5e9;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  --background-primary: #ffffff;
  --background-secondary: #f8fafc;
  --background-accent: #f1f5f9;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-accent: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-subtle: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
  --border-radius: 12px;
  --border-radius-lg: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 16px;
  background-color: var(--background-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

[hidden] {
  display: none !important;
}

.button {
  border-radius: var(--border-radius) !important;
  font-weight: 600 !important;
  transition: var(--transition) !important;
  border: 2px solid transparent !important;
  position: relative;
  overflow: hidden;
}

.button.is-dark {
  background: var(--text-primary) !important;
  border: none !important;
  color: white !important;
  box-shadow: var(--shadow-md);
}

.button.is-dark:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: var(--primary-color) !important;
}

.button.is-dark:active {
  transform: translateY(0);
  box-shadow: var(--shadow-md);
}

.footer .icon-link {
    font-size: 25px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.footer .icon-link:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.link-block a,
.link-block button {
    margin: 8px 4px;
}

.publication-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.dnerf {
  font-variant: small-caps;
}

.hero {
  position: relative;
  overflow: hidden;
}

.hero.is-light {
  background: var(--background-secondary);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.hero-body {
  padding: 4rem 1.5rem;
}

.publication-title {
    font-family: 'Inter', sans-serif !important;
    font-weight: 800 !important;
    color: var(--text-primary) !important;
    margin-bottom: 2rem !important;
    line-height: 1.1 !important;
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
}

.publication-title-line {
  display: block;
}

.publication-hero-container {
  max-width: 1320px !important;
}

.publication-title-line--subtitle {
  font-size: clamp(1.5rem, 2.5vw, 2.25rem);
  line-height: 1.15;
}

@media screen and (min-width: 769px) {
  .publication-title-line--subtitle {
    white-space: nowrap;
  }
}

.publication-banner {
  max-height: 70vh;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  margin: 2rem 0;
}

.publication-banner video {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  object-fit: cover;
  width: 100%;
  height: 100%;
  border-radius: var(--border-radius-lg);
}

.publication-header .hero-body {
  padding: 6rem 1.5rem 4rem;
}

.publication-authors {
    font-family: 'Inter', sans-serif !important;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.publication-venue {
    color: var(--text-secondary);
    width: fit-content;
    font-weight: 600;
    background: var(--background-accent);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    margin-top: 1rem;
    display: inline-block;
}

.publication-awards {
    color: #ef4444;
    width: fit-content;
    font-weight: 700;
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    border-left: 4px solid #ef4444;
    margin-top: 1rem;
}

.publication-authors a {
   color: var(--primary-color) !important;
   text-decoration: none;
   font-weight: 600;
   transition: var(--transition);
   position: relative;
}

.publication-authors a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background: var(--gradient-accent);
    transition: var(--transition);
}

.publication-authors a:hover::after {
    width: 100%;
}

.publication-authors a:hover {
    color: var(--primary-hover) !important;
}

.author-block {
  display: inline-block;
  margin-right: 0.5rem;
}

.publication-affiliations .affiliation-line,
.publication-affiliations .eql-cntrb {
  display: block;
}

.publication-affiliations .eql-cntrb {
  margin-top: 0.25rem;
}

.publication-banner img {
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
}

.publication-banner img:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-xl);
}

.paper-figure {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.paper-figure:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.method-overview-video-section {
  padding-top: 0.5rem;
  padding-bottom: 2rem;
}

.method-overview-video-container {
  max-width: 72rem !important;
  margin-inline: auto;
}

.method-overview-video {
  width: 90%;
  margin: 0 auto;
}

.method-overview-video iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
}

.scene-switcher {
  position: relative;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  aspect-ratio: 1320 / 496;
  background: #07090d;
  border-radius: 8px;
  overflow: hidden;
}

.scene-compare-video {
  position: relative;
  width: 100%;
  height: 100%;
  background: #07090d;
  display: none;
  object-fit: contain;
}

.scene-compare-video.is-active {
  display: block;
}

.scene-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--background-primary);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: var(--transition);
  z-index: 2;
}

.scene-nav:hover {
  background: var(--primary-color);
  color: #fff;
}

.scene-nav--prev {
  left: 0.75rem;
}

.scene-nav--next {
  right: 0.75rem;
}

.scene-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 0.75rem;
}

.scene-dot {
  width: 10px;
  height: 10px;
  border: none;
  border-radius: 50%;
  background: #b5b5b5;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 2px 5px rgb(50 50 50 / 0.1);
  transition: transform 0.3s, background-color 0.3s;
}

.scene-dot.is-active,
.scene-dot:hover {
  transform: scale(1.4);
}

.scene-dot.is-active {
  background: #363636;
}

.results-figures {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
}

.results-figure-group {
  width: 100%;
  margin: 0;
}

.results-figure {
  margin: 0;
  min-width: 0;
}

.results-figure .paper-figure {
  width: 100%;
}

.results-figures-caption {
  margin-top: 1rem;
}

.results-caption-part {
  display: inline;
}

.results-figure--speedup {
  flex: 1319 1 0;
}

.results-figure--breakdown {
  flex: 1560 1 0;
}

.method-processing-time-figure {
  width: 100%;
  margin: 2rem 0 0;
}

.method-processing-time-figure img {
  display: block;
  width: min(100%, 24rem);
  margin-inline: auto;
}

.method-processing-time-figure figcaption {
  margin-top: 1rem;
}

.references-list {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.7;
}

.references-list li {
  padding-left: 2.25rem;
  text-indent: -2.25rem;
}

.reference-index {
  color: var(--text-primary);
}

.references-section {
  padding-bottom: 1rem;
}

#BibTeX {
  padding-top: 1rem;
}

.eql-cntrb { 
  font-size: 0.875rem;
  color: var(--text-light);
  font-style: italic;
}

.title.is-3 {
  font-family: 'Inter', sans-serif !important;
  font-weight: 700 !important;
  color: var(--text-primary);
  margin-bottom: 2rem !important;
  position: relative;
  padding-bottom: 1rem;
}

.title.is-3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--gradient-accent);
  border-radius: 2px;
}

.content.has-text-justified {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.content.has-text-justified p {
  margin-bottom: 1.5rem;
}

.method-math-token {
  display: inline-block;
  white-space: nowrap;
}

.footer {
  background: var(--background-secondary);
  border-top: 1px solid var(--border-color);
  padding: 3rem 1.5rem;
}

.footer .content {
  color: var(--text-secondary);
  line-height: 1.7;
}

.footer a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

.footer a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

pre {
  background: var(--background-accent) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--border-radius) !important;
  padding: 1.5rem !important;
  font-size: 0.9rem !important;
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

code {
  background: var(--background-accent) !important;
  color: var(--text-primary) !important;
  font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace !important;
}

.bibtex-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.copy-bibtex-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.copy-bibtex-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.copy-bibtex-btn.copied {
  background: #10b981;
}

.copy-bibtex-btn.copied .copy-text::after {
  content: "ied!";
}

.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--shadow-lg);
}

.scroll-to-top:hover {
  background: var(--primary-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
}

@media screen and (max-width: 768px) {
  .hero-body {
    padding: 2rem 1rem;
  }

  .publication-header .hero-body {
    padding: 3rem 1rem 2rem;
  }

  .publication-title {
    font-size: 2.5rem !important;
    line-height: 1.2 !important;
    margin-bottom: 1.5rem !important;
  }

  .publication-authors {
    font-size: 1rem !important;
  }

  .button {
    margin: 0.25rem !important;
    font-size: 0.875rem !important;
    padding: 0.75rem 1rem !important;
  }

  .results-figures {
    flex-direction: column;
  }

  .content.has-text-justified {
    font-size: 1rem;
  }
}

@media screen and (max-width: 480px) {
  .scroll-to-top {
    display: none;
  }

  .publication-title {
    font-size: 2rem !important;
    line-height: 1.25 !important;
    overflow-wrap: anywhere;
  }

  .publication-authors,
  .author-block {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .publication-affiliations {
    font-size: 0.875rem !important;
  }

  .hero-body {
    padding: 1.5rem 0.75rem;
  }

  .link-block {
    display: block;
    margin-bottom: 0.5rem;
    width: 100%;
  }

  .publication-links {
    flex-direction: column;
    align-items: stretch;
  }

  .button {
    width: 100%;
    justify-content: center;
    white-space: normal !important;
  }

}

@media screen and (max-width: 480px) {
  .scene-nav {
    width: 36px;
    height: 36px;
  }
}

@media screen and (min-width: 769px) and (max-width: 1024px) {
  .hero-body {
    padding: 3rem 2rem;
  }

  .publication-header .hero-body {
    padding: 4rem 2rem 3rem;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero, .section {
  animation: fadeInUp 0.6s ease-out;
}

.button:focus,
.related-works-btn:focus,
a:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.viewer-shell {
  position: relative;
  width: 100%;
  background: transparent;
}

.viewer-shell:fullscreen,
.viewer-shell:-webkit-full-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 12px;
  background: #fff;
  overflow: auto;
}

#viewer-container {
  position: relative;
  width: 100%;
  height: 480px;
  overflow: hidden;
  background: #1a1a2e;
  border-radius: 8px;
}

#viewer-container:focus {
  outline: none;
}

#viewer-container:focus-visible {
  outline: 2px solid var(--primary-color);
}

.viewer-shell:fullscreen #viewer-container,
.viewer-shell:-webkit-full-screen #viewer-container {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  border-radius: 0;
}

.viewer-fullscreen-button {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.92);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.viewer-fullscreen-button:hover {
  background: var(--primary-color);
  color: #fff;
}

#viewer-container.viewer-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: #e0e0e0;
  text-align: center;
}

#viewer-container.viewer-fallback p {
  max-width: 60ch;
  margin: 0;
}

#viewer-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.viewer-fetch-overlay {
  position: absolute;
  top: 14px;
  left: 50%;
  z-index: 2;
  display: flex;
  width: min(70%, 360px);
  transform: translateX(-50%);
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.viewer-fetch-label {
  color: #fff;
  font-size: 0.85rem;
  text-shadow: 0 1px 2px rgb(0 0 0 / 0.6);
}

.viewer-fetch-bar {
  position: relative;
  width: 100%;
  height: 16px;
  overflow: hidden;
  border-radius: 8px;
  background: rgb(255 255 255 / 0.25);
}

.viewer-fetch-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: rgb(255 255 255 / 0.9);
}

.viewer-fetch-pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1a1a2e;
  font-size: 0.75rem;
  font-weight: 600;
}

.viewer-controls {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-top: 12px;
}

.viewer-controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.viewer-controls-row--threshold {
  display: flex;
  width: min(100%, 640px);
}

.viewer-control-label,
.viewer-threshold-label {
  color: #555;
  font-size: 0.95rem;
}

#viewer-scene,
#viewer-event-model,
#viewer-color-mode {
  min-height: 38px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--background-primary);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.95rem;
  padding: 0.45rem 0.7rem;
}

.viewer-threshold-number {
  color: #555;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 0.2rem;
  font-size: 0.95rem;
  min-width: 0;
}

#viewer-threshold-number {
  box-sizing: content-box;
  flex: 0 0 7.5ch;
  min-width: 0;
  min-height: 38px;
  width: 7.5ch;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--background-primary);
  color: var(--text-primary);
  font: inherit;
  font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
  font-size: 0.95rem;
  padding: 0.45rem 0.35rem;
}

.viewer-bbox-toggle {
  color: #555;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.95rem;
  white-space: nowrap;
}

#viewer-threshold {
  accent-color: var(--primary-color);
  flex: 0 1 270px;
  min-width: 0;
  width: min(70%, 270px);
}

.viewer-playback {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.viewer-play-button,
.viewer-step-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--text-primary);
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  min-height: 38px;
  padding: 0;
}

.viewer-play-button {
  width: 44px;
}

.viewer-step-button {
  flex: 0 0 auto;
  width: 38px;
}

.viewer-play-button:disabled,
.viewer-step-button:disabled {
  background: var(--secondary-color);
  cursor: default;
  opacity: 0.7;
}

#viewer-frame {
  accent-color: var(--primary-color);
  flex: 1 1 260px;
  max-width: 360px;
}

.viewer-frame-label,
.viewer-load-progress {
  color: #555;
  font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
  font-size: 0.9rem;
}

.viewer-load-progress {
  text-align: center;
  margin-top: 0;
}

.viewer-load-progress:empty {
  display: none;
}

.viewer-colorbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

#viewer-container.viewer-fallback a {
  color: #6ea8fe;
  text-decoration: underline;
}

.viewer-colorbar-gradient {
  width: 320px;
  max-width: 60%;
  height: 14px;
  border-radius: 7px;
}

.viewer-colorbar-label {
  font-size: 0.9rem;
  color: #555;
}

.viewer-colorbar-title {
  text-align: center;
  font-size: 0.9rem;
  color: #555;
  margin-top: 4px;
}

@media screen and (max-width: 480px) {
  #viewer-controls-primary {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    align-items: center;
    column-gap: 12px;
    row-gap: 10px;
    width: 100%;
  }

  #viewer-controls-primary .viewer-control-label {
    justify-self: end;
    text-align: right;
  }

  #viewer-scene,
  #viewer-event-model,
  #viewer-color-mode {
    min-width: 0;
    width: 100%;
  }

  #viewer-controls-primary .viewer-bbox-toggle {
    justify-content: center;
    justify-self: stretch;
  }

  .viewer-controls-row--threshold {
    display: grid;
    grid-template-columns: 1fr max-content max-content 1fr;
    align-items: center;
    column-gap: 12px;
    row-gap: 8px;
    width: 100%;
  }

  .viewer-threshold-label {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  #viewer-threshold {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
    width: 100%;
  }

  .viewer-threshold-number {
    grid-column: 3;
    grid-row: 1;
    justify-self: start;
    width: auto;
  }

  #viewer-threshold-number {
    box-sizing: border-box;
  }

  .viewer-playback {
    display: grid;
    grid-template-columns: 1fr max-content max-content max-content 1fr;
    align-items: center;
    column-gap: 12px;
    row-gap: 8px;
    width: 100%;
  }

  .viewer-play-button,
  .viewer-step-button {
    justify-self: center;
  }

  #viewer-play {
    grid-column: 2;
  }

  #viewer-prev-frame {
    grid-column: 3;
  }

  #viewer-next-frame {
    grid-column: 4;
  }

  #viewer-frame {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
    width: 100%;
    max-width: none;
  }

  .viewer-frame-label {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: center;
    text-align: center;
  }
}

@media print {
  .hero, .section {
    animation: none;
  }

  .button {
    background: transparent !important;
    color: var(--text-primary) !important;
    box-shadow: none !important;
  }
}
