/* =========================================================
   PROJECT DOCK — macOS-style, shared by all project pages

   Markup is rendered by /dock.js.
   Magnification: dock.js sets --s (0…1) on each item
   depending on the cursor distance. The bar keeps its
   height and only widens; magnified icons grow upward
   out of it.
========================================================= */

.project-dock {
  --icon: 60px;
  --icon-max: 94px;
  --pad: 10px;

  position: fixed;
  z-index: 999;

  left: 50%;
  bottom: 20px;

  transform: translateX(-50%);

  display: flex;
  align-items: flex-end;

  gap: 14px;

  height: calc(var(--icon) + var(--pad) * 2);

  padding: var(--pad) calc(var(--pad) + 1px);

  border-radius: 27px;

  background: #1d1d1f;

  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .04) inset,
    0 18px 40px rgba(0, 0, 0, .22),
    0 4px 12px rgba(0, 0, 0, .12);

  opacity: 0;
  translate: 0 24px;

  transition:
    opacity .6s ease,
    translate .7s cubic-bezier(.22, 1, .36, 1);
}

.project-dock.ready {
  opacity: 1;
  translate: 0 0;
}


/* =========================================================
   ITEM
========================================================= */

.dock-item {
  --s: 0;

  position: relative;

  flex: 0 0 auto;

  width:
    calc(var(--icon) + (var(--icon-max) - var(--icon)) * var(--s));

  height:
    calc(var(--icon) + (var(--icon-max) - var(--icon)) * var(--s));

  display: block;

  border-radius: 24%;

  background: #2a2a2d;

  box-shadow:
    0 calc(var(--s) * 10px) calc(var(--s) * 22px)
      rgba(0, 0, 0, calc(var(--s) * .28));

  -webkit-tap-highlight-color: transparent;

  transition:
    width .2s cubic-bezier(.25, 1, .5, 1),
    height .2s cubic-bezier(.25, 1, .5, 1),
    box-shadow .2s ease;
}

.dock-item img {
  width: 100%;
  height: 100%;

  display: block;

  object-fit: cover;

  border-radius: inherit;

  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.dock-item:active img {
  filter: brightness(.8);
}

.dock-item:focus-visible {
  outline: 2px solid #0a84ff;
  outline-offset: 3px;
}


/* =========================================================
   CURRENT PAGE INDICATOR
========================================================= */

.dock-item.current::after {
  content: "";

  position: absolute;

  left: 50%;
  bottom: -6px;

  width: 4px;
  height: 4px;

  border-radius: 50%;

  background: rgba(255, 255, 255, .45);

  transform: translateX(-50%);
}


/* =========================================================
   TOOLTIP
========================================================= */

.dock-tooltip {
  position: absolute;

  left: 50%;
  bottom: calc(100% + 10px);

  transform:
    translateX(-50%)
    translateY(4px);

  padding: 8px 13px;

  border-radius: 11px;

  background: #2c2c2e;

  color: #fff;

  font-size: 14px;
  font-weight: 500;
  letter-spacing: -.01em;
  line-height: 1.2;

  white-space: nowrap;

  opacity: 0;

  pointer-events: none;

  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .06) inset,
    0 6px 18px rgba(0, 0, 0, .18);

  transition:
    opacity .15s ease,
    transform .2s cubic-bezier(.22, 1, .36, 1);
}

.dock-item:hover .dock-tooltip,
.dock-item:focus-visible .dock-tooltip {
  opacity: 1;

  transform:
    translateX(-50%)
    translateY(0);
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 768px) {

  .project-dock {
    --icon: 56px;
    --icon-max: 56px;
    --pad: 9px;

    bottom: 14px;

    gap: 12px;

    border-radius: 25px;

    max-width: calc(100% - 24px);
  }

  .dock-tooltip {
    display: none;
  }
}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

  .project-dock {
    --icon-max: var(--icon);
  }

  .project-dock,
  .dock-item {
    transition: none;
  }
}


/* Keep the end of the page clear of the dock. */

body {
  padding-bottom: 112px;
}
