/* P7: calm coastal motion and a keyboard-accessible return-to-top control. */
:root {
  --sc-p7-motion-duration: 540ms;
  --sc-p7-wave-shadow: color-mix(in srgb, var(--sc-color-deep-sea) 24%, transparent);
}
.sc-p7-back-to-top,
.sc-p7-back-to-top * {
  letter-spacing: 0;
}
.sc-p7-back-to-top {
  position: fixed;
  z-index: 999;
  inset-inline-end: max(18px, env(safe-area-inset-right, 0px));
  bottom: max(24px, calc(22px + env(safe-area-inset-bottom, 0px)));
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  padding: 12px;
  background: linear-gradient(145deg, var(--sc-color-ocean), var(--sc-color-deep-sea));
  color: var(--sc-color-white, #fff);
  border: 1px solid var(--sc-color-warm-sand);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 12px 30px var(--sc-p7-wave-shadow);
  transition: transform 220ms ease, box-shadow 220ms ease, background-color 220ms ease;
  -webkit-tap-highlight-color: transparent;
}
.sc-p7-back-to-top[hidden] { display: none !important; }
.sc-p7-back-to-top__icon {
  display: block;
  width: 33px;
  height: 33px;
  overflow: visible;
}
.sc-p7-back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px var(--sc-p7-wave-shadow);
}
.sc-p7-back-to-top:active { transform: translateY(-1px) scale(.97); }
.sc-p7-back-to-top:focus-visible {
  outline: 3px solid var(--sc-color-warm-sand);
  outline-offset: 4px;
}
/* Ocean ripple is a transient hover treatment, not an endless animation. */
.sc-p7-back-to-top::before {
  content: '';
  position: absolute;
  inset: -6px;
  border: 1px solid var(--sc-color-teal);
  border-radius: 50%;
  opacity: 0;
  transform: scale(.86);
  transition: opacity 220ms ease, transform 320ms ease;
  pointer-events: none;
}
.sc-p7-back-to-top:hover::before,
.sc-p7-back-to-top:focus-visible::before {
  opacity: .65;
  transform: scale(1);
}
/* Motion is opt-in from JS; text remains readable when scripts are absent. */
html.sc-p7-motion [data-sc-p7-reveal]:not(.sc-p7-in-view) {
  opacity: 0;
  transform: translateY(18px);
}
html.sc-p7-motion [data-sc-p7-reveal] {
  transition: opacity var(--sc-p7-motion-duration) cubic-bezier(.2,.7,.2,1),
              transform var(--sc-p7-motion-duration) cubic-bezier(.2,.7,.2,1);
  transition-delay: var(--sc-p7-stagger, 0ms);
}
html.sc-p7-motion [data-sc-p7-reveal].sc-p7-in-view {
  opacity: 1;
  transform: none;
}
@media (max-width: 700px) {
  .sc-p7-back-to-top {
    width: 52px;
    height: 52px;
    padding: 11px;
    inset-inline-end: max(16px, env(safe-area-inset-right, 0px));
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  }
  .sc-p7-back-to-top__icon { width: 30px; height: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .sc-p7-back-to-top,
  .sc-p7-back-to-top::before,
  html.sc-p7-motion [data-sc-p7-reveal] {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
  html.sc-p7-motion [data-sc-p7-reveal] { opacity: 1 !important; }
}
