/* Live backdrop refraction: the displacement map samples toward the lens centre.
   Browsers without SVG backdrop filters retain a translucent glass fallback. */
.back-to-top-filter { position:absolute; pointer-events:none; }
.back-to-top {
 position:fixed; right:max(16px,env(safe-area-inset-right)); bottom:max(16px,env(safe-area-inset-bottom));
 z-index:20; display:grid; place-items:center; width:48px; height:48px; padding:0;
 border:1px solid #ffffff99; border-radius:50%; color:#111315;
 background:linear-gradient(135deg,#ffffff12,#ffffff03 45%,#ffffff0a);
 -webkit-backdrop-filter:blur(3px) saturate(125%);
 backdrop-filter:blur(3px) saturate(125%);
 box-shadow:inset 0 1px 2px #fff,inset 0 -1px 2px #ffffff66,0 4px 18px #0003,0 0 0 1px #11131544;
 cursor:pointer;
}
@supports (backdrop-filter: url("#back-to-top-lens")) {
 .back-to-top { backdrop-filter:url("#back-to-top-lens") saturate(125%); }
}
.back-to-top[hidden] { display:none; }
.back-to-top svg { width:22px; height:22px; filter:drop-shadow(0 1px 1px #ffffffaa); }
.back-to-top:focus-visible { outline:3px solid #111315; outline-offset:3px; box-shadow:0 0 0 6px #fff; }
@media (hover:hover) { .back-to-top:hover { background-color:#ffffff08; } }
@media (min-width:768px) { .back-to-top { right:max(24px,env(safe-area-inset-right)); bottom:max(24px,env(safe-area-inset-bottom)); } }
@media (forced-colors:active) { .back-to-top { background:ButtonFace; color:ButtonText; border:1px solid ButtonText; backdrop-filter:none; } }

/* Specular rim and press response, without continuous animation. */
.back-to-top::after { content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none; background:linear-gradient(140deg,#ffffff18,transparent 24%,transparent 78%,#ffffff0a); box-shadow:inset 1px 1px 1px #ffffffaa,inset -1px -1px 1px #ffffff33; }
.back-to-top svg { position:relative; z-index:1; filter:drop-shadow(0 0 1px #fff) drop-shadow(0 0 2px #fff); }
.back-to-top { transition:transform 140ms ease; }
.back-to-top:active { transform:scale(.94); }
@media (prefers-reduced-motion:reduce) { .back-to-top { transition:none; } .back-to-top:active { transform:none; } }
@media (prefers-reduced-transparency:reduce) { .back-to-top { background:#f4f3ef; backdrop-filter:none; -webkit-backdrop-filter:none; } }
