@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700;800&display=swap");

*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --bg: #fafafa;
  --card: #ffffff;
  --elevated: #f1f3f4;
  --border: #e2e5e8;
  --text: #1a1d21;
  --muted: #5f6872;
  --dim: #8a929b;
  --accent: #660874;
  --accent-soft: rgba(102, 8, 116, 0.08);
  --green: #168a55;
  --purple: #660874;
  --amber: #bf7116;
  --shadow: 0 1px 2px rgba(20, 28, 35, 0.06);
  --display: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --body: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --hero-mobile-scale: 1;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

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

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(226, 229, 232, 0.82);
  background: rgba(250, 250, 250, 0.86);
  backdrop-filter: blur(14px);
}

.brand {
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.topbar nav {
  display: flex;
  gap: 22px;
  font-size: 0.9rem;
  color: var(--muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.language-link {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.28rem 0.62rem;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.language-link:hover {
  color: var(--text);
  text-decoration: none;
}

section {
  padding: 3.2rem 0;
}

section + section {
  border-top: 1px solid var(--border);
}

.hero {
  position: relative;
  padding: 5.2rem 0 2.5rem;
  text-align: center;
}

.hero .container {
  width: min(1040px, calc(100% - 40px));
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 1000px;
  margin: 0 auto 1.05rem;
  font-family: var(--display);
  font-size: clamp(2rem, 3.25vw, 3rem);
  font-weight: 760;
  line-height: 1.16;
  letter-spacing: 0;
}

.title-line {
  display: block;
  white-space: nowrap;
}

.title-accent {
  color: var(--accent);
}

h2 {
  max-width: 820px;
  margin: 0 0 1rem;
  font-family: var(--display);
  font-size: clamp(1.45rem, 2.4vw, 1.95rem);
  font-weight: 760;
  line-height: 1.25;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 0.6rem;
  font-size: 1.08rem;
  line-height: 1.35;
}

p {
  margin: 0 0 1rem;
  color: var(--muted);
}

.tagline {
  max-width: 920px;
  margin: 0 auto 0.45rem;
  color: var(--muted);
  font-size: clamp(1.12rem, 1.75vw, 1.38rem);
  line-height: 1.55;
}

.tagline.english {
  max-width: 980px;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.55vw, 1.28rem);
  line-height: 1.6;
}

.authors {
  margin-top: 1.8rem;
  color: var(--dim);
  font-size: 0.9rem;
  line-height: 1.55;
  overflow-wrap: normal;
}

.author-line {
  display: block;
  white-space: nowrap;
}

.authors sup,
.affiliations sup {
  color: var(--accent);
  font-size: 0.72em;
  font-weight: 700;
}

.author-notes sup,
.affiliation-list sup {
  display: inline-block;
  margin-right: 0.16rem;
}

.affiliations {
  max-width: 760px;
  margin: 1.45rem auto 0;
  color: var(--dim);
  font-size: 0.78rem;
  line-height: 1.5;
}

.affiliation-list {
  display: grid;
  gap: 0.12rem;
  margin: 1rem 0 0;
}

.affiliation-list p,
.author-notes {
  margin: 0;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

.author-notes {
  margin: 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  margin: 1.7rem 0 0;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 1.05rem;
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.brand-icon {
  width: 1.35rem;
  height: 1.35rem;
  flex: 0 0 auto;
  object-fit: contain;
}

.button em {
  font-style: normal;
}

.button:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.contrib-grid div {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.teaser {
  padding-top: 1.5rem;
}

.paper-figure {
  overflow: hidden;
  margin: 1.7rem 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  background: var(--card);
  box-shadow: var(--shadow);
}

.paper-figure.large {
  margin-top: 0;
}

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

.paper-figure figcaption {
  padding: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.lead {
  max-width: 980px;
  color: var(--text);
  font-size: 1.02rem;
  line-height: 1.75;
}

.centered {
  margin: 1.5rem auto 0;
  text-align: center;
}

.nowrap {
  white-space: nowrap;
}

.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
  margin-top: 1.3rem;
}

.clean-list {
  margin: 1rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

.clean-list li + li {
  margin-top: 0.3rem;
}

.method-focus {
  display: grid;
  gap: 0;
  margin-top: 1.25rem;
}

.method-focus article {
  min-width: 0;
  padding: 1rem 0 1.15rem;
  border-top: 1px solid var(--border);
}

.method-focus article:first-child {
  border-top: 0;
  padding-top: 0.3rem;
}

.method-focus p:last-child {
  margin-bottom: 0;
}

.equation-block {
  overflow-x: auto;
  max-width: 100%;
  min-width: 0;
  margin: 0.55rem 0 0.7rem;
  padding: 0.15rem 0;
  color: var(--text);
  text-align: center;
  -webkit-overflow-scrolling: touch;
}

.equation-block mjx-container {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 0 !important;
  font-size: 92% !important;
}

.section-subtitle {
  max-width: 800px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.75;
}

.results-tables {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
  margin: 1.6rem 0 1.2rem;
}

.table-panel {
  overflow-x: auto;
}

.result-table-title {
  margin: 0 0 0.45rem;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 800;
  text-align: center;
}

.results-table {
  width: 100%;
  min-width: 390px;
  margin: 0;
  border-collapse: collapse;
  background: var(--card);
  font-size: 0.9rem;
}

.results-table th,
.results-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.72rem 0.58rem;
  text-align: left;
}

.results-table th {
  color: var(--text);
  font-weight: 750;
}

.results-table td:not(:first-child) {
  color: var(--text);
  font-family: var(--mono);
  font-weight: 750;
}

.results-table .dopd-row {
  background: var(--accent-soft);
}

.results-table .dopd-row td:not(:first-child) {
  color: var(--green);
}

.results-table .gain {
  color: var(--accent);
  font-size: 0.82em;
  font-weight: 800;
  white-space: nowrap;
}

.results-table .separator td {
  border-bottom-color: var(--text);
}

.takeaway {
  margin: 1rem 0 0;
  border: 1px solid #a9d0c3;
  border-radius: 8px;
  padding: 1rem 1.1rem;
  background: #eef8f4;
  color: #203d34;
}

.takeaway.compact {
  margin-top: 1rem;
  font-size: 0.92rem;
}

.contrib-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1.6rem;
}

.contrib-grid div {
  padding: 1rem;
  color: var(--muted);
}

.bibtex {
  margin-top: 0;
  padding: 0;
}

.bibtex-title {
  margin: 0 0 0.65rem;
  color: var(--text);
  font-weight: 800;
}

.bibtex pre {
  overflow-x: auto;
  margin: 0;
  border-radius: 8px;
  padding: 1rem;
  border: 1px solid var(--border);
  background: #f4f5f6;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.9rem;
}

footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-inner span {
  color: var(--text);
  font-weight: 800;
}

.copy-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  background: var(--text);
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 0.92rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.copy-toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .container,
  .hero .container {
    width: min(100% - 32px, 880px);
  }

  .topbar nav {
    display: none;
  }

  .two-column,
  .method-focus,
  .results-tables,
  .contrib-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 3.2rem 0 2.2rem;
  }

  .paper-figure {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .paper-figure img {
    min-width: 0;
  }

  .paper-figure.large img {
    min-width: 0;
  }
}

@media (max-width: 560px) {
  .container {
    width: auto;
    max-width: none;
    margin-right: 14px;
    margin-left: 14px;
  }

  .hero .container {
    position: relative;
    left: 50%;
    width: 1040px;
    max-width: none;
    margin-left: -520px;
    margin-right: 0;
    transform: scale(var(--hero-mobile-scale));
    transform-origin: top center;
  }

  .topbar {
    min-height: 56px;
    padding: 0 16px;
  }

  .brand {
    font-size: 0.86rem;
  }

  .hero {
    height: calc(514px * var(--hero-mobile-scale) + 28px);
    min-height: 0;
    overflow: hidden;
    padding: 14px 0;
  }

  h1 {
    margin-bottom: 1.05rem;
    font-size: 3rem;
    line-height: 1.16;
  }

  .title-line {
    white-space: nowrap;
  }

  h2 {
    font-size: 1.34rem;
    line-height: 1.32;
  }

  h3 {
    font-size: 1rem;
  }

  .tagline,
  .tagline.english {
    font-size: 1.28rem;
    line-height: 1.6;
  }

  p,
  .lead,
  .section-subtitle {
    font-size: 0.94rem;
    line-height: 1.72;
  }

  .authors {
    overflow: visible;
    margin-top: 1.8rem;
    padding-bottom: 0;
    font-size: 0.9rem;
    line-height: 1.55;
  }

  .author-line {
    white-space: nowrap;
  }

  .affiliations {
    overflow: visible;
    margin-top: 1.45rem;
    font-size: 0.78rem;
    line-height: 1.5;
  }

  .affiliation-list {
    gap: 0.12rem;
    margin-top: 1rem;
  }

  .author-notes,
  .affiliation-list p {
    white-space: nowrap;
  }

  .tagline br {
    display: none;
  }

  section {
    padding: 2.45rem 0;
  }

  .teaser {
    padding-top: 1rem;
  }

  .paper-figure {
    width: calc(100vw - 20px);
    max-width: none;
    margin: 1.2rem calc(50% - 50vw + 10px);
    border-radius: 7px;
    padding: 0.55rem;
  }

  .paper-figure figcaption {
    font-size: 0.78rem;
    line-height: 1.55;
  }

  .centered {
    margin-top: 1.1rem;
    text-align: left;
  }

  .hero-actions {
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.7rem;
  }

  .button {
    flex: 0 1 auto;
    min-width: 0;
    min-height: 42px;
    padding: 0 1.05rem;
    gap: 0.42rem;
    font-size: 1rem;
  }

  .brand-icon {
    width: 1.35rem;
    height: 1.35rem;
  }

  .results-tables {
    gap: 1rem;
    margin: 1.25rem 0 1rem;
  }

  .table-panel {
    margin: 0 -2px;
    padding-bottom: 0.25rem;
  }

  .result-table-title {
    text-align: left;
  }

  .results-table {
    min-width: 360px;
    font-size: 0.78rem;
  }

  .results-table th,
  .results-table td {
    padding: 0.62rem 0.42rem;
  }

  .equation-block {
    font-size: 0.76rem;
  }

  .equation-block mjx-container {
    font-size: 68% !important;
  }

  .takeaway {
    padding: 0.85rem 0.9rem;
    font-size: 0.86rem;
    line-height: 1.65;
  }

  .bibtex pre {
    padding: 0.8rem;
    font-size: 0.76rem;
  }

  .footer-inner {
    align-items: center;
    flex-direction: column;
    gap: 0.55rem;
    font-size: 0.82rem;
  }
}
