.post-wrap {
  padding-top: clamp(130px, 20vh, 190px);
}

.post-head,
.post,
.post-foot,
.post-callout {
  max-width: 40rem;
}

.crumbs {
  display: flex;
  gap: 10px;
  color: var(--ink-3);
}

.crumbs a {
  color: var(--ink-2);
  transition: color 0.2s ease;
}

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

.post-title {
  margin-top: 24px;
  width: fit-content;
  font-size: clamp(38px, 5.4vw, 68px);
  line-height: 1;
  letter-spacing: -0.05em;
  font-weight: 450;
}

.post {
  margin-top: 48px;
  font-size: clamp(17px, 1.4vw, 19px);
  line-height: 1.7;
  color: var(--ink-2);
}

.post > * + * {
  margin-top: 1.2em;
}

.post h2 {
  margin-top: 2.2em;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -0.025em;
  font-weight: 450;
}

.post h2 + * {
  margin-top: 0.6em;
}

.post strong {
  color: var(--ink);
  font-weight: 450;
}

.post a {
  color: var(--ink);
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.4s var(--ease);
}

.post a:hover {
  background-size: 0% 1px;
  background-position: 100% 100%;
}

.post pre {
  --r: 18px;
  margin-top: 1.6em;
  margin-bottom: 1.6em;
  padding: 16px 20px;
  background: var(--ink);
  color: #eaeaea;
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.6;
  overflow-x: auto;
}

.post p code {
  font-family: var(--sans);
  font-size: 0.82em;
  color: var(--ink);
  background: var(--surface);
  padding: 2px 7px;
  border-radius: 6px;
}

.post table {
  width: 100%;
  margin-top: 1.6em;
  margin-bottom: 1.6em;
  border-collapse: collapse;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.post th,
.post td {
  padding: 10px 12px 10px 0;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-weight: 400;
}

.post th {
  color: var(--ink-3);
}

.post td {
  color: var(--ink);
}

.post .num {
  text-align: right;
}

.post tr.me td {
  font-weight: 500;
}

.post figure {
  margin-top: 1.8em;
  margin-bottom: 1.8em;
}

.dark-fig {
  --r: 24px;
  padding: 14px;
  background: #111;
}

.dark-fig img {
  height: auto;
  width: 100%;
  border-radius: 10px;
}

.post figcaption {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-3);
}

.post-callout {
  --r: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 56px;
  padding: 22px 26px;
  background: var(--surface);
  transition: background-color 0.3s ease;
}

.post-callout:hover {
  background: var(--surface-2);
}

.post-callout .label {
  display: block;
  font-size: 13px;
}

.post-callout b {
  font-weight: 400;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.post-foot {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.post-foot a {
  --r: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  min-height: 132px;
  padding: 20px 22px;
  background: var(--surface);
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: -0.02em;
  transition: background-color 0.3s ease;
}

.post-foot a:hover {
  background: var(--surface-2);
}

.post-foot a.next {
  grid-column: 2;
  text-align: right;
}

.post-foot .label {
  font-size: 13px;
  letter-spacing: 0;
}

.post + .post-foot {
  margin-top: 56px;
}

/* on wide screens the headings move into a rail beside the text, same as the case studies */
@media (min-width: 1100px) {
  .post {
    --rail: 200px;
    --gap: clamp(32px, 5vw, 64px);
    display: grid;
    grid-template-columns: minmax(0, var(--rail)) minmax(0, 40rem);
    column-gap: var(--gap);
    max-width: none;
  }

  .post > * {
    grid-column: 2;
  }

  .post > h2 {
    grid-column: 1;
    padding-top: 6px;
    font-size: 17px;
  }

  .post > h2,
  .post > h2 + * {
    margin-top: 56px;
  }

  .post ~ .post-callout,
  .post ~ .post-foot {
    margin-left: calc(200px + clamp(32px, 5vw, 64px));
  }
}

@media (max-width: 560px) {
  .post-foot {
    grid-template-columns: 1fr;
  }

  .post-foot a.next {
    grid-column: 1;
  }
}
