/* Inferterra. One typeface, black on white. */

@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/source-serif-4-opsz-roman.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/source-serif-4-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --ink: #000;
  --paper: #fff;
  --quiet: #6b6b6b;
  --gutter: clamp(16px, 2.6vw, 40px);
  --rail: 15.5rem;
  --top: clamp(56px, 9vw, 128px);
  --square-pad: clamp(12px, 1.5vw, 20px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-optical-sizing: auto;
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-kerning: normal;
  font-variant-numeric: oldstyle-nums proportional-nums;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }

.vh {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: var(--gutter); top: 8px; background: var(--paper); padding: 6px 10px; z-index: 10; }

/* ---------- page frame ---------- */

.page {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  grid-template-areas:
    "mark nav"
    "rail main";
  column-gap: var(--gutter);
  max-width: 1720px;
  margin: 0 auto;
  padding: 28px var(--gutter) 96px;
}
.masthead { display: contents; }

.wordmark { grid-area: mark; display: block; width: 184px; color: var(--ink); align-self: center; }
.wordmark svg { display: block; width: 100%; height: auto; }
.wordmark:hover { opacity: 0.72; }

.nav { grid-area: nav; display: flex; gap: 1.6rem; align-items: center; font-size: 1.125rem; }
.nav a { color: var(--quiet); }
.nav a[aria-current="page"], .nav a.is-section { color: var(--ink); }

.main { grid-area: main; margin-top: var(--top); min-width: 0; }

.rail {
  grid-area: rail;
  margin-top: var(--top);
  align-self: start;
  position: sticky;
  top: 28px;
  font-size: 0.9375rem;
  line-height: 1.5;
}
.rail-group { list-style: none; margin: 0; padding: 0; }
.rail-label { font-size: inherit; font-weight: 400; color: var(--quiet); margin: 1.6rem 0 0.15rem; }

/* ---------- Studies ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.05em 0.62em;
  font-size: clamp(1.625rem, 1.1rem + 1.7vw, 2.5rem);
  line-height: 1.18;
  letter-spacing: -0.006em;
}
.filter {
  appearance: none; -webkit-appearance: none;
  background: none; border: 0; border-radius: 0; padding: 0; margin: 0;
  font: inherit; letter-spacing: inherit; color: var(--quiet); cursor: pointer;
}
.filter:hover { color: var(--ink); }
.filter[aria-pressed="true"] { color: var(--ink); }

.filter-note {
  min-height: 1.5em;
  max-width: 40rem;
  margin: 0.85rem 0 0;
  font-size: 1.125rem;
  color: var(--quiet);
}

.grid {
  list-style: none;
  margin: clamp(32px, 4vw, 56px) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 3vw, 44px) clamp(10px, 1.4vw, 20px);
}

.square a { display: block; color: var(--ink); }
.square a:hover { text-decoration: none; }
.square a:focus-visible { outline: none; }
.square a:focus-visible .square-media { outline: 2px solid var(--ink); outline-offset: 3px; }

/* the image fills the square */
.square-media {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #ececec;
  container-type: inline-size;
}
.square-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.square-media::after { content: ""; position: absolute; inset: 0; background: #000; opacity: 0; }
.square a:hover .square-media::after, .square a:focus-visible .square-media::after { opacity: 0.8; }

/* the one-line description shows over the image when a square is pointed at or focused */
.square-desc {
  position: absolute;
  z-index: 1;
  top: var(--square-pad);
  left: var(--square-pad);
  right: var(--square-pad);
  font-size: 1.125rem;
  line-height: 1.38;
  color: var(--paper);
  opacity: 0;
}
.square a:hover .square-desc, .square a:focus-visible .square-desc { opacity: 1; }
@container (max-width: 240px) { .square-desc { display: none; } }

.square-text { display: block; padding-top: 0.75rem; }
.square-title { display: block; font-size: clamp(1rem, 0.92rem + 0.35vw, 1.1875rem); line-height: 1.25; letter-spacing: -0.004em; }
.square a:hover .square-title, .square a:focus-visible .square-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.square-meta { display: flex; justify-content: space-between; gap: 0.75rem; margin-top: 0.3rem; font-size: 0.875rem; color: var(--quiet); }

.empty { margin: 1.5rem 0 0; font-size: 1.125rem; }
.credits { margin: clamp(48px, 6vw, 80px) 0 0; max-width: 46rem; font-size: 0.8125rem; line-height: 1.5; color: var(--quiet); }
.credits a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }

/* ---------- Studio ---------- */

.studio { max-width: 35rem; font-size: clamp(1.1875rem, 1.05rem + 0.45vw, 1.375rem); line-height: 1.5; }
.studio p { margin: 0 0 1em; }
.studio .lead {
  font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.625rem);
  line-height: 1.16;
  letter-spacing: -0.008em;
  font-weight: 400;
  margin: 0 0 1.25em;
}
.studio h2 { font-size: 1rem; font-weight: 400; color: var(--quiet); margin: 3rem 0 1.1rem; }
.services { margin: 0; }
.services div { margin: 0 0 1.35em; }
.services dt { margin: 0; }
.services dd { margin: 0.15em 0 0; color: var(--quiet); }
.studio .bio { margin-top: 3rem; }
.studio a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }

/* ---------- text pages ---------- */

.study { max-width: 41rem; }
.study-kind { margin: 0 0 1.1rem; font-size: 1rem; color: var(--quiet); }
.study-kind a { color: inherit; }
.study h1 {
  margin: 0;
  font-size: clamp(2.125rem, 1.4rem + 2.6vw, 3.375rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
.dek { margin: 0.8rem 0 0; font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem); line-height: 1.35; color: var(--quiet); text-wrap: pretty; }
.feature { margin: 2.5rem 0 0; }

.prose { margin-top: 2.5rem; font-size: 1.1875rem; line-height: 1.62; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1em; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li { margin-bottom: 0.4em; }
.prose h2 { margin: 2.6em 0 0.7em; font-size: 1.625rem; font-weight: 400; line-height: 1.22; letter-spacing: -0.006em; }
.prose h3 { margin: 2.2em 0 0.5em; font-size: 1.1875rem; font-weight: 600; line-height: 1.3; }
.prose h2 + h3 { margin-top: 1em; }
.prose a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.prose blockquote { margin: 1.6em 0; padding-left: 1.1em; border-left: 1px solid var(--ink); }
.prose blockquote p { margin: 0; }
.prose hr { border: 0; border-top: 1px solid var(--ink); width: 4rem; margin: 2.6em 0; }
.prose figure { margin: 2.2em 0; }
.prose figcaption, .prose figcaption p { margin: 0.6em 0 0; font-size: 0.9375rem; line-height: 1.45; color: var(--quiet); }
.prose .gallery-row { display: flex; gap: 8px; }
.prose .gallery-row + .gallery-row { margin-top: 8px; }
.prose .gallery-cell { min-width: 0; }
.prose .gallery-cell img { width: 100%; }
.prose .callout { margin: 2em 0; padding: 1.1em 1.3em; border: 1px solid var(--ink); }
.prose .callout p { margin: 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; margin: 1.5em 0; }
.prose th, .prose td { text-align: left; padding: 0.45em 0.6em 0.45em 0; border-bottom: 1px solid var(--ink); vertical-align: top; }
.prose #image-credits ~ p { font-size: 0.9375rem; line-height: 1.45; color: var(--quiet); margin-bottom: 0.7em; }
.prose .worklist { list-style: none; padding: 0; }
.prose .worklist li { margin-bottom: 0.7em; }
.prose .action { margin-top: 2em; }
.study-back { margin: 4rem 0 0; font-size: 1rem; }

/* ---------- smaller screens ---------- */

@media (min-width: 1560px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
  .square-desc { display: none; }
  .square a:hover .square-media::after, .square a:focus-visible .square-media::after { opacity: 0; }
}

@media (max-width: 860px) {
  .page {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "mark nav"
      "main main"
      "rail rail";
    padding-top: 20px;
    padding-bottom: 48px;
  }
  .wordmark { width: 132px; }
  .nav { gap: 1.1rem; font-size: 1.0625rem; }
  .main { margin-top: 48px; }
  .rail { position: static; margin-top: 72px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .studio .lead { margin-bottom: 1em; }
}

@media (max-width: 420px) {
  .square-meta .square-dest { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .square-media::after, .square-desc { transition: opacity 120ms linear; }
}

@media print {
  .rail, .nav, .filters, .filter-note, .study-back { display: none; }
  .page { display: block; }
  .main { margin-top: 1rem; }
}
