/* Light only: every figure on the page has a white ground, so the page keeps one too. */
:root {
  --ground: #ffffff;
  --ink: #171a18;
  --muted: #5d665f;
  --rule: #dfe5e0;
  --accent: #2e6b3f;
  --display: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --body: "Source Serif 4", Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  padding-block: 0 4rem;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
  font: 400 18px/1.6 var(--body);
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
img, video { max-width: 100%; height: auto; display: block; }
p { margin: 0; }
h1, h2 { font-family: var(--display); text-wrap: balance; margin: 0; }

.page { max-width: 60rem; margin-inline: auto; }

.masthead { display: flex; flex-direction: column; gap: 1.5rem; padding-block: 3.5rem 2.5rem; max-width: 52rem; }
h1 { font-size: clamp(2rem, 4.6vw, 3.2rem); line-height: 1.08; font-weight: 700; letter-spacing: -0.02em; }
.people { display: flex; flex-direction: column; gap: 0.35rem; font-family: var(--display); }
.authors { font-size: 1.05rem; line-height: 1.5; }
.authors span { white-space: nowrap; }
.authors a { color: inherit; text-decoration: none; }
.authors a:hover { text-decoration: underline; }
.mark { font-weight: 700; font-size: 1.1em; vertical-align: baseline; line-height: 1; padding-left: 0.05em; }
.affil, .draft { color: var(--muted); font-family: var(--display); font-size: 0.95rem; }

/* The demos: one run at page width and two beneath, each captioned with the instruction the robot was given. */
.demos { display: flex; flex-direction: column; gap: 2rem; }
.demo-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; align-items: start; }
.demo video { width: 100%; background: #000; }
.instruction { display: block; color: var(--ink); font-family: var(--body); font-size: 1.05rem; line-height: 1.45;
               margin-bottom: 0.3rem; }
.hero .instruction { font-size: 1.2rem; max-width: 52rem; }
.instruction::before { content: "\201C"; }
.instruction::after { content: "\201D"; }

figure { margin: 0; display: flex; flex-direction: column; gap: 0.8rem; }
figcaption { font-family: var(--display); color: var(--muted); font-size: 0.92rem; line-height: 1.5; max-width: 52rem; }

/* Sections: heading in a rail on the left, prose on the right, figures across both. */
section { display: grid; grid-template-columns: 11rem minmax(0, 1fr); column-gap: 2.5rem; row-gap: 1.4rem;
          padding-block: 3rem 0; border-top: 1px solid var(--rule); margin-top: 3rem; }
section > h2 { grid-column: 1 / -1; font-size: 1.15rem; line-height: 1.35; font-weight: 700; }
section > h2:has(+ .prose) { grid-column: 1; }
section > .prose { grid-column: 2; max-width: 46rem; display: flex; flex-direction: column; gap: 1.1rem; }
section > figure { grid-column: 1 / -1; }

footer { display: flex; align-items: center; gap: 0.8rem; font-family: var(--display); color: var(--muted);
         font-size: 0.92rem; border-top: 1px solid var(--rule); margin-top: 4rem; padding-block: 1.5rem 0; }
footer p { margin-right: auto; }
footer .analytics { color: inherit; font-size: 0.8rem; }
/* The mascot, as on the episode viewer: it wiggles up on hover and says something. */
#mascot { width: 1.9rem; height: auto; cursor: help; position: relative; z-index: 1; transition: transform 0.25s ease; }
#mascot:hover { transform: scale(1.6); animation: wiggle 0.6s ease-in-out; }
@keyframes wiggle { 0% { transform: scale(1); } 25% { transform: rotate(-13deg) scale(1.3); }
                    75% { transform: rotate(13deg) scale(1.55); } 100% { transform: scale(1.6); } }
/* The quip sits outside the flow, to the left of the mascot, so showing it moves nothing under the pointer. */
.mascot-slot { position: relative; display: flex; align-items: center; }
#quip { position: absolute; right: calc(100% + 0.8rem); top: 50%; transform: translateY(-50%); padding: 0.1rem 0.7rem;
        border: 1px solid var(--rule); border-radius: 999px; font-size: 0.78rem; white-space: nowrap;
        background: var(--ground); }
@media (prefers-reduced-motion: reduce) { #mascot:hover { animation: none; transform: none; } }

@media (max-width: 900px) {
  section { grid-template-columns: minmax(0, 1fr); row-gap: 1.2rem; padding-block: 2.5rem 0; margin-top: 2.5rem; }
  section > h2, section > .prose { grid-column: 1; }
}
@media (max-width: 600px) {
  body { font-size: 17px; }
  .masthead { padding-block: 2.5rem 2rem; }
  .demo-row { grid-template-columns: 1fr; }
}
