/*
  Explainer version of the page (2026-11-27). Loaded after neutral.css and
  figures.css. Holds the spacing of the new sections and the sketch of the
  two paradigms (figure.paradigms, played by static/js/figures.js).
*/

/* The sketch of the two paradigms: a closed mask and an empty pass. The
   dark values are in the dark sheet in the head of the page. */
:root {
  --pg-mask: #dcdbd6;
  --pg-empty: #b9b8b2;
}

/* ---------- Rounded corners ---------- */

/* Boxes (the BibTeX block, the menu sheet and, on the dark page, the sheets
   under the paper figures) and buttons have rounded corners, in the light
   and in the dark theme. */
:root {
  --radius-box: 10px;
  --radius-button: 6px;
}

.hero .btn,
.copy-btn,
.skip-link {
  border-radius: var(--radius-button);
}

.bib,
.hero .more-menu {
  border-radius: var(--radius-box);
}

/* The entry scrolls sideways on a phone: keep it inside the corners. */
.bib pre {
  border-radius: var(--radius-box);
}

.fa-button,
.theme-toggle {
  border-radius: var(--radius-button);
}

/* ---------- Theme button ---------- */

/* One small button at the top right of the page, shown by theme.js. It
   carries the icon of the theme it leads to: the moon on the light page,
   the sun on the dark one (dark sheet in the head). */
.theme-toggle {
  position: absolute;
  top: 8px;
  right: 12px;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
}

.theme-toggle[hidden] {
  display: none;
}

.theme-toggle:hover {
  color: var(--ink);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: -2px;
}

.theme-toggle .icon-sun {
  display: none;
}

/* Footer logos come in pairs, one for each ground. */
.logos .for-dark {
  display: none;
}

/* Section titles are sentences: balance their lines. */
main h2,
main h3 {
  text-wrap: balance;
}

/* Sub-sections: the findings of a section and the parts of Details. */
.wrap > h2 + article {
  margin-top: 16px;
}

.wrap > p + article,
.wrap > article + article {
  margin-top: 40px;
}

/* A paper figure that sits between two paragraphs. */
.wrap > .teaser,
.wrap > .paradigms {
  margin-block: 14px;
}

@media (max-width: 600px) {
  .wrap > p + article,
  .wrap > article + article {
    margin-top: 28px;
  }
}

/* ---------- The two paradigms, a sketch ---------- */

/* Plain HTML, not a figure of the paper. Without JavaScript, and under
   reduced motion until the reader plays it, both rows show the finished
   sentence and every pass. */
.paradigms {
  width: min(720px, 100%);
  justify-self: center;
}

.pg {
  display: grid;
  row-gap: 26px;
  padding-block: 20px;
  border-block: 1px solid var(--hairline);
}

.pg-row {
  display: grid;
  row-gap: 9px;
}

.pg-name {
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--muted);
}

.pg-name b {
  margin-right: 6px;
  color: var(--ink);
}

/* The sentence. Each token keeps its box whether it is shown or not, so the
   two rows line up token by token. */
.pg-line {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 6px;
  margin-left: -3px;
  font-size: 1.125rem;
  line-height: 1.45;
}

.pg-token {
  position: relative;
  padding: 1px 3px;
  border-radius: 3px;
  color: var(--ink);
  transition: color 180ms ease-out, background-color 320ms ease-out, opacity 180ms ease-out;
}

/* One small square for each pass, in the colour of the paradigm. */
.pg-passes {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--muted);
}

.pg-passes > span:first-child {
  margin-right: 5px;
}

.pg-tick {
  width: 9px;
  height: 9px;
  border: 1px solid var(--pg-colour);
  border-radius: 2px;
  background: var(--pg-colour);
  transition: background-color 200ms ease-out, border-color 200ms ease-out;
}

.pg-ar {
  --pg-colour: var(--autoregressive);
  --pg-tint: rgb(133 105 172 / 0.3);
}

.pg-diff {
  --pg-colour: var(--diffusion);
  --pg-tint: rgb(222 106 58 / 0.3);
}

/* While it plays. A token of the autoregressive row does not exist until it
   is written; a token of the diffusion row is a mask until it opens. */
.pg-ready:not(.fa-still) .pg-ar .pg-token:not(.is-on) {
  opacity: 0;
}

.pg-ready:not(.fa-still) .pg-diff .pg-token:not(.is-on) {
  color: transparent;
  background-color: var(--pg-mask);
}

.pg-ready:not(.fa-still) .pg-tick:not(.is-on) {
  background-color: transparent;
  border-color: var(--pg-empty);
}

/* A thin bar marks the place where the autoregressive row writes next. */
.pg-ar .pg-line {
  position: relative;
}

.pg-ready:not(.fa-still) .pg-ar .pg-line:not(:has(.is-on))::before,
.pg-ready:not(.fa-still) .pg-ar .pg-token.is-on:not(:last-child):not(:has(+ .is-on))::after {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--pg-colour);
}

.pg-ready:not(.fa-still) .pg-ar .pg-line:not(:has(.is-on))::before {
  left: 3px;
}

.pg-ready:not(.fa-still) .pg-ar .pg-token.is-on:not(:last-child):not(:has(+ .is-on))::after {
  right: -4px;
}

/* A token just written carries the colour of its paradigm for a moment. */
.pg-ready:not(.fa-still) .pg-token.is-on {
  animation: pg-new 900ms ease-out 1;
}

@keyframes pg-new {
  0% { background-color: var(--pg-tint); }
  100% { background-color: transparent; }
}

.pg-ready figcaption {
  margin-top: 8px;
}

@media (max-width: 600px) {
  .pg-line {
    font-size: 1.0625rem;
  }
}

/* The repository address in the closing section, as it was in the abstract:
   on a phone it may break after the organisation. */
@media (max-width: 600px) {
  #use .url-break::after {
    content: "\200B";
  }
}

/* The nine biases under Details: the name on the left, what the test changes
   on the right, one line each. */
.biases {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 24px;
  margin: 0;
}

.biases dt {
  font-weight: 700;
}

.biases dd {
  margin: 0;
}

/* On a phone the name sits above its line, as for the metrics. */
@media (max-width: 600px) {
  .biases {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 2px;
  }

  .biases dd {
    margin-bottom: 10px;
  }
}
