:root {
  --bg: #fcfcfa;
  --bg-strong: #ffffff;
  --surface: rgba(255, 255, 255, 0.96);
  --surface-strong: #ffffff;
  --line: rgba(40, 40, 40, 0.1);
  --line-strong: rgba(40, 40, 40, 0.16);
  --text: #18151a;
  --muted: #655c5d;
  --accent: #924d2e;
  --accent-deep: #69341d;
  --accent-soft: #f4eee9;
  --shadow: 0 16px 44px rgba(20, 20, 20, 0.05);
  --radius: 26px;
  --nav-height: 78px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.018) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.16), transparent 75%);
  pointer-events: none;
}

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

a {
  color: inherit;
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, SFMono-Regular, Menlo, Consolas, monospace;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 1rem 1.4rem 0;
}

.nav-shell {
  max-width: 1180px;
  margin: 0 auto;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.25rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 28px rgba(20, 20, 20, 0.05);
}

.nav-brand,
.nav-links,
.hero-badge,
.hero-title,
.button,
.section-kicker,
.panel h3,
.table-heading h3,
.big-number,
.stat-card strong {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.nav-brand {
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.04em;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.85rem;
  font-size: 0.94rem;
}

.nav-links a {
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--accent-deep);
  background: rgba(146, 77, 46, 0.1);
  transform: translateY(-1px);
}

.hero {
  padding: 2.5rem 1.4rem 1rem;
}

.hero-shell,
.section-shell {
  max-width: 1180px;
  margin: 0 auto;
}

.section-shell-narrow {
  max-width: 980px;
}

.hero-shell {
  text-align: center;
  padding: 1.6rem 1.2rem 0.8rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #975032 0%, #b8653d 100%);
  border: 0;
  color: #fff;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 0.86rem;
  font-weight: 600;
}

.hero-title {
  max-width: 920px;
  margin: 1rem auto 1rem;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.hero-subtitle {
  max-width: 850px;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(1.08rem, 1.7vw, 1.36rem);
  line-height: 1.55;
}

.author-list,
.affiliations,
.action-row,
.chip-row,
.hero-stats {
  display: flex;
  flex-wrap: wrap;
}

.author-list {
  justify-content: center;
  gap: 0.9rem 1.2rem;
  max-width: 980px;
  margin: 1.2rem auto 0.7rem;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--muted);
}

.author-list span,
.affiliations span {
  white-space: nowrap;
}

.author-list a,
.author-list a:visited,
.author-list a:hover,
.author-list a:focus-visible {
  color: var(--text);
  text-decoration: none !important;
  border-bottom: 0 !important;
  box-shadow: none;
}

.author-list a {
  display: inline-block;
  transition: color 0.2s ease, transform 0.2s ease;
}

.author-list a:hover,
.author-list a:focus-visible {
  color: #2f6fd6;
  transform: translateY(-1px);
}

.author-list sup,
.affiliations sup,
.author-note sup {
  color: var(--accent);
}

.affiliations {
  justify-content: center;
  gap: 0.75rem 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.action-row {
  justify-content: center;
  gap: 0.8rem;
  margin-top: 1.4rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.button:hover {
  transform: translateY(-2px);
  border-color: rgba(146, 77, 46, 0.4);
  background: rgba(255, 255, 255, 0.9);
}

.button-primary {
  background: linear-gradient(135deg, #975032 0%, #b8653d 100%);
  border-color: transparent;
  color: #fff9f4;
  box-shadow: 0 18px 32px rgba(146, 77, 46, 0.2);
}

.section {
  padding: 1.5rem 1.4rem 2.4rem;
}

.section-kicker {
  margin: 0 0 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 1.5rem;
}

.section-heading h2,
.text-panel h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
}

.compact-title {
  font-size: clamp(1.55rem, 2.6vw, 2.2rem) !important;
  line-height: 1.12 !important;
}

.section-heading p,
.text-panel p,
.panel p,
.figure-panel figcaption,
.table-heading p {
  color: var(--muted);
  line-height: 1.72;
  font-size: 1.04rem;
}

.teaser-layout,
.method-layout,
.figure-stack {
  display: grid;
  gap: 1.35rem;
}

.teaser-layout {
  grid-template-columns: 1fr;
  align-items: start;
}

.method-layout {
  grid-template-columns: 1fr;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel h3 {
  margin: 0 0 0.65rem;
  font-size: 1.18rem;
  letter-spacing: -0.03em;
}

.text-panel,
.query-panel,
.code-panel {
  padding: 1.8rem;
}

.figure-panel {
  padding: 1rem;
  margin: 0 auto;
}

.figure-panel img {
  width: 100%;
  border-radius: calc(var(--radius) - 8px);
  border: 1px solid rgba(119, 70, 42, 0.12);
  background: #ffffff;
}

.figure-panel-medium {
  max-width: 900px;
}

.figure-panel-wide {
  max-width: 1120px;
}

.figure-panel-portrait {
  max-width: 980px;
}

.figure-panel figcaption {
  padding: 0.95rem 0.35rem 0.15rem;
}

.overview-note {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.15rem 1.4rem;
}

.overview-note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.72;
  font-size: 1.02rem;
}

.figure-scroll-shell {
  overflow: auto;
  border-radius: calc(var(--radius) - 8px);
}

.portrait-scroll-shell {
  max-height: min(86vh, 1320px);
}

.wide-scroll-shell {
  max-height: min(84vh, 1120px);
}

.prompt-scroll-shell {
  max-height: min(78vh, 980px);
}

.hero-stats,
.card-grid,
.method-copy,
.table-stack {
  gap: 1rem;
}

.hero-stats {
  margin-top: 1.4rem;
}

.stat-card {
  flex: 1 1 180px;
  padding: 1rem 1.05rem;
  border-radius: 22px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.98);
}

.stat-card strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 1.3rem;
  letter-spacing: -0.04em;
}

.stat-card span {
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.95rem;
}

.card-grid {
  display: grid;
}

.three-up {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.benchmark-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.three-up .panel,
.benchmark-grid .panel,
.method-copy .panel,
.compact-stats .panel {
  padding: 1.5rem;
}

.method-copy {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.method-copy .panel {
  height: 100%;
}

.chip-row {
  gap: 0.7rem;
}

.chip,
.inline-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: 0.88rem;
}

.chip {
  padding: 0.55rem 0.8rem;
  background: #f6ece2;
  border: 1px solid rgba(146, 77, 46, 0.14);
  color: var(--accent-deep);
}

.chip-soft {
  background: rgba(146, 77, 46, 0.08);
}

.inline-chip {
  padding: 0.12rem 0.55rem;
  background: rgba(146, 77, 46, 0.08);
  border: 1px solid rgba(146, 77, 46, 0.12);
  color: var(--accent-deep);
}

.muted-copy {
  color: var(--muted);
}

.difficulty-list {
  display: grid;
  gap: 0.8rem;
}

.difficulty-list div {
  display: grid;
  gap: 0.25rem;
  padding: 0.85rem 0.95rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(119, 70, 42, 0.1);
}

.difficulty-list strong {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: 1rem;
}

.query-panel {
  margin-top: 1.2rem;
}

.query-row {
  margin-top: 0.9rem;
}

.compact-stats .panel {
  text-align: left;
}

.big-number {
  margin: 0 0 0.35rem;
  font-size: 2.4rem;
  line-height: 1;
  letter-spacing: -0.07em;
}

.table-stack {
  display: grid;
  margin-top: 1rem;
}

.table-panel {
  margin-left: auto;
  margin-right: auto;
}

.table-panel-wide {
  max-width: 1160px;
}

.table-panel-medium {
  max-width: 860px;
}

.figure-panel-results {
  max-width: 920px;
}

.table-heading {
  margin-bottom: 0.9rem;
}

.table-heading h3 {
  margin-bottom: 0.4rem;
}

.table-footnote {
  margin: 0.75rem 0 0;
  padding: 0 0.2rem 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid rgba(119, 70, 42, 0.1);
}

table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.82);
}

thead th {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: 0.96rem;
  text-align: left;
  color: var(--accent-deep);
  background: rgba(146, 77, 46, 0.08);
}

th,
td {
  padding: 0.72rem 0.82rem;
  border-bottom: 1px solid rgba(119, 70, 42, 0.1);
  vertical-align: top;
  font-size: 1rem;
  line-height: 1.45;
}

tbody td[rowspan] {
  font-weight: 600;
  vertical-align: middle;
}

tbody tr.ours-row td {
  background: rgba(146, 77, 46, 0.07);
}

tbody tr.ours-row:hover td {
  background: rgba(146, 77, 46, 0.11);
}

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

tbody tr:hover td {
  background: rgba(255, 249, 242, 0.8);
}

.placeholder-panel {
  display: grid;
  place-items: center;
  min-height: 240px;
  padding: 2rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.78)),
    repeating-linear-gradient(
      -45deg,
      rgba(146, 77, 46, 0.04),
      rgba(146, 77, 46, 0.04) 12px,
      transparent 12px,
      transparent 24px
    );
}

.placeholder-copy {
  max-width: 620px;
  text-align: center;
}

.code-panel pre {
  margin: 0;
  overflow-x: auto;
  padding: 1rem 0.2rem 0.1rem;
  color: #2b2324;
  line-height: 1.65;
  font-size: 0.96rem;
}

.site-footer {
  margin-top: 3rem;
  padding: 0 1.4rem 2.8rem;
}

.site-footer .section-shell {
  max-width: 1180px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding-top: 1.2rem;
}

.site-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

.site-footer a {
  color: inherit;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: #2f6fd6;
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1080px) {
  .teaser-layout,
  .method-layout,
  .three-up,
  .benchmark-grid {
    grid-template-columns: 1fr;
  }

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

  .nav-shell {
    height: auto;
    padding-top: 1rem;
    padding-bottom: 1rem;
    border-radius: 28px;
    align-items: flex-start;
  }

  .nav-links {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .site-nav {
    padding: 0.85rem 0.85rem 0;
  }

  .hero,
  .section {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .hero-shell {
    padding-left: 0.2rem;
    padding-right: 0.2rem;
  }

  .text-panel,
  .query-panel,
  .code-panel,
  .three-up .panel,
  .benchmark-grid .panel,
  .method-copy .panel,
  .compact-stats .panel {
    padding: 1.2rem;
  }

  .author-list,
  .affiliations {
    gap: 0.5rem 0.9rem;
  }

  .author-list span,
  .affiliations span {
    white-space: normal;
  }

  .nav-links {
    gap: 0.4rem;
    font-size: 0.87rem;
  }

  .button {
    width: 100%;
  }

  .action-row {
    width: 100%;
  }

  .action-row a {
    flex: 1 1 220px;
  }
}
