/* Floating contact button: click = back to top, hover (or first tap on touch) = fan of contact links.
   Shared by every page: include css/fab.css + js/fab.js and the .fab markup before </body>. */
.fab { position: fixed; right: clamp(16px, 2.4vw, 32px); bottom: clamp(16px, 2.4vw, 32px); z-index: 60; width: 64px; height: 64px; }
.fab-main { position: relative; z-index: 2; width: 64px; height: 64px; border: 0; border-radius: 50%; background: var(--forest); color: var(--white); cursor: pointer; display: grid; place-items: center; box-shadow: 0 16px 34px -14px rgba(14,59,46,.75); transition: transform .3s var(--ease), background-color .2s; }
.fab-main:hover { background: var(--forest-2); }
.fab-main svg.fab-arrow { width: 18px; height: 18px; margin-right: 24px; }
.fab-main::after { content: ""; position: absolute; left: calc(50% - 4px); width: 26px; height: 24px; background: currentColor; pointer-events: none;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 26' fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 4L2 22' stroke-width='1.6'/%3E%3Cg transform='translate(9 3) scale(.87)' stroke-width='2'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.12.96.35 1.9.69 2.8a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.9.34 1.84.57 2.8.69a2 2 0 0 1 1.73 2.04z'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat; }
.fab-ring { position: absolute; inset: 0; width: 64px; height: 64px; transform: rotate(-90deg); pointer-events: none; }
.fab-ring circle { fill: none; stroke-width: 3; }
.fab-ring .track { stroke: rgba(255,255,255,.14); }
.fab-ring .bar { stroke: var(--green); stroke-linecap: round; stroke-dasharray: 188.5; stroke-dashoffset: 188.5; transition: stroke-dashoffset .15s linear; }

/* the fan: items sit behind the main button and move out along a quarter circle (up and to the left) */
.fab-items { list-style: none; margin: 0; padding: 0; }
.fab-item { position: absolute; left: 8px; top: 8px; width: 48px; height: 48px; z-index: 1;
  transform: translate(0, 0) scale(.4); opacity: 0; visibility: hidden;
  transition: transform .42s cubic-bezier(.3, 1.5, .5, 1), opacity .25s, visibility .42s; transition-delay: calc((var(--n) - var(--i)) * 30ms); }
.fab-item a { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--white); color: var(--forest); text-decoration: none; box-shadow: 0 10px 24px -12px rgba(14,59,46,.6), 0 0 0 1px var(--line); transition: background-color .2s, color .2s, transform .2s; }
.fab-item a:hover, .fab-item a:focus-visible { background: var(--green); color: var(--ink); transform: scale(1.08); }
.fab-item svg { width: 22px; height: 22px; }
.fab-item .fab-label { position: absolute; right: calc(100% + 10px); top: 50%; transform: translate(6px, -50%); padding: 5px 10px; border-radius: 8px; background: var(--ink); color: var(--white); font-size: 13px; font-weight: 600; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.fab-item a:hover + .fab-label, .fab-item a:focus-visible + .fab-label { opacity: 1; transform: translate(0, -50%); }

.fab.is-open .fab-item { opacity: 1; visibility: visible; transition-delay: calc(var(--i) * 45ms);
  /* --x / --y are set by js/fab.js: a quarter circle from straight up to straight left */
  transform: translate(var(--x, 0), var(--y, 0)) scale(1); }
.fab.is-open .fab-main { transform: rotate(0deg); }
.fab-hint { position: absolute; right: 74px; top: 50%; transform: translateY(-50%); padding: 6px 12px; border-radius: 8px; background: var(--white); color: var(--ink); font-size: 13px; font-weight: 600; white-space: nowrap; box-shadow: 0 8px 20px -12px rgba(14,59,46,.6); opacity: 0; pointer-events: none; transition: opacity .2s; }
.fab.is-open .fab-hint { opacity: 0; }
.fab:not(.is-open) .fab-main:hover ~ .fab-hint { opacity: 1; }

.fab-main .fab-chat { display: none; }

@media (prefers-reduced-motion: reduce) { .fab-item, .fab-main, .fab-ring .bar { transition: none; } }
@media (max-width: 560px) { .fab { width: 56px; height: 56px; } .fab-main, .fab-ring { width: 56px; height: 56px; } .fab-item { left: 4px; top: 4px; } }
