/* =========================================================
   DOCK NAV  (bottom, fixed)
   Edit the variables in the first block to change the look.
   ========================================================= */
.dock {
  --dock-panel: rgba(24, 24, 28, 0.78);
  --dock-edge: rgba(255, 255, 255, 0.09);
  --dock-tile: #2b2b31;
  --dock-tile-edge: rgba(255, 255, 255, 0.08);
  --dock-ink: #f4f4f5;
  --dock-label-bg: #f4f4f5;
  --dock-label-ink: #18181b;
  --dock-dot: rgba(255, 255, 255, 0.7);
  --dock-sep: rgba(255, 255, 255, 0.14);
  --dock-accent: #0a84ff;
  --dock-badge: #ff453a;

  /* these are set by js/dock.js, the values below are only fallbacks */
  --dock-base: 50px;
  --dock-thickness: 68px;
  --dock-gap: 10px;
  --dock-pad: 9px;
  --dock-reach: 0px;

  position: fixed;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 50;
  box-sizing: border-box;
  height: var(--dock-thickness);
  padding-bottom: var(--dock-pad);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: var(--dock-gap);
  color: var(--dock-ink);
}

/* the panel behind the icons */
.dock::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: calc(100% - var(--dock-reach));
  height: 100%;
  transform: translateX(-50%);
  border-radius: calc(var(--dock-thickness) * 0.32);
  background: var(--dock-panel);
  border: 1px solid var(--dock-edge);
  box-shadow: 0 16px 32px -16px rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  z-index: -1;
}

.dock__item {
  position: relative;
  flex: none;
  display: block;
  width: var(--dock-base);
  height: var(--dock-base);
  color: inherit;
  text-decoration: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.dock__tile {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--dock-base);
  height: var(--dock-base);
  display: grid;
  place-items: center;
  border-radius: calc(var(--dock-base) * 0.28);
  background: var(--dock-tile);
  border: 1px solid var(--dock-tile-edge);
  transform-origin: 0 0;
  will-change: transform;
}

.dock__tile svg {
  width: 46%;
  height: 46%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dock__item:active .dock__tile { filter: brightness(0.8); }

.dock__item:focus-visible .dock__tile {
  outline: 2px solid var(--dock-accent);
  outline-offset: 2px;
}

/* dot under the current page */
.dock__item[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(var(--dock-pad) * -0.62);
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--dock-dot);
}

/* label shown on hover / keyboard focus */
.dock__item::after {
  content: attr(aria-label);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  padding: 4px 10px;
  border-radius: 7px;
  background: var(--dock-label-bg);
  color: var(--dock-label-ink);
  font: 500 0.8rem/1.3 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.dock__item:hover::after,
.dock__item:focus-visible::after { opacity: 1; }

/* optional number badge: <span class="dock__badge">3</span> inside .dock__tile */
.dock__badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--dock-badge);
  color: #fff;
  font: 600 11px/18px system-ui, sans-serif;
  text-align: center;
}

.dock__sep {
  flex: none;
  width: 1px;
  height: calc(var(--dock-base) * 0.62);
  margin-bottom: calc(var(--dock-base) * 0.19);
  background: var(--dock-sep);
}

/* keeps page content from hiding behind the dock (class added by js/dock.js) */
body.has-dock { padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }

/* phones / touch: no hover labels, no magnification */
@media (hover: none) {
  .dock__item::after { display: none; }
}