/* ------------------------------------------------------------------ */
/* Tokens: midnight paper, ivory ink, hairline rules, hyperref links   */
/* ------------------------------------------------------------------ */

@font-face {
  font-family: "STIX Two Text";
  src: url("fonts/stixtwo-roman.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "STIX Two Text";
  src: url("fonts/stixtwo-italic.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/plexmono-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
/* Math symbols from the design-matched STIX Two Math, slotted into the same
   family. Declared for italic too: math symbols stay upright in italic text. */
@font-face {
  font-family: "STIX Two Text";
  src: url("fonts/stixtwo-math.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  unicode-range: U+2203, U+2208, U+220B, U+220E, U+2264-2265, U+221E, U+03B1-03B4, U+2192, U+22A2;
  font-display: swap;
}
@font-face {
  font-family: "STIX Two Text";
  src: url("fonts/stixtwo-math.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  unicode-range: U+2203, U+2208, U+220B, U+220E, U+2264-2265, U+221E, U+03B1-03B4, U+2192, U+22A2;
  font-display: swap;
}

:root {
  --paper: #10141a;
  --ink: #e7e1d3;
  --dim: #a49d90;
  --faint: #8a8478;
  --rule: #262b33;
  --link: #8fb3d9;
  --serif: "STIX Two Text", "Times New Roman", Georgia, serif;
  --mono: "IBM Plex Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html {
  background: var(--paper);
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ------------------------------------------------------------------ */
/* Running head                                                        */
/* ------------------------------------------------------------------ */

.running-head {
  display: flex;
  justify-content: space-between;
  max-width: 42rem;
  margin: 0 auto;
  padding: 1.1rem 1.5rem 0.6rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ------------------------------------------------------------------ */
/* Page column                                                         */
/* ------------------------------------------------------------------ */

.paper {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

/* ------------------------------------------------------------------ */
/* Title block                                                         */
/* ------------------------------------------------------------------ */

.title-block {
  text-align: center;
  margin: 4.5rem 0 3rem;
}

.title-block h1 {
  font-size: clamp(1.9rem, 5.5vw, 2.7rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  margin: 0 0 1.6rem;
}

/* The vendored subsets carry no true small-cap glyphs, so these heads use
   honest capitals at reduced size rather than browser-faked small caps. */
.author {
  text-transform: uppercase;
  letter-spacing: 0.26em;
  font-size: 0.92rem;
  margin: 0 0 0.35rem;
}

.affiliation,
.date {
  color: var(--dim);
  font-style: italic;
  font-size: 0.95rem;
  margin: 0 0 0.2rem;
}

.epigraph {
  margin: 2.2rem auto 0;
  max-width: 26rem;
  font-style: italic;
  color: var(--dim);
  font-size: 0.95rem;
  line-height: 1.5;
}
.epigraph-attr {
  font-style: normal;
  font-size: 0.8rem;
  color: var(--faint);
}

/* ------------------------------------------------------------------ */
/* Abstract                                                            */
/* ------------------------------------------------------------------ */

.abstract {
  margin: 0 auto 3rem;
  max-width: 34rem;
  font-size: 0.95rem;
}
.abstract-head {
  text-align: center;
  text-transform: uppercase;
  font-weight: 400;
  letter-spacing: 0.28em;
  font-size: 0.72rem;
  color: var(--dim);
  margin: 0 0 0.7rem;
}
.abstract p { margin: 0; }

/* ------------------------------------------------------------------ */
/* Figure 1 — the imagination engine                                   */
/* ------------------------------------------------------------------ */

.figure {
  margin: 3rem 0;
}

.fig-frame {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--rule);
  background: var(--paper);
  cursor: pointer;
  border-radius: 0;
}
.fig-frame:hover { border-color: var(--faint); }
.fig-frame:disabled { cursor: default; }
.fig-frame:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
}

#engine {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 5;
}

figcaption {
  margin-top: 0.8rem;
  font-size: 0.85rem;
  color: var(--dim);
  line-height: 1.55;
}
.fig-label {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.76rem;
  color: var(--ink);
}
figcaption code {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink);
}

.noscript-note {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--faint);
}

/* ------------------------------------------------------------------ */
/* Sections and theorem environments                                   */
/* ------------------------------------------------------------------ */

section { margin: 3.2rem 0; }

/* Journal setting: justified, hyphenated prose (LaTeX justifies everything,
   theorem statements included). The colophon keeps its centered alignment. */
section > p,
.abstract p {
  text-align: justify;
  hyphens: auto;
}

section h2 {
  text-align: center;
  text-transform: uppercase;
  font-weight: 400;
  letter-spacing: 0.28em;
  font-size: 0.82rem;
  margin: 0 0 1.8rem;
}
.sec-no { margin-right: 0.4em; }

.env { margin: 1.4rem 0 0.4rem; }
.env strong { font-weight: 600; }
.env em { font-style: italic; }

.remark { color: var(--dim); }

.proof {
  margin: 0.4rem 0 1.4rem;
  color: var(--dim);
}
.proof em { color: var(--dim); }

/* End-of-proof tombstone: an open square, AMS style */
.qed {
  display: inline-block;
  width: 0.52em;
  height: 0.52em;
  border: 1px solid var(--ink);
  margin-left: 0.35em;
  vertical-align: baseline;
}
/* amsthm sets \qed flush against the right margin of the proof's last line */
.proof .qed {
  border-color: var(--dim);
  float: right;
  margin-top: 0.45em;
}

.listing {
  margin: 1.4rem 0;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--rule);
  overflow-x: auto;
}
.listing code {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--ink);
}

/* ------------------------------------------------------------------ */
/* Links                                                               */
/* ------------------------------------------------------------------ */

a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid rgba(143, 179, 217, 0.35);
}
a:hover { border-bottom-color: var(--link); }
a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-bottom-color: transparent;
}

/* ------------------------------------------------------------------ */
/* Footnotes                                                           */
/* ------------------------------------------------------------------ */

.fn-ref { font-size: 0.7em; }
.fn-ref a { border-bottom: none; }

.footnotes {
  margin-top: 4rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.82rem;
  color: var(--dim);
}
.footnotes ol {
  margin: 0;
  padding-left: 1.3rem;
}
.footnotes li { margin-bottom: 0.3rem; }
.footnotes li::marker { color: var(--faint); }
.footnotes li:target { color: var(--ink); }

/* ------------------------------------------------------------------ */
/* References (alphanumeric keys, amsalpha style)                      */
/* ------------------------------------------------------------------ */

.references ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
}
.references li {
  margin-bottom: 0.45rem;
  color: var(--dim);
}
.bibkey {
  color: var(--ink);
  margin-right: 0.35em;
}

/* ------------------------------------------------------------------ */
/* Colophon                                                            */
/* ------------------------------------------------------------------ */

.colophon {
  margin-top: 4.5rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
  text-align: center;
  font-size: 0.82rem;
  font-style: italic;
  color: var(--faint);
}
.colophon p { margin: 0 0 1.2rem; }

.tombstone { text-align: center; }
.qed-large {
  width: 0.7em;
  height: 0.7em;
  border-color: var(--dim);
  margin-left: 0;
}

/* ------------------------------------------------------------------ */
/* Small screens                                                       */
/* ------------------------------------------------------------------ */

@media (max-width: 480px) {
  body { font-size: 1rem; }
  .running-head { letter-spacing: 0.12em; }
  .title-block { margin-top: 3rem; }
}

/* ------------------------------------------------------------------ */
/* Print: the paper becomes an actual paper                            */
/* ------------------------------------------------------------------ */

@media print {
  :root {
    --paper: #ffffff;
    --ink: #111111;
    --dim: #444444;
    --faint: #777777;
    --rule: #cccccc;
    --link: #1a4d8f;
  }
  html, body { background: #ffffff; }
  .fig-frame { cursor: default; }
  .screen-only,
  .noscript-note { display: none; }
  a { border-bottom: none; }
}
