/* The travel app tab bar with the jumping ink drop: a white tab bar alone on a white page; the chosen tab sits on a
   glossy drop of midnight ink that jumps to the next tab and splashes on it. */
:root {
  --page: #ffffff;          /* the page */
  --bar: #ffffff;           /* the tab bar */
  --ink: #1d2659;           /* the ink of the drop, and the chosen label */
  --icon: #a2a5b3;          /* an icon that is off */
  --icon-hover: #5d6278;    /* an icon under the pointer */
  --on: #ffffff;            /* the icon drawn on the ink */
  --badge: #e0583a;         /* the badge on Trips */
  --rim: rgba(29, 38, 89, 0.07); /* the hairline around 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(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------------------------------------------------------------- the tab bar */
/* as wide as a phone's tab bar, and never wider than the screen */
.bar {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: min(360px, 100%);
  height: 72px;
  padding: 0 6px;
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(247, 248, 252, 1) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 1) inset,
    0 -1px 0 rgba(29, 38, 89, 0.04) inset,
    0 0 0 1px var(--rim),
    0 22px 40px -22px rgba(25, 32, 80, 0.38),
    0 6px 14px -6px rgba(25, 32, 80, 0.14);
}

/* the ink layer: as wide as the bar and taller, so the drop can jump above it; sized in pixels by the script */
.bar__ink {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 128px;
  overflow: visible;
  pointer-events: none;
}

.bar__goo {
  fill: var(--ink);
}

.bar__ripple {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1;
  opacity: 0;
}

.tab {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 7px;
  padding: 9px 0 0;
  border: 0;
  border-radius: 20px;
  background: transparent;
  color: var(--icon);
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.tab:focus {
  outline: none;
}

.tab:focus-visible {
  box-shadow: 0 0 0 2px var(--bar), 0 0 0 3.5px rgba(29, 38, 89, 0.45);
}

/* the press scales this wrapper; GSAP moves the strokes inside the svg */
.tab__art {
  display: block;
  width: 28px;
  height: 28px;
  transition: transform 0.35s cubic-bezier(0.3, 1.6, 0.5, 1);
}

.tab:active .tab__art {
  transform: scale(0.88);
  transition-duration: 0.08s;
}

.tab__icon {
  display: block;
  width: 28px;
  height: 28px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tab__base {
  transition: opacity 0.25s ease, color 0.25s ease;
}

.tab__on {
  stroke: var(--on);
  opacity: 0;
  transition: opacity 0.12s ease 0.2s;
}

.tab.is-on .tab__on {
  opacity: 1;
  transition-delay: 0s;
}

.tab__on path,
.tab__on circle {
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
}

.tab__label {
  --wght: 460;
  font-size: 11px;
  line-height: 14px;
  letter-spacing: 0.01em;
  font-variation-settings: 'wght' var(--wght), 'wdth' 100;
  transition: color 0.3s ease;
}

.tab.is-on .tab__label {
  color: var(--ink);
}

.tab__badge {
  position: absolute;
  top: 4px;
  left: calc(50% + 8px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--badge);
  box-shadow: 0 0 0 2px var(--bar), 0 3px 6px -2px rgba(224, 88, 58, 0.55);
  color: #ffffff;
  font-size: 9.5px;
  line-height: 16px;
  text-align: center;
  font-variation-settings: 'wght' 680, 'wdth' 100;
  pointer-events: none;
}

@media (hover: hover) {
  .tab:not(.is-on):hover {
    color: var(--icon-hover);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tab__art,
  .tab:active .tab__art {
    transition: none;
    transform: none;
  }
}
