/* Four Vectors: site styles.
   Tokens first. The brand kit page (/brand/) documents every value here. */

@font-face { font-family: "CMU Serif"; src: url("fonts/cmu-serif-500-roman.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "CMU Serif"; src: url("fonts/cmu-serif-500-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "CMU Serif"; src: url("fonts/cmu-serif-700-roman.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "CMU Serif"; src: url("fonts/cmu-serif-700-italic.woff2") format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "CMU Typewriter"; src: url("fonts/cmu-typewriter-text-500-roman.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  /* Colour: a white page, black ink, one blue that only ever means belief. */
  --paper: #ffffff;
  --ink: #000000;
  --text: #1c1c1c;
  --graphite: #646464;
  --abstract: #f4f4f4;
  --rule: #d9d9d9;
  --belief: #2b4acb;
  --belief-wash: rgba(43, 74, 203, 0.09);

  /* Type: Computer Modern, the face of the papers this work comes from. */
  --serif: "CMU Serif", "Latin Modern Roman", "Computer Modern Serif", Georgia, "Times New Roman", serif;
  --mono: "CMU Typewriter", "Latin Modern Mono", Consolas, "Courier New", monospace;

  /* Scale (px at a 16px root): 13, 15, 18, 21, 26, 36 to 56 */
  --fs-pill: 0.8125rem;
  --fs-small: 0.9375rem;
  --fs-body: 1.125rem;
  --fs-head: 1.3125rem;
  --fs-sub: 1.625rem;
  --fs-display: clamp(2.125rem, 1.35rem + 3.3vw, 3.5rem);

  /* Layout */
  --measure: 38.5rem;
  --wide: 52rem;
  --gutter: 1rem;
  --radius-pill: 6px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--serif);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Page grid: text column, with a wider lane for figures ---------- */

.page {
  display: grid;
  grid-template-columns:
    [full-start] minmax(var(--gutter), 1fr)
    [wide-start] minmax(0, calc((var(--wide) - var(--measure)) / 2))
    [text-start] min(var(--measure), 100% - 2 * var(--gutter))
    [text-end] minmax(0, calc((var(--wide) - var(--measure)) / 2))
    [wide-end] minmax(var(--gutter), 1fr) [full-end];
}
.page > *, .content > *, .section > * { grid-column: text; }
.page > .content, .content > .section { grid-column: full; display: grid; grid-template-columns: subgrid; }
.page > .wide, .section > .wide { grid-column: wide; }

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Masthead ---------- */

.masthead {
  text-align: center;
  padding-top: clamp(3.5rem, 11vh, 7rem);
}

.logo-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto clamp(3rem, 8vh, 5rem);
  color: var(--ink);
  text-decoration: none;
}
.logo-slot .logo-mark { display: block; height: clamp(3.25rem, 2.6rem + 2vw, 4.25rem); width: auto; }
.logo-slot:focus-visible { outline-offset: 8px; }
/* Text wordmark, used only where the logo cannot go */
.wordmark {
  font-weight: 700;
  font-size: 1.375rem;
  letter-spacing: 0.01em;
  line-height: 1;
}

.tagline {
  margin: 0 auto;
  max-width: 15em;
  color: var(--ink);
  font-weight: 400;
  font-size: var(--fs-display);
  font-variant-caps: small-caps;
  line-height: 1.12;
  letter-spacing: 0.012em;
  text-wrap: balance;
}

.subline {
  margin: 1.5rem auto 0;
  max-width: 30em;
  color: var(--graphite);
  font-size: var(--fs-body);
  line-height: 1.5;
  text-align: center;
  hyphens: manual;
  text-wrap: balance;
}

/* Contact, paper, hiring, location: three or four short facts */
.facts {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: auto;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  margin: clamp(3rem, 9vh, 5.5rem) 0 0;
  text-align: left;
}
.facts div { min-width: 0; }
.facts dt { color: var(--ink); font-size: var(--fs-small); line-height: 1.4; margin: 0 0 0.45rem; }
.facts dd { margin: 0; }

.pill {
  display: inline-block;
  max-width: 100%;
  padding: 0.28rem 0.6rem 0.24rem;
  border-radius: var(--radius-pill);
  background: var(--abstract);
  color: #474747;
  font-family: var(--mono);
  font-size: var(--fs-pill);
  font-variant-numeric: lining-nums;
  line-height: 1.45;
  text-decoration: none;
  overflow-wrap: anywhere;
}
a.pill { transition: background-color 120ms ease, color 120ms ease; }
a.pill:hover { background: #e9e9e9; color: var(--ink); }

/* ---------- Abstract box ---------- */

.abstract {
  margin: 3.25rem 0 0;
  padding: 2.25rem clamp(1.25rem, 6%, 3rem) 2.4rem;
  background: var(--abstract);
}
.abstract h2, .abstract .abstract-title {
  margin: 0 0 1.1rem;
  color: var(--ink);
  font-size: var(--fs-body);
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}
.abstract p { margin: 0; }

/* ---------- Running text ---------- */

p {
  margin: 0 0 1em;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
  hyphenate-limit-chars: 7 3 3;
  text-wrap: pretty;
}

a { color: inherit; text-decoration-line: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; text-decoration-color: rgba(0, 0, 0, 0.32); }
a:hover { text-decoration-color: currentColor; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }

.section { margin-top: 3.4rem; }
.lead-in { margin-top: 3.4rem; }

.section > h2 {
  display: flex;
  gap: 0;
  margin: 0 0 0.9rem;
  color: var(--ink);
  font-size: var(--fs-head);
  font-weight: 700;
  line-height: 1.3;
}
.section > h2 .n { flex: none; width: 2.1em; font-variant-numeric: lining-nums; }

.runin { color: var(--ink); font-weight: 700; }

.cite { white-space: nowrap; text-decoration: none; color: var(--ink); }
.cite:hover { text-decoration: underline; }

/* Notation: beta with a superscript, as in the paper */
.math { font-style: italic; white-space: nowrap; }
.math sup { font-style: normal; font-size: 0.7em; line-height: 0; margin-left: 0.14em; }
.hat { position: relative; display: inline-block; }
.hat::before {
  content: "\005E";
  position: absolute;
  left: 66%;
  top: -0.2em;
  transform: translateX(-50%);
  font-style: normal;
  font-size: 0.74em;
  line-height: 1;
}

/* ---------- Figure 1 ---------- */

.figure { margin: 2.1rem 0 2.6rem; }
.figure-legend {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  justify-content: center;
  gap: 0.4rem 2.2rem;
  margin: 0 0 0.8rem;
  padding: 0;
  list-style: none;
  color: var(--text);
  font-size: var(--fs-small);
  line-height: 1.4;
}
.figure-legend li { display: inline-flex; align-items: center; gap: 0.5rem; }
.figure-legend svg { flex: none; width: 22px; height: 22px; }

.figure-stage { position: relative; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 0.75rem 0; }
.figure-stage svg { display: block; width: 100%; height: auto; }
.figure-stage .noscript { padding: 2rem 0; color: var(--graphite); text-align: center; font-size: var(--fs-small); }

.figure-controls {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-top: 0.85rem;
  font-size: var(--fs-small);
}
.figure-controls button {
  flex: none;
  min-width: 5.2rem;
  padding: 0.42rem 0.8rem 0.38rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  line-height: 1.2;
  cursor: pointer;
}
.figure-controls button:hover { background: var(--ink); color: var(--paper); }
.figure-controls label { flex: none; }
.figure-controls input[type="range"] { flex: 1 1 auto; min-width: 0; accent-color: var(--ink); height: 1.5rem; margin: 0; cursor: pointer; }
.figure-controls output { flex: none; min-width: 4.6rem; font-family: var(--mono); font-size: var(--fs-pill); font-variant-numeric: lining-nums tabular-nums; color: var(--graphite); text-align: right; }

.figure-status {
  min-height: 1.5em;
  margin: 0.55rem 0 0;
  color: var(--graphite);
  font-size: var(--fs-small);
  font-style: italic;
  line-height: 1.5;
  text-align: center;
  hyphens: manual;
}

.figure figcaption {
  max-width: var(--measure);
  margin: 1.15rem auto 0;
  font-size: var(--fs-small);
  line-height: 1.55;
  text-align: justify;
  hyphens: auto;
}
.figure figcaption b { color: var(--ink); }

/* ---------- Reference ---------- */

.reference {
  display: grid;
  grid-template-columns: 2.1em 1fr;
  margin: 1.2rem 0 0;
  font-size: 1rem;
  line-height: 1.55;
}
.reference .key { color: var(--ink); font-variant-numeric: lining-nums; }
.reference cite { font-style: italic; }
.reference p { margin: 0; text-align: left; hyphens: manual; }
.reference .meta { color: var(--graphite); }
.link-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.85rem 0 0; padding: 0; list-style: none; }

/* ---------- Close and footer ---------- */

.belief { margin-top: 0.2rem; }

.closing { margin-top: 1.5rem; text-align: left; }
.closing .link-row { margin-top: 0.75rem; }

.site-footer {
  margin-top: 5.5rem;
  padding: 1.6rem 0 2.6rem;
  border-top: 1px solid var(--rule);
  color: var(--graphite);
  font-size: var(--fs-small);
  line-height: 1.5;
  text-align: center;
}
.site-footer p { margin: 0; text-align: center; hyphens: manual; }
.site-footer a { color: inherit; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; margin: 0 0 0.9rem; padding: 0; list-style: none; color: var(--ink); }
.footer-links li + li::before { content: "|"; margin: 0 0.75em; color: var(--rule); }
.footer-links a { text-decoration-color: rgba(0, 0, 0, 0.25); }
.site-footer .legal { max-width: 36rem; margin: 0.7rem auto 0; font-size: 0.8125rem; line-height: 1.6; }

/* Compact header for housekeeping pages (company information) */
.masthead.compact { padding-top: clamp(2.5rem, 7vh, 4.5rem); }
.masthead.compact .logo-slot { margin-bottom: clamp(1.6rem, 4.5vh, 2.6rem); }
.masthead.compact .tagline { font-size: clamp(1.75rem, 1.35rem + 1.5vw, 2.25rem); }
.content > .section.first { margin-top: 2.6rem; }

/* ---------- Tables, set like booktabs ---------- */

.booktabs { width: 100%; border-collapse: collapse; margin: 0.4rem 0 1.4rem; font-size: var(--fs-small); line-height: 1.45; }
.booktabs caption { caption-side: top; margin-bottom: 0.5rem; text-align: left; }
.booktabs caption b { color: var(--ink); }
.booktabs thead th { border-top: 1.5px solid var(--ink); border-bottom: 1px solid var(--ink); color: var(--ink); font-weight: 700; }
.booktabs tbody tr:first-child > * { border-top: 1.5px solid var(--ink); }
.booktabs thead + tbody tr:first-child > * { border-top: 0; }
.booktabs tbody tr:last-child > * { border-bottom: 1.5px solid var(--ink); }
.booktabs th, .booktabs td { padding: 0.48rem 1rem 0.48rem 0; text-align: left; vertical-align: top; font-weight: 400; }
.booktabs tbody th { color: var(--ink); }
.booktabs th:last-child, .booktabs td:last-child { padding-right: 0; }
.booktabs.details tbody th { width: 34%; }
.booktabs.positions td:last-child { white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 0.9em; font-variant-numeric: lining-nums; }

/* ---------- Lists inside running text (careers) ---------- */

.list-head { margin-bottom: 0.3rem; }
.items { margin: 0 0 1.1em; padding-left: 1.2em; }
.items li { margin: 0.28em 0; padding-left: 0.25em; }
.items li::marker { color: var(--graphite); }
.role .link-row { margin-top: 0.2rem; }
.updated { color: var(--graphite); font-size: var(--fs-small); }

/* Without hyphenation, justified lines open up gaps: set ragged right instead. */
:where(.no-hyphens) p, :where(.no-hyphens) .figure figcaption { text-align: left; }

/* ---------- Small screens ---------- */

@media (max-width: 40rem) {
  body { font-size: 1.0625rem; line-height: 1.58; }
  p, .figure figcaption { text-align: left; hyphens: manual; }
  .facts { grid-auto-flow: row; grid-template-columns: 1fr; gap: 1rem; }
  .booktabs { font-size: 0.875rem; }
  .booktabs.details tbody th { width: 40%; }
  .facts div { display: grid; grid-template-columns: 5.5rem 1fr; align-items: baseline; }
  .facts dt { margin: 0; }
  .abstract { margin-top: 2.5rem; }
  .abstract p { text-align: left; }
  .section, .lead-in { margin-top: 2.8rem; }
  .figure-legend { grid-template-columns: 1fr; justify-content: start; gap: 0.3rem; }
  .figure.wide { grid-column: full; }
  .figure-legend, .figure-controls, .figure-status, .figure figcaption { padding-inline: var(--gutter); }
  .figure-stage .lbl-f { display: none; }
  .figure-stage .lbl-obj { font-size: 25px; }
  .figure-stage .lbl-room { font-size: 22px; }
  .figure-stage .lbl-robot, .figure-stage .lbl-other { font-size: 21px; }
  .figure-stage .lbl-speech { font-size: 23px; }
  .figure-controls { flex-wrap: wrap; gap: 0.6rem 0.8rem; }
  .figure-controls input[type="range"] { order: 3; flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  a.pill { transition: none; }
}

/* ---------- Print: the site prints as the paper it resembles ---------- */

@media print {
  body { font-size: 11pt; }
  .figure-controls, .figure-status { display: none; }
  .pill { background: none; padding: 0; }
  a { text-decoration: none; }
  .site-footer { margin-top: 2rem; }
}
