/* Phone menu (menu.js): a glass button in the top bar that floats once the
   top bar scrolls away, and a glass sheet of shortcuts to every page.
   Pages can set --menu-accent. Hidden above 900px, where the page's own nav shows. */
.menu-btn { display: none; }

@media (max-width: 900px) {
  .menu-btn {
    display: grid; place-items: center; flex: none;
    width: 44px; height: 44px; padding: 0; border-radius: 50%; cursor: pointer; color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: linear-gradient(160deg, rgba(40, 50, 56, 0.62), rgba(10, 14, 16, 0.78));
    -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    -webkit-tap-highlight-color: transparent;
  }
  .menu-btn i, .menu-btn i::before, .menu-btn i::after {
    display: block; width: 16px; height: 1.8px; border-radius: 2px; background: currentColor; position: relative;
  }
  .menu-btn i::before, .menu-btn i::after { content: ""; position: absolute; left: 0; }
  .menu-btn i::before { top: -5.5px; }
  .menu-btn i::after { top: 5.5px; width: 10px; }
  .menu-btn.float[hidden] { display: none; }
  .menu-btn.float { position: fixed; top: 14px; right: 14px; z-index: 60; animation: menu-pop 0.45s cubic-bezier(0.22, 1, 0.36, 1); }
  .menu-gap { display: flex; align-items: center; gap: 10px; }
}
@keyframes menu-pop { from { transform: scale(0.6); opacity: 0; } }

.menu-scrim { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, 0.38); opacity: 0; pointer-events: none; transition: opacity 0.35s ease; }
.menu-scrim.on { opacity: 1; pointer-events: auto; }

/* The glass sheet. It is revealed with clip-path (never opacity or transform on the
   glass itself), because phones drop backdrop blur while those animate. */
.menu-sheet {
  position: fixed; z-index: 80; top: 12px; right: 12px; width: min(380px, calc(100vw - 24px));
  padding: 14px; border-radius: 26px; color: #f2f5f4; font-family: inherit;
  background: linear-gradient(160deg, rgba(44, 56, 62, 0.74), rgba(10, 16, 19, 0.86));
  -webkit-backdrop-filter: blur(20px) saturate(1.4); backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid color-mix(in srgb, var(--menu-accent, #e4f96b) 26%, rgba(255, 255, 255, 0.14));
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  clip-path: inset(0 0 100% 30% round 26px); visibility: hidden;
  transition: clip-path 0.55s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.55s;
}
.menu-sheet.on { clip-path: inset(0 0 0 0 round 26px); visibility: visible; transition: clip-path 0.55s cubic-bezier(0.22, 1, 0.36, 1); }
.menu-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 12px 8px; }
.menu-head span { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(242, 245, 244, 0.55); }
.menu-x { width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.08); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; }
.menu-list { display: grid; gap: 8px; }
.menu-list a, .menu-foot a {
  display: grid; grid-template-columns: 12px 1fr auto; gap: 12px; align-items: center;
  padding: 13px 14px; border-radius: 16px; background: rgba(255, 255, 255, 0.07); color: inherit; text-decoration: none;
  opacity: 0; transform: translateY(8px); transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s ease;
}
.menu-sheet.on .menu-list a, .menu-sheet.on .menu-foot a { opacity: 1; transform: none; transition-delay: calc(var(--k) * 45ms + 120ms), calc(var(--k) * 45ms + 120ms), 0s; }
.menu-list a:active, .menu-list a:hover { background: rgba(255, 255, 255, 0.12); }
.menu-list a[aria-current="page"] { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--menu-accent, #e4f96b) 55%, transparent); }
.menu-list i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.menu-list b { display: block; font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.menu-list small { display: block; margin-top: 2px; font-size: 12.5px; color: rgba(242, 245, 244, 0.6); }
.menu-list em, .menu-foot em { font-style: normal; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; color: var(--menu-accent, #e4f96b); }
.menu-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.menu-foot a { grid-template-columns: 1fr auto; font-weight: 600; font-size: 14.5px; }
.menu-foot a.cta { background: var(--menu-accent, #e4f96b); color: #071012; }
.menu-foot a.cta em { color: #071012; }
@media (prefers-reduced-motion: reduce) {
  .menu-sheet, .menu-sheet.on, .menu-list a, .menu-foot a, .menu-scrim { transition: none !important; }
  .menu-btn.float { animation: none; }
}
