:root {
  --ink: #18211f;
  --muted: #68736f;
  --paper: #fbf7ee;
  --panel: #ffffff;
  --soft: #f2eadc;
  --line: #ddd5c8;
  --blue: #315a9f;
  --orange: #c95f13;
  --green: #4f8f2c;
  --teal: #0f766e;
  --shadow: 0 22px 70px rgba(40, 28, 15, 0.11);
  --radius-lg: 24px;
  --radius-md: 16px;
  --font-display: "Fraunces", "Iowan Old Style", "Georgia", serif;
  --font-body: "Aptos", "IBM Plex Sans", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(201, 95, 19, 0.15), transparent 30rem),
    radial-gradient(circle at 90% 8%, rgba(49, 90, 159, 0.14), transparent 28rem),
    linear-gradient(180deg, #fffaf2 0%, var(--paper) 45%, #f3eadc 100%);
  font-family: var(--font-body);
  line-height: 1.6;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background-image:
    linear-gradient(rgba(24, 33, 31, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 33, 31, 0.045) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.48), transparent 82%);
}

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

p,
figure {
  margin: 0;
}

.hero {
  padding: 24px clamp(18px, 4vw, 56px) 46px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 34px rgba(24, 33, 31, 0.06);
}

.brand {
  color: var(--blue);
  font-weight: 900;
  letter-spacing: -0.04em;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(10px, 2vw, 24px);
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 750;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--orange);
}

.hero-content {
  max-width: 1040px;
  margin: 72px auto 0;
  text-align: center;
}

.eyebrow,
.section-tag {
  color: var(--orange);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.08;
}

h1,
h2 {
  font-family: var(--font-display);
  letter-spacing: -0.055em;
}

h1 {
  margin-top: 12px;
  color: var(--ink);
  font-size: clamp(3.5rem, 9vw, 7.2rem);
  line-height: 0.9;
  white-space: nowrap;
}

h2 {
  max-width: 860px;
  margin-top: 10px;
  font-size: clamp(2.2rem, 4.4vw, 4.2rem);
}

h3 {
  font-size: 1.18rem;
  letter-spacing: -0.035em;
}

h4 {
  font-size: 1rem;
}

.paper-title {
  max-width: 980px;
  margin: 18px auto 0;
  color: var(--blue);
  font-size: clamp(1.3rem, 2.4vw, 2.1rem);
  font-weight: 900;
  letter-spacing: -0.035em;
}

.author-line,
.venue-line {
  color: var(--muted);
}

.author-line {
  margin-top: 22px;
  font-weight: 900;
}

.venue-line {
  margin-top: 2px;
}

.resource-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

.resource-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(49, 90, 159, 0.28);
  border-radius: 999px;
  background: #fff;
  color: var(--blue);
  font-weight: 900;
  box-shadow: 0 10px 28px rgba(49, 90, 159, 0.08);
}

.resource-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.resource-link.disabled {
  cursor: not-allowed;
}

.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 76px clamp(18px, 4vw, 36px);
}

.alt-section {
  max-width: none;
  margin: 0;
  padding-right: max(clamp(18px, 4vw, 36px), calc((100vw - 1180px) / 2 + 36px));
  padding-left: max(clamp(18px, 4vw, 36px), calc((100vw - 1180px) / 2 + 36px));
  background: rgba(255, 255, 255, 0.42);
  border-block: 1px solid rgba(221, 213, 200, 0.72);
}

.section-lede {
  max-width: 890px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 1.12rem;
}

.paper-figure {
  overflow: hidden;
  margin-top: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.paper-figure img {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
}

.paper-figure figcaption {
  padding: 13px 18px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.98rem;
  text-align: center;
}

.hero-figure {
  margin-top: 30px;
}

.problem-grid,
.component-grid,
.question-list,
.finding-grid,
.vqa-grid {
  display: grid;
  gap: 18px;
  margin-top: 34px;
}

.problem-grid,
.component-grid,
.question-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.core-problems {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

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

.problem-grid article,
.component-grid article,
.question-list article,
.finding-grid article,
.vqa-grid article {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 16px 46px rgba(24, 33, 31, 0.07);
}

.problem-grid article,
.component-grid article,
.question-list article,
.finding-grid article {
  padding: 22px;
}

.problem-grid span,
.finding-grid span,
.vqa-grid span {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--orange);
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}

.problem-grid p,
.component-grid p,
.question-list p,
.finding-grid p,
.result-block p,
.vqa-grid p {
  margin-top: 12px;
  color: var(--muted);
}

.component-grid article:nth-child(1) {
  border-color: rgba(49, 90, 159, 0.32);
}

.component-grid article:nth-child(2) {
  border-color: rgba(201, 95, 19, 0.32);
}

.component-grid article:nth-child(3) {
  border-color: rgba(79, 143, 44, 0.32);
}

.result-block {
  margin-top: 56px;
}

.result-block > h3 {
  color: var(--blue);
  font-size: 1.55rem;
}

.table-card {
  margin-top: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow);
}

.chart-carousel {
  margin-top: 22px;
}

.chart-controls {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 12px;
}

.chart-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(49, 90, 159, 0.28);
  border-radius: 999px;
  background: #fff;
  color: var(--blue);
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 10px 28px rgba(49, 90, 159, 0.08);
}

.chart-button:hover,
.chart-button:focus-visible {
  border-color: rgba(201, 95, 19, 0.38);
  color: var(--orange);
}

.chart-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.chart-scroller {
  display: grid;
  grid-auto-columns: 100%;
  grid-auto-flow: column;
  gap: 22px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-padding-inline: 2px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.chart-scroller::-webkit-scrollbar {
  display: none;
}

.chart-scroller:focus-visible {
  outline: 3px solid rgba(49, 90, 159, 0.35);
  outline-offset: 6px;
}

.chart-scroller .table-card {
  margin-top: 0;
  scroll-snap-align: start;
}

.table-card h4 {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(49, 90, 159, 0.08), rgba(201, 95, 19, 0.08));
}

.table-scroll {
  overflow-x: auto;
  max-width: 100%;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  white-space: nowrap;
}

th,
td {
  padding: 8px 10px;
  border: 1px solid #e8e1d6;
  text-align: right;
}

th:first-child,
td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
  text-align: left;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f4eadb;
  color: #322a20;
  font-weight: 900;
}

thead th:first-child {
  z-index: 3;
  background: #f4eadb;
}

tbody tr:nth-child(even):not(.group):not(.best-row) {
  background: #fcfaf6;
}

.group td {
  position: static;
  background: #eaf1fb;
  color: var(--blue);
  font-weight: 900;
  text-align: center;
}

.best-row td {
  background: #edf7ea;
  font-weight: 900;
}

.best-row td:first-child {
  background: #edf7ea;
}

.vqa-block .paper-figure {
  max-width: 980px;
}

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

.vqa-grid article:nth-child(1) span,
.vqa-grid article:nth-child(1) h4 {
  color: #2f7ee6;
}

.vqa-grid article:nth-child(2) span,
.vqa-grid article:nth-child(2) h4 {
  color: var(--teal);
}

.vqa-grid article:nth-child(3) span,
.vqa-grid article:nth-child(3) h4 {
  color: #ec8b35;
}

.citation-section pre {
  overflow-x: auto;
  margin-top: 26px;
  padding: 22px;
  border: 1px solid rgba(24, 33, 31, 0.12);
  border-radius: var(--radius-md);
  background: #17201e;
  color: #fff4de;
  box-shadow: var(--shadow);
}

code {
  font-family: "Cascadia Code", "IBM Plex Mono", "Menlo", monospace;
  font-size: 0.92rem;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px clamp(18px, 4vw, 36px) 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.94rem;
}

@media (max-width: 980px) {
  .topbar {
    align-items: flex-start;
    border-radius: 22px;
    flex-direction: column;
  }

  h1 {
    white-space: normal;
  }

  .problem-grid,
  .component-grid,
  .question-list,
  .vqa-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .hero-content {
    margin-top: 50px;
  }

  .resource-row,
  .site-footer {
    flex-direction: column;
  }

  .resource-link {
    justify-content: center;
    width: 100%;
  }

  .section,
  .alt-section {
    padding-top: 56px;
    padding-bottom: 56px;
  }

  .finding-grid {
    grid-template-columns: 1fr;
  }

  th,
  td {
    padding: 7px 8px;
  }
}
