/* ==========================================================================
   Liquid glass nav dock.

   Layering (bottom to top):
     .liquid-nav-ambient  soft ground glow that tracks the bead's X
     .liquid-nav-blur     real backdrop blur + SVG warp, CLIPPED to the same
                          liquid path as the bar, so the frost melts too
     svg .liquid-nav-bar  the precise liquid silhouette + socket, one path
     .liquid-nav-bead     glowing bead, transform-only per frame
     .liquid-nav-items    real <button>s at each tab x, for a11y + hit area
   ========================================================================== */

.liquid-nav {
  position: fixed;
  left: 50%;
  bottom: var(--space-5);
  transform: translateX(-50%);
  width: min(84vw, 430px);
  height: 54px;
  z-index: 40;
  /* contain:strict (paint+layout+style+size) clips ALL descendant paint to
     this box regardless of overflow:visible on children - that clipped the
     bead's halo (which sits ~30px above the bar) and the ambient glow's
     intentional bleed. layout+style keeps the isolation without the clip. */
  contain: layout style;
}

.liquid-nav-ambient {
  position: absolute;
  inset: -26px -14px -16px;
  border-radius: 44px;
  /* Follows the bead: --bead-x is written by _positionBead each frame. */
  background:
    /* Tracks the bead. Was a strong orange wash (0.38) that lit the bar from
       below; now a faint blue tint that only grounds the bead. */
    radial-gradient(120px 70px at var(--bead-x, 50%) 78%, rgba(90, 130, 200, 0.12), transparent 72%),
    radial-gradient(70% 90% at 50% 100%, rgba(30, 64, 175, 0.10), transparent 72%);
  filter: blur(16px);
  pointer-events: none;
  z-index: 0;
}

.liquid-nav-blur {
  position: absolute;
  inset: 0;
  /* Clipped to the live bar outline (path kept in sync in _render), so the
     socket is a genuine void in the frost, not a rectangle peeking through. */
  clip-path: url(#nav-bar-clip);
  /* Same split as .glass-refract (see glass.css): backdrop-filter chained
     with a url(#svg-filter) renders as a flat opaque block in current
     Chromium. blur/saturate stay in backdrop-filter; the warp is a separate
     regular `filter`. */
  -webkit-backdrop-filter: blur(15px) saturate(130%);
  backdrop-filter: blur(15px) saturate(130%);
  filter: url(#liquid-refract-soft);
  background: rgba(248, 250, 253, 0.34);
  z-index: 1;
}

.liquid-nav-svg {
  position: relative;
  z-index: 2;
  display: block;
  /* SVG's UA default is overflow:hidden (unlike other elements) - without
     this the bead halo, which sits ~30px above the 0..70 viewBox, is sliced
     off at the top and reads as a halved circle. */
  overflow: visible;
}

.liquid-nav-bar {
  fill: url(#nav-bar-fill);
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 1;
}

.liquid-nav-bar-sheen {
  pointer-events: none;
  opacity: 0.9;
}

.liquid-nav-bar-shadow {
  fill: rgba(15, 40, 80, 0.30);
  filter: blur(11px);
  transform: translateY(8px);
  opacity: 0.5;
}

/* ---- bead ------------------------------------------------------------- */

/* Soft blue, matte. The halo and the coloured drop-shadow were what made
   this glow; both are dialled right down so the bead reads as a solid marker
   sitting on the bar rather than a light source behind it. */
.bead-halo {
  opacity: 0.45;
}

.bead-mid {
  fill: rgba(96, 136, 205, 0.16);
  filter: blur(3px);
}

.bead-core {
  /* A neutral, tight shadow for depth only — the old one was a wide warm
     bloom, which is glow by another name. */
  filter: drop-shadow(0 2px 3px rgba(20, 40, 80, 0.30));
}

/* Specular highlight softened: at 0.75 white it was the brightest thing on
   the bar and did most of the "lit from within" work. */
.bead-spec {
  fill: rgba(255, 255, 255, 0.30);
  transform: translate(-3px, -4px);
  filter: blur(1.6px);
}

.bead-contact {
  fill: rgba(40, 70, 130, 0.16);
  filter: blur(4px);
  transform: translate(0, 15px);
}

.bead-halo, .bead-mid, .bead-core, .bead-spec { cursor: grab; }
.liquid-nav.is-dragging .liquid-nav-bead * { cursor: grabbing; }

/* ---- items ------------------------------------------------------------ */

.liquid-nav-items {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.liquid-nav-item {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  height: 54px;
  width: 52px;
  /* Content sits below the deepest socket (~15px rest) so the dip never
     eats into an icon. */
  padding-top: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  pointer-events: auto;
  color: var(--text-tertiary);
  transition: color var(--dur-med) var(--ease-out);
}

.liquid-nav-icon {
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  transform: scale(calc(1 + var(--push, 0) * 0.12));
  transition: transform var(--dur-fast) var(--ease-out);
}

.liquid-nav-icon svg { width: 100%; height: 100%; }

.liquid-nav-label {
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.01em;
  opacity: calc(0.45 + var(--push, 0) * 0.55);
}

.liquid-nav-item.is-active {
  color: var(--ebid-primary);
}

.liquid-nav-item.is-active .liquid-nav-label {
  color: var(--ebid-primary-dark);
}

@media (min-width: 900px) {
  .liquid-nav {
    left: auto;
    right: var(--space-6);
    bottom: var(--space-6);
    transform: none;
    width: 400px;
  }
}

/* Gradient stops for the dock, driven from tokens so the bar follows the
   theme. stop-color is a genuine CSS property on <stop>, so this works
   without touching the SVG markup per theme. */
.nav-stop-top { stop-color: var(--nav-bar-top); }
.nav-stop-bottom { stop-color: var(--nav-bar-bottom); }
.sheen-stop-0 { stop-color: var(--nav-sheen-0); }
.sheen-stop-1 { stop-color: var(--nav-sheen-1); }
.sheen-stop-2 { stop-color: var(--nav-sheen-2); }
