:root{
  --edge-pad: clamp(16px, 6vw, 48px);
  --page-max: 1400px;
  --sort-h: 0px;
}

:root{
  --header-h: 72px;
  --edge-pad: clamp(16px, 6vw, 48px);
  --page-max: 1400px;
  --blur: 6px;
  --overlay: .08;
  --radius: 50px;
}

.site-header{
  position: fixed;
  top: -1.4px; left: 0; right: 0;
  padding: 0;
  z-index: 80;
  height: var(--header-h);
  display: flex; align-items: center;
  background: transparent;
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
  overflow: clip;
  isolation: isolate;

  box-shadow:
    0 20px 32px -18px rgba(0,0,0,.22),
    0  6px 12px  -6px rgba(0,0,0,.08);
}

.site-header::before{
  content:"";
  position:absolute; inset:0;
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
  pointer-events:none;

  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.08) contrast(1.03);
          backdrop-filter: blur(var(--blur)) saturate(1.08) contrast(1.03);

  background:
    radial-gradient(140% 180% at 50% 40%,
      rgba(255,255,255, calc(var(--overlay)*.25)) 55%,
      rgba(255,255,255, var(--overlay)) 100%);
}

.site-header{ isolation: isolate; }

.site-header::after{
  content:"";
  position:absolute; inset:0;
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
  pointer-events:none;
  box-shadow:
    inset 0 0 0 2px rgba(0,0,0,.10),
    inset 0 1px 0 rgba(255,255,255,.45);
}

.header-inner.header-view{
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: var(--page-max);
  padding: 0 16px;
  margin: 0 auto;
}

.header-inner.header-view .go-back-arrow{ place-self: center start; width: max-content; }
.header-inner.header-view .logo{     place-self: center; }
.header-inner.header-view .fav-btn{       place-self: center end; }

a.logo {
  margin-top: 8px;
}

.logo-image {
  width: 125px;
}

.header-inner.header-view .go-back-arrow{
  justify-self: start;
  width: max-content;
  align-self: center;
}

.go-back-arrow{
  all: unset;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: 0 .7rem 0 .52rem;
  min-height: 40px;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1;
  color: #111;

  -webkit-backdrop-filter: blur(3px) saturate(1.06) contrast(1.02);
          backdrop-filter: blur(3px) saturate(1.06) contrast(1.02);
  background: rgba(255,255,255,.10);

  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,.10),
    0 3px 8px -3px rgba(0,0,0,.08);

  transform: translateZ(0);
  transform-origin: center;
  will-change: transform, box-shadow, background-color;
  transition:
    box-shadow 240ms ease,
    background-color 240ms ease;

  -webkit-tap-highlight-color: rgba(0,0,0,0);
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: none;
}

.go-back-arrow:hover{
  background: rgba(255,255,255,.2);
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,.10),
    0 4px 10px -4px rgba(0,0,0,.10);
}

.back-label{ font-size: 16px; }

.fav-btn{
  all: unset;
  color: #292929ff;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  vertical-align: middle;

  min-height: 40px;
  border-radius: 999px;

  -webkit-backdrop-filter: blur(3px) saturate(1.06) contrast(1.02);
          backdrop-filter: blur(3px) saturate(1.06) contrast(1.02);
  background: rgba(255,255,255,.10);
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,.10),
    0 3px 8px -3px rgba(0,0,0,.08);

  will-change: transform, box-shadow, background-color;
  transform: translateZ(0);
  transform-origin: center;
  transition:
    padding-inline 300ms cubic-bezier(.22,.61,.36,1),
    box-shadow 300ms ease,
    background-color 300ms ease,
    color 300ms ease,
    border-radius 300ms ease,
    transform 300ms cubic-bezier(.22,.61,.36,1);
  z-index: 100;
  text-decoration: none;
}

.fav-btn svg{ display: block; }

@media (hover: hover) and (pointer: fine){
  .fav-btn:hover{
    transform: scale(1.12);
    box-shadow:
      inset 0 0 0 1px rgba(0,0,0,.10),
      0 4px 10px -4px rgba(0,0,0,.10);
  }
}

.fav-btn:not(.has-count){
  inline-size: 40px;
  block-size: 40px;
  justify-content: center;
  align-items: center;
}

.fav-btn:not(.has-count) .fav-count{
  display: none;
}

.fav-btn.has-count{
  padding: 0 .7rem 0 .52rem;
}

.fav-count{
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateX(-6px) scale(.92);
  margin-left: 0;
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
  transition:
    max-width 300ms cubic-bezier(.22,.61,.36,1),
    margin-left 300ms cubic-bezier(.22,.61,.36,1),
    opacity 300ms ease,
    transform 300ms ease;
  min-width: 0;
}


.fav-btn.has-count .fav-count{
  max-width: 4ch;
  margin-left: .25rem;
  opacity: 1;
  transform: translateX(0) scale(1);
}

@keyframes favCountPop{
  0%{   transform: translateX(0) scale(1); }
  50%{  transform: translateX(0) scale(1.18); }
  100%{ transform: translateX(0) scale(1); }
}
.fav-count.is-updating{ animation: favCountPop 180ms ease; }



@media (max-width: 1440px) {
  .header-inner.header-view{
    padding: 0 26px;
  }
}

@media (max-width: 395px) {
  .header-inner.header-view{
    gap: 8px;
  }

  .logo-image {
    width: 115px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}