/* Shared components: the section heads, the pill links and the logo
   chips. */

.section {
  max-width: var(--w-content);
  margin: 0 auto;
  padding: 5.5rem 1.5rem 0;
}

.section:last-of-type { padding-bottom: 5.5rem; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  border-top: 1px solid var(--line);
  padding-top: 1.1rem;
  margin-bottom: 2.4rem;
}

.section-head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  letter-spacing: -0.015em;
}

/* Small links below a section title, in the mono style. */
.section-head { flex-wrap: wrap; }

.section-head .head-links {
  flex-basis: 100%;
  display: flex;
  gap: 1.4rem;
  margin-top: 0.1rem;
}

.section-head .head-links a {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--accent-strong);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: border-color 140ms ease;
}

.section-head .head-links a:hover, .section-head .head-links a:focus-visible {
  border-bottom-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

@media (max-width: 720px) {
  .section { padding: 3.75rem 1.15rem 0; }
  .section:last-of-type { padding-bottom: 3.75rem; }
  .section-head { gap: 0.9rem; margin-bottom: 1.8rem; }

  .section-head .head-links { gap: 1.1rem; }
}

.pill {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  border-radius: 999px;
  padding: 0.5rem 1.05rem;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.pill:hover, .pill:focus-visible {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.pill.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.pill.primary:hover, .pill.primary:focus-visible {
  background: var(--accent-fill);
  border-color: var(--accent-fill);
  color: var(--accent-fill-ink);
}

/* The round mark of a paper or a thesis. The publications rail and the
   cards of the lab use it. */
.node-icon {
  position: relative;
  z-index: 1;
  margin-top: 0.15rem;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.node-icon svg { width: 1.05rem; height: 1.05rem; }

/* A link inside a sentence: the accent colour with a light underline,
   which becomes solid on a pointer or the focus. Every block of prose
   on the site uses it. */
.about-prose a,
.snapshot .fact-value a,
.footer-email,
.page-note a,
.model-note p a {
  color: var(--accent-strong);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  transition: border-color 140ms ease;
}

.about-prose a:hover, .about-prose a:focus-visible,
.snapshot .fact-value a:hover, .snapshot .fact-value a:focus-visible,
.footer-email:hover, .footer-email:focus-visible,
.page-note a:hover, .page-note a:focus-visible,
.model-note p a:hover, .model-note p a:focus-visible {
  border-bottom-color: var(--accent-strong);
}

/* The number of a section, of a card or of a topic. */
.index {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  color: var(--accent);
}

/* A round or square control under a pointer or the focus. */
.theme-toggle:hover, .theme-toggle:focus-visible,
.nav-toggle:hover, .nav-toggle:focus-visible,
.field-pause:hover, .field-pause:focus-visible,
.copy-btn:hover, .copy-btn:focus-visible,
.copy-btn.is-copied,
.cite-tab[aria-pressed="true"],
.chip:hover, .chip:focus-visible,
.lab-mode:hover, .lab-mode:focus-visible {
  color: var(--accent-strong);
  border-color: var(--accent);
}

/* A canvas that fills the box of its parent. */
#flowfield,
.model-preview canvas,
.instrument-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Logo chips. The white background keeps each logo easy to read in the dark
   theme. */
.org-icon {
  flex-shrink: 0;
  width: 2.7rem;
  height: 2.7rem;
  border: 1px solid var(--line);
  background: #ffffff;
  overflow: hidden;
}

.org-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Inner page head: the eyebrow, the title, the lede and the counts. Every
   page below the home page uses it. */

.page-head {
  max-width: var(--w-content);
  margin: 0 auto;
  padding: 4.5rem 1.5rem 0;
}

.page-head .eyebrow {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.page-head .eyebrow .dot { color: var(--accent); padding: 0 0.35rem; }

.page-head .eyebrow a {
  text-decoration: none;
  border-bottom: 1px solid var(--hairline);
  transition: color 140ms ease, border-color 140ms ease;
}

.page-head .eyebrow a:hover, .page-head .eyebrow a:focus-visible {
  color: var(--accent-strong);
  border-bottom-color: var(--accent);
}

.page-head h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.3rem, 7vw, 3.6rem);
  letter-spacing: -0.035em;
  line-height: 1.02;
  margin: 0.7rem 0 0;
}

/* The mark after a name or a heading. */
.accent-mark { color: var(--accent); }

.page-head .lede {
  margin-top: 1.1rem;
  max-width: var(--w-prose);
  color: var(--muted);
  font-size: 1.06rem;
}

/* The counts: plain text between two 1px lines. */
.page-stats {
  display: flex;
  flex-wrap: wrap;
  margin-top: 2.4rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.page-stat {
  flex: 1 1 8rem;
  padding: 1.1rem 1.2rem 1.15rem 0;
}

.page-stat + .page-stat {
  border-left: 1px solid var(--hairline);
  padding-left: 1.4rem;
}

.page-stat .figure {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.65rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.page-stat .label {
  margin-top: 0.2rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 720px) {
  .page-head { padding: 3rem 1.15rem 0; }
  .page-head .lede { font-size: 1rem; }

  .page-stats { margin-top: 1.9rem; }

  .page-stat {
    flex: 1 1 45%;
    padding: 0.9rem 0.9rem 0.95rem 0;
  }

  /* A third statistic starts a new row, with no line on its left. */
  .page-stat:nth-child(odd) + .page-stat { border-left: 1px solid var(--hairline); padding-left: 1rem; }
  .page-stat:nth-child(odd) { border-left: 0; padding-left: 0; }
}

/* Shown only when a script runs. */
.needs-js { display: none; }
.js .needs-js { display: inline-flex; }
