/* The liquid glass tab bar: everything you see is drawn by the script in one WebGL canvas; the bar's place and size
   come from the nav below, laid over the canvas with the real links. The colours are here: the script reads them. */
:root {
  --page: #000000;          /* the page */
  --glass: #1b1c22;         /* the tint of the frosted bar */
  --icon: #8e909c;          /* the tabs you are not on */
  --icon-on: #ffffff;       /* the tab under the pointer */
  --accent: #7fd4ff;        /* the tab you are on, under the lens */
  --bar-h: 70px;            /* the height of the bar */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--icon-on);
  font-family: 'Figtree Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

/* the component: the strip of covers, and the bar floating over its lower part */
.tabbar {
  position: relative;
  width: min(420px, calc(100vw - 32px));
  height: 166px;
}

.tabbar__scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* the real links, clear, over the bar drawn in the canvas */
.tabbar__nav {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 10px;
  height: var(--bar-h);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 0 6px;
  border-radius: 999px;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.tabbar__nav.is-dragging {
  cursor: grabbing;
}

.tabbar__tab {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  margin: 6px 2px;
  border-radius: 999px;
  color: transparent;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

/* with WebGL the icons and the words are drawn in the canvas; these stay for the screen readers and as the
   picture when there is no WebGL */
.tabbar__tab svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tabbar__tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 0;
}

html[data-using='pointer'] .tabbar__tab:focus-visible {
  outline: none;
}

/* no WebGL: a plain frosted bar with the links in sight */
.no-gl .tabbar__nav {
  background: color-mix(in srgb, var(--glass) 82%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.no-gl .tabbar__tab {
  color: var(--icon);
}

.no-gl .tabbar__tab[aria-current='page'] {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}
