:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #1a202c;
  --muted: #4a5568;
  --accent: #2b6cb0;
  --accent-hover: #2c5282;
  --border: #e2e8f0;
  --hero-bg: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  --max-width: 1100px;
  --radius: 10px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.hero {
  background: var(--hero-bg);
  color: #f7fafc;
  text-align: center;
  padding: 4rem 1.5rem 3.5rem;
}

.hero-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  line-height: 1.1;
}

.hero-title__brand {
  display: block;
  width: 100%;
  max-width: 518px;
  margin: 0 auto;
  padding: 0;
}

.hero-title__brand-scaler {
  container-type: inline-size;
  width: 100%;
  overflow: hidden;
  display: flex;
  justify-content: center;
  height: calc(74px * min(1, 100cqw / 518px));
  max-height: 74px;
}

.hero-title__brand-scaler__inner {
  width: 518px;
  flex-shrink: 0;
  transform-origin: top center;
  transform: scale(min(1, calc(100cqw / 518px)));
  line-height: 0;
}

.hero-title__brand-scaler__inner img {
  width: 518px;
  height: 74px;
  object-fit: contain;
  display: block;
}

.hero-title__project {
  font-size: clamp(3rem, 7.5vw, 4.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.hero .subtitle {
  font-size: clamp(1.4rem, 3.8vw, 1.9rem);
  max-width: 52rem;
  margin: 0 auto 1.5rem;
  color: #cbd5e0;
  line-height: 1.5;
}

.hero .authors {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 0.35rem 0.55rem;
  font-size: 1.28rem;
  margin-bottom: 0.5rem;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1rem;
  line-height: 1.6;
  overflow-x: auto;
  scrollbar-width: none;
}

.hero .authors::-webkit-scrollbar {
  display: none;
}

.hero .authors .author {
  flex-shrink: 0;
  white-space: nowrap;
}

.hero .authors .author-sep {
  flex-shrink: 0;
  color: #718096;
  font-weight: 300;
  user-select: none;
  padding: 0;
}

.hero .affiliations {
  font-size: 1.18rem;
  color: #a0aec0;
  margin: 0.5rem auto 0.25rem;
  max-width: 52rem;
  line-height: 1.5;
}

.hero .affiliations sup {
  margin-right: 0.2rem;
  font-weight: 600;
  color: #cbd5e0;
}

.hero .authors sup {
  font-size: 0.75em;
  font-weight: 500;
  margin-left: 0.05em;
}

.hero .authors sup .corr-mark {
  display: inline-block;
  margin-left: 0.12em;
  color: #90cdf4;
  text-decoration: none;
  line-height: 0;
  vertical-align: baseline;
  transition: color 0.15s;
}

.hero .authors sup .corr-mark:hover {
  color: #bee3f8;
  text-decoration: none;
}

.hero .authors sup .corr-mark svg {
  width: 0.82em;
  height: 0.82em;
  vertical-align: 0.05em;
}

.hero .note sup .corr-mark {
  color: #90cdf4;
  text-decoration: none;
  line-height: 0;
}

.hero .note sup .corr-mark:hover {
  color: #bee3f8;
  text-decoration: none;
}

.hero .note sup .corr-mark svg {
  width: 0.82em;
  height: 0.82em;
  vertical-align: 0.05em;
}

.hero .note {
  font-size: 0.98rem;
  color: #718096;
  margin-bottom: 1.25rem;
}

.affiliation-logos-scaler {
  container-type: inline-size;
  width: 100%;
  max-width: var(--max-width);
  overflow: hidden;
  display: flex;
  justify-content: center;
  margin: 0 auto 1.75rem;
  height: calc(96px * min(1, 100cqw / 1100px));
  max-height: 96px;
}

.affiliation-logos-scaler__inner {
  width: 1100px;
  flex-shrink: 0;
  transform-origin: top center;
  transform: scale(min(1, calc(100cqw / 1100px)));
}

.affiliation-logos {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 2.25rem;
  width: 1100px;
  margin: 0;
  padding: 0;
}

.affiliation-logos img {
  flex-shrink: 0;
  height: 64px;
  width: auto;
  max-width: 260px;
  object-fit: contain;
  opacity: 0.92;
  transition: opacity 0.15s;
}

.affiliation-logos img:hover {
  opacity: 1;
}

.affiliation-logos img.affiliation-logos__ace {
  height: 89px;
  max-width: 462px;
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.75rem;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.35rem;
  padding: 0.55rem 1.25rem;
  box-sizing: border-box;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
}

.btn.primary {
  background: #4299e1;
  color: #fff;
}

.btn.primary:hover {
  background: #3182ce;
  text-decoration: none;
}

.btn--pdf .btn__row,
.btn--github .btn__row,
.btn--dataset .btn__row {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-align: left;
}

.btn--pdf .btn__icon,
.btn--github .btn__icon,
.btn--dataset .btn__icon {
  width: 1.35rem;
  height: 1.35rem;
  flex-shrink: 0;
  opacity: 0.95;
  display: block;
}

.btn--pdf .btn__text,
.btn--github .btn__text,
.btn--dataset .btn__text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  line-height: 1.2;
}

.btn--pdf .btn__title,
.btn--github .btn__title,
.btn--dataset .btn__title {
  font-size: 0.95rem;
}

.btn--pdf .btn__meta,
.btn--github .btn__meta,
.btn--dataset .btn__meta {
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.88;
  letter-spacing: 0.02em;
}

.btn--pdf .btn__format {
  font-weight: 700;
  letter-spacing: 0.06em;
}

.btn--arxiv {
  background: #b31b1b;
  color: #fff;
  border: 1px solid #9a1616;
}

.btn--arxiv:hover {
  background: #9a1616;
  text-decoration: none;
}

.btn--arxiv .btn__row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn--arxiv .btn__arxiv-logo {
  display: block;
  height: 2.05rem;
  width: auto;
  max-width: 5.75rem;
  margin: 0;
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.btn.secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  text-decoration: none;
}

.btn.disabled {
  background: rgba(255, 255, 255, 0.06);
  color: #718096;
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: default;
  pointer-events: none;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

section {
  padding: 3rem 0;
  border-bottom: 1px solid var(--border);
}

section:last-of-type {
  border-bottom: none;
}

section h2 {
  font-size: 1.75rem;
  margin-bottom: 1.25rem;
  text-align: center;
  color: var(--text);
}

.teaser-showcase {
  margin-top: 1.5rem;
  padding: 0;
  container-type: inline-size;
  border-bottom: none;
}

.video-demo {
  padding-top: 2.5rem;
}

.video-demo__figure {
  margin: 1rem 0 0;
}

.video-demo__player {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  background: #1a202c;
  vertical-align: middle;
}

.teaser-scaler {
  width: 100%;
  overflow: hidden;
  display: flex;
  justify-content: center;
  height: calc(500px * min(1, 100cqw / 1100px));
  max-height: 500px;
}

.teaser-scaler__inner {
  width: 1100px;
  flex-shrink: 0;
  transform-origin: top center;
  transform: scale(min(1, calc(100cqw / 1100px)));
}

.teaser-grid {
  display: grid;
  grid-template-columns: 1.2fr 2.8fr;
  gap: 0.5rem;
  align-items: stretch;
  width: 1100px;
}

.teaser-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.teaser-panel__title {
  margin: 0;
  padding: 0.85rem 1.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
  color: #fff;
  background: linear-gradient(90deg, #5b4b9a 0%, #6d5cad 50%, #5b4b9a 100%);
}

.teaser-panel.teaser-panel--datasets {
  background: #dce4ee;
}

.teaser-panel--datasets .teaser-panel__title {
  background: linear-gradient(90deg, #4c3d8a 0%, #6a56b8 100%);
}

.teaser-panel--datasets .dataset-cards {
  background: #dce4ee;
}

.teaser-panel--generation .teaser-panel__title {
  background: linear-gradient(90deg, #5a458f 0%, #7b62b5 100%);
}

.teaser-panel.teaser-panel--generation {
  background: #dce4ee;
}

.teaser-panel--generation .teaser-panel__visual {
  background: #dce4ee;
}

.dataset-cards {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.dataset-card {
  display: grid;
  grid-template-columns: minmax(92px, 0.95fr) 1.05fr;
  gap: 0.65rem;
  padding: 0.85rem;
  align-items: center;
  flex: 1;
  min-height: 0;
  border-bottom: 1px solid var(--border);
}

.dataset-card:last-child {
  border-bottom: none;
}

.dataset-card__media {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 0;
  line-height: 0;
}

.dataset-card__media img {
  width: 100%;
  max-width: 130px;
  max-height: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
}

.dataset-card__stat {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
  letter-spacing: -0.02em;
}

.dataset-card__name {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0.2rem 0 0.55rem;
  line-height: 1.35;
}

.dataset-card__tags {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.dataset-card__tags li {
  font-size: 0.82rem;
  color: var(--text);
  padding-left: 1.15rem;
  position: relative;
}

.dataset-card__tags li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #38a169;
  font-weight: 700;
  font-size: 0.75rem;
}

.teaser-panel--generation {
  min-height: 0;
}

.teaser-panel__visual {
  flex: 1;
  display: flex;
  min-height: 0;
  line-height: 0;
}

.teaser-panel__visual img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center top;
  display: block;
}

.teaser-panel__visual.img-loadable {
  width: 100%;
}

.teaser-panel__visual.img-loadable .img-loadable__frame {
  flex: 1;
  width: 100%;
  min-height: 10rem;
}

.teaser-panel__visual.img-loadable.is-loading .img-loadable__frame {
  background: linear-gradient(110deg, #d5dde8 8%, #c8d4e2 18%, #d5dde8 33%);
}

.teaser-panel__visual.img-loadable .img-loadable__frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center top;
}

.abstract__subtitle {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  margin: 0 0 1rem;
}

.keypoints {
  list-style: none;
  counter-reset: keypoint;
  width: 100%;
  margin: 0 0 1.5rem;
  padding: 1.5rem 2rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(3, auto);
  grid-auto-flow: column;
  gap: 1.35rem 3rem;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.keypoints li {
  position: relative;
  padding: 0 0 0 2.5rem;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.65;
  text-align: left;
}

.keypoints li::before {
  counter-increment: keypoint;
  content: counter(keypoint);
  position: absolute;
  left: 0;
  top: 0.15rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.5rem;
  text-align: center;
}

.keypoints li strong {
  display: block;
  color: var(--text);
  font-size: 1.02rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  line-height: 1.35;
}

@media (max-width: 720px) {
  .keypoints {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-auto-flow: row;
    padding: 1.25rem 1.35rem;
    gap: 1.1rem;
  }
}

.abstract-full {
  width: 100%;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.abstract-full summary {
  padding: 0.85rem 1.15rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.abstract-full summary::-webkit-details-marker {
  display: none;
}

.abstract-full summary::after {
  content: " ▾";
  font-size: 0.85em;
}

.abstract-full[open] summary::after {
  content: " ▴";
}

.abstract-full__body {
  padding: 0 1.15rem 1.15rem;
  border-top: 1px solid var(--border);
}

.abstract-full__body p {
  text-align: justify;
  text-align-last: left;
  text-justify: inter-word;
  hyphens: auto;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.75;
  margin: 0;
  padding-top: 1rem;
}

.pipeline-steps {
  margin-top: 1.5rem;
  display: grid;
  gap: 1rem;
}

.pipeline-steps li {
  list-style: none;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-left: 4px solid var(--accent);
}

.pipeline-steps strong {
  color: var(--accent);
}

.figure {
  margin: 1.5rem 0;
}

.figure img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.figure--method img,
.figure--result img {
  aspect-ratio: auto;
  height: auto;
  object-fit: contain;
}

.img-loadable__frame {
  position: relative;
  background: transparent;
  border: none;
  border-radius: 0;
}

.img-loadable.is-loading .img-loadable__frame {
  min-height: 12rem;
  background: linear-gradient(110deg, #edf2f7 8%, #e2e8f0 18%, #edf2f7 33%);
  background-size: 200% 100%;
  animation: img-shimmer 1.4s ease-in-out infinite;
}

.img-loadable__spinner {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  color: var(--muted);
  transition: opacity 0.25s ease;
}

.img-loadable__spinner-ring {
  width: 2rem;
  height: 2rem;
  border: 3px solid #cbd5e0;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: img-spin 0.75s linear infinite;
}

.img-loadable__spinner-text {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.img-loadable__frame img {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.img-loadable.is-loaded .img-loadable__frame {
  min-height: 0;
  animation: none;
  background: transparent;
}

.img-loadable.is-loaded .img-loadable__spinner {
  opacity: 0;
  pointer-events: none;
}

.img-loadable.is-loaded .img-loadable__frame img {
  opacity: 1;
}

.img-loadable.is-error .img-loadable__spinner {
  color: #c53030;
}

.img-loadable.is-error .img-loadable__spinner-ring {
  border-top-color: #c53030;
  animation: none;
}

@keyframes img-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes img-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .img-loadable.is-loading .img-loadable__frame {
    animation: none;
  }

  .img-loadable__spinner-ring {
    animation: none;
    border-top-color: var(--accent);
  }
}

.result-block {
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: none;
  position: relative;
}

.result-block:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    #d1d9e6 12%,
    #d1d9e6 88%,
    transparent 100%
  );
}

.result-block:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
}

.result-block__title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  margin-bottom: 1rem;
  letter-spacing: 0.01em;
}

.figure figcaption {
  padding: 0.75rem 1rem 0;
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.gallery .figure img {
  aspect-ratio: 4 / 3;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: 1rem 0;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

th,
td {
  padding: 0.65rem 0.85rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

th {
  background: #edf2f7;
  font-weight: 600;
}

tr:last-child td {
  border-bottom: none;
}

tr.highlight td {
  font-weight: 600;
  background: #ebf8ff;
}

.table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
}

#bibtex pre {
  background: #1a202c;
  color: #e2e8f0;
  padding: 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
}

footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
}

footer a {
  color: var(--accent);
}

/* Mobile: fluid layout instead of transform scale (smoother + readable) */
@media (max-width: 900px) {
  .hero-title__brand-scaler,
  .affiliation-logos-scaler,
  .teaser-scaler,
  .teaser-showcase {
    container-type: normal;
  }

  .hero-title__brand-scaler {
    height: auto;
    max-height: none;
  }

  .hero-title__brand-scaler__inner {
    width: 100%;
    max-width: 518px;
    transform: none;
  }

  .hero-title__brand-scaler__inner img {
    width: 100%;
    height: auto;
    max-height: 74px;
  }

  .hero .subtitle {
    font-size: 1.05rem;
    line-height: 1.45;
    padding: 0 0.25rem;
  }

  .hero .authors {
    flex-wrap: wrap;
    justify-content: center;
    font-size: 1rem;
    gap: 0.35rem 0.45rem;
    overflow-x: visible;
    -webkit-overflow-scrolling: auto;
  }

  .hero .affiliations {
    font-size: 0.92rem;
    line-height: 1.55;
    padding: 0 0.5rem;
  }

  .hero .note {
    font-size: 0.88rem;
    line-height: 1.5;
    padding: 0 0.5rem;
  }

  .affiliation-logos-scaler {
    height: auto;
    max-height: none;
    margin-bottom: 1.25rem;
  }

  .affiliation-logos-scaler__inner {
    width: 100%;
    transform: none;
  }

  .affiliation-logos {
    width: 100%;
    flex-wrap: wrap;
    gap: 1rem 1.25rem;
    padding: 0 0.5rem;
  }

  .affiliation-logos img {
    height: 44px;
    max-width: min(42vw, 200px);
  }

  .affiliation-logos img.affiliation-logos__ace {
    height: 52px;
    max-width: min(72vw, 280px);
  }

  main {
    padding: 0 1rem 3rem;
  }

  .teaser-scaler {
    height: auto;
    max-height: none;
  }

  .teaser-scaler__inner {
    width: 100%;
    transform: none;
  }

  .teaser-grid {
    width: 100%;
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .teaser-panel--generation {
    order: -1;
  }

  .teaser-panel--datasets {
    order: 1;
  }

  .dataset-card {
    grid-template-columns: 72px 1fr;
    padding: 0.75rem;
  }

  .dataset-card__stat {
    font-size: 1.45rem;
  }

  .dataset-card__name {
    font-size: 0.68rem;
  }

  .teaser-panel__visual {
    min-height: 200px;
  }

  .teaser-panel__visual img {
    height: auto;
    max-height: 280px;
  }

  section h2 {
    font-size: 1.45rem;
  }

  .keypoints li {
    padding-left: 2.25rem;
    font-size: 0.92rem;
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 2.5rem 0.85rem 2rem;
  }

  .hero-title__project {
    font-size: clamp(2.25rem, 12vw, 3rem);
  }

  .buttons {
    gap: 0.5rem;
  }

  .btn {
    font-size: 0.88rem;
    padding: 0.55rem 1rem;
  }

  section {
    padding: 2rem 0;
  }

  #bibtex pre {
    font-size: 0.78rem;
    padding: 1rem;
  }
}
