:root {
  --ink: #202124;
  --muted: #5f6368;
  --link: #27677a;
  --line: #d9dde0;
  --soft: #f5f7f7;
  --paper: #ffffff;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 17px;
  line-height: 1.55;
}

main {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

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

a:hover,
a:focus-visible { text-decoration: underline; }

.paper-header {
  max-width: 980px;
  margin: 0 auto;
  padding: 58px 0 10px;
  text-align: center;
}

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

h1 {
  max-width: 900px;
  margin: 0 auto 24px;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.13;
}

.title-mark {
  display: block;
  font-size: clamp(2.25rem, 5.2vw, 3.75rem);
  white-space: nowrap;
}

.title-rest {
  display: block;
  max-width: 860px;
  margin: 8px auto 0;
  font-size: clamp(1.7rem, 3.7vw, 2.75rem);
  line-height: 1.16;
}

.authors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 24px;
  margin-bottom: 6px;
  font-size: 1.08rem;
}

.authors a { font-weight: 600; }
.authors sup { margin-left: -20px; color: var(--muted); }

.affiliations,
.venue {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.91rem;
}

.venue {
  margin-top: 14px;
  color: var(--ink);
  font-size: 1.3rem;
  font-weight: 700;
}

.resource-links {
  margin: 22px 0 0;
  font-size: 1.18rem;
}

.resource-links span {
  padding: 0 10px;
  color: #a1a6aa;
}

.paper-details {
  max-width: 900px;
  margin: 30px auto 0;
  text-align: left;
}

details {
  border-top: 1px solid var(--line);
}

details:last-child { border-bottom: 1px solid var(--line); }

summary {
  padding: 15px 2px;
  cursor: pointer;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.28rem;
}

details pre {
  margin: 0 0 20px;
  padding: 18px 20px;
  overflow-x: auto;
  background: var(--soft);
  color: #244e5a;
  font-size: 0.82rem;
  line-height: 1.5;
}

.details-copy {
  padding: 0 4px 10px;
  color: var(--ink);
}

.details-copy p:last-child { margin-bottom: 8px; }

section {
  margin-top: 74px;
  padding-top: 52px;
  border-top: 1px solid var(--line);
}

.section-copy {
  max-width: 850px;
  margin: 0 auto 26px;
}

.section-copy h2 {
  margin-bottom: 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.9rem, 4.5vw, 2.8rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-align: center;
}

.section-copy p {
  margin-bottom: 10px;
  color: var(--ink);
}

.section-copy p:last-child { margin-bottom: 0; }

.motion-figure,
.result-figure,
.interactive-result,
.detailization-loop { margin: 0; }

.motion-figure video,
.motion-figure .reduced-motion {
  display: block;
  width: 100%;
  aspect-ratio: 32 / 15;
  border: 1px solid var(--line);
  background: white;
  object-fit: cover;
}

.reduced-motion { display: none !important; }

#results > .section-copy { margin-bottom: 48px; }

.result-block + .result-block {
  margin-top: 76px;
  padding-top: 52px;
  border-top: 1px solid var(--line);
}

.result-block > h3,
.detailization-copy h4 {
  margin-bottom: 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  font-weight: 400;
}

.result-block > h3 { text-align: center; }

.result-block > p,
.detailization-copy p {
  max-width: 850px;
  margin: 0 auto 24px;
  color: var(--ink);
}

.result-block > p { text-align: left; }

.result-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.interactive-result {
  padding: 24px;
  border: 1px solid var(--line);
  background: #fbfbfb;
}

.interactive-result img {
  display: block;
  height: auto;
}

.result-row-label,
.control-label {
  color: #43484c;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-align: center;
  text-transform: uppercase;
}

.result-row-label { margin-bottom: 7px; }

.wide-result-row {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.wide-result-row img {
  width: 100%;
  min-width: 780px;
}

.wide-result-row + .result-row-label { margin-top: 18px; }

.result-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 22px 0 16px;
}

.segmented-control {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid #9da9ad;
  border-radius: 3px;
}

.segmented-control button {
  min-height: 36px;
  padding: 6px 14px;
  border: 0;
  border-left: 1px solid #9da9ad;
  background: white;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
}

.segmented-control button:first-child { border-left: 0; }

.segmented-control button:hover,
.segmented-control button:focus-visible { background: #edf3f4; }

.segmented-control button.active {
  background: var(--link);
  color: white;
}

.select-controls {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.7fr);
  gap: 18px;
  max-width: 850px;
  margin: 0 auto 18px;
}

.single-select-control {
  max-width: 850px;
  margin: 0 auto 18px;
}

.select-controls label,
.single-select-control label {
  display: grid;
  gap: 6px;
  color: #43484c;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

select {
  width: 100%;
  min-height: 42px;
  padding: 7px 34px 7px 10px;
  border: 1px solid #9da9ad;
  border-radius: 3px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
}

.selected-request {
  max-width: 850px;
  margin: 0 auto 22px;
  padding: 11px 14px;
  border-left: 3px solid var(--link);
  background: #f4f7f7;
  color: var(--ink);
}

.selected-request span { font-weight: 700; }

.editing-comparison {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.comparison-cell img {
  width: 100%;
  border: 1px solid var(--line);
}

.generation-comparison {
  width: min(100%, 850px);
  margin: 0 auto;
}

.generation-labels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 850px;
  margin: 7px auto 0;
  font-size: 0.9rem;
  font-style: italic;
  text-align: center;
}

figcaption {
  max-width: 850px;
  margin: 15px auto 0;
  color: var(--ink);
  font-size: 0.93rem;
  text-align: left;
}

figcaption strong { color: var(--ink); }

.detailization-copy {
  max-width: 850px;
  margin: 58px auto 22px;
  text-align: center;
}

.detailization-copy h4 { font-size: 1.65rem; }
.detailization-copy p { text-align: left; }

.detailization-loop {
  padding: 22px 24px 20px;
  border: 1px solid var(--line);
  background: #fbfbfb;
}

.detailization-loop img {
  display: block;
  width: 100%;
  height: auto;
}

.loop-label {
  margin-bottom: 8px;
  color: #43484c;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

.loop-arrow {
  height: 42px;
  color: var(--link);
  font-size: 2rem;
  line-height: 42px;
  text-align: center;
}

.detailization-control { margin: 16px 0 4px; }

.library-tabs {
  display: flex;
  justify-content: center;
  max-width: 850px;
  margin: 0 auto 24px;
  border-bottom: 1px solid var(--line);
}

.library-tabs button {
  min-width: 112px;
  padding: 11px 18px 10px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #4c5458;
  cursor: pointer;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 650;
}

.library-tabs button:hover { color: var(--link); }

.library-tabs button:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.library-tabs button.active {
  border-bottom-color: var(--link);
  color: var(--link);
}

.library-diagram {
  padding: 26px;
  border: 1px solid #aab7bc;
  background: #fbfcfc;
}

.library-diagram-header {
  max-width: 1000px;
  margin: 0 auto 12px;
  text-align: center;
}

.library-category {
  margin-bottom: 3px;
  color: #596268;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.library-diagram-header h3 {
  margin-bottom: 9px;
  font-size: 1.55rem;
}

.library-diagram-header h3 code {
  padding: 3px 8px;
  border-radius: 3px;
  background: #e8e2ef;
  color: #392d4d;
  font-size: 0.9em;
}

.library-diagram-header > p:last-child {
  margin: 0 auto;
  color: var(--ink);
  font-size: 0.9rem;
  text-align: left;
}

.library-flow {
  display: grid;
  grid-template-columns: minmax(330px, 0.9fr) minmax(460px, 1.4fr);
  gap: 22px;
  align-items: stretch;
}

.library-code-panel,
.library-applications {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 1px solid #294856;
  background: white;
}

.library-code-panel {
  display: flex;
  min-height: 0;
  flex-direction: column;
}

.library-code-panel h4,
.library-applications > h4 {
  margin: 0;
  padding: 10px 14px;
  border-bottom: 1px solid #294856;
  background: #f2f6f7;
  color: #253a44;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.065em;
  text-align: center;
  text-transform: uppercase;
}

.library-code-panel pre {
  height: 0;
  min-height: 0;
  flex: 1 1 auto;
  margin: 0;
  padding: 16px;
  overflow: auto;
  background: white;
  color: #172126;
  font-size: 0.71rem;
  line-height: 1.42;
  overflow-wrap: anywhere;
  tab-size: 4;
  white-space: pre-wrap;
}

.library-code-panel code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }

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

.library-examples figure {
  min-width: 0;
  margin: 0;
  padding: 10px 10px 9px;
}

.library-examples figure:nth-child(odd) { border-right: 1px solid var(--line); }
.library-examples figure:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }

.library-examples img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: white;
}

.library-examples figcaption {
  min-height: 2.65em;
  margin: 5px 2px 0;
  color: #394449;
  font-size: 0.72rem;
  line-height: 1.35;
  text-align: center;
}

.library-examples figcaption code {
  color: inherit;
  font-size: inherit;
  white-space: pre-line;
}

.library-legend {
  margin: 8px 16px 13px;
  color: #354148;
  font-size: 0.78rem;
  text-align: center;
}

.library-legend span {
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 6px;
  border: 1px solid #4f7850;
  background: #98df8a;
  vertical-align: -1px;
}

.publication {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.publication:last-child { border-bottom: 1px solid var(--line); }

.publication h3 {
  margin-bottom: 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 400;
}

.publication p {
  margin-bottom: 5px;
  font-size: 0.94rem;
}

.publication-authors { color: var(--muted); }

#acknowledgements .section-copy {
  max-width: 900px;
  text-align: left;
}

#acknowledgements .section-copy h2 { text-align: center; }

#acknowledgements .section-copy p {
  color: var(--ink);
  margin-bottom: 12px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .motion-figure video { display: none; }
  .motion-figure .reduced-motion { display: block !important; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }

  main { width: min(100% - 24px, 620px); }

  .paper-header { padding-top: 40px; }

  .title-mark { font-size: clamp(2rem, 10vw, 3rem); }
  .title-rest { font-size: clamp(1.5rem, 7.5vw, 2.15rem); }

  .authors { gap: 5px 18px; }
  .authors sup { margin-left: -15px; }

  section {
    margin-top: 58px;
    padding-top: 40px;
  }

  .section-copy { margin-bottom: 20px; }

  .motion-figure video,
  .motion-figure .reduced-motion { border-width: 1px; }

  .result-block + .result-block {
    margin-top: 54px;
    padding-top: 40px;
  }

  .result-block > h3 { font-size: 1.7rem; }

  .interactive-result,
  .detailization-loop { padding: 14px 10px; }

  .result-control {
    align-items: stretch;
    flex-direction: column;
    gap: 7px;
  }

  .segmented-control { align-self: center; }

  .select-controls { grid-template-columns: 1fr; }

  .editing-comparison { grid-template-columns: 1fr 1fr; }

  .library-tabs {
    flex-wrap: wrap;
    border-bottom: 0;
    gap: 5px;
  }

  .library-tabs button {
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid var(--line);
  }

  .library-tabs button.active {
    border-color: var(--link);
    background: #edf3f5;
  }

  .library-diagram { padding: 16px 12px; }
  .library-flow { grid-template-columns: 1fr; }
  .library-applications { order: 1; }
  .library-code-panel { order: 2; }
  .library-code-panel pre {
    height: 410px;
    flex: 0 0 auto;
  }
}

@media (max-width: 430px) {
  main { width: calc(100% - 18px); }
  .affiliations { line-height: 1.8; }
  .paper-details { margin-top: 24px; }
  details pre { padding: 14px; font-size: 0.7rem; }
  .detailization-loop { padding-inline: 5px; }
  .library-diagram { padding-inline: 7px; }
  .library-diagram-header h3 { font-size: 1.25rem; }
  .library-examples figure { padding: 5px; }
  .library-examples figcaption { font-size: 0.62rem; }
  .library-code-panel pre { padding: 12px; font-size: 0.65rem; }
}
