/* ==========================================================
   DOCK
   A shortcut strip along the bottom of the desk. It belongs in
   the scene rather than sitting on top of it: this is a Mac, so
   of course there is a dock.

   Clicking a tile does not open anything. It dims every other
   object and lights one, which is the whole point: a visitor
   learns where a thing lives instead of being teleported to it.
   ========================================================== */
.dock {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    z-index: 120;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 20px;
    background: rgba(28, 28, 32, 0.52);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 14px 44px rgba(0, 0, 0, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(22px) saturate(170%);
    -webkit-backdrop-filter: blur(22px) saturate(170%);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

/* A window or page covers the desk, so the shortcuts to it are noise. */
body.window-open .dock {
    opacity: 0;
    transform: translateX(-50%) translateY(14px);
    pointer-events: none;
}

.dock-item {
    position: relative;
    width: 46px;
    height: 46px;
    padding: 0;
    border: none;
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    /* only transform animates on hover, so the blurred slab behind is
       never re-rasterised while the mouse moves along the row */
    transition: transform 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.4);
}

.dock-item:hover,
.dock-item:focus-visible { transform: translateY(-9px) scale(1.08); }
.dock-item:focus-visible { outline: 2px solid #FFD34D; outline-offset: 3px; }
.dock-item:active { transform: translateY(-4px) scale(1.02); }

.dock-item img,
.dock-item svg {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    display: block;
    pointer-events: none;
}

/* the running-app dot, lit while this object is the one being pointed at */
.dock-item::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    width: 4px;
    height: 4px;
    margin-left: -2px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.dock-item.pointing::after { opacity: 1; }

/* name above the tile, the way a dock does it */
.dock-label {
    position: absolute;
    bottom: 58px;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 10px;
    border-radius: 7px;
    background: rgba(22, 22, 26, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.14);
    font-family: 'SF Pro Rounded', ui-rounded, -apple-system, sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

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

/* ---- the pointed-at object ----
   Every other outline is turned off by .dock-dimmed, so this is the only
   lit thing in the scene. That isolation is what makes it readable; a
   seventh glow among six others would not be. */
.studio-wrapper.dock-dimmed .hitbox.pulsed:not(.dock-target) {
    stroke: transparent !important;
    filter: none !important;
    opacity: 0 !important;
    animation: none !important;
}

.hitbox.dock-target {
    stroke: #FFE9B0 !important;
    stroke-width: 6 !important;
    fill: rgba(255, 198, 96, 0.16) !important;
    opacity: 1 !important;
    filter: drop-shadow(0 0 14px rgba(255, 214, 120, 0.95))
            drop-shadow(0 0 34px rgba(255, 170, 40, 0.65)) !important;
    animation: dockTargetPulse 1.1s ease-in-out infinite !important;
}

@keyframes dockTargetPulse {
    0%, 100% { opacity: 0.72; }
    50%      { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .hitbox.dock-target { animation: none !important; opacity: 1 !important; }
    .dock-item, .dock-item:hover { transition: none; }
}

/* The gate owns everything below 1024px, so the dock never appears there. */
@media (max-width: 1023px) {
    .dock { display: none; }
}
