@font-face {
  font-family: "Commit Mono";
  src: url("../fonts/CommitMono-400-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --text: #252525;
  --muted: #6b6b6b;
  --rule: #e4e4e4;
  --forecast: #4779a8;
  --observed: #b96243;
  --accent: #365f84;
  --accent-hover: #294a68;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: "Commit Mono", monospace;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 32px;
}
body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
[hidden] {
  display: none !important;
}
a {
  color: inherit;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover {
  color: var(--accent);
}
::selection {
  background: #dce9f4;
}
button,
select {
  font: inherit;
}
button {
  cursor: pointer;
  touch-action: manipulation;
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
:focus-visible {
  outline: 2px solid var(--forecast);
  outline-offset: 4px;
}
h1,
h2,
p,
figure,
dl {
  margin: 0;
}
h1,
h2 {
  line-height: 1.2;
  text-wrap: balance;
}
h1 {
  font-size: 42px;
  letter-spacing: -1.2px;
  font-weight: 500;
}
h2 {
  font-size: 26px;
  font-weight: 500;
  margin: 44px 0 18px;
  letter-spacing: -0.35px;
}
p {
  margin: 0 0 18px;
}
strong {
  font-weight: 600;
}
sup {
  font-family: var(--sans);
  font-size: 0.65em;
  vertical-align: super;
}

.article {
  width: min(760px, calc(100% - 48px));
  margin: 44px auto 0;
  padding-bottom: 32px;
}
.article-header {
  margin-bottom: 26px;
}
.article-header h1 {
  animation: title-arrival 550ms ease-out;
}
.title-context {
  color: var(--accent);
}
.title-answer {
  color: #a14f36;
}
@keyframes title-arrival {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.subtitle {
  font-size: 22px;
  line-height: 1.4;
  color: #626262;
  margin: 12px 0 20px;
}
.authors {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  font-size: 17px;
  margin-bottom: 5px;
}
.authors sup {
  margin-left: 3px;
}
.affiliations,
.publication {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}
.affiliations {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  margin-top: 10px;
}
.affiliation,
.affiliation a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.affiliation {
  gap: 12px;
}
.affiliation sup {
  align-self: flex-start;
  margin-right: -6px;
}
.affiliation a {
  text-decoration: none;
  color: var(--text);
}
.affiliation a:hover {
  opacity: 0.7;
}
.affiliation img {
  display: block;
  height: auto;
  object-fit: contain;
}
.tufa-logo {
  width: 26px;
}
.mila-logo {
  width: 68px;
}
.udem-logo {
  width: 92px;
}
.publication {
  margin-top: 10px;
  font-weight: 700;
}
.paper-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  font-family: var(--sans);
  font-size: 14px;
  margin-top: 12px;
}
.paper-links a {
  color: var(--accent);
  text-decoration-color: #a8bed1;
  overflow-wrap: anywhere;
}
.paper-links a:hover {
  color: var(--accent-hover);
  text-decoration-color: currentColor;
}
.contents {
  position: fixed;
  left: calc(50% - 640px);
  top: 220px;
  width: 145px;
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.6;
}
.contents p {
  color: var(--muted);
  margin: 0 0 13px;
}
.contents a {
  display: block;
  text-decoration: none;
  padding: 4px 0;
  color: #707070;
}
.contents a:hover {
  color: var(--text);
}
.skip-link {
  position: absolute;
  top: -70px;
  left: 20px;
  background: white;
  padding: 8px;
  font-family: var(--sans);
  font-size: 14px;
}
.skip-link:focus {
  top: 12px;
}

.wide-figure {
  width: min(940px, calc(100vw - 56px));
  margin-left: 50%;
  transform: translateX(-50%);
}
.method-figure {
  margin-top: 0;
  margin-bottom: 28px;
}
.method-diagram img,
.chart-image img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}
.demo-figure {
  margin-top: 30px;
  margin-bottom: 42px;
}
#explorer {
  border-top: 1px solid #ccc;
  border-bottom: 1px solid #ccc;
  padding: 20px 0 18px;
}
.loading-message {
  font-family: var(--sans);
  font-size: 15px;
  text-align: center;
  padding: 70px 20px;
}
.prompt-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--sans);
  font-size: 14px;
}
.prompt-controls label {
  color: var(--muted);
}
.prompt-controls .text-button {
  margin-left: auto;
}
select {
  appearance: none;
  border: 1px solid #d5d5d5;
  border-radius: 3px;
  color: var(--text);
  background: white
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%236b6b6b' stroke-width='1.5'%3E%3Cpath d='m1 1 5 5 5-5'/%3E%3C/svg%3E")
    no-repeat right 11px center;
  padding: 6px 32px 6px 10px;
  max-width: 100%;
  min-width: 0;
  font-family: var(--sans);
  font-size: 14px;
}
.prompt-text {
  font-size: 21px;
  line-height: 1.5;
  margin: 21px 0 7px;
  max-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
}
.metadata {
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted);
  margin: 0;
}
.model-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  border-bottom: 1px solid var(--rule);
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 21px;
  font-family: var(--sans);
  font-size: 14px;
}
.tabs button {
  padding: 7px 0 9px;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--muted);
  background: none;
}
.tabs button[aria-pressed="true"] {
  border-bottom-color: var(--accent);
  color: var(--accent);
}
.tabs button:hover {
  color: var(--text);
}
.demo-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 32px;
  padding-top: 22px;
}
.plot-panel {
  min-width: 0;
}
.plot-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 21px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.forecast {
  background: var(--forecast);
}
.observed {
  background: var(--observed);
}
#activation-plot {
  display: block;
  width: 100%;
  overflow: visible;
}
.chart-axis {
  font-family: var(--sans);
  font-size: 14px;
  fill: var(--muted);
}
.observation-point {
  cursor: pointer;
  fill: var(--observed);
  stroke: white;
  stroke-width: 2;
}
.rollout-trail {
  fill: none;
  stroke: var(--observed);
  stroke-width: 1.4;
  stroke-opacity: 0.18;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.rollout-trail-recent {
  stroke-width: 1.7;
  stroke-opacity: 0.45;
}
.plot-point {
  transition: opacity 0.2s;
}
.plot-panel > .metadata {
  margin-left: 5px;
}
.answer-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.answer-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-family: var(--sans);
  font-size: 14px;
  margin-bottom: 10px;
}
#reveal-count {
  color: var(--muted);
  font-size: 12px;
}
.rollout-options {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 16px;
}
.rollout-option {
  position: relative;
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1;
  min-height: 36px;
  padding: 7px 0 12px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: white;
  color: var(--text);
}
.rollout-option::before,
.rollout-option::after {
  content: "";
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 4px;
  height: 3px;
  border-radius: 2px;
  pointer-events: none;
}
.rollout-option::before {
  background: var(--rule);
}
.rollout-option::after {
  background: var(--observed);
  clip-path: inset(0 calc(100% - var(--rollout-progress, 0%)) 0 0);
  transition: clip-path 120ms linear;
}
.rollout-option:hover {
  border-color: #b4b4b4;
  color: var(--text);
}
.rollout-option[aria-pressed="true"] {
  border-color: var(--text);
  box-shadow: inset 0 0 0 1px var(--text);
  font-weight: 600;
}
.answer-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-family: var(--sans);
  font-size: 13px;
}
#answer-progress {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.answer-reader {
  height: 280px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  overflow-wrap: anywhere;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 16px;
}
.answer-placeholder {
  color: var(--muted);
  font-size: 15px;
  margin: 0;
}
.answer-full {
  white-space: pre-wrap;
  font-size: 16px;
  line-height: 1.7;
  margin: 0;
}
.answer-full:empty {
  display: none;
}
.button {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.4;
  padding: 8px 12px;
  border: 1px solid #bbb;
  border-radius: 3px;
  background: #fff;
  color: var(--text);
}
.button:hover {
  background: #f5f5f5;
  border-color: #888;
}
#play-replay {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
#play-replay:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.text-button {
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.5;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: #bbb;
  text-underline-offset: 3px;
}
.text-button:hover {
  color: var(--text);
}
.replay-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 19px;
}
.token-progress {
  margin-top: 16px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
}
.token-progress label {
  display: flex;
  justify-content: space-between;
  font-variant-numeric: tabular-nums;
}
.token-progress input {
  display: block;
  width: 100%;
  margin: 6px 0 0;
  accent-color: var(--observed);
  cursor: pointer;
}
#replay-status {
  margin-top: 12px;
  min-height: 40px;
}
.figure-explanation {
  margin: 22px 0 0;
  font-size: 16px;
  line-height: 1.6;
  max-width: 780px;
}
.figure-explanation strong {
  font-weight: 600;
}
figcaption {
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
  margin-top: 16px;
}
figcaption p {
  margin: 0 0 10px;
}
summary {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  cursor: pointer;
}
summary:hover {
  color: #41698d;
}
.family-list {
  margin: 26px 0;
}
.family-list > div {
  display: grid;
  grid-template-columns: 105px minmax(0, 1fr);
  gap: 20px;
  padding: 13px 0;
  border-top: 1px solid var(--rule);
}
.family-list > div:last-child {
  border-bottom: 1px solid var(--rule);
}
.family-list dt {
  font-family: var(--sans);
  font-size: 14px;
  padding-top: 2px;
}
.family-list dd {
  font-size: 17px;
  line-height: 1.55;
  margin: 0;
}
.results-figure {
  margin-top: 30px;
  margin-bottom: 34px;
}
.research-note {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
}
.citation-section {
  border-top: 1px solid var(--rule);
  margin-top: 48px;
}
.citation-section h2 {
  margin-top: 35px;
}
.citation-details {
  margin-top: 20px;
}
.citation-details .text-button {
  display: block;
  margin-top: 16px;
}
.citation-details pre {
  margin: 14px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
}
.article-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 60px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
}
.article-footer a {
  text-decoration: none;
}
.copy-status {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  width: max-content;
  padding: 10px 16px;
  background: #fff;
  border: 1px solid #ccc;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  z-index: 5;
}
.copy-status:empty {
  display: none;
}

@media (max-width: 1379px) {
  .contents {
    display: none;
  }
}
@media (max-width: 800px) {
  .article {
    margin-top: 36px;
  }
  .wide-figure {
    width: 100%;
    margin-left: 0;
    transform: none;
  }
  .demo-layout {
    grid-template-columns: 1fr;
    gap: 25px;
  }
  .plot-panel {
    max-width: 540px;
    width: 100%;
    margin-inline: auto;
  }
  .answer-panel {
    border-top: 1px solid var(--rule);
    padding-top: 18px;
  }
  #replay-status {
    min-height: 0;
  }
}
@media (max-width: 520px) {
  body {
    font-size: 17px;
    line-height: 1.6;
  }
  .article {
    width: calc(100% - 40px);
    margin-top: 28px;
  }
  h1 {
    font-size: 32px;
    letter-spacing: -0.7px;
  }
  h2 {
    font-size: 24px;
    margin-top: 36px;
  }
  .subtitle {
    font-size: 20px;
    margin-top: 12px;
  }
  .article-header {
    margin-bottom: 22px;
  }
  .authors {
    gap: 16px;
    font-size: 16px;
  }
  .affiliations,
  .publication {
    font-size: 12px;
  }
  .prompt-controls {
    flex-wrap: wrap;
    gap: 8px 10px;
  }
  .prompt-controls select {
    flex: 1;
  }
  .prompt-controls .text-button {
    margin-left: 0;
  }
  .prompt-text {
    font-size: 19px;
  }
  .model-controls {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
    border: 0;
  }
  .model-controls .tabs {
    width: 100%;
    border-bottom: 1px solid var(--rule);
    gap: 19px;
  }
  #forecast-kind {
    font-size: 12px;
  }
  .demo-layout {
    padding-top: 20px;
  }
  .plot-legend {
    font-size: 12px;
    gap: 16px;
  }
  .figure-explanation {
    font-size: 16px;
  }
  .family-list > div {
    grid-template-columns: 85px minmax(0, 1fr);
    gap: 14px;
  }
  .family-list dd {
    font-size: 16px;
  }
  .citation-details pre {
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
