:root {
  --ink: #172033;
  --muted: #526077;
  --subtle: #6d788b;
  --paper: #ffffff;
  --soft: #f7f9fc;
  --line: #dfe5ec;
  --blue: #315f7d;
  --blue-deep: #234a66;
  --blue-soft: #edf4f8;
  --purple: #7056a6;
  --purple-soft: #f3effa;
  --orange: #d58722;
  --orange-soft: #fff5e6;
  --green: #079c72;
  --green-soft: #eaf8f3;
  --link: #1d5f91;
  --shadow: 0 14px 36px rgba(42, 60, 84, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 0%, rgba(49, 95, 125, 0.08), transparent 26rem),
    var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.67;
}

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

a:hover {
  text-decoration: underline;
}

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

.project-page {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 48px 0 84px;
}

.project-hero {
  max-width: 1030px;
  margin: 0 auto;
  padding: 18px 0 42px;
  text-align: center;
}

.eyebrow,
.result-kicker {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.project-hero h1 {
  margin: 0 auto 24px;
  color: #111827;
  font-size: clamp(1.75rem, 3.5vw, 2.65rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.authors {
  margin: 0 auto 6px;
  color: #243147;
  font-size: clamp(0.98rem, 1.4vw, 1.12rem);
  line-height: 1.45;
}

.authors sup,
.affiliation sup {
  color: var(--blue);
  font-weight: 800;
}

.affiliation {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.venue-line {
  margin: 16px auto 4px;
  color: var(--blue);
  font-size: 1.05rem;
}

.project-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.project-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-width: 7rem;
  min-height: 2.55rem;
  padding: 0 1.05rem;
  border: 1px solid #ccd6e1;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  font-weight: 700;
  box-shadow: 0 3px 12px rgba(49, 95, 125, 0.05);
}

.project-links a:hover {
  border-color: var(--link);
  color: var(--link);
  text-decoration: none;
}

.link-icon {
  width: 1.05rem;
  height: 1.05rem;
  fill: currentColor;
}

.tldr {
  max-width: 900px;
  margin: 26px auto 0;
  padding: 1.2rem 1.35rem;
  border: 1px solid #d5e2ea;
  border-left: 4px solid var(--blue);
  border-radius: 10px;
  color: #263549;
  background: rgba(237, 244, 248, 0.74);
  font-size: 1.07rem;
  text-align: left;
}

section {
  max-width: 920px;
  margin: 0 auto;
  padding: 22px 0 6px;
}

h2 {
  margin: 2.25em 0 0.78em;
  padding-bottom: 0.25em;
  border-bottom: 1px solid var(--line);
  color: #172033;
  font-size: clamp(1.5rem, 3vw, 1.95rem);
  font-weight: 700;
  line-height: 1.24;
  letter-spacing: -0.015em;
}

h3 {
  margin: 0 0 0.55rem;
  color: #1e2a3c;
  font-size: 1.2rem;
  line-height: 1.3;
}

p,
ul,
ol {
  margin-top: 0;
  margin-bottom: 1rem;
}

.central-question {
  position: relative;
  margin: 1.65rem 0;
  padding: 1.1rem 1.25rem 1.05rem;
  border: 1px solid #edd6b3;
  border-left: 4px solid var(--orange);
  border-radius: 10px;
  background: var(--orange-soft);
}

.central-question span {
  display: block;
  margin-bottom: 0.25rem;
  color: #9c5a06;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.central-question p {
  margin: 0;
  color: #382b1d;
  font-size: 1.1rem;
  font-weight: 650;
}

.policy-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.85rem;
  margin: 1.7rem 0 0.8rem;
}

.policy-card {
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 6px 22px rgba(42, 60, 84, 0.06);
}

.policy-card.on-policy {
  border-top: 4px solid var(--green);
  background: var(--green-soft);
}

.policy-card.off-policy {
  border-top: 4px solid var(--orange);
  background: var(--orange-soft);
}

.policy-card > span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.policy-card strong {
  display: block;
  margin: 0.2rem 0 0.05rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  font-style: italic;
}

.policy-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.only-variable {
  width: 9rem;
  color: var(--subtle);
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.25;
  text-align: center;
  text-transform: uppercase;
}

.only-variable::before,
.only-variable::after {
  content: "";
  display: block;
  height: 1px;
  margin: 0.38rem 0;
  background: linear-gradient(90deg, var(--green), var(--orange));
}

.paper-figure {
  margin: 30px auto 32px;
}

.wide-figure {
  width: min(1080px, calc(100vw - 40px));
  margin-left: 50%;
  transform: translateX(-50%);
}

.paper-figure img,
.compact-figure img,
.model-grid img,
.folded-content figure img,
.spectrum-inset img {
  width: 100%;
  height: auto;
  margin: 0 auto;
}

figcaption {
  margin: 11px auto 0;
  color: var(--subtle);
  font-size: 0.9rem;
  line-height: 1.42;
  text-align: center;
}

.takeaway {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: start;
  margin: 1.55rem 0;
  padding: 1rem 1.2rem;
  border: 1px solid #cadce7;
  border-left: 4px solid var(--blue);
  border-radius: 10px;
  background: var(--blue-soft);
  color: #27384a;
}

.takeaway > span {
  padding-top: 0.08rem;
  color: var(--blue);
  font-size: 1rem;
}

.takeaway p {
  margin: 0;
}

.equation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  width: min(1080px, calc(100vw - 40px));
  margin: 1.6rem 0 1.25rem 50%;
  transform: translateX(-50%);
}

.equation-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.forward-card {
  border-top: 4px solid var(--purple);
}

.reverse-card {
  border-top: 4px solid var(--orange);
}

.equation-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  padding: 0.85rem 1rem 0;
}

.equation-heading span {
  font-size: 1.04rem;
  font-weight: 800;
}

.equation-heading em {
  color: var(--subtle);
  font-size: 0.86rem;
}

.equation {
  min-height: 142px;
  padding: 0.3rem 0.5rem;
  overflow-x: auto;
  font-size: 0.79rem;
}

.equation-note {
  min-height: 154px;
  padding: 0.9rem 1rem 1rem;
  border-top: 1px solid var(--line);
}

.forward-card .equation-note {
  background: var(--purple-soft);
}

.reverse-card .equation-note {
  background: var(--orange-soft);
}

.equation-note strong,
.equation-note > span {
  display: block;
}

.equation-note strong {
  margin-bottom: 0.1rem;
  color: #243147;
}

.equation-note > span {
  color: var(--muted);
  font-size: 0.94rem;
}

.equation-note p {
  margin: 0.55rem 0 0;
  color: #344258;
  font-size: 0.92rem;
  line-height: 1.5;
}

.equation-conclusion {
  max-width: 820px;
  margin: 0 auto;
  color: #314055;
  text-align: center;
}

.spectrum-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(250px, 0.7fr);
  gap: 1.6rem;
  align-items: center;
  margin: 1.15rem 0 1.4rem;
}

.spectrum-inset {
  margin: 0;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 8px 24px rgba(42, 60, 84, 0.08);
}

.spectrum-scale {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 1.35rem 0 0;
  padding-top: 1rem;
}

.spectrum-scale::before {
  content: "";
  position: absolute;
  top: 0.3rem;
  right: 7%;
  left: 7%;
  height: 5px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--orange), #9b8d6c 50%, var(--green));
}

.spectrum-scale div {
  text-align: center;
}

.spectrum-scale strong,
.spectrum-scale span {
  display: block;
}

.spectrum-scale strong {
  color: #253246;
  font-size: 0.9rem;
}

.spectrum-scale span {
  color: var(--subtle);
  font-size: 0.78rem;
}

.spectrum-main {
  margin-top: 22px;
}

.star-result {
  width: min(1080px, calc(100vw - 40px));
  margin: 1.7rem 0 1.35rem 50%;
  padding: 1.25rem 1.25rem 1.15rem;
  transform: translateX(-50%);
  border: 1px solid #ded7ee;
  border-left: 4px solid var(--purple);
  border-radius: 14px;
  background: linear-gradient(135deg, #ffffff, #faf8fe);
  box-shadow: var(--shadow);
}

.star-result h3 {
  font-size: 1.35rem;
}

.star-result > p {
  max-width: 900px;
  margin-bottom: 1.2rem;
  color: #38465a;
}

.generalisation-result {
  border-color: #cde8dd;
  border-left-color: var(--green);
  background: linear-gradient(135deg, #ffffff, #f4fbf8);
}

.generalisation-result .result-kicker {
  color: #087d5d;
}

.model-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.model-grid figure {
  position: relative;
  margin: 0;
  padding: 2rem 0.55rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}

.model-label {
  position: absolute;
  top: 0.5rem;
  left: 0.6rem;
  z-index: 1;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  color: #ffffff;
  background: var(--blue-deep);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.side-result {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 2rem;
  align-items: center;
  margin: 1.6rem 0 2.2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.side-result h3 {
  font-size: 1.3rem;
}

.compact-figure {
  margin: 0;
}

.square-figure {
  max-width: 380px;
  justify-self: end;
}

.style-result {
  grid-template-columns: minmax(310px, 0.9fr) minmax(0, 1.1fr);
  border-bottom: 0;
}

.style-figure {
  max-width: 460px;
}

.folded-stack {
  display: grid;
  gap: 0.9rem;
  margin: 1.45rem 0;
}

.folded-experiment {
  overflow: hidden;
  border: 1px solid #cedbe4;
  border-radius: 12px;
  background: #f6fafc;
}

.folded-experiment summary {
  position: relative;
  display: grid;
  grid-template-columns: minmax(210px, 0.75fr) minmax(0, 1.25fr);
  gap: 1rem;
  align-items: center;
  padding: 1rem 3rem 1rem 1.15rem;
  cursor: pointer;
  list-style: none;
}

.folded-experiment summary::-webkit-details-marker {
  display: none;
}

.folded-experiment summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 1.15rem;
  width: 1.45rem;
  height: 1.45rem;
  transform: translateY(-50%);
  border-radius: 50%;
  color: var(--blue);
  background: #e5eff5;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.32rem;
  text-align: center;
}

.folded-experiment[open] summary::after {
  content: "-";
}

.folded-experiment[open] summary {
  border-bottom: 1px solid #cedbe4;
  background: #edf5f8;
}

.summary-title,
.summary-finding {
  display: block;
}

.summary-title {
  color: #213147;
  font-weight: 800;
}

.summary-finding {
  color: var(--muted);
  font-size: 0.92rem;
}

.folded-content {
  padding: 1.15rem;
  background: #fbfdfe;
}

.folded-content > p {
  max-width: 820px;
  margin-right: auto;
  margin-left: auto;
}

.folded-content figure {
  margin: 1.25rem auto 0.25rem;
}

.conclusion-section {
  padding-bottom: 16px;
}

.final-takeaway {
  margin: 1.7rem 0 0;
  padding: 1.3rem 1.4rem;
  border-radius: 12px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue-deep), var(--blue));
  box-shadow: var(--shadow);
}

.final-takeaway span {
  display: block;
  margin-bottom: 0.25rem;
  color: #cfe2ed;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.final-takeaway p {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 650;
}

mjx-container[jax="SVG"][display="true"] {
  margin: 0.75em auto !important;
  overflow-x: auto;
  overflow-y: hidden;
}

@media (max-width: 840px) {
  .equation-grid,
  .model-grid {
    grid-template-columns: 1fr;
  }

  .equation {
    min-height: auto;
  }

  .equation-note {
    min-height: 0;
  }

  .spectrum-intro,
  .side-result,
  .style-result {
    grid-template-columns: 1fr;
  }

  .spectrum-inset {
    width: min(360px, 100%);
    margin: 0 auto;
  }

  .square-figure,
  .style-figure {
    max-width: 520px;
    justify-self: center;
  }

  .style-result > figure {
    order: 2;
  }
}

@media (max-width: 680px) {
  .project-page {
    width: min(100% - 28px, 980px);
    padding-top: 30px;
  }

  .project-hero {
    padding-top: 8px;
  }

  .project-hero h1 {
    font-size: 1.95rem;
  }

  .tldr {
    font-size: 1rem;
  }

  .policy-pair {
    grid-template-columns: 1fr;
  }

  .only-variable {
    width: 100%;
  }

  .only-variable::before,
  .only-variable::after {
    display: none;
  }

  .equation-grid,
  .star-result,
  .wide-figure {
    width: calc(100vw - 28px);
  }

  .equation {
    font-size: 0.72rem;
  }

  .star-result {
    padding: 1rem 0.8rem;
  }

  .folded-experiment summary {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
}

@media (max-width: 420px) {
  .project-page {
    width: min(100% - 22px, 980px);
  }

  .project-links a {
    min-width: 0;
    flex: 1 1 8rem;
  }

  .equation-grid,
  .star-result,
  .wide-figure {
    width: calc(100vw - 22px);
  }

  .equation {
    font-size: 0.63rem;
  }
}
