/* The magnifying dock: a row of app icons on a tray. Under the pointer the icons grow, the nearest the most, and
   push the others aside so they never overlap; the tray grows with them. A pressed icon jumps, and a small line under
   it says the app is open. */
:root {
  --page: #ffffff;          /* the page */
  --size: 62px;             /* an icon at rest (the image keeps a margin for its shadow) */
  --gap: 4px;               /* between two icons */
  --pad: 8px;               /* inside the tray */
  --tray: rgba(242, 242, 246, 0.94);
  --ink: #1d1d1f;
}

* {
  box-sizing: border-box;
}

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

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

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

/* ---------------------------------------------------------------- the dock */
/* the script places everything: the icons from the middle of the dock, the tray as wide as the icons need */
.dock {
  position: relative;
  height: calc(var(--size) + var(--pad) * 2);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.dock__tray {
  position: absolute;
  left: 50%;
  bottom: 0;
  height: 100%;
  border-radius: 26px;
  background: var(--tray);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06), 0 24px 44px -26px rgba(0, 0, 0, 0.38);
}

.dock__item {
  position: absolute;
  left: 50%;
  bottom: var(--pad);
  width: var(--size);
  height: var(--size);
  margin-left: calc(var(--size) / -2);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: none;
  cursor: pointer;
  transform-origin: 50% 100%;
  will-change: transform;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

.dock__item:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.dock__icon {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  -webkit-user-drag: none;
}

/* on a phone two icons stay hidden, so the others have room to swell */
@media (max-width: 480px) {
  .dock__item[data-extra] {
    display: none;
  }
}

/* the line under an open app */
.dock__open {
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 12px;
  height: 3px;
  margin-left: -6px;
  border-radius: 2px;
  background: var(--ink);
  opacity: 0;
  transform-origin: 50% 50%;
}

/* the name above the icon pointed at */
.dock__tip {
  position: absolute;
  left: 50%;
  bottom: 0;
  padding: 6px 11px;
  border-radius: 9px;
  background: rgba(29, 29, 31, 0.92);
  color: #fff;
  font-size: 12.5px;
  font-weight: 560;
  letter-spacing: 0.01em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}
