/* The lab: its index (/lab/) and its notes, which start as copies of lab/_template.html. The parts the home page shows
   too (the topics, the empty state, Fig. 1) are in site.css, and a note's text is set by prose.css.
   On both pages the swarm has the header to itself. The reading part below it asks for no swarm (data-formation="off")
   and is opaque besides, so no particle crosses the text, even while the header's swarm is still on screen. */

/* The pause toggle sits at the header's bottom right, as on the home page and the 404. */
.lab-head > .swarm-toggle, .note__head > .swarm-toggle {
  position: absolute;
  right: var(--pad);
  bottom: 26px;
}

/* ---------- The index: header ---------- */
/* The title and the promise on the left; Fig. 1 on the right, where the swarm runs the loop (`ring`). */
.lab-head {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: center;
  gap: 56px 5vw;
  padding: calc(var(--nav-h) + 40px) var(--pad) 88px;
}
.lab-head__text { min-width: 0; }
.lab-head h1 {
  font-size: clamp(44px, 7.2vw, 124px);
  font-weight: 600;
  line-height: .92;
  letter-spacing: -.048em;
  text-wrap: balance;
}
.lab-head__promise {
  max-width: 36ch;
  margin-top: 32px;
  font-size: clamp(17px, 1.45vw, 21px);
  line-height: 1.5;
  color: var(--mute);
  text-wrap: pretty;
}

/* ---------- The index: topics and notes ---------- */
/* Two columns that line up with the header's: the topics under the title, the notes under the figure. */
.lab-index {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: start;
  gap: 72px 5vw;
  padding: 72px var(--pad) 18vh;
  background: var(--bg);
}
.lab-index__part { min-width: 0; }
.lab-index .topics { margin-top: 0; }
/* Framed like a row of the list it will become: published notes replace it, newest first. */
.lab-index .lab__empty {
  margin-top: 0;
  padding: 22px 0;
  border-block: 1px solid var(--line);
}
.lab-index .btn { margin-top: 40px; }

@media (max-width: 820px) {
  .lab-head, .lab-index { grid-template-columns: 1fr; }
  .lab-head { padding-bottom: 84px; }
  .lab-index { padding-top: 48px; }
}

/* ---------- A note ---------- */
/* The header: the title at the bottom, and a calm swarm (`drift`) above it, which a gradient fades out before the
   text begins. */
.note__head {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 62vh;
  min-height: 62svh;
  padding: calc(var(--nav-h) + 48px) 0 76px;
}
.note__head::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(rgba(0, 0, 0, 0) 30%, #000 90%);
  pointer-events: none;
}

.note__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  color: var(--mute);
  transition: color .2s;
}
.note__back:hover { color: var(--fg); }
.note__back .icon { width: 13px; height: 13px; }
.note__back:hover .icon { transform: translateX(-2px); }
.note__back + h1 { margin-top: 26px; }

/* The title starts where the text does, and may run wider than a paragraph. */
.note__head .prose {
  width: auto;
  margin-inline: max(var(--pad), (100% - var(--measure)) / 2) var(--pad);
}
.note__head h1 { max-width: 11em; }

.note__body {
  padding: 24px 0 18vh;
  background: var(--bg);
}
