html { scroll-padding-top: 104px; }

.site-header {
  transition: background-color .25s ease, box-shadow .25s ease, transform .25s ease;
}

.site-header.is-floating {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1180px, calc(100% - 32px));
  height: 68px;
  padding: 0 25px;
  background: rgba(10, 41, 35, .94);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px;
  box-shadow: 0 12px 38px rgba(6, 24, 20, .25);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: nav-in .25s ease both;
}

.site-header.is-floating .brand-mark { width: 34px; height: 34px; }
.site-header.is-floating .brand { font-size: 21px; }

.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--coral);
  color: #fff;
  font-size: 23px;
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(20, 49, 43, .26);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}

.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: #e96650; transform: translateY(-2px); }
.back-to-top:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

@keyframes nav-in {
  from { opacity: 0; transform: translate(-50%, -12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@media (max-width: 900px) {
  html { scroll-padding-top: 94px; }
  .site-header.is-floating { top: 10px; width: calc(100% - 20px); height: 62px; padding: 0 16px; }
  .site-header.is-floating nav { top: 0; border-radius: 10px; }
  .back-to-top { right: 16px; bottom: 16px; width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .site-header.is-floating { animation: none; }
}
