:root {
  --site-content-max: 1280px;
  --gutter: clamp(24px, 4vw, 64px);
  --site-inset: max(var(--gutter), calc((100% - var(--site-content-max)) / 2));
  --layout-gap: clamp(28px, 4vw, 56px);
  --section-gap: clamp(62px, 7.2vw, 104px);
  --chapter-gap: calc(var(--section-gap) / 2);
  --topbar-h: 66px;
  --heading-size: clamp(22px, 1.9vw, 28px);
  --subheading-size: clamp(16px, 1.3vw, 19px);
  --body-size: clamp(14px, 1.05vw, 16px);
  --body-leading: 1.9;
}

.wrap {
  width: min(calc(100% - 2 * var(--gutter)), var(--site-content-max));
  margin-inline: auto;
}

.layout-two, .layout-three { display: grid; gap: var(--layout-gap); }
.layout-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.layout-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.layout-sidebar { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }

.photo-frame { display: block; aspect-ratio: var(--photo-ratio, 8 / 5); overflow: hidden; }
.photo-frame--portrait { --photo-ratio: 3 / 4; }
.photo-frame--square { --photo-ratio: 1; }
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 760px) {
  :root {
    --gutter: clamp(20px, 4vw, 24px);
    --layout-gap: clamp(18px, 4vw, 28px);
    --section-gap: clamp(44px, 8vw, 62px);
    --topbar-h: 58px;
  }
  .layout-two, .layout-sidebar { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 540px) {
  .layout-three { grid-template-columns: minmax(0, 1fr); }
}
