header.site-header > .header-inner > .header-trail-lockup > .brand {
  position: relative;
}

header.site-header > .header-inner > .header-trail-lockup > .brand::before,
header.site-header > .header-inner > .header-trail-lockup > .brand::after {
  content: "";
  position: absolute;
  top: var(--hat-brand-top, 50%);
  left: 0;
  width: 35px;
  height: 24px;
  pointer-events: none;
  transform-origin: 0 0;
  /* The editor places the 35 × 24 hat at (2, -10) on a 140 × 32 mark. */
  transform: scale(var(--hat-brand-fit, .8)) translate(26px, -6px) rotate(-18deg) scale(1.32) translate(-24px, -20px);
}

header.site-header > .header-inner > .header-trail-lockup > .brand::before {
  background: linear-gradient(152deg, #ff686c 5%, #e12739 46%, #a31228 89%);
  clip-path: path("M 8.5 18 C 11 14.5 14 11 14 8.5 C 10.5 9 8.2 11 6.5 14 L 2.5 12.5 C 5.2 6.6 10.3 2.5 17 2.3 C 23.6 2 27.1 5.5 28.5 10.5 C 29.4 13.4 28.9 16.4 30 19.5 Z");
}

header.site-header > .header-inner > .header-trail-lockup > .brand::after {
  background: linear-gradient(155deg, #fff 44%, #f5f7fc 68%, #dce5f4 100%);
  clip-path: path("M 10 16.2 Q 19 16.6 29 17.6 Q 31 17.9 30.7 20.1 Q 30.6 22 28.8 22 Q 20 21 9.7 20.8 Q 7.7 20.8 8 18.5 Q 8.1 16.5 10 16.2 Z M 4.5 9.7 A 4.3 4.3 0 1 1 4.5 18.3 A 4.3 4.3 0 0 1 4.5 9.7 Z");
}


@media (max-width: 700px) {
  header.site-header > .header-inner > .header-trail-lockup > .brand {
    --hat-brand-fit: .657143;
  }

  :root:has(.site-header--public-subpage) header.site-header > .header-inner > .header-trail-lockup > .brand {
    --hat-brand-fit: .457143;
  }
}

@media (max-width: 480px) {
  :root header.site-header > .header-inner > .header-trail-lockup > .brand, :root:has(.site-header--public-subpage) header.site-header > .header-inner > .header-trail-lockup > .brand {
    --hat-brand-fit: .5;
  }

  @supports (transform: scale(calc(1px / 1px))) {
    :root header.site-header > .header-inner > .header-trail-lockup > .brand, :root:has(.site-header--public-subpage) header.site-header > .header-inner > .header-trail-lockup > .brand {
      --hat-brand-fit: calc(clamp(62px, 18vw, 82px) / 140px);
    }
  }
}

@media (max-width: 760px) {
  dialog.site-dialog.header-trail-dialog[open]:has(> .header-trail-proxy) {
    inset-block-start: var(--header-trail-dialog-top, 88px);
    inset-block-end: auto;
    margin-block-start: 0;
    margin-block-end: 16px;
    max-height: calc(100dvh - var(--header-trail-dialog-top, 88px) - 16px);
  }
}
