/* Institutional homepage: warm ivory paper, Newsreader for names and
   headings, Instrument Sans for everything else, neutral ink links with a
   soft underline, hairline rules, and generous space. Both fonts are
   self-hosted from fonts/ (SIL OFL 1.1, see fonts/LICENSE.txt), and the
   one script (vines.js, the margin drawings) is local too, so the page
   makes no third-party requests. */

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("fonts/newsreader-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("fonts/newsreader-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/instrument-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/instrument-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --paper: #F8F6F1;
  --band: #EFECE4;      /* the ground behind clips while they load */
  --ink: #1C1B18;
  --text: #34322D;      /* body copy, 11.6:1 on paper */
  --muted: #65615A;     /* captions and meta, 5.6:1 on paper */
  --rule: #E2DED4;
  --rule-strong: #CFCAC0;
  --accent: #B5462A;    /* the award star only */

  --serif: "Newsreader", ui-serif, Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: #E4DFD3; color: var(--ink); }

p { margin: 0 0 1.2em; }

/* Links are ink, not a hue: a quiet underline that firms up on hover. */
a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: rgba(28, 27, 24, 0.32);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: text-decoration-color 120ms ease;
}

a:hover { text-decoration-color: currentColor; }

a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---- Top bar ---------------------------------------------------- */

.topbar { border-bottom: 1px solid var(--rule); }

.topbar-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 22px 24px;
}

.site-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.topnav {
  display: flex;
  gap: 28px;
}

.topnav a {
  font-size: 14px;
  line-height: 1.2;
  color: var(--muted);
  text-decoration: none;
}

.site-title:hover,
.topnav a:hover { color: var(--ink); }

/* ---- Two-column layout ------------------------------------------ */

.layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 680px);
  gap: 72px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 24px 0;
}

/* ---- Sidebar ---------------------------------------------------- */

.sidebar { align-self: start; }

.avatar {
  display: block;
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 6px;
}

.author-name {
  margin: 20px 0 0;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.author-bio {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.45;
}

.author-email {
  display: block;
  color: var(--muted);
  text-decoration: none;
}

.author-email:hover { color: var(--ink); }

.author-urls {
  margin: 20px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--rule);
  list-style: none;
}

.author-urls li { margin-bottom: 6px; }

.author-urls a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 2px 4px 2px 0;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
}

.author-urls a:hover { color: var(--ink); }

.icon {
  width: 15px;
  height: 15px;
  fill: var(--muted);
  flex-shrink: 0;
}

.icon[fill="none"] { fill: none; stroke: var(--muted); }

/* ---- Content ---------------------------------------------------- */

.content section + section {
  margin-top: 64px;
  padding-top: 40px;
  border-top: 1px solid var(--rule);
}

h2 {
  margin: 0 0 24px;
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
}

h3 {
  margin: 1.4em 0 0.6em;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--ink);
}

h2 + h3 { margin-top: 0.6em; }

/* The opening sentence of About reads as a lead. */
#about h2 + p {
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink);
}

/* Publications: no bullets, one hairline between entries, the title in
   the serif and everything below it in small sans. */
.entries {
  margin: 0;
  padding: 0;
  list-style: none;
}

.entries > li {
  padding: 22px 0;
  border-top: 1px solid var(--rule);
}

.entries > li:first-child {
  padding-top: 0;
  border-top: 0;
}

.entries > li > p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--muted);
}

.entries strong {
  display: inline-block;
  margin-bottom: 4px;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 450;
  line-height: 1.3;
  letter-spacing: -0.005em;
  color: var(--ink);
}

.entries a:has(> strong) { text-decoration: none; }
.entries a:has(> strong):hover strong {
  text-decoration: underline;
  text-decoration-color: rgba(28, 27, 24, 0.4);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.entries em { color: var(--text); }

.authors {
  font-weight: 600;
  color: var(--text);
}

/* An honor attached to an entry, marked with a small star. */
.award {
  font-weight: 500;
  color: var(--ink);
}

.award .star { color: var(--accent); }

.status { color: var(--text); }

/* Each paper's plate sits to the left of its entry, as a small still that
   turns into its loop when it scrolls into view (loops.js), and opens the
   plate in the gallery. The grounds are the plates' own deep inks, so the
   thumbnail needs no frame of its own. */
.entries > li.has-plate {
  display: grid;
  grid-template-columns: clamp(160px, 38%, 256px) minmax(0, 1fr);
  column-gap: 28px;
  align-items: start;
}

.has-plate > .plate-thumb { grid-row: 1 / span 2; }

.has-plate > p,
.has-plate > figure { grid-column: 2; }

.plate-thumb {
  display: block;
  margin-top: 5px;
  border-radius: 4px;
  overflow: hidden;
  text-decoration: none;
}

.plate-thumb img,
.plate-thumb video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.plate-thumb:focus-visible { outline-offset: 2px; }

/* ---- Figures ---------------------------------------------------- */

figure { margin: 8px 0 1.4em; }

figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  border-radius: 6px;
}

figcaption {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.entries figure { margin: 18px 0 0; }

/* Two photos side by side; they stack on phones. */
.figure-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin: 8px 0 1.4em;
}

.figure-row figure { margin: 0; }

/* A photo inside a publication entry, kept smaller than a paper figure. */
.figure-photo { max-width: 20rem; }

/* The lab, closing the page under the address: the group portrait tall on
   the left, three rooms stacked on the right at the portrait's height. The
   portrait sits in a frame of its own so the three rooms set the row height. */
.lab-mosaic {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  gap: 14px;
  margin: 32px 0 0;
}

.lab-mosaic img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.lab-mosaic .lab-main {
  position: relative;
  grid-row: 1 / span 3;
}

.lab-mosaic .lab-main img {
  position: absolute;
  inset: 0;
  height: 100%;
  aspect-ratio: auto;
  object-position: 50% 30%;
}

/* ---- Contact ---------------------------------------------------- */

#contact p { color: var(--text); }

/* ---- Margin vines (vines.js, wide screens only) ------------------- */

.vines {
  position: absolute;
  z-index: 0;
  overflow: visible;
  pointer-events: none;
}

.vines .leaf {
  opacity: 0;
  transform: rotate(var(--r, -16deg)) scale(0.18);
  transform-box: view-box;
  transition:
    opacity 0.9s ease,
    transform 1.5s cubic-bezier(0.16, 0.84, 0.24, 1);
}

.vines .leaf.on {
  opacity: 1;
  transform: none;
}

.vines .z {
  opacity: 0;
  transition: opacity 0.45s ease;
}

.vines .flower.on .z { opacity: 1; }

/* The meadow grows up from the footer rule, tuft by tuft, outward from
   where the two stems root. */
.vines .tuft {
  transform: scale(0.6, 0);
  transform-box: view-box;
  transition: transform 1.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.vines-meadow.on .tuft { transform: none; }

.vines-meadow.on .z { opacity: 1; }

.vines.instant * { transition: none !important; }

@media (prefers-reduced-motion: reduce) {
  .vines * { transition: none !important; }
}

@media (max-width: 1399px) {
  .vines { display: none; }
}

/* ---- Gallery page ----------------------------------------------- */

/* The gallery keeps the homepage's grid, a 240px column and the wide one
   beside it: each plate hangs in the wide column with its legend to the
   left, the way a print hangs beside its label. */
.gallery {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 24px 0;
}

.gallery-head,
.plate {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 0 72px;
}

.gallery-head { padding-bottom: 48px; }

.gallery-head h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 44px;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.gallery-head p {
  max-width: 36em;
  margin: 8px 0 0;
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
}

.plate {
  padding: 56px 0;
  border-top: 1px solid var(--rule);
}

/* A second piece under the same paper: no rule above it. */
.plate-more {
  padding-top: 0;
  border-top: 0;
}

.plate-legend h2,
.plate-legend h3 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-weight: 450;
  color: var(--ink);
}

.plate-legend h2 {
  font-size: 21px;
  line-height: 1.28;
  letter-spacing: -0.005em;
}

.plate-legend h3 {
  font-size: 18px;
  line-height: 1.3;
}

.plate-legend h2 a { text-decoration: none; }

.plate-legend h2 a:hover {
  text-decoration: underline;
  text-decoration-color: rgba(28, 27, 24, 0.4);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.plate-meta {
  margin: 0 0 14px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
}

.plate-meta em { color: var(--text); }

.plate-caption {
  margin: 0 0 14px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text);
}

.plate-links {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
}

.plate-media { margin: 0; }

.plate-media img,
.plate-media video {
  display: block;
  width: 100%;
  height: auto;
  border: 0;
  border-radius: 6px;
}

.plate-media img[width="1600"],
.plate-media video[width="1600"] {
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

/* The paper's own figure and the plates on white keep the hairline frame. */
.plate-figure img,
.plate-light img,
.plate-light video { border: 1px solid var(--rule); }

/* Two domains side by side: the biology plate takes three quarters, and
   the blackboard fills the rest at the plate's height, cropped to its middle
   column (the boxed result). On a phone they stack. */
.plate-pair {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 12px;
}

.plate-pair figure { margin: 0; }

.plate-pair .pair-main img,
.plate-pair .pair-main video {
  aspect-ratio: 1800 / 1000;
  object-fit: cover;
  border: 1px solid var(--rule);
}

.plate-pair .pair-side { position: relative; }

.plate-pair .pair-side img {
  position: absolute;
  inset: 0;
  height: 100%;
  object-fit: cover;
  object-position: 57% 50%;
}

@media (max-width: 767px) {
  .plate-pair { grid-template-columns: 1fr; }

  .plate-pair .pair-side img {
    position: static;
    height: auto;
    aspect-ratio: 1064 / 582;
  }
}

/* The rollouts: one row per policy, one clip per seed. */
.rollouts {
  display: grid;
  gap: 28px;
}

.rollout-row h4 {
  margin: 0 0 8px;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

.rollout-clips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.rollout-clips figure { margin: 0; }

.rollout-clips video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 4px;
  background: var(--band);
}

.rollout-clips figcaption {
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.4;
}

.clips-toggle {
  margin-top: 4px;
  padding: 6px 14px;
  font: 500 13px/1.2 var(--sans);
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  cursor: pointer;
}

.clips-toggle:hover { border-color: var(--ink); }

.clips-toggle:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.topnav a[aria-current="page"] { color: var(--ink); }

/* ---- Featured project ------------------------------------------- */

/* Space Services is shown in its own colors, the near-black ground and
   ivory serif of spaceservices.org, so it reads as the site it links to:
   the homepage's figure strip runs edge to edge, and the audience sits
   under the description. */
.feature {
  --ss-ground: #131312;
  --ss-ivory: #EBE8E0;
  --ss-muted: #A29E95;
  --ss-rule: #2C2B28;
  overflow: hidden;
  border-radius: 8px;
  background: var(--ss-ground);
  color: var(--ss-muted);
}

.feature-media { display: block; }

.feature-media img,
.feature-media video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1280 / 630;
  object-fit: cover;
}

.feature-body { padding: 26px 32px 28px; }

.feature h3 {
  margin: 0 0 8px;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--ss-ivory);
}

.feature h3 a {
  color: inherit;
  text-decoration: none;
}

.feature h3 a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

.feature-text { max-width: 36em; }

.feature-text p {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
}

.feature-text .feature-links {
  display: flex;
  gap: 20px;
  margin-top: 14px;
  font-size: 14px;
}

.feature-links a {
  color: var(--ss-ivory);
  text-decoration-color: rgba(235, 232, 224, 0.35);
}

.feature-links a:hover { text-decoration-color: var(--ss-ivory); }

.feature a:focus-visible { outline: 2px solid var(--ss-ivory); outline-offset: 3px; }

.feature-stats {
  display: flex;
  gap: 40px;
  margin: 22px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--ss-rule);
  list-style: none;
  font-size: 13px;
  line-height: 1.3;
  white-space: nowrap;
}

.feature-stats .stat {
  display: block;
  margin-bottom: 4px;
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--ss-ivory);
}

@media (max-width: 767px) {
  .feature-body { padding: 20px 18px 22px; }

  .feature h3 { font-size: 26px; }

  .feature-stats {
    gap: 24px;
    padding-top: 18px;
  }

  .feature-stats .stat { font-size: 24px; }
}

/* ---- Footer ----------------------------------------------------- */

/* The footer is the ground the meadow grows from: one hairline horizon
   across the page's own ivory, the name in the serif, the rest quiet. */
.page-footer {
  margin-top: 96px;
  border-top: 1px solid var(--rule-strong);
  color: var(--muted);
}

.footer-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 32px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px 24px 48px;
  font-size: 13px;
  line-height: 1.5;
}

.footer-inner p { margin: 0; }

.footer-name {
  margin-bottom: 4px !important;
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* ---- Tablet ----------------------------------------------------- */

@media (max-width: 1023px) {
  .layout {
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 48px;
    padding-top: 44px;
  }

  .avatar {
    width: 160px;
    height: 160px;
  }

  .author-name { font-size: 24px; }

  h2 { font-size: 32px; }

  .gallery-head,
  .plate {
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 0 48px;
  }

  .gallery { padding-top: 44px; }
}

/* ---- Phone ------------------------------------------------------ */

@media (max-width: 767px) {
  .topbar-inner { padding: 16px; }

  .site-title { font-size: 20px; }

  .topnav { gap: 18px; }

  .layout {
    display: block;
    padding: 0 16px;
  }

  /* Portrait beside the name, then the links. */
  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 0 14px;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--rule);
  }

  .avatar {
    width: 64px;
    height: 64px;
    border-radius: 4px;
  }

  .author-name {
    margin: 0;
    font-size: 24px;
  }

  .author-urls {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 20px;
    margin-top: 14px;
    padding-top: 0;
    border-top: 0;
  }

  .author-urls li { margin: 0; }

  .content { padding-top: 32px; }

  .content section + section {
    margin-top: 48px;
    padding-top: 32px;
  }

  h2 { font-size: 30px; }

  #about h2 + p { font-size: 17px; }

  .entries strong { font-size: 18.5px; }

  /* On a phone the plate leads its entry, at the column's full width. */
  .entries > li.has-plate {
    display: block;
  }

  .plate-thumb {
    margin: 0 0 14px;
  }

  .figure-row {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  /* On a phone the portrait leads at full width, then the first room, then
     the other two side by side. */
  .lab-mosaic {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .lab-mosaic .lab-main,
  .lab-mosaic .lab-main + img {
    grid-row: auto;
    grid-column: 1 / -1;
  }

  .lab-mosaic .lab-main img {
    position: static;
    height: auto;
  }

  /* The gallery stacks: legend, then its plate. */
  .gallery { padding: 32px 16px 0; }

  .gallery-head,
  .plate { display: block; }

  .gallery-head { padding-bottom: 32px; }

  .gallery-head h1 { font-size: 36px; }

  .plate { padding: 40px 0; }

  .plate-more { padding-top: 0; }

  .plate-legend { margin-bottom: 18px; }

  .rollout-clips { gap: 8px; }

  .page-footer { margin-top: 64px; }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 32px 16px 28px;
  }
}

@media (max-width: 479px) {
  .topnav { display: none; }
}

@media print {
  body { background: #FFFFFF; }
  .topnav, .vines { display: none; }
  .layout { display: block; padding-top: 0; }
  .sidebar { position: static; }
  a { text-decoration: none; }
}
