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

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

:root {
  --bg: #faf9f6;
  --card: #ffffff;
  --elevated: #f1f3f4;
  --border: #e2e5e8;
  --text: #1a1d21;
  --muted: #5f6872;
  --dim: #8a929b;
  --accent: #5c42a0;
  --accent-soft: rgba(92, 66, 160, 0.08);
  --accent-hover: #3d2b6e;
  --green: #168a55;
  --purple: #660874;
  --amber: #bf7116;
  --shadow: 0 1px 2px rgba(20, 28, 35, 0.06);
  --shadow-md: 0 4px 12px rgba(20, 28, 35, 0.08);
  --display: "Inter", "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

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: calc(100% - 80px);
  max-width: 1400px;
  margin: 0 auto;
}

/* ===== Topbar ===== */
.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(--display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

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

.topbar nav a {
  color: var(--muted);
}

.topbar nav a:hover {
  color: var(--text);
  text-decoration: none;
}

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

/* ===== Sections ===== */
section {
  padding: 3.2rem 0;
}

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

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.01em;
}

.title-line {
  display: block;
}

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

h2 {
  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.005em;
}

h3 {
  margin: 0 0 0.6rem;
  font-family: var(--display);
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.35;
}

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

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

.hero .container {
  width: calc(100% - 80px);
  max-width: 1400px;
}

.tagline.english {
  max-width: 900px;
  margin: 0 auto 0.45rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.55vw, 1.22rem);
  line-height: 1.65;
}

.tagline.english strong {
  color: var(--text);
  font-weight: 700;
}

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

.author-line {
  display: block;
}

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

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

.affiliation-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1.2rem;
  margin: 0 0 0.6rem;
}

.affiliation-list p {
  margin: 0;
  color: inherit;
}

.author-notes,
.venue {
  margin: 0.5rem 0 0;
  color: var(--dim);
}

.venue strong {
  color: var(--accent);
  font-weight: 700;
}

/* ===== Hero action buttons ===== */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  margin: 1.9rem 0 0;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 1.1rem;
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.button em {
  font-style: normal;
}

.button:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.button i {
  color: var(--accent);
}

/* ===== Figures ===== */
.teaser {
  padding-top: 1.5rem;
}

.paper-figure {
  overflow: hidden;
  margin: 1.7rem auto;
  max-width: 900px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  background: var(--card);
  box-shadow: var(--shadow);
}

.paper-figure.large {
  margin-top: 0;
  max-width: 820px;
}

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

.paper-figure figcaption {
  padding: 0.85rem 0.3rem 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

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

.section-subtitle {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
}

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

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

/* ===== Method / two-column ===== */
.method-focus {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.6rem;
  margin-top: 1.25rem;
}

.method-focus article {
  min-width: 0;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  box-shadow: var(--shadow);
}

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

/* ===== Equations ===== */
.equation-block {
  overflow-x: auto;
  max-width: 100%;
  min-width: 0;
  margin: 1rem 0 1.25rem;
  padding: 0.5rem 0;
  color: var(--text);
  text-align: center;
  -webkit-overflow-scrolling: touch;
}

/* ===== Takeaway box ===== */
.takeaway {
  margin: 1.25rem 0 0;
  border: 1px solid #a9d0c3;
  border-radius: 10px;
  padding: 1rem 1.1rem;
  background: #eef8f4;
  color: #203d34;
  font-size: 0.98rem;
  line-height: 1.6;
}

.takeaway strong {
  color: #14432f;
}

/* ===== Interactive Explorer ===== */
.explorer-search {
  width: 100%;
  margin: 0.6rem 0 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 0.95rem;
  background: var(--card);
  color: var(--text);
  font: inherit;
  box-shadow: var(--shadow);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.explorer-search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.explorer-status {
  margin: 0.5rem 0 0;
  color: var(--dim);
  font-size: 0.85rem;
}

.explorer-card {
  margin: 1rem 0 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  background: var(--card);
  box-shadow: var(--shadow);
}

.explorer-question {
  margin-bottom: 0.85rem;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.55;
}

.badge-best {
  display: inline-block;
  margin-right: 0.55rem;
  border-radius: 6px;
  padding: 0.15rem 0.5rem;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
}

.explorer-bars {
  display: grid;
  gap: 0.32rem;
}

.model-bar-row {
  display: grid;
  grid-template-columns: 155px 1fr 52px;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.8rem;
}

.model-name {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  position: relative;
  height: 8px;
  border-radius: 4px;
  background: var(--elevated);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--dim);
  border-radius: 4px;
  transition: width 200ms ease;
}

.bar-fill-best {
  background: var(--accent);
}

.model-bar-best .model-name,
.model-bar-best .bar-label {
  color: var(--accent);
  font-weight: 700;
}

.bar-label {
  color: var(--muted);
  text-align: right;
}

/* ===== BibTeX ===== */
.bibtex {
  position: relative;
  margin-top: 0;
}

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

.bibtex pre {
  overflow-x: auto;
  margin: 0;
  border-radius: 10px;
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--border);
  background: #f4f5f6;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.6;
}

.copy-btn {
  position: absolute;
  top: 2.3rem;
  right: 0.65rem;
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  background: var(--card);
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease;
}

.copy-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.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-md);
  font-size: 0.9rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

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

/* ===== Footer ===== */
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: 700;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .container,
  .hero .container {
    width: calc(100% - 32px);
    max-width: none;
  }

  .topbar nav {
    display: none;
  }

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

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

  .model-bar-row {
    grid-template-columns: 120px 1fr 48px;
    font-size: 0.74rem;
  }
}

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

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

  .brand {
    font-size: 0.88rem;
  }

  h1 {
    font-size: 1.9rem;
    line-height: 1.2;
  }

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

  h3 {
    font-size: 1rem;
  }

  .tagline.english {
    font-size: 1.05rem;
    line-height: 1.65;
  }

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

  section {
    padding: 2.4rem 0;
  }

  .paper-figure {
    padding: 0.55rem;
  }

  .paper-figure figcaption {
    font-size: 0.82rem;
  }

  .hero-actions {
    gap: 0.55rem;
  }

  .button {
    padding: 0 0.9rem;
    font-size: 0.95rem;
  }

  .bibtex pre {
    padding: 0.85rem;
    font-size: 0.78rem;
  }

  .copy-btn {
    top: 0.55rem;
    right: 0.55rem;
  }

  .model-bar-row {
    grid-template-columns: 110px 1fr 44px;
    font-size: 0.7rem;
    gap: 0.4rem;
  }

  .footer-inner {
    flex-direction: column;
    gap: 0.55rem;
    font-size: 0.85rem;
  }
}
