/* User-supplied handwriting: native ink, transparent PNG, individual optical sizes. */
.title-accessible { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.page-heading { max-width: 700px; }
main .illustrated-title { position: relative; margin: 0; text-align: center; line-height: 1; }
.illustrated-title img { display: block; width: var(--title-width); max-width: 100%; height: auto; margin-inline: auto; transform: none; object-fit: contain; }
.home-personal > .illustrated-title { margin: 0 auto 36px; max-width: 1040px; }
@media (max-width: 820px) {
  .illustrated-title img { width: var(--title-mobile-width); }
  .home-personal > .illustrated-title { margin-block-end: 28px; }
}

/* Shared optical alignment: titles follow the same right edge as the reading column. */
.page-heading:has(.illustrated-title) { margin-block-start: 60px; margin-block-end: 32px; }
.page-heading .illustrated-title img { margin-inline-start: 0; margin-inline-end: auto; }
/* Compensate for the trimmed canvas and slight size reduction after rotation. */
.page-heading:has([data-title="literary-editing"]) { margin-block-end: 40px; }
body[data-page="contact"] .page-heading { margin-block-end: 20px; }
body[data-page=""] .home-personal { padding-block-start: 84px; }
.home-personal > .illustrated-title { margin-block-end: 10.4px; }
/* Keep the existing footer itself unchanged while allowing short pages to fill the viewport. */
@media (max-width: 820px) {
  .page-heading:has(.illustrated-title) { margin-block-start: 58px; margin-block-end: 17px; }
  .page-heading:has([data-title="literary-editing"]) { margin-block-end: 23px; }
  body[data-page="contact"] .page-heading { margin-block-end: 12px; }
  body[data-page=""] .home-personal { padding-block-start: 61px; }
  .home-personal > .illustrated-title { margin-block-end: 6.4px; }
}
/* Local spacing adjustment for the writing beliefs title only. */
body[data-page="writing-editing"] .page-heading { margin-block-end: 20px; }
@media (max-width: 820px) {
  body[data-page="writing-editing"] .page-heading { margin-block-end: 5px; }
}
/* Stretch this title vertically by 10%, keeping its responsive width unchanged. */
body[data-page="writing-editing"] .illustrated-title img {
  aspect-ratio: 1698 / 400.4;
  object-fit: fill;
}
