/* Frame A2Z — floating dock (3D glass keys) */
.floating-menu {
    --menu-accent: var(--coral, #ff7e50);
    --active-index: 0;
    position: fixed;
    z-index: 120;
    right: 50%;
    bottom: calc(18px + env(safe-area-inset-bottom));
    display: grid;
    width: min(500px, calc(100vw - 32px));
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 8px;
    transform: translateX(50%);
    border: 1px solid rgba(190, 255, 236, .2);
    border-radius: 26px;
    background: linear-gradient(180deg, rgba(24, 62, 53, .86), rgba(8, 26, 22, .9));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 4px 0 #06150f, 0 8px 0 #030c0a, 0 26px 50px rgba(0, 0, 0, .55);
    color: rgba(246, 239, 226, .66);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

body { padding-bottom: 100px; }

.floating-link {
    position: relative;
    z-index: 1;
    display: flex;
    min-width: 0;
    min-height: 62px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 0;
    border-radius: 18px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: color .22s ease, background .22s ease, transform .18s ease;
}

.floating-link svg {
    display: block;
    flex: 0 0 auto;
    width: 21px;
    height: 21px;
    overflow: visible;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.9;
    transition: color .22s ease, transform .36s cubic-bezier(.22, 1, .36, 1);
}

.floating-link small {
    overflow: hidden;
    max-width: 100%;
    font: 700 11px/1.1 var(--sans, "Manrope", sans-serif);
    letter-spacing: .02em;
    text-overflow: ellipsis;
}

.floating-link:hover,
.floating-link[aria-current="page"],
.floating-pages[open] > .floating-link {
    color: #ffb79a;
}

.floating-link:hover svg,
.floating-link[aria-current="page"] svg,
.floating-pages[open] > .floating-link svg {
    transform: translateY(-3px) scale(1.1);
}

.floating-link:active { transform: translateY(2px); }

.floating-pages { position: relative; min-width: 0; }
.floating-pages > summary { list-style: none; }
.floating-pages > summary::-webkit-details-marker { display: none; }

.floating-mega-menu {
    position: absolute;
    right: 50%;
    bottom: calc(100% + 18px);
    display: grid;
    width: min(330px, calc(100vw - 32px));
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 14px;
    transform: translateX(50%);
    border: 1px solid rgba(190, 255, 236, .22);
    border-radius: 22px;
    background: rgba(8, 26, 22, .96);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 4px 0 #06150f, 0 30px 50px rgba(0, 0, 0, .6);
    transform-origin: bottom center;
    animation: floating-menu-enter .4s cubic-bezier(.22, 1, .36, 1) both;
}

.floating-mega-menu p {
    grid-column: 1 / -1;
    padding: 2px 8px 8px;
    color: var(--mint, #7fe6cf);
    font: 800 10px/1.2 var(--sans, "Manrope", sans-serif);
    letter-spacing: .14em;
    text-transform: uppercase;
}

.floating-mega-menu a {
    padding: 13px 11px;
    border-radius: 12px;
    background: linear-gradient(180deg, #1c4a3f, #12342d);
    color: #f6efe2;
    font: 700 13px/1.2 var(--sans, "Manrope", sans-serif);
    text-decoration: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 3px 0 #06150f;
    transition: transform .15s ease, box-shadow .15s ease, background .2s ease, color .2s ease;
}

.floating-mega-menu a:hover,
.floating-mega-menu a[aria-current="page"] {
    transform: translateY(-2px);
    background: linear-gradient(180deg, #ff9a72, #ff7040);
    color: #2b0d03;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 5px 0 #b8431a;
}

.floating-mega-menu a:active { transform: translateY(2px); box-shadow: 0 1px 0 #b8431a; }

.floating-indicator {
    position: absolute;
    z-index: 0;
    top: 8px;
    bottom: 8px;
    left: 8px;
    width: calc((100% - 16px) / 4);
    transform: translateX(calc(var(--active-index) * 100%));
    transition: transform .52s cubic-bezier(.22, 1, .36, 1);
    pointer-events: none;
}

.floating-menu.is-initializing .floating-indicator { transition: none; }

.floating-indicator::before {
    position: absolute;
    inset: 0;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 126, 80, .28), rgba(255, 126, 80, .08));
    box-shadow: inset 0 0 0 1px rgba(255, 126, 80, .5), inset 0 2px 8px rgba(0, 0, 0, .35);
    content: "";
}

.floating-indicator::after {
    position: absolute;
    right: 50%;
    bottom: 5px;
    width: 22px;
    height: 4px;
    transform: translateX(50%);
    border-radius: 4px;
    background: var(--menu-accent);
    box-shadow: 0 0 12px rgba(255, 126, 80, .9);
    content: "";
}

.floating-indicator.is-moving::before { animation: floating-dot-spring .48s cubic-bezier(.22, 1, .36, 1); }

.floating-menu :where(a, summary):focus-visible { outline: 3px solid var(--mint, #7fe6cf); outline-offset: 2px; }

@keyframes floating-menu-enter {
    from { opacity: 0; transform: translate(50%, 12px) scale(.96) rotateX(-18deg); }
    to { opacity: 1; transform: translate(50%, 0) scale(1) rotateX(0); }
}

@keyframes floating-dot-spring {
    0%, 100% { transform: scale(1); }
    45% { transform: scale(1.06, .94); }
    75% { transform: scale(.98, 1.02); }
}

@media (max-width: 420px) {
    .floating-menu { bottom: calc(10px + env(safe-area-inset-bottom)); width: calc(100vw - 20px); padding: 6px; border-radius: 22px; }
    .floating-link { min-height: 56px; gap: 3px; }
    .floating-link svg { width: 19px; height: 19px; }
    .floating-link small { font-size: 10px; }
    .floating-indicator { top: 6px; bottom: 6px; left: 6px; width: calc((100% - 12px) / 4); }
}

@media (prefers-reduced-motion: reduce) {
    .floating-link, .floating-link svg, .floating-mega-menu a, .floating-indicator { transition: none; }
    .floating-mega-menu, .floating-indicator.is-moving::before { animation: none; }
}
