:root {
  --background: #fcfcfc;
  --foreground: #0a0a0a;
  --muted-foreground: #737373;
  --border: #e5e5e5;
  --tile: #f3f3f2;
  --serif: 'Newsreader', ui-serif, Georgia, 'Times New Roman', serif;
  --sans: 'Inter', ui-sans-serif, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
}

body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--sans);
  font-weight: 450;
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

main {
  max-width: 672px;
  margin: 0 auto;
  padding: 96px 24px 128px;
}

.mark {
  display: block;
  width: 36px;
  height: 26px;
  margin-bottom: 64px;
}

/* Serif voice: intro, headings. */
.intro {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 32.5px;
  color: var(--muted-foreground);
}

.intro + .intro {
  margin-top: 16px;
}

.intro strong {
  font-weight: 400;
  color: var(--foreground);
}

.underline {
  text-decoration: underline;
  text-decoration-color: rgb(115 115 115 / 0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color 150ms ease;
}

.underline:hover {
  text-decoration-color: var(--muted-foreground);
}

section {
  margin-top: 80px;
}

h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 20px;
  line-height: 28px;
  margin-bottom: 24px;
}

/* Projects grid. */
.projects {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px 24px;
}

.tile {
  aspect-ratio: 324 / 170;
  border-radius: 10px;
  background: var(--tile);
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  font-family: var(--serif);
  font-size: 22px;
  line-height: 28px;
  color: var(--foreground);
  transition: background-color 150ms ease;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  border-radius: 10px;
}

.tile:has(img) {
  padding: 0;
  overflow: hidden;
}

.tile.contain img {
  object-fit: contain;
  object-position: center;
  border-radius: 0;
}

.tile.contain {
  background: #fff;
  padding: 12px;
}

.project .tile img {
  transition: opacity 150ms ease;
}

.project:hover .tile img {
  opacity: 0.92;
}

.project:hover .tile {
  background: #eeeeec;
}

/* Figures: one fixed height, image fitted inside, so every figure lines up. */
figure {
  margin-top: 24px;
}

figure a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 440px;
  padding: 20px;
  border-radius: 10px;
  background: var(--tile);
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.04);
}

figure img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.06);
}

figcaption {
  margin-top: 12px;
  font-size: 14px;
  line-height: 20px;
  color: var(--muted-foreground);
}

.project-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
}

h3,
.small {
  font-size: 14px;
  line-height: 20px;
  color: var(--muted-foreground);
}

h3 {
  font-weight: 500;
}

.small {
  font-weight: 450;
}

.year {
  font-variant-numeric: tabular-nums;
}

/* Row list, like emad.design's Crafts. */
.rows {
  list-style: none;
  padding: 0;
}

.rows li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.rows li:last-child {
  border-bottom: none;
}

.rows .small {
  text-align: right;
  flex-shrink: 0;
}

.body {
  color: var(--muted-foreground);
}

.body + .body {
  margin-top: 16px;
}

footer {
  margin-top: 96px;
}

/* Case study page. */
.back {
  display: inline-block;
  font-size: 14px;
  line-height: 20px;
  color: var(--muted-foreground);
  margin-bottom: 64px;
  transition: color 150ms ease;
}

.back:hover {
  color: var(--foreground);
}

.title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 28px;
  line-height: 36px;
  margin-bottom: 16px;
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.facts dt {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--foreground);
}

.facts dd {
  font-size: 14px;
  line-height: 20px;
  color: var(--muted-foreground);
}

h4 {
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  margin: 32px 0 8px;
}

.learnings li {
  display: block;
}

.report {
  margin-top: 24px;
}

.learnings strong {
  display: block;
  font-weight: 500;
  color: var(--foreground);
}

@media (max-width: 640px) {
  main {
    padding-top: 64px;
  }

  .projects,
  .facts {
    grid-template-columns: 1fr;
  }

  figure a {
    height: 240px;
    padding: 16px;
  }
}
