/* The notched tab bar: a near-black bar on a white page, with a notch cut in its top edge and a coral disc floating
   in it. The icons in the bar are grey; the one in the disc is white. */
:root {
  --page: #ffffff;          /* the page */
  --bar: #151519;           /* the bar */
  --icon: #8b8b96;          /* an icon in the bar */
  --bubble: #ff5b3a;        /* the disc */
  --on: #ffffff;            /* the icon in the disc, the name under it */
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

/* quick taps never become a double tap that zooms the page */
html {
  touch-action: manipulation;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--bar);
  font-family: 'Lexend 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: 60px 16px 40px;
}

/* ---------------------------------------------------------------- the bar */
.bar {
  position: relative;
  width: min(400px, 100%);
  height: 76px;
}

.bar__shape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.bar__shape path {
  fill: var(--bar);
}

/* the disc: its middle on the notch, moved by the script */
.bar__bubble {
  position: absolute;
  left: -29px;
  top: -31px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--bubble);
  box-shadow: 0 10px 22px -10px rgba(255, 91, 58, 0.45);
  will-change: transform;
}

/* the name of the tab that is on, under the disc */
.bar__label {
  position: absolute;
  left: 0;
  top: 47px;
  width: 90px;
  margin-left: -45px;
  font-size: 12px;
  font-weight: 560;
  letter-spacing: 0.02em;
  text-align: center;
  color: var(--on);
  pointer-events: none;
}

/* ---------------------------------------------------------------- the tabs */
.tab {
  position: absolute;
  top: 0;
  display: grid;
  place-items: center;
  width: 64px;
  height: 76px;
  margin-left: -32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--icon);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.tab svg {
  width: 26px;
  height: 26px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: color 0.3s ease;
}

.tab.is-on {
  color: var(--on);
  cursor: default;
}

@media (hover: hover) and (pointer: fine) {
  .tab:not(.is-on):hover {
    color: #c9c9d2;
  }
}

.tab:focus-visible {
  outline: none;
}

.tab:focus-visible svg {
  outline: 2px solid var(--on);
  outline-offset: 6px;
  border-radius: 6px;
}
