/* The nav bar that tucks the extra links into More. White ground, one ink, one accent for the count and the grip
   while it is held. Everything inside the bar is placed by the script (GSAP x), the CSS only draws. */
:root {
  --paper: #ffffff;        /* the background */
  --ink: #111214;          /* the current link, the More word */
  --soft: #6d6e72;         /* the other links */
  --line: rgba(17, 18, 20, 0.09); /* the hairline around the bar and the panel */
  --fill: #f2f2f1;         /* the soft pill under the current or pointed link */
  --accent: #3d5afe;       /* the count in More and the grip while held */
  --on-accent: #ffffff;    /* the number on the count */
  --grip: #d6d6d3;         /* the grip at rest */
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.stage {
  height: 100vh;
  height: 100dvh;
  display: grid;
  place-items: center;
  padding: 16px;
}
/* room under the bar for the panel, so the whole thing sits in the middle */
.wrap {
  position: relative;
  height: min(250px, 70vh);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding-top: min(24px, 4vh);
}
.bar {
  position: relative;
  height: 56px;
  width: 460px;
  flex: none;
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 0 0 1px var(--line), 0 1px 1px rgba(17, 18, 20, 0.03), 0 10px 30px -12px rgba(17, 18, 20, 0.16);
}
.bar__pill {
  position: absolute;
  left: 0;
  top: 8px;
  height: 40px;
  width: 60px;
  border-radius: 12px;
  background: var(--fill);
}
.bar__link {
  position: absolute;
  left: 0;
  top: 8px;
  height: 40px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  white-space: nowrap;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  font-variation-settings: 'wdth' 100;
  letter-spacing: -0.005em;
  color: var(--soft);
  text-decoration: none;
  transition: color 0.25s;
}
.bar__link[aria-current='page'] { color: var(--ink); }
@media (hover: hover) { .bar__link:hover { color: var(--ink); } }
.bar__link:focus-visible, .more:focus-visible, .panel__row:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.more {
  position: absolute;
  right: 8px;
  top: 8px;
  height: 40px;
  padding: 0 10px 0 14px;
  display: flex;
  align-items: center;
  gap: 7px;
  appearance: none;
  border: 0;
  background: none;
  border-radius: 12px;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.3s;
}
.more.is-on { background: var(--fill); }
.more__badge {
  position: relative;
  height: 18px;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 11px;
  font-weight: 650;
  line-height: 18px;
  text-align: center;
  overflow: hidden;
}
.more__num { display: block; }
.more__num + .more__num { position: absolute; inset: 0; }
.more__chev { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.panel {
  position: absolute;
  right: 0;
  top: 64px;
  width: 180px;
  padding: 6px;
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 0 0 1px var(--line), 0 18px 40px -16px rgba(17, 18, 20, 0.22);
  transform-origin: 85% 0;
  z-index: 2;
}
.panel[hidden] { display: block; visibility: hidden; }
.panel__row {
  display: flex;
  align-items: center;
  height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--soft);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.panel__row[aria-current='page'] { color: var(--ink); background: var(--fill); }
@media (hover: hover) { .panel__row:hover { color: var(--ink); background: var(--fill); } }
/* the grip: a thin rounded line beside the bar's edge, the only handle of the piece */
.grip {
  flex: none;
  width: 16px;
  height: 56px;
  display: grid;
  place-items: center;
  cursor: ew-resize;
  touch-action: none;
  border-radius: 8px;
  outline: none;
}
.grip:focus-visible .grip__bar { background: var(--accent); }
.grip__bar {
  display: block;
  width: 4px;
  height: 26px;
  border-radius: 2px;
  background: var(--grip);
}
