/*
 * BTN mobile dock
 * A single smoked-glass surface with thumb-sized navigation targets.
 */

.btn-mobile-dock {
  display: none;
}

@media (max-width: 767px), (max-height: 500px) and (hover: none) and (pointer: coarse) {
  :root {
    --btn-dock-ink: oklch(0.94 0.012 48);
    --btn-dock-muted: oklch(0.74 0.018 48);
    --btn-dock-coral: oklch(0.72 0.19 34);
    --btn-dock-coral-soft: oklch(0.83 0.11 44);
    --btn-dock-live: oklch(0.66 0.24 27);
    --btn-dock-ease: cubic-bezier(0.22, 1, 0.36, 1);
  }

  body.wp-theme-generatepress {
    padding-bottom: calc(92px + env(safe-area-inset-bottom)) !important;
  }

  .btn-mobile-dock {
    position: fixed;
    z-index: 1000;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    justify-content: center;
    padding: 0 10px max(9px, env(safe-area-inset-bottom));
    pointer-events: none;
  }

  .btn-mobile-dock__surface {
    position: relative;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: min(100%, 480px);
    min-height: 68px;
    overflow: hidden;
    color: var(--btn-dock-ink);
    background: rgba(27, 26, 25, 0.84);
    background: color-mix(in oklch, oklch(0.18 0.005 70) 84%, transparent);
    border: 1px solid oklch(0.93 0.018 48 / 0.16);
    border-radius: 23px;
    box-shadow:
      0 18px 42px oklch(0.06 0.01 30 / 0.48),
      inset 0 1px 0 oklch(0.97 0.01 50 / 0.09);
    backdrop-filter: blur(19px) saturate(150%);
    -webkit-backdrop-filter: blur(19px) saturate(150%);
    pointer-events: auto;
    isolation: isolate;
  }

  .btn-mobile-dock__surface::before {
    position: absolute;
    z-index: -1;
    top: -45px;
    left: 50%;
    width: 190px;
    height: 90px;
    border-radius: 50%;
    background: color-mix(in oklch, var(--accent) 10%, transparent);
    filter: blur(28px);
    transform: translateX(-50%);
    content: "";
    pointer-events: none;
  }

  .btn-mobile-dock__item {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 66px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 3px;
    padding: 7px 2px 6px;
    color: var(--btn-dock-muted);
    text-align: center;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition:
      color 220ms var(--btn-dock-ease),
      transform 140ms var(--btn-dock-ease);
    touch-action: manipulation;
  }

  .btn-mobile-dock__item::after {
    position: absolute;
    top: 0;
    left: 50%;
    width: 19px;
    height: 2px;
    border-radius: 0 0 999px 999px;
    background: var(--accent);
    opacity: 0;
    transform: translateX(-50%) scaleX(0.35);
    transition:
      opacity 220ms var(--btn-dock-ease),
      transform 220ms var(--btn-dock-ease);
    content: "";
  }

  .btn-mobile-dock__item:is(:hover, :focus-visible),
  .btn-mobile-dock__item.is-current {
    color: var(--btn-dock-ink);
  }

  .btn-mobile-dock__item.is-current::after {
    opacity: 1;
    transform: translateX(-50%) scaleX(1);
  }

  .btn-mobile-dock__item:focus-visible {
    outline: 2px solid var(--btn-dock-coral-soft);
    outline-offset: -4px;
    border-radius: 18px;
  }

  .btn-mobile-dock__item:active {
    transform: scale(0.93);
  }

  .btn-mobile-dock__icon {
    position: relative;
    display: grid;
    width: 34px;
    height: 31px;
    place-items: center;
    border-radius: 12px;
    transition:
      color 220ms var(--btn-dock-ease),
      background-color 220ms var(--btn-dock-ease),
      transform 220ms var(--btn-dock-ease);
  }

  .btn-mobile-dock__icon svg {
    width: 23px;
    height: 23px;
    overflow: visible;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .btn-mobile-dock__play {
    fill: currentColor;
    stroke: none;
  }

  .btn-mobile-dock__item:is(:hover, :focus-visible) .btn-mobile-dock__icon,
  .btn-mobile-dock__item.is-current .btn-mobile-dock__icon {
    color: var(--accent);
    background: color-mix(in oklch, var(--accent) 10%, transparent);
    transform: translateY(-1px);
  }

  .btn-mobile-dock__label {
    overflow: hidden;
    max-width: 100%;
    font-family: "Raleway", sans-serif;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: 0.045em;
    text-transform: uppercase;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .btn-mobile-dock__item--publish {
    color: var(--accent);
  }

  .btn-mobile-dock__item--publish .btn-mobile-dock__icon {
    width: 42px;
    height: 42px;
    color: var(--contrast);
    background: var(--accent);
    border: 1px solid color-mix(in oklch, var(--accent) 66%, transparent);
    border-radius: 15px;
    box-shadow:
      0 7px 15px oklch(0.08 0.005 70 / 0.42),
      inset 0 1px 0 oklch(0.99 0.01 75 / 0.5);
    transform: translateY(-4px);
  }

  .btn-mobile-dock__item--publish .btn-mobile-dock__icon svg {
    width: 25px;
    height: 25px;
    stroke-width: 2;
  }

  .btn-mobile-dock__item--publish .btn-mobile-dock__label {
    margin-top: -4px;
    color: var(--accent);
    font-weight: 700;
  }

  .btn-mobile-dock__item--publish:is(:hover, :focus-visible) .btn-mobile-dock__icon,
  .btn-mobile-dock__item--publish.is-current .btn-mobile-dock__icon {
    color: var(--contrast);
    background: var(--accent);
    transform: translateY(-5px) scale(1.03);
  }

  .btn-mobile-dock__item--live {
    color: var(--btn-dock-muted);
  }

  .btn-mobile-dock__item--live .btn-mobile-dock__icon {
    width: 34px;
    height: 31px;
    color: inherit;
    background: transparent;
    box-shadow: none;
  }

  .btn-mobile-dock__live-dot {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--btn-dock-live);
    box-shadow:
      0 0 0 3px oklch(0.66 0.24 27 / 0.12),
      0 2px 7px oklch(0.55 0.23 27 / 0.38);
    animation: btn-dock-live-blink 1.35s ease-in-out infinite;
    will-change: transform, opacity;
  }

  .btn-mobile-dock__item--live:is(:hover, :focus-visible) .btn-mobile-dock__icon {
    color: var(--btn-dock-ink);
    background: transparent;
  }

  .btn-mobile-dock__item--plan {
    color: var(--btn-dock-coral-soft);
  }

  .btn-mobile-dock__icon--peach {
    width: 38px;
    filter: drop-shadow(0 3px 5px oklch(0.4 0.13 28 / 0.34));
    transform-origin: 50% 70%;
  }

  .btn-mobile-dock__icon--peach .btn-mobile-dock__peach-svg {
    width: 29px;
    height: 29px;
    fill: initial;
    stroke: none;
  }

  .btn-mobile-dock__item--plan:is(:hover, :focus-visible) .btn-mobile-dock__icon,
  .btn-mobile-dock__item--plan.is-current .btn-mobile-dock__icon {
    background: transparent;
    filter: saturate(1.08);
  }

  @keyframes btn-dock-live-blink {
    0%,
    44%,
    100% {
      opacity: 1;
      transform: scale(1);
    }
    52%,
    64% {
      opacity: 0.24;
      transform: scale(0.84);
    }
  }
}

@media (max-width: 350px) {
  .btn-mobile-dock {
    padding-right: 6px;
    padding-left: 6px;
  }

  .btn-mobile-dock__surface {
    border-radius: 20px;
  }

  .btn-mobile-dock__label {
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn-mobile-dock *,
  .btn-mobile-dock *::before,
  .btn-mobile-dock *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .btn-mobile-dock__live-dot {
    animation: none !important;
  }
}
