/* Project pages and the case study ---------------------------------- */
/* One shared template: a way back, the label and title, a row of big
   figures, the diagram in a large card, then hairline rows for the
   summary, stack and links, and the next project at the end. */
.project {
  width: calc(100% - 2 * var(--gutter));
  max-width: calc(var(--wide) - 48px);
  margin: 0 auto;
  padding-top: clamp(48px, 7vw, 96px);
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--muted);
  font-size: 15px;
  transition: color 200ms;
}

@media (hover: hover) {
  .back:hover { color: var(--text); }
}

.project__head {
  margin-top: clamp(32px, 5vw, 64px);
}

.project__title {
  max-width: 14em;
  margin-top: 20px;
  font-size: clamp(36px, 7.4vw, 104px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.045em;
  text-wrap: balance;
  overflow-wrap: break-word;
  -webkit-hyphens: auto;
  hyphens: auto;
}

.project__lede {
  max-width: 40em;
  margin-top: 28px;
  color: var(--muted);
  font-size: var(--t-lede);
  line-height: 1.55;
}

/* Big figures: the number over its label, in a row of hairline cells. */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 0 32px;
  margin-top: clamp(48px, 6vw, 80px);
}

.stats > div {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.stats dd {
  order: -1;
  font-size: clamp(44px, 5vw, 64px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.stats [data-count] {
  display: inline-block;
}

.stats dt {
  max-width: 22em;
  color: var(--muted);
  font-size: var(--t-small);
  line-height: 1.5;
}

/* The diagram's card. */
.project__figure {
  margin-top: clamp(32px, 4vw, 56px);
}

.project__figure .reel__scene {
  max-width: 820px;
  margin: 0 auto;
}

.project__figure .reel__scene--plate {
  max-width: none;
}

.project__body {
  margin-top: clamp(56px, 7vw, 104px);
}

.project__body h2 {
  padding-top: 4px;
  color: var(--dim);
  font-weight: 400;
}

.project__body p + p {
  margin-top: 16px;
}

.project__summary {
  max-width: 40em;
  color: var(--text);
  font-size: var(--t-lede);
  line-height: 1.55;
}

.stack {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* A smaller build inside a row: its name, meta line and paragraph. */
.item__name {
  font-size: var(--t-card);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.item__meta {
  margin-top: 6px;
  color: var(--dim);
}

.item__text {
  max-width: 40em;
  margin-top: 14px;
  color: var(--muted);
}

/* The next project, large, at the end of every page. */
.next {
  display: block;
  margin-top: clamp(72px, 9vw, 128px);
  padding: 40px;
}

.next__title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 16px;
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.next__title span {
  color: var(--muted);
  transition: color 200ms, transform 200ms var(--ease-out);
}

@media (hover: hover) {
  .next:hover .next__title span { color: var(--text); transform: translateX(4px); }
}

@media (max-width: 719px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 20px;
  }

  .stats dd {
    font-size: 40px;
  }

  .next {
    padding: 28px 24px;
  }
}

.items > li + li {
  margin-top: 36px;
  padding-top: 36px;
  border-top: 1px solid var(--line);
}
