:root {
  --ink: #18363a;
  --muted: #53696b;
  --soft-muted: #748889;
  --paper: #fbfcfa;
  --surface: #ffffff;
  --line: #dbe5e2;
  --teal: #176c68;
  --teal-dark: #0e4c49;
  --teal-pale: #e7f3f0;
  --amber: #b17825;
  --amber-pale: #f8f1e4;
  --violet: #6c578e;
  --violet-pale: #f1edf7;
  --shadow: 0 18px 55px rgba(22, 54, 58, 0.08);
}

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

a {
  color: var(--teal);
}

a:hover {
  color: var(--teal-dark);
}

code.token-text {
  background: transparent;
  border-radius: 0;
  color: inherit;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.92em;
  padding: 0;
}

.site-container {
  width: min(1120px, calc(100% - 44px));
  margin: 0 auto;
}

.site-hero {
  background:
    radial-gradient(ellipse at 80% 10%, rgba(220, 238, 228, 0.72), transparent 37%),
    linear-gradient(140deg, #f3f7f1 0%, #f9f8f2 56%, #f2f5ef 100%);
  border-bottom: 1px solid #e8eeea;
}

.site-hero .hero-body {
  padding: 4.75rem 1.5rem 3.2rem;
}

.site-eyebrow,
.section-kicker {
  color: var(--teal);
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  line-height: 1.3;
  margin: 0 0 0.85rem;
  text-transform: uppercase;
}

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

.publication-authors {
  color: #28494d;
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: clamp(1rem, 1.7vw, 1.22rem);
  line-height: 1.8;
  margin: 0 auto;
  max-width: 980px;
}

.author-block {
  display: inline-block;
  margin: 0 0.12rem;
}

.publication-authors sup,
.affiliations sup {
  color: var(--teal);
  font-size: 0.68em;
}

.affiliations {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.98rem;
  gap: 0.35rem 1.4rem;
  justify-content: center;
  margin: 0.75rem auto 0;
}

.equal-contribution {
  color: var(--soft-muted);
  font-size: 0.86rem;
  margin: 0.25rem 0 1.45rem;
}

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

.publication-links .button {
  border: 1px solid rgba(24, 54, 58, 0.14);
  font-weight: 600;
  min-height: 2.65rem;
  padding-left: 1.05rem;
  padding-right: 1.05rem;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.publication-links .button:hover {
  box-shadow: 0 6px 16px rgba(24, 54, 58, 0.12);
  transform: translateY(-1px);
}

.publication-links .button.is-dark {
  background: var(--teal-dark);
}

.publication-links .button.is-light {
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
}

.hero-facts {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 3.2rem;
  justify-content: center;
  margin: 2.5rem auto 0;
}

.hero-facts div {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.hero-facts strong {
  color: var(--teal-dark);
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

.hero-facts span {
  color: var(--muted);
  font-size: 0.8rem;
}

.section-nav {
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
}

.section-nav .site-container {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.7rem;
  justify-content: center;
  padding: 0.8rem 0;
}

.section-nav a {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}

.section-nav a:hover {
  color: var(--teal);
}

.section-panel {
  padding: 5.2rem 0;
}

.section-heading {
  margin: 0 auto 2.6rem;
  max-width: 780px;
  text-align: center;
}

.section-heading h2,
.abstract-copy h2 {
  color: var(--ink);
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: clamp(1.85rem, 3.7vw, 2.65rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.18;
  margin: 0 0 0.9rem;
}

.section-heading > p:last-child,
.abstract-copy > p:last-child {
  color: var(--muted);
  font-size: 1.04rem;
  margin: 0;
}

.examples-section {
  background: var(--paper);
}

.example-grid {
  align-items: start;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.example-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.clip-player {
  background: #142124;
  margin: 0;
}

.clip-player video {
  aspect-ratio: 16 / 9;
  background: #142124;
  display: block;
  object-fit: contain;
  width: 100%;
}

.clip-player figcaption {
  align-items: center;
  color: #f1f6f3;
  display: flex;
  font-size: 0.77rem;
  justify-content: space-between;
  letter-spacing: 0.04em;
  padding: 0.52rem 1rem;
  text-transform: uppercase;
}

.example-copy {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
}

.source-caption,
.caption-view {
  border-radius: 11px;
  padding: 0.8rem 0.9rem;
}

.source-caption {
  background: var(--amber-pale);
  border-left: 3px solid var(--amber);
}

.caption-view {
  background: #f4f7f6;
  border-left: 3px solid #b7c9c5;
}

.positive-view {
  background: var(--violet-pale);
  border-left-color: var(--violet);
}

.caption-label {
  color: #7c643e;
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  line-height: 1.3;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

.summary-label {
  color: var(--teal);
}

.detail-label {
  color: #53696b;
}

.positive-label {
  color: var(--violet);
}

.source-caption p,
.caption-view p {
  color: var(--ink);
  font-size: 0.91rem;
  line-height: 1.55;
  margin: 0;
}

.source-caption p {
  font-weight: 600;
}

.section-note,
.table-note {
  color: var(--soft-muted);
  font-size: 0.86rem;
  margin: 1.1rem auto 0;
  max-width: 900px;
  text-align: center;
}

.pipeline-section {
  background: #f2f6f3;
  border-bottom: 1px solid #e7eeea;
  border-top: 1px solid #e7eeea;
}

.pipeline-figure {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  margin: 0;
  overflow: hidden;
  padding: clamp(0.5rem, 2vw, 1.25rem);
}

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

.pipeline-figure figcaption {
  border-top: 1px solid #edf1ef;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.45rem;
  padding: 0.8rem 0.4rem 0.15rem;
  text-align: center;
}

.pipeline-stages {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 1.3rem;
}

.pipeline-stages article {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.1rem;
}

.step-number {
  color: var(--teal);
  display: inline-block;
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
}

.pipeline-stages h3,
.representation-card h3 {
  color: var(--ink);
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 0.35rem;
}

.pipeline-stages p {
  color: var(--muted);
  font-size: 0.87rem;
  line-height: 1.55;
  margin: 0;
}

.loss-section {
  background: #fcfcfa;
}

.representation-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 900px);
  justify-content: center;
}

.representation-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 12px 36px rgba(22, 54, 58, 0.06);
  padding: 1.35rem;
}

.dual-card {
  border-color: #9bc5bc;
  box-shadow: 0 16px 44px rgba(23, 108, 104, 0.11);
}

.representation-heading {
  align-items: flex-start;
  display: flex;
  gap: 0.8rem;
  margin-bottom: 1.2rem;
}

.representation-heading p {
  color: var(--muted);
  font-size: 0.86rem;
  margin: 0.2rem 0 0;
}

.representation-index {
  align-items: center;
  background: #edf2f0;
  border-radius: 50%;
  color: var(--muted);
  display: inline-flex;
  flex: 0 0 2rem;
  font-weight: 700;
  height: 2rem;
  justify-content: center;
  width: 2rem;
}

.dual-card .representation-index {
  background: var(--teal);
  color: white;
}

.caption-source-chip,
.cls-token,
.view-loss {
  align-items: center;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  min-height: 3.8rem;
  text-align: center;
}

.caption-source-chip {
  color: var(--ink);
  font-size: 0.81rem;
  font-weight: 700;
  line-height: 1.3;
  padding: 0.5rem;
}

.caption-source-chip small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 500;
}

.summary-chip {
  background: var(--teal-pale);
}

.detail-chip {
  background: #edf1f4;
}

.cls-token {
  background: #273f43;
  color: #fff;
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  min-width: 4.6rem;
  padding: 0.45rem;
}

.summary-token {
  background: var(--teal);
}

.detail-token {
  background: #596a83;
}

.flow-arrow {
  color: #94a5a2;
  font-size: 1rem;
  font-weight: 700;
}

.loss-equation {
  background: #f5f7f6;
  border-radius: 10px;
  color: #355154;
  font-size: 0.83rem;
  line-height: 1.5;
  margin-top: 0.8rem;
  padding: 0.65rem 0.8rem;
  text-align: center;
}

.dual-flow {
  display: grid;
  gap: 0.55rem;
}

.dual-flow-row {
  align-items: center;
  display: grid;
  gap: 0.42rem;
  grid-template-columns: minmax(0, 1fr) auto minmax(70px, auto) auto minmax(35px, auto);
}

.dual-flow-row .caption-source-chip {
  min-height: 3.4rem;
}

.view-loss {
  background: #f0f4f2;
  color: var(--teal-dark);
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  min-height: 2.8rem;
}

.loss-equation {
  background: var(--teal-pale);
  color: var(--teal-dark);
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: 0.96rem;
  font-weight: 600;
  margin-top: 0.7rem;
}

.loss-equation mjx-container[display="true"] {
  margin: 0.35rem 0 !important;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.representation-note {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0.75rem 0 0;
  text-align: center;
}

.loss-rationale {
  background: #f3f7f5;
  border-left: 3px solid var(--teal);
  border-radius: 0 11px 11px 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.65;
  margin: 1.35rem auto 0;
  max-width: 900px;
  padding: 0.95rem 1.1rem;
}

.loss-section .section-note {
  margin-top: 1.25rem;
}

.results-section {
  background: #f2f6f3;
  border-bottom: 1px solid #e7eeea;
  border-top: 1px solid #e7eeea;
}

.results-block + .results-block {
  margin-top: 2.8rem;
}

.results-block h3 {
  color: var(--ink);
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: clamp(1.25rem, 2.4vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 0.8rem;
}

.table-scroll {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(22, 54, 58, 0.05);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.results-table {
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 760px;
  width: 100%;
}

.standard-table,
.finetune-table {
  min-width: 900px;
}

.fine-table {
  min-width: 1030px;
}

.results-table caption {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 1rem 1rem 0.65rem;
  text-align: left;
}

.results-table th,
.results-table td {
  border-bottom: 1px solid #e9efec;
  padding: 0.78rem 0.9rem;
  text-align: center;
  white-space: nowrap;
}

.results-table thead th {
  background: #f5f8f6;
  color: #506669;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.025em;
}

.results-table thead th:first-child,
.results-table tbody th {
  text-align: left;
}

.results-table tbody th {
  color: var(--ink);
  font-weight: 700;
}

.results-table tbody th small {
  color: var(--soft-muted);
  font-size: 0.71rem;
  font-weight: 500;
}

.results-table tbody tr:last-child th,
.results-table tbody tr:last-child td {
  border-bottom: 0;
}

.baseline-row {
  background: #fbfaf6;
}

.mvc-row {
  background: #f2faf7;
}

.mvc-10m-row {
  background: #e2f2ed;
}

.mvc-row th {
  color: var(--teal-dark) !important;
}

.table-note {
  margin-top: 0.7rem;
  text-align: left;
}

.abstract-section {
  background: #fff;
}

.abstract-copy {
  max-width: 860px;
}

.abstract-copy h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin-bottom: 1rem;
}

.abstract-copy > p:last-child {
  line-height: 1.8;
  text-align: justify;
}

.site-footer {
  background: #f3f6f4;
  border-top: 1px solid var(--line);
  color: var(--soft-muted);
  font-size: 0.8rem;
  padding: 1.6rem 0;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 900px) {
  .example-grid,
  .representation-grid {
    gap: 1rem;
  }

  .representation-card {
    padding: 1rem;
  }

  .dual-flow-row {
    gap: 0.32rem;
  }

  .caption-source-chip {
    font-size: 0.74rem;
    padding: 0.4rem;
  }

  .caption-source-chip small {
    font-size: 0.65rem;
  }

  .cls-token {
    min-width: 3.9rem;
  }
}

@media (max-width: 700px) {
  .site-container {
    width: min(100% - 30px, 540px);
  }

  .site-hero .hero-body {
    padding: 3.5rem 0.8rem 2.3rem;
  }

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

  .affiliations {
    flex-direction: column;
    gap: 0.05rem;
  }

  .hero-facts {
    gap: 0.9rem 1.6rem;
    margin-top: 1.8rem;
  }

  .hero-facts strong {
    font-size: 1.25rem;
  }

  .section-nav .site-container {
    gap: 0.35rem 1rem;
  }

  .section-nav a {
    font-size: 0.78rem;
  }

  .section-panel {
    padding: 3.6rem 0;
  }

  .section-heading {
    margin-bottom: 1.8rem;
  }

  .section-heading > p:last-child {
    font-size: 0.96rem;
  }

  .example-grid,
  .representation-grid,
  .pipeline-stages {
    grid-template-columns: 1fr;
  }

  .pipeline-figure {
    border-radius: 12px;
    padding: 0.45rem;
  }

  .pipeline-figure figcaption {
    font-size: 0.8rem;
  }

  .dual-flow-row {
    grid-template-columns: minmax(0, 1fr) auto minmax(64px, auto) auto minmax(32px, auto);
  }

  .dual-flow-row .caption-source-chip {
    font-size: 0.69rem;
  }

  .dual-flow-row .caption-source-chip small {
    font-size: 0.6rem;
  }

  .dual-flow-row .cls-token {
    font-size: 0.8rem;
    min-width: 3.6rem;
  }

  .abstract-copy > p:last-child {
    text-align: left;
  }
}
