:root {
  --bg: #efe7d8;
  --bg-deep: #e7dbc7;
  --paper: rgba(249, 244, 236, 0.86);
  --paper-strong: rgba(255, 251, 245, 0.82);
  --cool-paper: rgba(244, 249, 253, 0.92);
  --ink: #1e2824;
  --muted: #5d655f;
  --accent: #8f2f28;
  --accent-2: #2d6b61;
  --line: rgba(31, 42, 35, 0.12);
  --line-cool: rgba(110, 130, 154, 0.18);
  --shadow: 0 20px 50px rgba(54, 39, 20, 0.08);
  --radius-xl: 28px;
  --radius-lg: 18px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(143, 47, 40, 0.07), transparent 26rem),
    radial-gradient(circle at top right, rgba(45, 107, 97, 0.06), transparent 24rem),
    linear-gradient(180deg, #f6efe2 0%, var(--bg) 52%, var(--bg-deep) 100%);
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  line-height: 1.55;
}

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

img,
video {
  border-radius: calc(var(--radius-lg) - 4px);
}

p,
li,
td,
th {
  font-size: 0.97rem;
}

strong {
  font-weight: 700;
}

em {
  font-style: italic;
}

a {
  color: inherit;
  text-decoration: none;
}

.hero-shell {
  padding: 1rem 1rem 0;
}

.topbar {
  max-width: 1100px;
  margin: 0 auto 0.8rem;
  padding: 0.7rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(249, 244, 236, 0.82);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0.9rem;
  z-index: 10;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
}

.brand-mark img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.brand-copy {
  display: grid;
  gap: 0.05rem;
}

.brand-lab {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.brand-lab:hover {
  color: var(--accent);
}

.brand-project {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--ink);
}

.authors a:hover {
  color: var(--accent);
}

.hero {
  max-width: 980px;
  margin: 0 auto;
  padding: 3.1rem 1rem 2rem;
  text-align: center;
}

.eyebrow {
  margin: 0 0 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.76rem;
  color: var(--accent);
  font-weight: 700;
}

h1,
h2,
h3 {
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
}

h1 {
  margin: 0;
  font-size: clamp(2.1rem, 4vw, 3.15rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.subtitle {
  max-width: 760px;
  margin: 1rem auto 1.45rem;
  font-size: 0.98rem;
  color: var(--muted);
}

.authors,
.affiliations {
  display: flex;
  justify-content: center;
  gap: 0.55rem 1rem;
  flex-wrap: wrap;
}

.authors {
  font-size: 0.93rem;
  font-weight: 700;
}

.authors a {
  padding-bottom: 0.05rem;
  border-bottom: 1px solid transparent;
}

.authors a:hover {
  border-bottom-color: rgba(143, 47, 40, 0.28);
}

.affiliations {
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.author-note {
  margin: 0.42rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.cta-row {
  margin-top: 1.45rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.cta {
  border: 1px solid rgba(31, 42, 35, 0.14);
  background: rgba(249, 244, 236, 0.84);
  padding: 0.72rem 1.05rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 8px 22px rgba(46, 34, 20, 0.05);
}

.cta:hover {
  transform: translateY(-1px);
}

.cta.primary {
  background: var(--accent);
  color: #fff7f2;
  border-color: transparent;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem 3.5rem;
}

.section-card {
  margin-bottom: 1.15rem;
  padding: 1.55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--paper);
  box-shadow: var(--shadow);
  scroll-margin-top: 6rem;
}

.teaser {
  border-color: var(--line-cool);
  background: linear-gradient(180deg, rgba(249, 244, 236, 0.85) 0%, rgba(244, 249, 253, 0.95) 100%);
}

.figure-head {
  margin-bottom: 0.85rem;
}

.tag-only-head {
  margin-bottom: 0.55rem;
}

.section-tag,
.part-label {
  display: inline-block;
  padding: 0.24rem 0.62rem;
  border-radius: 999px;
  background: rgba(143, 47, 40, 0.1);
  color: var(--accent);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

h2 {
  margin: 0;
  font-size: clamp(1.28rem, 2.2vw, 1.68rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
}

h3 {
  margin: 0 0 0.45rem;
  font-size: 1.03rem;
}

.tau-symbol {
  font-family: "STIX Two Math", "Cambria Math", "STIXGeneral", "Times New Roman", serif;
  font-style: italic;
  font-weight: 600;
  text-transform: none;
  display: inline-block;
  line-height: 1;
  transform: translateY(0.02em);
}

.hl-bad,
.hl-good {
  position: relative;
  white-space: nowrap;
}

.hl-bad {
  color: var(--accent);
}

.hl-good {
  color: var(--accent-2);
}

.hl-bad::after,
.hl-good::after {
  content: "";
  position: absolute;
  left: -0.08em;
  right: -0.08em;
  bottom: 0.04em;
  height: 0.46em;
  border-radius: 0.22em;
  z-index: -1;
}

.hl-bad::after {
  background: rgba(143, 47, 40, 0.12);
}

.hl-good::after {
  background: rgba(45, 107, 97, 0.14);
}

.hl-bad-inline {
  color: var(--accent);
  font-weight: 700;
}

.hl-good-inline {
  color: var(--accent-2);
  font-weight: 700;
}

.thesis-line {
  margin: 0 0 0.65rem;
  font-size: 0.94rem;
  color: var(--ink);
}

.caption,
.abstract-copy {
  margin: 0;
  color: var(--ink);
}

.lead,
.small-note {
  color: var(--muted);
}

.motion-meta {
  margin: 0.55rem 0 0.25rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.motion-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem 1.05rem;
  margin: 0.5rem 0 0.2rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.motion-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
}

.legend-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.source {
  background: #000;
}

.legend-dot.current {
  background: #9b0000;
}

.legend-dot.target {
  background: #7a79ea;
  opacity: 0.72;
}

.legend-line {
  width: 1.2rem;
  height: 0;
  border-top: 2px solid #d87f7f;
  display: inline-block;
}

.motion-grid,
.tldr-grid,
.sample-grid {
  display: grid;
  gap: 0.95rem;
}

.motion-grid {
  grid-template-columns: 1fr;
}

.tldr-grid,
.sample-grid.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.motion-card,
.tldr-card,
.sample-card,
.bibtex {
  border: 1px solid var(--line);
  background: var(--paper-strong);
  border-radius: var(--radius-lg);
}

.motion-card {
  margin: 0;
  padding: 0.8rem;
  border-color: var(--line-cool);
  background: rgba(246, 249, 252, 0.88);
}

.motion-card img {
  width: 100%;
  height: auto;
  border: 1px solid rgba(110, 130, 154, 0.13);
  box-shadow: 0 10px 24px rgba(89, 107, 130, 0.07);
}

.motion-card {
  max-width: 100%;
}

.motion-card figcaption,
.sample-card figcaption {
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 0.87rem;
  line-height: 1.45;
}

.tldr-grid {
  margin-top: 0.2rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tldr-card {
  padding: 1rem 1rem 0.9rem;
}

.tldr-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.tldr-copy {
  max-width: 920px;
  margin: 0;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.65;
}

.keywords {
  margin: 0.95rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.keywords span {
  padding: 0 0.22rem;
}

.dataset-tabs {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.15rem 0 1rem;
  padding: 0.25rem;
  border: 1px solid rgba(31, 42, 35, 0.08);
  border-radius: 999px;
  background: rgba(255, 251, 245, 0.72);
}

.dataset-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.5rem 0.92rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.dataset-tab:hover {
  color: var(--ink);
}

.dataset-tab.is-active {
  background: linear-gradient(180deg, #8eb2ee 0%, #6f9be7 100%);
  color: #13233c;
  box-shadow: 0 6px 18px rgba(84, 119, 185, 0.18);
}

.ffhq-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.95rem;
  padding: 0.25rem;
  border: 1px solid rgba(31, 42, 35, 0.08);
  border-radius: 999px;
  background: rgba(255, 251, 245, 0.72);
}

.ffhq-switch {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.48rem 0.9rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.ffhq-switch:hover {
  color: var(--ink);
}

.ffhq-switch.is-active {
  background: linear-gradient(180deg, #8eb2ee 0%, #6f9be7 100%);
  color: #13233c;
  box-shadow: 0 6px 18px rgba(84, 119, 185, 0.18);
}

.sample-block[hidden] {
  display: none !important;
}

.sample-block.is-active {
  animation: fadePanel 180ms ease;
}

.sample-head {
  margin-bottom: 0.85rem;
}

.sample-head p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.91rem;
}

.sample-card {
  margin: 0;
  padding: 0.75rem;
}

.sample-card a {
  display: block;
}

.sample-card a:hover img {
  transform: translateY(-1px);
}

.sample-card img {
  width: 100%;
  height: auto;
  transition: transform 180ms ease;
}

.ffhq-stage {
  max-width: 100%;
}

.ffhq-feature[hidden] {
  display: none !important;
}

.ffhq-feature {
  padding: 0.9rem;
}

.ffhq-feature img {
  width: 100%;
  border: 1px solid rgba(31, 42, 35, 0.08);
  box-shadow: 0 14px 28px rgba(54, 39, 20, 0.08);
}

.mini-table-wrap {
  margin-top: 1rem;
  padding: 0.85rem 0.9rem 0.75rem;
  border: 1px solid rgba(31, 42, 35, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(255, 251, 245, 0.72);
}

.mini-table {
  width: 100%;
  border-collapse: collapse;
}

.mini-table th,
.mini-table td {
  padding: 0.7rem 0.55rem;
  border-bottom: 1px solid rgba(31, 42, 35, 0.08);
  text-align: left;
  font-size: 0.83rem;
}

.mini-table th {
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.74rem;
}

.mini-table tbody tr:last-child td {
  border-bottom: 0;
}

.mnist-table tbody tr td:nth-child(4),
.mnist-table tbody tr td:nth-child(6) {
  color: var(--accent-2);
  font-weight: 700;
}

.mnist-table tbody tr td:nth-child(3),
.mnist-table tbody tr td:nth-child(5) {
  color: var(--accent);
}

.ffhq-table tbody tr td:nth-child(3),
.ffhq-table tbody tr td:nth-child(5) {
  color: var(--accent-2);
  font-weight: 700;
}

.ffhq-table tbody tr td:nth-child(2),
.ffhq-table tbody tr td:nth-child(4) {
  color: var(--accent);
}

.table-note {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

pre {
  margin: 0;
  overflow: auto;
}

.bibtex {
  padding: 1rem 1.05rem;
}

code {
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.88rem;
}

.footer {
  padding: 1.2rem 1rem 2.3rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

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

@media (max-width: 960px) {
  .topbar {
    border-radius: 24px;
    align-items: center;
  }

  .motion-grid,
  .tldr-grid,
  .sample-grid.two-up {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .hero-shell {
    padding: 0.7rem 0.7rem 0;
  }

  .page {
    padding: 0 0.7rem 2.8rem;
  }

  .hero {
    padding: 2.4rem 0.35rem 1.6rem;
  }

  .section-card {
    padding: 1.15rem;
    border-radius: 20px;
  }

  .brand-lockup {
    align-items: flex-start;
  }

  .brand-project {
    font-size: 0.92rem;
  }

  .subtitle {
    font-size: 0.98rem;
  }

  .authors {
    font-size: 0.94rem;
  }
}
