:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --paper: #ffffff;
  --paper-soft: #fbfcff;
  --ink: #151922;
  --muted: #5f6674;
  --line: #dfe4ee;
  --accent: #b23a75;
  --accent-2: #266f93;
  --accent-3: #42845c;
  --shadow: 0 18px 45px rgba(33, 39, 56, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #ffffff 0%, var(--bg) 35%, #ffffff 100%);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
}

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

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

.hero {
  padding-top: 64px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 248, 251, 0.96)),
    radial-gradient(circle at 20% 15%, rgba(178, 58, 117, 0.14), transparent 34%),
    radial-gradient(circle at 82% 8%, rgba(38, 111, 147, 0.13), transparent 32%);
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  width: 100%;
  min-height: 64px;
  margin: 0;
  padding-inline: max(16px, calc((100% - 1120px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid rgba(223, 228, 238, 0.9);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 6px;
}

.navlinks {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.navlinks a {
  padding: 8px 10px;
  border-radius: 6px;
}

.navlinks a:hover {
  background: rgba(21, 25, 34, 0.06);
  color: var(--ink);
}

.hero-inner {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 66px;
  text-align: center;
}

.eyebrow {
  width: fit-content;
  margin: 0 auto 14px;
  padding: 4px 12px;
  border: 1px solid rgba(178, 58, 117, 0.26);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(178, 58, 117, 0.07);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 980px;
  margin: 0 auto 18px;
  font-size: clamp(34px, 6vw, 67px);
  line-height: 1.04;
  letter-spacing: 0;
}

.hero-title {
  max-width: 980px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
}

.hero-title img {
  flex: 0 0 auto;
  width: clamp(54px, 7vw, 86px);
  height: clamp(54px, 7vw, 86px);
  object-fit: contain;
  border-radius: 8px;
}

.authors {
  margin-bottom: 2px;
  color: var(--accent-2);
  font-size: clamp(14px, 1.5vw, 17px);
  font-weight: 650;
}

.affiliation {
  margin-bottom: 26px;
  color: var(--muted);
  font-size: 16px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 0 auto 36px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid #cad1dd;
  border-radius: 999px;
  background: #1b1f2a;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 7px 18px rgba(27, 31, 42, 0.16);
  transition: transform 150ms ease, background 150ms ease;
}

.pill:hover {
  transform: translateY(-1px);
  background: #2b3140;
}

.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 11px;
  font-family: "JetBrains Mono", monospace;
  line-height: 1;
}

.icon i {
  font-size: 14px;
  line-height: 1;
}

.arxiv-icon {
  min-width: 30px;
}

.arxiv-icon .ai {
  font-family: Academicons;
  font-size: 15px;
}

.hero-figure {
  --hero-panel-height: clamp(220px, 23vw, 300px);
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
}

.hero-image-card {
  display: flex;
  align-items: stretch;
  flex: 0 0 auto;
  height: var(--hero-panel-height);
  overflow: hidden;
}

.hero-image-card-small {
  aspect-ratio: 815 / 748;
}

.hero-image-card-wide {
  aspect-ratio: 1280 / 934;
}

.figure-card.hero-image-card img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.hero-stats {
  display: grid;
  flex: 0 1 250px;
  height: var(--hero-panel-height);
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.hero-stats div,
.insight-grid article,
.metric-strip div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 10px 30px rgba(33, 39, 56, 0.08);
}

.hero-stats div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
  padding: 14px 18px;
}

.hero-stats strong {
  display: block;
  color: var(--accent);
  font-size: 22px;
  line-height: 1;
}

.hero-stats span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 650;
  font-size: 12px; 
  line-height: 1.4;
} 

.hero-overview {
  margin-top: 38px;
  text-align: left;
}

.hero-overview .section-heading {
  justify-content: flex-start;
}

.hero-overview .lead {
  max-width: none; 
  font-size: 16px;
  margin-inline: 0;
}

.hero-overview .lead + .lead {
  margin-top: 14px;
}

.text-highlight {
  color: var(--accent-2);
  font-weight: 800;
  background: rgba(38, 111, 147, 0.1);
  border-radius: 4px;
  padding: 0 4px;
}

.section {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 64px 0;
}

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

.visual-band {
  width: 100%;
  padding-inline: max(16px, calc((100% - 1080px) / 2));
  background: #eef3f8;
  border-top: 1px solid #d7e0eb;
  border-bottom: 1px solid #d7e0eb;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.section-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  background: #1b1f2a;
  color: #fff;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  font-weight: 800;
}

.section-icon-image {
  width: 34px;
  min-width: 34px;
  padding: 0;
  overflow: hidden;
}

.section-icon-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

h2 {
  margin: 0;
  font-size: clamp(25px, 3vw, 36px);
  line-height: 1.15;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 18px;
  line-height: 1.25;
}

.lead {
  max-width: 900px;
  color: #29303d;
  font-size: 20px;
  line-height: 1.65;
}

.visual-band > .lead {
  width: 100%;
  max-width: none;
  font-size: 17px;
}

.section > p,
.split p {
  max-width: 900px;
  color: var(--muted);
  font-size: 17px;
}

.section > .full-width-text {
  width: 100%;
  max-width: none;
}

.results-layout > .full-width-text,
.wide-grid > .full-width-text,
.two-panel > .full-width-text {
  grid-column: 1 / -1;
  width: 100%;
  max-width: none;
}

.section.visual-band > p {
  width: 100%;
  max-width: none;
}

.desiderata-layout {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(260px, 3fr);
  gap: 28px;
  align-items: center;
}

.section-copy p,
.section-copy .lead {
  max-width: none;
  color: var(--muted);
  font-size: 17px;
}

.section-copy .lead {
  width: 100%;
}

.side-figure img {
  min-height: 0;
}

.limitation-list {
  max-width: 900px;
  margin: -4px 0 18px;
  padding-left: 24px;
  color: var(--muted);
  font-size: 17px;
}

.limitation-list li + li {
  margin-top: 10px;
}

.limitation-list strong {
  color: var(--ink);
  font-weight: 800;
}

.insight-grid,
.three-panel,
.wide-grid,
.results-layout,
.two-panel,
.page-preview {
  display: grid;
  gap: 16px;
}

.insight-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 28px;
}

.insight-grid article {
  padding: 20px;
}

.insight-grid p {
  margin: 0;
  color: var(--muted);
}

.insight-grid ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.insight-grid li + li {
  margin-top: 4px;
}

.three-panel,
.results-layout {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 28px;
}

.paired-figures {
  --paired-figure-height: clamp(220px, 30vw, 360px);
  grid-template-columns: minmax(0, 1.29fr) minmax(0, 2.54fr);
  align-items: stretch;
}

.paired-figures .figure-card {
  display: flex;
  flex-direction: column;
}

.paired-figures img {
  height: var(--paired-figure-height);
  min-height: 0;
  object-fit: contain;
}

.balanced-figures {
  --paired-figure-height: clamp(260px, 34vw, 420px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wide-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 28px;
}

.wide-grid.single-figure {
  grid-template-columns: 1fr;
}

.two-panel {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 28px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  gap: 34px;
  align-items: center;
}

.full-width-section {
  grid-template-columns: 1fr;
}

.full-width-section > div,
.full-width-section p {
  max-width: none;
}

.hypothesis-box {
  width: 100%;
  max-width: none;
  margin: 20px 0 0;
  padding: 18px 20px;
  border: 2px solid #2563eb;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
}

.section > .hypothesis-box {
  max-width: none;
}

.hypothesis-box strong {
  color: #1d4ed8;
  font-weight: 800;
}

.figure-card {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.figure-card.large {
  padding: 18px;
}

.figure-card img {
  width: 100%;
  min-height: 180px;
  object-fit: contain;
  border-radius: 4px;
  background: #fff;
}

figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.formula {
  margin: 22px 0;
  padding: 18px 20px;
  border-left: 5px solid var(--accent-2);
  border-radius: 8px;
  background: #eef6fa;
}

.formula span {
  display: block;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.formula strong {
  display: block;
  margin-top: 5px;
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(16px, 2.5vw, 23px);
  line-height: 1.35;
}

.cost-model {
  grid-column: 1 / -1;
}

.cost-model summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  padding: 10px 14px;
  border: 1px solid rgba(8, 145, 178, 0.35);
  border-radius: 8px;
  color: var(--accent-2);
  background: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.cost-model summary::-webkit-details-marker {
  display: none;
}

.cost-model summary::after {
  content: "+";
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
}

.cost-model[open] summary {
  margin-bottom: 16px;
}

.cost-model[open] summary::after {
  content: "-";
}

.cost-model p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.cost-model p + .cost-equation,
.cost-equation + p {
  margin-top: 16px;
}

.cost-equation {
  padding: 14px 16px;
  border: 1px solid rgba(8, 145, 178, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  overflow-x: auto;
}

.cost-model .formula-label {
  margin-bottom: 8px;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.cost-equation pre {
  margin: 0;
  color: var(--ink);
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(12px, 1.35vw, 15px);
  line-height: 1.65;
  white-space: pre;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.metric-strip div {
  padding: 18px 20px;
  text-align: center;
}

.metric-strip b {
  display: block;
  color: var(--accent-3);
  font-size: 34px;
  line-height: 1;
}

.metric-strip span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-weight: 650;
  line-height: 1.35;
}

.page-preview {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 28px;
}

.page-preview figure {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 12px 32px rgba(33, 39, 56, 0.11);
}

.page-preview img {
  width: 100%;
  aspect-ratio: 612 / 792;
  object-fit: cover;
  object-position: top center;
  border: 1px solid #edf0f5;
  border-radius: 4px;
}

.citation-section {
  padding-bottom: 74px;
}

.codebox {
  position: relative;
  margin-top: 20px;
  border: 1px solid #2e3545;
  border-radius: var(--radius);
  background: #151922;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(21, 25, 34, 0.18);
}

pre {
  margin: 0;
  padding: 22px;
  overflow-x: auto;
  color: #f5f7fb;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  line-height: 1.65;
}

.copy-button {
  position: absolute;
  top: 10px;
  right: 10px;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.copy-button:hover {
  background: rgba(255, 255, 255, 0.16);
}

.footer {
  border-top: 1px solid var(--line);
  padding: 26px 16px 34px;
  background: #fff;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.footer p {
  margin: 0;
}

@media (max-width: 860px) {
  .hero {
    padding-top: 116px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 16px;
  }

  .navlinks {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero-inner {
    padding-top: 42px;
  }

  .hero-title {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .hero-figure {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-image-card,
  .hero-stats {
    width: 100%;
    height: auto;
  }

  .hero-stats {
    grid-template-rows: none;
  }

  .hero-figure,
  .desiderata-layout,
  .split,
  .insight-grid,
  .three-panel,
  .wide-grid,
  .results-layout,
  .two-panel,
  .page-preview,
  .metric-strip {
    grid-template-columns: 1fr;
  }

  .split {
    gap: 22px;
  }

  .paired-figures {
    --paired-figure-height: auto;
  }

  .section,
  .visual-band {
    padding-top: 48px;
    padding-bottom: 48px;
  }

  .lead {
    font-size: 18px;
  }
}

@media (max-width: 520px) {
  .hero-inner,
  .section {
    width: min(100% - 24px, 1080px);
  }

  .visual-band {
    padding-inline: 12px;
  }

  .button-row {
    justify-content: stretch;
  }

  .pill {
    flex: 1 1 calc(50% - 10px);
    padding-inline: 10px;
  }

  .hero-stats strong,
  .metric-strip b {
    font-size: 30px;
  }
}
