/* The button back to the top, a ring. It only shows once the visitor has
   scrolled down (js/nach-oben.js sets .ist-da), and it stands in the column of the page, so the docked chat
   never covers it. An ink disc; the yellow ring around it fills with how far the page is read. */
.nach-oben {
  position: fixed; z-index: 15; right: 24px; bottom: 24px; display: grid; place-items: center;
  width: 56px; height: 56px; padding: 0; appearance: none; border: 0; border-radius: 50%;
  background: var(--tinte); color: var(--grund); box-shadow: var(--shadow-lg); cursor: pointer;
  opacity: 0; visibility: hidden; translate: 0 18px;
  transition: opacity var(--dur-normal) var(--ease), translate var(--dur-normal) var(--ease),
    right var(--dur-slow) var(--ease), visibility 0s linear var(--dur-normal);
}
.nach-oben.ist-da { opacity: 1; visibility: visible; translate: 0 0; transition-delay: 0s; }
.nach-oben svg { display: block; overflow: visible; }
.nach-oben__ring { position: absolute; inset: -6px; rotate: -90deg; }
.nach-oben__ring circle {
  fill: none; stroke: var(--gelb); stroke-width: 4; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--gelesen, 0));
}
/* The turned ring would otherwise paint over the arrow. */
.nach-oben__pfeil { position: relative; width: 22px; height: 22px; }
/* On hover the arrow leaves at the top and comes back from below. */
.nach-oben:hover .nach-oben__pfeil, .nach-oben:focus-visible .nach-oben__pfeil { animation: oben-durch 520ms var(--ease); }
@keyframes oben-durch { 45% { translate: 0 -26px; opacity: 0; } 46% { translate: 0 26px; opacity: 0; } 100% { translate: 0 0; opacity: 1; } }
.nach-oben:focus-visible { outline: 2px solid var(--tinte); outline-offset: 10px; }
/* On a phone it is smaller and sits in the free strip below the picture of a panel (leistungen.css). */
@media (max-width: 599px) {
  .nach-oben { width: 48px; height: 48px; right: 14px; bottom: 14px; }
  .nach-oben__ring { inset: -5px; }
}
@media (min-width: 1024px) {
  /* 24 px from the corner: the longest panel (AI Native) ends its text just above and beside it. */
  .chat-docked .nach-oben { right: calc(50% + 24px); }
}
/* Between 1024 and 1120 px the docked chat leaves the page as narrow as a phone: the panels show their phone
   layout (leistungen.css, @container up to 560 px), so the button takes its phone size there as well. */
@media (min-width: 1024px) and (max-width: 1120px) {
  .chat-docked .nach-oben { width: 48px; height: 48px; right: calc(50% + 14px); bottom: 14px; }
  .chat-docked .nach-oben__ring { inset: -5px; }
}
/* The foot of the page keeps the corner of the button free, so the button never lies on its links. */
.fuss { padding-bottom: 76px; }
@media (min-width: 1024px) { .fuss { padding-bottom: 96px; } }
@media (prefers-reduced-motion: reduce) {
  .nach-oben { transition-duration: 0s; }
  .nach-oben:hover .nach-oben__pfeil, .nach-oben:focus-visible .nach-oben__pfeil { animation: none; }
}
