.scope-page { --scope-surface: #e5ebed; }
.scope-page .study-hero,
.scope-page .study-cover { background: white; }
.scope-page .study-hero .study-tags li,
.scope-page .scope-challenge > .surface-backdrop { background: var(--scope-surface); }
.scope-challenge-inner > h2 { margin-bottom: var(--section-heading-gap); }
.scope-page .study-chapter > h2 { margin-bottom: var(--section-heading-gap); }
.scope-page .study-cover { padding-bottom: 0; }
.scope-page .study-cover img { aspect-ratio: 1440 / 1050; }
.scope-finish { margin-top: var(--case-section-space); }
.scope-text { max-width: 70ch; }
.scope-level + .scope-level { margin-top: var(--section-heading-gap); }
.scope-level > p { margin-top: 16px; }

.study .scope-media,
.study .scope-demo,
.study .scope-phones { margin-top: clamp(24px, 4vw, 40px); }
.scope-media, .scope-demo, .scope-phones {
  padding: clamp(12px, 3vw, 32px);
  border-radius: 20px;
  background: var(--scope-surface);
}
.scope-media img,
.scope-stage img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: clamp(6px, 1.2vw, 14px);
}
.scope-phones {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 250px));
  justify-content: center;
  gap: clamp(12px, 5vw, 56px);
  padding-block: clamp(24px, 5vw, 48px);
}
.scope-phones img { width: 100%; height: auto; }

#scope-demo { scroll-margin-top: 76px; }
.scope-demo {
  --scope-tooltip-bg: #171d25;
  --scope-tooltip-ink: #e4e9f1;
  --scope-tooltip-muted: #9ba7b6;
  --scope-tooltip-border: #4a5261;
  --scope-highlight: #69a0fc;
}
.scope-demo [hidden] { display: none; }
.scope-stage {
  position: relative;
  display: grid;
  isolation: isolate;
  container-type: inline-size;
  aspect-ratio: 16 / 9;
  pointer-events: none;
  user-select: none;
}
.scope-stage img {
  grid-area: 1 / 1;
}
.scope-stage img[data-scope-screen="light"] { opacity: 0; transition: opacity 120ms ease; }
.scope-demo[data-theme="light"] img[data-scope-screen="light"] { opacity: 1; }
.scope-marker, .scope-tooltip {
  position: absolute;
  left: var(--x);
  top: var(--y);
  pointer-events: none;
}
.scope-hover-art { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.scope-hover-art > g { visibility: hidden; }
.scope-stage[data-hover="heatmap"] [data-scope-hover="heatmap"],
.scope-stage[data-hover="post"] [data-scope-hover="post"],
.scope-stage[data-hover="retention"] [data-scope-hover="retention"],
.scope-stage[data-hover="custom"] [data-scope-hover="custom"],
.scope-stage[data-hover="filter"] [data-scope-hover="filter"],
.scope-stage[data-hover="weekly"] [data-scope-hover="weekly"],
.scope-stage[data-hover="theme"] [data-scope-hover="theme"] { visibility: visible; }
.scope-marker {
  width: .52cqw;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--scope-highlight);
  transform: translate(-50%, -50%);
}
.scope-tooltip {
  z-index: 2;
  display: grid;
  row-gap: .21cqw;
  min-width: 6.77cqw;
  padding: .365cqw .52cqw;
  border: max(1px, .104cqw) solid var(--scope-tooltip-border);
  border-radius: .42cqw;
  background: var(--scope-tooltip-bg);
  color: var(--scope-tooltip-muted);
  font: 400 .885cqw/1.18 Inter, Arial, sans-serif;
  white-space: nowrap;
  transform: translate(-50%, calc(-100% - .42cqw));
}
.scope-tooltip[data-kind="pie"],
.scope-tooltip[data-kind="heatmap"] { transform: none; }
.scope-tooltip[data-kind="pie"] { min-width: 8.91cqw; }
.scope-tooltip[data-kind="heatmap"] { min-width: 6.46cqw; }
.scope-tooltip [data-scope-detail],
.scope-tooltip [data-scope-value] { color: var(--scope-tooltip-ink); }
.scope-tooltip[data-kind="line"] .scope-tooltip-label::before {
  content: '';
  display: inline-block;
  width: .625cqw;
  aspect-ratio: 1;
  margin-inline-end: .52cqw;
  border: max(1px, .104cqw) solid var(--scope-highlight);
  border-radius: 50%;
  vertical-align: -.02em;
}
.scope-cursor {
  position: absolute;
  inset: 0 auto auto 0;
  z-index: 3;
  width: clamp(12px, 1.45cqw, 24px);
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 1px 1px #131922) drop-shadow(0 0 2px #131922a0);
  transform-origin: 0 0;
  translate: calc(var(--cursor-x, 0) * 1cqw) calc(var(--cursor-y, 0) * .5625cqw);
  transition: translate var(--travel, 0ms) ease-in-out, transform 90ms ease-out;
}
.scope-cursor-hand, .scope-cursor[data-hand] .scope-cursor-arrow { display: none; }
.scope-cursor[data-hand] .scope-cursor-hand { display: initial; }
.scope-cursor[data-pressed] { transform: scale(.82); }
.scope-finish .scope-text + .scope-text { margin-top: 16px; }

@media (prefers-reduced-motion: reduce) {
  .scope-stage img, .scope-cursor { transition: none; }
}
