:root {
  --ink: #172033;
  --muted: #596276;
  --paper: #ffffff;
  --warm: #fffaf0;
  --amber: #f59e0b;
  --orange: #ea580c;
  --violet: #7557d5;
  --line: #e8e5df;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
}

body {
  color: var(--ink);
  background: var(--paper);
  font-family: 'Noto Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

a {
  color: #6946cc;
}

.navbar {
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(23, 32, 51, 0.08);
  backdrop-filter: blur(14px);
}

.navbar-item {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
}

.navbar-item:hover,
.navbar-item:focus {
  color: var(--violet) !important;
  background: transparent !important;
}

.brand {
  gap: 0.55rem;
  font-family: 'Google Sans', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
}

.brand-mark {
  width: 1.15rem;
  height: 1.15rem;
  display: inline-block;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--amber), var(--orange) 52%, var(--violet));
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.12);
}

.publication-header {
  padding-top: 6rem;
  background:
    radial-gradient(circle at 17% 18%, rgba(245, 158, 11, 0.18), transparent 31%),
    radial-gradient(circle at 83% 30%, rgba(117, 87, 213, 0.13), transparent 28%),
    linear-gradient(180deg, var(--warm) 0%, #fff 100%);
}

.publication-header .hero-body {
  padding-bottom: 2.5rem;
}

.eyebrow,
.section-kicker {
  margin-bottom: 0.7rem;
  color: var(--orange);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.publication-title {
  max-width: 1050px;
  margin: 0 auto 1.4rem !important;
  color: var(--ink);
  font-family: 'Google Sans', sans-serif;
  font-size: clamp(2.3rem, 5vw, 4.4rem) !important;
  font-weight: 700 !important;
  letter-spacing: -0.045em;
  line-height: 1.04 !important;
}

.gradient-word {
  background: linear-gradient(100deg, var(--orange), var(--amber) 47%, var(--violet) 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.publication-authors,
.publication-affiliations {
  font-family: 'Google Sans', sans-serif;
}

.publication-authors {
  font-size: 1.25rem;
  font-weight: 500;
}

.publication-affiliations {
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 1rem;
}

.author-block {
  display: inline-block;
  margin: 0.15rem 0.65rem;
}

.publication-authors a {
  color: inherit;
  text-decoration: none;
}

.publication-authors a:hover {
  color: #6946cc;
  text-decoration: underline;
}

.publication-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 1.6rem;
}

.resource-button {
  min-width: 8.6rem;
  color: #fff !important;
  background: var(--ink) !important;
  border: 0 !important;
  box-shadow: 0 8px 22px rgba(23, 32, 51, 0.12);
  font-weight: 600;
}

.resource-button:hover,
.resource-button:focus {
  background: var(--violet) !important;
  transform: translateY(-1px);
}

.resource-button small {
  margin-left: 0.25rem;
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.68rem;
  font-weight: 500;
}

.resource-button.is-unavailable {
  cursor: default;
  opacity: 0.58;
  box-shadow: none;
}

.teaser .hero-body {
  padding-top: 1rem;
  padding-bottom: 4rem;
}

.chapter-tabs {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 800px;
  margin: 0 auto -1px;
  padding: 0 0.7rem;
}

.chapter-tab {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 0.75rem 1.1rem;
  color: var(--muted);
  background: #f3f1ec;
  border: 1px solid var(--line);
  border-bottom-color: var(--line);
  cursor: pointer;
  font: inherit;
  font-family: 'Google Sans', sans-serif;
  font-size: 0.98rem;
  font-weight: 600;
}

.chapter-tab:first-child {
  border-radius: 14px 0 0 0;
}

.chapter-tab:last-child {
  border-radius: 0 14px 0 0;
}

.chapter-tab + .chapter-tab {
  border-left: 0;
}

.chapter-tab:hover,
.chapter-tab:focus-visible {
  color: var(--violet);
  background: #faf9f6;
  outline: none;
}

.chapter-tab.is-active {
  color: var(--ink);
  background: #fff;
  border-bottom-color: #fff;
}

.chapter-tab.is-active::after {
  position: absolute;
  right: 20%;
  bottom: 0.42rem;
  left: 20%;
  height: 3px;
  background: linear-gradient(90deg, var(--orange), var(--amber), var(--violet));
  border-radius: 999px;
  content: '';
}

.chapter-number {
  color: var(--orange);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

.chapter-viewer {
  padding: 1.25rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 22px 60px rgba(23, 32, 51, 0.1);
}

.chapter-panel[hidden] {
  display: none;
}

.sample-grid {
  display: grid;
  gap: 1rem;
}

.sample-grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sample-grid-four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.video-sample {
  min-width: 0;
  padding: 0.55rem;
  overflow: hidden;
  background: #f6f5f2;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.video-sample h3 {
  min-height: 1.5rem;
  margin: 0.2rem 0.25rem 0.55rem;
  color: var(--ink);
  font-family: 'Google Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
}

.result-video {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  background: #fff;
  border-radius: 9px 9px 4px 4px;
  object-fit: cover;
}

.lighting-strip {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: clamp(70px, 7.3vw, 100px);
  margin-top: 0.4rem;
  overflow: hidden;
  background: #fff;
  border: 1px solid #ece9e2;
  border-radius: 4px 4px 9px 9px;
}

.lighting-label {
  position: absolute;
  z-index: 1;
  top: 0.35rem;
  left: 0.4rem;
  padding: 0.18rem 0.38rem;
  color: #fff;
  background: rgba(23, 32, 51, 0.72);
  border-radius: 5px;
  font-size: 0.59rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  line-height: 1.2;
  text-transform: uppercase;
}

.lighting-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.lighting-video.is-envmap {
  object-fit: cover;
}

.chapter-caption {
  max-width: 820px;
  margin: 1.15rem auto 0.2rem;
  color: var(--muted);
  font-family: 'Google Sans', sans-serif;
  font-size: 1.05rem;
  line-height: 1.55;
  text-align: center;
}

.paper-figure {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 20px 55px rgba(23, 32, 51, 0.09);
}

.paper-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.section {
  padding-top: 5.5rem;
  padding-bottom: 5.5rem;
}

.section-heading {
  max-width: 780px;
  margin: 0 auto 2.5rem;
}

.section .title {
  color: var(--ink);
  font-family: 'Google Sans', sans-serif;
  letter-spacing: -0.025em;
}

.section-lede {
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.65;
}

.abstract-heading {
  margin-bottom: 2rem;
}

.abstract-copy {
  color: #384154;
  font-size: 1.03rem;
  line-height: 1.82;
}

.abstract-copy strong {
  color: var(--ink);
}

.tldr-card {
  position: relative;
  overflow: hidden;
  margin-top: 2rem;
  padding: 1.6rem;
  color: #384154;
  background: linear-gradient(145deg, #fffaf0, #f7f3ff);
  border: 1px solid rgba(117, 87, 213, 0.2);
  border-radius: 16px;
  box-shadow: 0 14px 34px rgba(23, 32, 51, 0.08);
  font-size: 0.98rem;
  line-height: 1.72;
}

.tldr-card::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--amber), var(--orange), var(--violet));
  content: '';
}

.tldr-card p:last-child {
  margin-bottom: 0;
}

.tldr-label {
  margin-bottom: 0.7rem;
  color: var(--violet);
  font-family: 'Google Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.method-section {
  background: #f7f6fb;
}

.architecture-figure {
  margin-bottom: 2.25rem;
  padding: 1rem;
}

.method-cards {
  margin-top: 0.5rem;
}

.method-card {
  height: 100%;
  padding: 1.6rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: 0 10px 26px rgba(23, 32, 51, 0.05);
}

.featured-card {
  border-color: rgba(117, 87, 213, 0.34);
  box-shadow: 0 12px 30px rgba(117, 87, 213, 0.11);
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.3rem;
  height: 2.3rem;
  margin-bottom: 1.15rem;
  color: #fff;
  background: linear-gradient(135deg, var(--orange), var(--violet));
  border-radius: 50%;
  font-family: 'Google Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
}

.method-card .title {
  margin-bottom: 0.65rem !important;
}

.method-card p {
  color: var(--muted);
  line-height: 1.65;
}

.gallery-chapter-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 820px;
  margin: 0 auto 2rem;
  overflow: hidden;
  background: #f4f2ed;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.gallery-chapter-tab {
  padding: 0.9rem 0.65rem;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-family: 'Google Sans', sans-serif;
  font-weight: 700;
}

.gallery-chapter-tab + .gallery-chapter-tab {
  border-left: 1px solid var(--line);
}

.gallery-chapter-tab span {
  margin-right: 0.35rem;
  color: var(--orange);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

.gallery-chapter-tab:hover,
.gallery-chapter-tab:focus-visible {
  color: var(--violet);
  outline: none;
}

.gallery-chapter-tab.is-active {
  color: #fff;
  background: var(--ink);
}

.gallery-chapter-tab.is-active span {
  color: #fbc56c;
}

.results-gallery {
  min-height: 520px;
}

.results-gallery-panel[hidden] {
  display: none;
}

.gallery-panel-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  max-width: 1050px;
  margin: 0 auto 1.5rem;
}

.gallery-panel-heading .title {
  margin-bottom: 0.35rem !important;
}

.gallery-panel-heading p {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.6;
}

.gallery-panel-heading > span {
  flex: 0 0 auto;
  padding: 0.4rem 0.7rem;
  color: var(--muted);
  background: var(--warm);
  border: 1px solid #f0e4c8;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.object-results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.35rem;
  max-width: 1050px;
  margin: 0 auto;
}

.progressive-results-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
}

.scene-results-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
}

.result-gallery-card {
  min-width: 0;
  padding: 0.65rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: 0 12px 32px rgba(23, 32, 51, 0.08);
}

.result-card-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.2rem 0.25rem 0.65rem;
}

.result-card-heading h4 {
  margin: 0;
  color: var(--ink);
  font-family: 'Google Sans', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
}

.result-card-heading span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-card-video {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  background: #f6f5f2;
  border-radius: 10px 10px 5px 5px;
  object-fit: cover;
}

.result-lighting-preview {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 82px;
  margin-top: 0.45rem;
  overflow: hidden;
  background: #f7f6f3;
  border: 1px solid #eeece7;
  border-radius: 5px;
}

.result-lighting-preview > span {
  position: absolute;
  z-index: 1;
  top: 0.35rem;
  left: 0.4rem;
  padding: 0.16rem 0.35rem;
  color: #fff;
  background: rgba(23, 32, 51, 0.72);
  border-radius: 5px;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.result-lighting-preview video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.result-lighting-preview video.is-envmap {
  object-fit: cover;
}

.result-condition-switcher {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  margin-top: 0.6rem;
}

.result-condition {
  min-width: 0;
  padding: 0.48rem 0.35rem;
  overflow: hidden;
  color: var(--muted);
  background: #f3f1ec;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  font: inherit;
  font-size: 0.69rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-condition:hover,
.result-condition:focus-visible {
  color: var(--violet);
  border-color: rgba(117, 87, 213, 0.3);
  outline: none;
}

.result-condition.is-active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.progressive-gallery-card .result-lighting-preview {
  height: 70px;
}

.progressive-switcher {
  display: flex;
}

.progressive-switcher .result-condition {
  position: relative;
  flex: 1;
  border-radius: 5px;
}

.progressive-switcher .result-condition::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--line);
  content: '';
}

.progressive-switcher .result-condition.is-active::before {
  background: linear-gradient(90deg, var(--amber), var(--orange), var(--violet));
}

.bibtex-section {
  background: var(--warm);
}

.bibtex-block {
  position: relative;
}

.bibtex-block pre {
  margin: 0;
  padding: 1.6rem 5.5rem 1.6rem 1.6rem;
  overflow-x: auto;
  color: #e8ecf5;
  background: var(--ink);
  border-radius: 14px;
  box-shadow: 0 16px 38px rgba(23, 32, 51, 0.14);
  font-size: 0.92rem;
}

.copy-button {
  position: absolute;
  z-index: 2;
  top: 0.8rem;
  right: 0.8rem;
  padding: 0.48rem 0.7rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
}

.copy-button:hover,
.copy-button:focus {
  background: rgba(255, 255, 255, 0.2);
}

.copy-button span {
  margin-left: 0.25rem;
}

.footer {
  padding: 2.5rem 1.5rem;
  color: var(--muted);
  background: #fff;
  border-top: 1px solid var(--line);
}

.template-credit {
  font-size: 0.84rem;
}

@media screen and (max-width: 1023px) {
  .navbar-menu {
    border-top: 1px solid var(--line);
    box-shadow: none;
  }

  .navbar-menu.is-active {
    display: block;
  }
}

@media screen and (max-width: 768px) {
  .publication-header {
    padding-top: 4.75rem;
  }

  .publication-header .hero-body {
    padding: 2.5rem 1.25rem 1.5rem;
  }

  .publication-title {
    font-size: clamp(2rem, 10vw, 3.2rem) !important;
  }

  .publication-authors {
    font-size: 1.08rem;
  }

  .author-block {
    margin: 0.12rem 0.35rem;
  }

  .teaser .hero-body {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .chapter-tabs {
    padding: 0;
  }

  .chapter-tab {
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.72rem 0.25rem 0.95rem;
    font-size: 0.75rem;
    line-height: 1.15;
  }

  .chapter-viewer {
    padding: 0.7rem;
    border-radius: 0 0 14px 14px;
  }

  .sample-grid-three,
  .sample-grid-four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .video-sample h3 {
    min-height: 2.2rem;
    font-size: 0.78rem;
  }

  .lighting-strip {
    height: 62px;
  }

  .chapter-caption {
    padding: 0 0.35rem;
    font-size: 0.9rem;
  }

  .paper-figure {
    border-radius: 12px;
  }

  .section {
    padding: 4rem 1.2rem;
  }

  .architecture-figure {
    padding: 0.4rem;
  }

  .gallery-chapter-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.12rem;
    padding: 0.7rem 0.25rem;
    font-size: 0.72rem;
    line-height: 1.15;
  }

  .gallery-chapter-tab span {
    margin: 0;
  }

  .gallery-panel-heading {
    align-items: flex-start;
  }

  .gallery-panel-heading > span {
    display: none;
  }

  .object-results-grid,
  .scene-results-grid,
  .progressive-results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .result-gallery-card {
    padding: 0.4rem;
    border-radius: 11px;
  }

  .result-card-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.05rem;
    padding: 0.15rem 0.15rem 0.5rem;
  }

  .result-card-heading h4 {
    font-size: 0.88rem;
  }

  .result-card-heading span {
    font-size: 0.62rem;
  }

  .result-lighting-preview,
  .progressive-gallery-card .result-lighting-preview {
    height: 58px;
  }

  .result-condition-switcher {
    gap: 0.22rem;
    margin-top: 0.4rem;
  }

  .result-condition {
    padding: 0.4rem 0.2rem;
    font-size: 0.58rem;
  }

  .bibtex-block pre {
    padding: 3.5rem 1rem 1rem;
    font-size: 0.76rem;
  }
}

@media screen and (max-width: 480px) {
  .object-results-grid,
  .scene-results-grid,
  .progressive-results-grid {
    grid-template-columns: 1fr;
  }
}

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

  .chapter-panel video {
    visibility: visible;
  }

  .results-gallery-panel video {
    visibility: visible;
  }
}
