/* The dock (R8): the bottom bars magnify under the pointer or a finger. js/ux/dock.js writes --dk (0..1, the falloff, per item) and --de (0..1, the bar is engaged);
   everything below is transform and opacity only. design-research/BACKLOG-5-bencho-features.md section 2. No colour, fill or edge is set here: whatever the strips
   look like stays. The items are inside capsules 56px high that clip in y, so the numbers are small: the glyph (photo, icon, dot, number) grows most, the item a little. */
[data-dock] { --dock-lift: 1; --dock-item: .05; --dock-mk: 1; --dock-dim: .2; --de: 0; }
[data-dock="card"] { --dock-lift: 2; --dock-item: .05; }      /* the landmarks bar: photo 1 to 1.3, an icon 1 to 1.45 (the glyph's growth is set per glyph in js: --gm) */
[data-dock="chip"] { --dock-lift: 1; --dock-item: .05; }     /* POI, rings, legend, stat, radius chips: the dot or number 1 to 1.25 */
[data-dock="seg"]  { --dock-lift: 0; --dock-item: .04; }     /* Home plan modes */
[data-dock="leg"]  { --dock-lift: 0; --dock-item: .04; }      /* Home floor legend */
html.tv [data-dock] { --dock-item: .035; --dock-mk: .7; }                    /* type is already 1.7x on the TV: the growth is 30% smaller */

/* a bar that does not scroll scrubs under a finger: the page must not take the touch (set by js while the bar fits) */
[data-dock][data-scrub="1"] { touch-action: none; }

/* only once the strip has arrived (js adds .dock-live after its entrance): the item's transform is the dock's, whatever GSAP left inline */
[data-dock].dock-live > .dk-i {
  transform: translate3d(0, calc(var(--dk, 0) * var(--dock-lift) * -1px), 0) scale(calc(1 + var(--dk, 0) * var(--dock-item))) !important;
  transform-origin: 50% 50%;
}
[data-dock].dock-live > .dk-i .dk-g { transform: scale(calc(1 + var(--dk, 0) * var(--gm, .25) * var(--dock-mk))); transform-origin: 50% 50%; }
/* neighbours step back while the pointer is on the bar; the one under it and the chosen one stay at full strength */
[data-dock].dock-live > .dk-i:not(.on):not([aria-pressed="true"]):not([aria-selected="true"]):not([aria-current]) {
  opacity: calc(1 - var(--de, 0) * (1 - var(--dk, 0)) * var(--dock-dim)) !important;
}
[data-dock].dock-eng > .dk-i { will-change: transform, opacity; }
[data-dock].dock-eng > .dk-i .dk-g { will-change: transform; }

/* reduced motion: nothing scales or lifts; the opacity step is all that is left, in 120ms */
@media (prefers-reduced-motion: reduce) {
  [data-dock], html.tv [data-dock] { --dock-lift: 0; --dock-item: 0; --dock-mk: 0; }
  [data-dock].dock-live > .dk-i { transition: opacity 120ms linear !important; }
  [data-dock].dock-eng > .dk-i, [data-dock].dock-eng > .dk-i .dk-g { will-change: auto; }
}
