/* ==========================================================================
   VelveFlix — кнопка «наверх» (FAB). Дизайн-система 2026, токены vf-*.
   Круглая 44px, стекло на тёмном фоне, появляется по скроллу (JS .is-visible).
   ========================================================================== */
.vf-totop {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: var(--vf-z-sticky, 100);

  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;

  color: var(--vf-text, #F2F4F8);
  background: color-mix(in srgb, var(--vf-surface-2, #1E212B) 78%, transparent);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  backdrop-filter: blur(12px) saturate(160%);
  border: 1px solid var(--vf-line-strong, #3A4150);
  border-radius: var(--vf-radius-round, 50%);
  box-shadow: var(--vf-shadow-2, 0 4px 12px rgba(0,0,0,.45));
  cursor: pointer;

  opacity: 0;
  transform: translateY(8px) scale(.92);
  pointer-events: none;
  transition:
    opacity var(--vf-dur-base, 180ms) var(--vf-ease-out, cubic-bezier(0,0,.2,1)),
    transform var(--vf-dur-base, 180ms) var(--vf-ease-out, cubic-bezier(0,0,.2,1)),
    background var(--vf-dur-fast, 120ms) var(--vf-ease-standard, ease),
    border-color var(--vf-dur-fast, 120ms) var(--vf-ease-standard, ease);
}
.vf-totop[hidden] { display: none; }

.vf-totop.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.vf-totop:hover {
  color: var(--vf-text-on-accent, #1A0E0C);
  background: var(--vf-accent, #FF5C49);
  border-color: var(--vf-accent, #FF5C49);
}
.vf-totop:active {
  background: var(--vf-accent-press, #E84A38);
  transform: translateY(0) scale(.96);
}
.vf-totop:focus-visible {
  outline: 2px solid var(--vf-focus-ring, #6AA8FF);
  outline-offset: 2px;
}
.vf-totop svg { display: block; }

/* Мобайл: не перекрывать sticky WtW-CTA (полоса bottom:0 на singular тайтлах).
   Когда бар активен — приподнимаем кнопку над ним. */
@media (max-width: 767px) {
  body.has-sticky-cta .vf-totop {
    bottom: calc(72px + max(12px, env(safe-area-inset-bottom)));
  }
}

@media (prefers-reduced-motion: reduce) {
  .vf-totop { transition: opacity var(--vf-dur-fast, 120ms) linear; transform: none; }
  .vf-totop.is-visible { transform: none; }
}
