/* ================= navigation rail ================= */
.rail{
  position:fixed;z-index:60;right:28px;bottom:28px;
  display:flex;flex-direction:column;align-items:center;
}
.rail__b{
  position:relative;width:44px;height:44px;flex:0 0 44px;padding:0;margin:0;
  background:none;border:0;cursor:pointer;display:grid;place-items:center;
  color:var(--red);transition:color .45s var(--ease),opacity .45s var(--ease);
}
.rail__b svg.ico{width:20px;height:20px;fill:none;stroke:currentColor;
  stroke-width:1.25;stroke-linecap:square;stroke-linejoin:miter;}
.rail__b .ring{position:absolute;inset:0;width:44px;height:44px;pointer-events:none;}
.rail__b .ring circle{
  fill:none;stroke:currentColor;stroke-width:1;opacity:.85;
  stroke-dasharray:132;stroke-dashoffset:132;
  transition:stroke-dashoffset .6s var(--ease);
}
.rail__b:hover .ring circle{stroke-dashoffset:0;}
.rail__b:focus-visible{outline:1px solid currentColor;outline-offset:3px;}
.rail__b[disabled]{opacity:.26;cursor:default;}
.rail__b[disabled]:hover .ring circle{stroke-dashoffset:132;}
/* back to top only earns its place once there is something to go back from */
.rail__top{opacity:0;pointer-events:none;}
.rail__top.is-shown{opacity:1;pointer-events:auto;}
.rail__gap{height:8px;}
.rail__pair{display:flex;flex-direction:column;align-items:center;}
.rail__sep{display:block;width:13px;height:1px;margin:9px 0;background:currentColor;
  opacity:.3;color:var(--red);transition:background .45s var(--ease);}
/* over a dark band (the hero, the footer) */
.rail.on-dark .rail__b,.rail.on-dark .rail__sep{color:#fff;}
.rail.on-dark .rail__sep{background:#fff;}
/* the rail stays on phones too, just smaller and tucked into the corner */
@media (max-width:980px){
  .rail{right:14px;bottom:14px;}
  .rail__b{width:36px;height:36px;flex:0 0 36px;}
  .rail__b svg.ico{width:16px;height:16px;}
  .rail__b .ring{width:36px;height:36px;}
  .rail__gap{height:6px;}
  .rail__sep{width:11px;}
}

/* Reserve a clear gutter for the rail: the page narrows only when the window is
   too tight to hold both the 1140px container and the rail. Wide windows are
   untouched, because the container's own margins are already wider than the rail. */
@media (min-width:981px){
  :root{--container:min(1140px, 100vw - 200px);}
}
