:root {
  color-scheme: light;
  --text: #1f2933;
  --muted: #5d6874;
  --link: #2868b2;
  --light: #f6f8fa;
  --soft-blue: #f3f7fc;
  --line: #dce2e8;
  --button: #202832;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: #ffffff;
  color: var(--text);
  font-family: "Noto Sans", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

.container {
  width: min(960px, calc(100% - 36px));
  margin: 0 auto;
}

.narrow,
.media-column {
  width: min(900px, calc(100% - 36px));
}

.text-column {
  width: min(840px, calc(100% - 36px));
}

.results-column {
  width: min(1120px, calc(100% - 36px));
}

.gallery-column {
  width: min(980px, calc(100% - 40px));
}

.paper-header {
  padding: 48px 0 38px;
  text-align: center;
}

h1,
h2,
p,
figure {
  margin-top: 0;
}

h1 {
  margin-bottom: 20px;
  font-size: clamp(2rem, 4vw, 2.65rem);
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

h2 {
  margin-bottom: 24px;
  text-align: center;
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.25;
}

.authors {
  margin-bottom: 7px;
  color: #111111;
  font-size: 1.18rem;
  line-height: 1.55;
}

.authors span {
  white-space: nowrap;
}

.authors sup,
.affiliation sup {
  margin-left: 1px;
  font-size: 0.68em;
  line-height: 0;
  vertical-align: super;
}

.author-link {
  color: var(--link);
  font-weight: 500;
  text-decoration: none;
}

.author-link:hover,
.author-link:focus-visible {
  text-decoration: underline;
}

.contribution,
.affiliation,
.status {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 1rem;
}

.contribution {
  margin: 1px 0 4px;
  font-size: 0.94rem;
}

.affiliation {
  margin-bottom: 0;
}

.status {
  margin: 9px 0 19px;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  margin: 12px 0 26px;
}

.link-button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--button);
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

a.link-button:hover,
a.link-button:focus-visible {
  background: #344353;
}

.link-button.disabled {
  cursor: not-allowed;
  opacity: 0.42;
  user-select: none;
}

.teaser {
  width: min(100%, 860px);
  margin: 24px auto 0;
}

.teaser img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
}

.teaser-placeholder {
  display: flex;
  min-height: 240px;
  align-items: center;
  justify-content: center;
  border: 1px dashed #b9c2cb;
  border-radius: var(--radius);
  background: var(--light);
  color: var(--muted);
}

.teaser-placeholder[hidden],
.teaser img[hidden] {
  display: none;
}

.teaser figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.5;
  text-align: center;
}

.section {
  padding: 58px 0;
}

.gallery-section,
.results-section {
  background: var(--light);
}

.gallery-section {
  padding: 48px 0;
}

.gallery-carousel {
  position: relative;
  padding: 18px 24px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(31, 41, 51, 0.06);
}

.scene-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e8ecf0;
}

.current-scene-name {
  font-size: 1.02rem;
  font-weight: 700;
  white-space: nowrap;
}

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

.gallery-slide.is-active {
  animation: gallery-fade 180ms ease-out;
}

@keyframes gallery-fade {
  from {
    opacity: 0.55;
  }
  to {
    opacity: 1;
  }
}

.scene-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 20px;
  align-items: stretch;
}

.scene-result {
  display: grid;
  min-width: 0;
  grid-template-rows: 30px minmax(0, 1fr);
}

.scene-input-group {
  display: grid;
  min-width: 0;
  padding: 14px;
  grid-template-rows: 26px minmax(0, 1fr);
  border: 1px solid #d9e5e4;
  border-radius: 11px;
  background: #f2f7f6;
}

.scene-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.media-item {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 6px;
  min-width: 0;
}

.media-group-title {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}

.media-item-header {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.35;
  white-space: nowrap;
}

.result-header {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.result-name {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.media-card {
  position: relative;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 9px;
  text-align: center;
}

.input-media-card,
.result-media-card {
  border: 1px solid #cbd3db;
  border-radius: 10px;
  background: #f8fafb;
}

.input-media-card {
  aspect-ratio: 1 / 1;
  height: auto;
}

.result-media-card {
  aspect-ratio: 16 / 10;
  border: 1px solid #343d46;
  background: #11171d;
}

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

.carousel-controls {
  margin: 0;
}

.carousel-button {
  position: absolute;
  top: 54%;
  z-index: 2;
  display: flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 0 3px;
  transform: translateY(-50%);
  border: 1px solid #cbd3db;
  border-radius: 50%;
  background: #ffffff;
  color: #344251;
  font: inherit;
  font-size: 1.75rem;
  line-height: 1;
  box-shadow: 0 3px 10px rgba(31, 41, 51, 0.1);
  cursor: pointer;
}

.carousel-button:hover,
.carousel-button:focus-visible {
  border-color: #8fa2b5;
  background: #f3f6f9;
  outline: none;
}

.carousel-button:focus-visible {
  box-shadow: 0 0 0 3px rgba(40, 104, 178, 0.2), 0 3px 10px rgba(31, 41, 51, 0.1);
}

.carousel-previous {
  left: -18px;
}

.carousel-next {
  right: -18px;
}

.scene-index {
  min-width: 48px;
  color: var(--muted);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.tldr-callout {
  padding: 26px 30px;
  border: 1px solid #d7e4f3;
  border-radius: var(--radius);
  background: var(--soft-blue);
  color: #26394d;
  font-size: 1.17rem;
  font-weight: 500;
  line-height: 1.65;
  text-align: center;
}

.method-figure {
  margin-bottom: 22px;
}

.method-intro {
  width: min(1000px, 100%);
  margin: 0 auto 22px;
  color: #3f4a55;
  font-size: 1rem;
  line-height: 1.7;
  text-align: left;
}

.method-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0 0;
  padding: 0;
  counter-reset: method-stage;
  list-style: none;
}

.method-flow li {
  position: relative;
  display: flex;
  height: 100%;
  min-width: 0;
  flex-direction: column;
  padding: 16px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #ffffff;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  overflow-wrap: anywhere;
  counter-increment: method-stage;
}

.method-flow li::before {
  display: block;
  width: 25px;
  height: 25px;
  margin: 0 auto 9px;
  border-radius: 50%;
  background: #e7eef6;
  color: #315a87;
  content: counter(method-stage);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 25px;
}

.method-flow strong,
.method-flow span {
  display: block;
}

.method-flow strong {
  margin-bottom: 6px;
  color: var(--text);
}

.method-flow span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 400;
  line-height: 1.45;
}

.result-media {
  width: 100%;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 5px 18px rgba(31, 41, 51, 0.06);
}

.result-media img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
}

.bibtex-section {
  border-top: 1px solid #eef1f4;
}

pre {
  margin: 0;
  padding: 19px 21px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f8fa;
  color: #20252b;
  font-size: 0.88rem;
  line-height: 1.55;
  text-align: left;
}

footer {
  padding: 28px 0 38px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
}

footer p {
  margin-bottom: 0;
}

@media (max-width: 800px) {
  .gallery-carousel {
    padding: 20px;
  }

  .scene-layout {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .scene-input-group,
  .scene-result {
    grid-template-rows: 30px auto;
  }

  .scene-inputs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
  }

  .input-media-card {
    aspect-ratio: 1 / 1;
    height: auto;
  }

  .carousel-controls {
    display: flex;
    justify-content: center;
    gap: 22px;
    margin-top: 18px;
  }

  .carousel-button {
    position: static;
    transform: none;
  }
}

@media (max-width: 760px) {
  .paper-header {
    padding-top: 34px;
  }

  h1 {
    font-size: 1.78rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .section {
    padding: 45px 0;
  }

  .authors {
    font-size: 1.03rem;
  }

  .method-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 520px) {
  .container,
  .narrow,
  .media-column,
  .text-column,
  .results-column,
  .gallery-column {
    width: min(100% - 24px, 960px);
  }

  .link-row {
    gap: 7px;
  }

  .link-button {
    min-height: 34px;
    padding: 7px 12px;
    font-size: 0.82rem;
    white-space: normal;
  }

  .tldr-callout {
    padding: 21px 18px;
    font-size: 1.04rem;
  }

  .method-flow {
    grid-template-columns: 1fr;
  }

  .gallery-carousel {
    padding: 14px;
  }

  .scene-inputs {
    gap: 10px;
  }

  .media-item-header {
    font-size: 0.8rem;
  }

  .scene-result {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .result-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    margin-bottom: 7px;
  }

  .carousel-controls {
    gap: 20px;
  }

  .carousel-button {
    width: 42px;
    height: 42px;
  }

  pre {
    padding: 15px;
    font-size: 0.77rem;
  }
}
