:root {
  scroll-padding-block-start: var(--anchor-clearance, 132px);
}

.header-slot {
  position: sticky;
  z-index: 9;
  inset-block-start: 0;
  min-block-size: var(--header-slot-height, 0);
  pointer-events: none;
}

.site-header {
  pointer-events: auto;
}

.header-inner,
.site-header .brand-name,
.site-header .brand-small,
.header-rule {
  transition: font-size .2s ease, min-height .2s ease, padding .2s ease, transform .2s ease;
}

.header-slot.is-measuring * {
  transition: none;
}

.header-slot.is-compact .site-header {
  box-shadow: 0 4px 14px rgb(10 17 18 / 16%);
}

.header-slot.is-compact .header-inner {
  min-height: clamp(67px, 5.4vw, 78px);
  padding-block: 6px;
}

.header-slot.is-compact .brand-name {
  font-size: clamp(2.05rem, 4vw, 3.1rem);
}

.header-slot.is-compact .brand-small {
  font-size: clamp(.42rem, .64vw, .53rem);
}

.header-slot.is-compact .header-rule {
  transform: translateY(21px);
}

.back-to-top {
  position: fixed;
  z-index: 8;
  inset-inline-end: max(14px, env(safe-area-inset-right));
  inset-block-end: var(--back-to-top-bottom, max(14px, env(safe-area-inset-bottom)));
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgb(245 238 226 / 70%);
  border-radius: 2px;
  background: var(--pine);
  color: var(--ivory);
  box-shadow: 0 3px 10px rgb(10 17 18 / 16%);
  cursor: pointer;
}

.back-to-top[hidden] { display: none; }

.back-to-top:hover { background: #314345; }

.back-to-top:focus-visible {
  outline-color: var(--pine);
  box-shadow: 0 0 0 5px var(--ivory);
}

.back-to-top svg { width: 22px; height: 22px; }

@media (max-width: 730px) {
  .header-slot.is-compact .header-inner {
    min-height: 0;
    gap: 2px 14px;
    padding-block: 4px 0;
  }

  .header-slot.is-compact .brand-name {
    font-size: clamp(1.75rem, 7vw, 2.25rem);
  }

  .header-slot.is-compact .brand-small { font-size: .42rem; }
}

@media (prefers-reduced-motion: reduce) {
  .header-inner,
  .site-header .brand-name,
  .site-header .brand-small,
  .header-rule {
    transition: none;
  }
}
