/* Menu: same pill-to-panel morph as Zora (animated by js/menu.js) */
#menu {
  --p: 18px;
  position: fixed;
  top: calc(var(--top) + env(safe-area-inset-top, 0px));
  right: calc(var(--pad) - 16px);
  z-index: 51;
  width: 100px; height: 44px;
  border-radius: 22px;
  background: transparent;
  overflow: hidden;
  opacity: 0; visibility: hidden;
  transform-origin: 50% 0;
  box-shadow: 0 20px 60px rgba(0,0,0,0);
  transition: background-color .5s, box-shadow .5s;
  -webkit-user-select: none; user-select: none
}
/* panel look lives in CSS so a theme switch while open recolours the panel instantly */
#menu.gl {
  background: #222;
  box-shadow: 0 20px 60px rgba(0,0,0,.45), inset 0 0 0 1px color-mix(in srgb, var(--fg) 10%, transparent)
}
html[data-theme=light] #menu.gl {
  background: rgb(255,251,241);
  box-shadow: 0 20px 60px rgba(0,0,0,.18), inset 0 0 0 1px color-mix(in srgb, var(--fg) 10%, transparent)
}

#menu .ml {
  position: absolute; inset: 0; z-index: 3;
  border: 0; padding: 0 16px 0 0; border-radius: inherit;
  background: none; color: var(--fg); cursor: pointer;
  font: inherit; font-size: var(--nfs); line-height: 1.2;
  display: flex; align-items: flex-start; justify-content: flex-end; transition: color .25s
}
#menu .ml:hover { color: var(--acc) }
#menu.open .ml { pointer-events: none }

#menu .mc {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  padding: var(--p);
  opacity: 0; pointer-events: none;
  color: var(--fg)
}
#menu.open .mc { pointer-events: auto }

#menu .mh { display: flex; justify-content: space-between; align-items: center; flex: none }
#menu .mx, #th {
  height: 36px; border: 0; border-radius: 999px;
  background: color-mix(in srgb, var(--fg) 10%, transparent);
  color: var(--fg); cursor: pointer;
  font: 400 15px/1 'Outfit', sans-serif;
  display: grid; place-items: center;
  transition: background .3s, color .3s
}
#menu .mx { padding: 0 16px }
#th { width: 36px; padding: 0 }
#th svg { width: 20px; height: 20px; display: block }
#menu .mx:hover, #th:hover { background: color-mix(in srgb, var(--fg) 20%, transparent) }

#menu ul { list-style: none; margin: 14px 0 0; padding: 0 4px; display: flex; flex-direction: column; gap: 3px }
#menu li a {
  display: block; padding: 2px 0;
  font: 400 clamp(20px, 1.7 * var(--vw), 26px)/1.3 'Outfit', sans-serif;
  color: var(--fg); text-decoration: none;
  transition: color .25s, translate .45s var(--e)
}
#menu li a:hover { color: var(--acc); translate: 6px 0 }
#menu li sup { margin-left: .2em; font: 400 .5em/1 'Outfit', sans-serif; color: var(--acc); vertical-align: top; position: relative; top: -.15em }
#menu li sup:not(:empty)::before { content: "(" } #menu li sup:not(:empty)::after { content: ")" }
#menu .mi { margin: 18px 4px 0; font: 400 15px/1.3 'Outfit', sans-serif }
#menu .mi div { display: flex; justify-content: space-between; gap: 16px; padding: 2px 0 }
#menu .mi dt { color: var(--mut) }
#menu .mi dd { margin: 0; text-align: right; color: var(--fg) }
#menu .mi a { color: inherit; text-decoration: none; transition: color .25s }
#menu .mi a:hover { color: var(--acc) }

#menu button:focus-visible, #menu a:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 8px }
html.nv #menu { display: none }


/* desktop: 25px from the top, 52px from the sides and bottom (logo, Menu, Zora, page content) */
@media (min-width: 1024px) {
  :root { --top: 25px; --pad: 52px; --bot: 52px }
}
