/* Note Inc. side menu, after the PS3's XrossMediaBar */

/* the glass tab on the left edge */
.xmb-tab {
  position: fixed; left: 0; top: 50%; z-index: 60;
  translate: 0 -50%;
  display: grid; justify-items: center; gap: 10px;
  padding: 14px 9px 14px 8px; border: 1px solid rgba(255, 255, 255, 0.28); border-left: 0;
  border-radius: 0 16px 16px 0; cursor: pointer;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.06));
  backdrop-filter: blur(12px) saturate(1.4); -webkit-backdrop-filter: blur(12px) saturate(1.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  color: #F4F7FA;
  transition: translate 0.35s ease, opacity 0.35s ease, padding 0.25s ease, background 0.25s ease;
}
.xmb-tab:hover { padding-left: 13px; background: linear-gradient(160deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1)); }
.xmb-tab.is-hidden { translate: -110% -50%; opacity: 0; pointer-events: none; }
.xmb-tab__lines { display: grid; gap: 4px; }
.xmb-tab__lines i { display: block; width: 16px; height: 2px; border-radius: 1px; background: currentColor; }
.xmb-tab__lines i:nth-child(2) { width: 11px; }
.xmb-tab__txt { writing-mode: vertical-rl; rotate: 180deg; font-size: 0.66rem; font-weight: 600; letter-spacing: 0.3em; text-transform: uppercase; }
html.xmb-open .xmb-tab { translate: -110% -50%; opacity: 0; }
/* a tab over light sections still reads */
.xmb-tab { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45); }
.xmb-tab .xmb-tab__lines i { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); }

/* the panel */
.xmb { position: fixed; inset: 0; z-index: 500; }
.xmb[hidden] { display: none; }
.xmb__dim { position: absolute; inset: 0; background: rgba(2, 8, 6, 0.35); opacity: 0; transition: opacity 0.4s ease; }
.xmb.is-open .xmb__dim { opacity: 1; }
.xmb__panel {
  position: absolute; left: 0; top: 0; bottom: 0; width: min(440px, 90vw); overflow: hidden; overflow: clip; /* never scrolls, even when focus moves */
  background: linear-gradient(170deg, rgba(14, 44, 38, 0.55) 0%, rgba(6, 18, 16, 0.42) 100%);
  backdrop-filter: blur(22px) saturate(1.5); -webkit-backdrop-filter: blur(22px) saturate(1.5);
  border-right: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 30px 0 80px rgba(0, 0, 0, 0.35), inset -1px 0 0 rgba(255, 255, 255, 0.06);
  color: #F4F7FA;
  translate: -102% 0; transition: translate 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
  touch-action: none;
}
.xmb.is-open .xmb__panel { translate: 0 0; }
.xmb__wave { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.xmb__top { position: absolute; left: 28px; right: 64px; top: 22px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 0.78rem; letter-spacing: 0.08em; }
.xmb__brand { font-family: var(--display); font-size: 1.1rem; letter-spacing: 0.02em; }
.xmb__clock { opacity: 0.8; font-variant-numeric: tabular-nums; white-space: pre; }
.xmb__close {
  position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.08); color: #fff; font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.xmb__close:hover { background: rgba(255, 255, 255, 0.18); }

/* the options: all in view, none of it scrolls. Sizes follow the height of the screen. */
.xmb__panel { --rows: var(--n, 15); --pitch: calc((100vh - 130px) / var(--rows)); --pitch: calc((100dvh - 130px) / var(--rows)); --tile: clamp(26px, calc(var(--pitch) * 0.82), 56px); }
.xmb__list {
  position: absolute; left: 0; right: 0; top: 66px; bottom: 56px; padding: 0 18px 0 22px;
  display: grid; grid-template-rows: repeat(var(--rows), minmax(0, 1fr)); grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); column-gap: 6px;
}
.xmb__item {
  position: relative; display: block; min-width: 0; padding: 0; margin: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
  transform-origin: 14% 50%; z-index: 1;
  translate: -26px 0; opacity: 0;
  transition: translate 0.55s cubic-bezier(0.2, 0.9, 0.25, 1) calc(var(--i) * 28ms), opacity 0.45s ease calc(var(--i) * 28ms), transform 0.32s cubic-bezier(0.2, 0.9, 0.25, 1);
  -webkit-tap-highlight-color: transparent;
}
.xmb.is-open .xmb__item { translate: 0 0; opacity: 1; }
/* each one drifts up and down on its own beat, like it is floating in a bubble */
.xmb__bob {
  position: absolute; inset: 0; display: flex; align-items: center; gap: calc(var(--tile) * 0.3); padding: 0 8px;
  animation: xmbBob var(--t, 4s) ease-in-out var(--d, 0s) infinite;
}
@keyframes xmbBob { 0%, 100% { transform: translateY(calc(var(--pitch) * -0.07)); } 50% { transform: translateY(calc(var(--pitch) * 0.07)); } }
.xmb__icon { flex: none; width: calc(var(--tile) + 6px); height: calc(var(--tile) + 6px); perspective: 500px; display: grid; place-items: center; }
.xmb__tile {
  position: relative; width: var(--tile); height: var(--tile); border-radius: calc(var(--tile) * 0.29); display: grid; place-items: center;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.07) 55%, rgba(255, 255, 255, 0.14) 100%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), inset 0 -8px 16px rgba(0, 0, 0, 0.15), 0 8px 18px rgba(0, 0, 0, 0.3);
  transform: rotateY(-26deg) rotateX(10deg);
  transform-style: preserve-3d;
  transition: transform 0.45s cubic-bezier(0.2, 0.9, 0.25, 1), box-shadow 0.35s ease, background 0.35s ease;
}
.xmb__tile::after { /* a glossy streak across the glass */
  content: ""; position: absolute; inset: 2px 2px 50% 2px; border-radius: calc(var(--tile) * 0.25) calc(var(--tile) * 0.25) 40% 40%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0)); pointer-events: none;
}
.xmb__tile svg { width: 46%; height: 46%; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35)); transform: translateZ(12px); }
.xmb__text { position: relative; min-width: 0; display: block; }
.xmb__text b { display: block; font-weight: 600; font-size: clamp(0.85rem, calc(var(--pitch) * 0.36), 1.12rem); line-height: 1.1; letter-spacing: 0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5); }
.xmb__text em { /* the one-line blurb, only when you point at it */
  position: absolute; left: 0; top: 100%; margin-top: 1px; font-style: normal; font-size: 0.72rem; line-height: 1.2; color: #D5E2EA; white-space: nowrap;
  opacity: 0; transform: translateY(-3px); transition: opacity 0.25s ease, transform 0.25s ease; pointer-events: none; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

/* point at one (or tab to it) and it swells and lights up */
.xmb__item:hover, .xmb__item:focus-visible { transform: scale(1.2); z-index: 3; outline: none; }
.xmb__item:hover .xmb__tile, .xmb__item:focus-visible .xmb__tile {
  transform: rotateY(0) rotateX(0) scale(1.12);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.45) 0%, rgba(189, 235, 255, 0.18) 55%, rgba(255, 255, 255, 0.26) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 0 28px rgba(189, 235, 255, 0.55), 0 12px 26px rgba(0, 0, 0, 0.35);
}
.xmb__item:hover .xmb__text em, .xmb__item:focus-visible .xmb__text em { opacity: 1; transform: none; }
/* a small lit dot marks the part of the page you are on */
.xmb__item.is-here .xmb__text b::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border-radius: 50%; vertical-align: middle; background: #BDEBFF; box-shadow: 0 0 8px 2px rgba(189, 235, 255, 0.7); }

.xmb__help { position: absolute; left: 30px; right: 20px; bottom: 16px; margin: 0; display: flex; gap: 18px; flex-wrap: wrap; font-size: 0.72rem; letter-spacing: 0.06em; opacity: 0.6; }

/* when rows get tight the blurb would crowd the next one, so only the label swells */
@media (max-height: 520px) and (max-width: 599px) { .xmb__text em { display: none; } }

/* short, wide screens (a phone on its side): two columns so everything still fits */
@media (max-height: 640px) and (min-width: 600px) {
  .xmb__panel { --rows: var(--n2, 8); --pitch: calc((100vh - 90px) / var(--rows)); --pitch: calc((100dvh - 90px) / var(--rows)); width: min(620px, 94vw); }
  .xmb__list { top: 52px; bottom: 34px; }
  .xmb__top { top: 14px; }
  .xmb__help { bottom: 8px; }
}
@media (max-width: 560px) {
  .xmb-tab { padding: 10px 7px 10px 6px; gap: 8px; }
  .xmb-tab__txt { font-size: 0.58rem; }
  .xmb__list { padding-left: 14px; }
  .xmb__top { left: 20px; }
  .xmb__help { left: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .xmb__panel, .xmb__item, .xmb__tile, .xmb__dim, .xmb-tab { transition: none; }
  .xmb__bob { animation: none; }
  .xmb__item { translate: 0 0; opacity: 1; }
}
