:root { --glimo-size: clamp(4.65rem, 7.2vw, 6.5rem); }

.scope-guide {
  display: flex;
  align-items: center;
  gap: .68rem;
  width: fit-content;
  max-width: min(100%, 27rem);
  text-align: start;
}

.scope-guide[data-glimo-side="right"] {
  flex-direction: row-reverse;
}

.scope-guide-perch {
  flex: 0 0 var(--glimo-size);
  width: var(--glimo-size);
  aspect-ratio: 70 / 76;
}

#scope-glimo {
  position: fixed;
  inset: 0 auto auto 0;
  z-index: 4;
  width: var(--glimo-size);
  pointer-events: none;
  visibility: hidden;
}

#scope-glimo[data-visible] { visibility: visible; }

#scope-glimo svg {
  display: block;
  width: 100%;
  overflow: visible;
  filter: drop-shadow(0 .45rem .35rem #080a0a70);
}

.scope-glimo-antenna {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

.scope-glimo-bulb,
.scope-glimo-eyes,
.scope-glimo-mouth {
  transform-box: fill-box;
  transform-origin: center;
}

.scope-guide-note {
  position: relative;
  min-width: 0;
  display: grid;
  gap: .23rem;
  padding: .6rem .8rem .65rem;
  border-radius: .9rem;
  background: #f0f1eb;
  color: #17241f;
}

.scope-guide-note::before {
  position: absolute;
  inset: 44% auto auto -.42rem;
  width: .64rem;
  height: .71rem;
  background: inherit;
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
  content: "";
}

[data-glimo-side="right"] .scope-guide-note::before {
  inset: 44% -.42rem auto auto;
  transform: scaleX(-1);
}

.scope-guide-note > strong {
  grid-row: 1;
  color: #25644f;
  font-size: .8rem;
  line-height: 1.2;
}

.scope-guide .scope-guide-note p {
  grid-area: 2 / 1;
  margin: 0;
  color: inherit;
  font-size: clamp(.9rem, 1.1vw, 1rem);
  line-height: 1.35;
}

.scope-guide-next,
.scope-guide[data-glimo-followup] .scope-guide-first { visibility: hidden; }
.scope-guide[data-glimo-followup] .scope-guide-next { visibility: visible; }

[data-glimo-ready] .scope-guide-note {
  opacity: 0;
  transition: opacity .2s ease-out;
}

[data-glimo-ready] [data-glimo-speaking] .scope-guide-note { opacity: 1; }

.opening .scope-guide {
  justify-self: end;
}

.chapter-copy .scope-guide,
.closing .scope-guide { margin-top: clamp(1rem, 2.4svh, 1.8rem); }
.closing .scope-guide { margin-inline: auto; }

.measure-heading, .share-heading {
  grid-template-columns: minmax(0, 1fr) minmax(17rem, .67fr);
  align-items: center;
  justify-items: start;
  gap: clamp(1.1rem, 3.6vw, 4.25rem);
  text-align: start;
}

.measure-heading .scope-guide,
.share-heading .scope-guide { justify-self: end; }

@media (max-width: 49rem) {
  :root { --glimo-size: clamp(3.75rem, 17vw, 4.65rem); }
  .scope-guide { gap: .56rem; }

  .chapter:not(.opening) { padding-bottom: 3.5rem; }
  .chapter-grid { gap: clamp(1.1rem, 2.7svh, 1.7rem); }
  .chapter-copy [data-glimo-side="right"] { margin-inline-start: auto; }
  .opening .scope-guide { justify-self: center; }

  .measure-heading, .share-heading {
    grid-template-columns: minmax(0, 1fr);
    gap: .85rem;
  }

  .share-heading .scope-guide { justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  [data-glimo-ready] .scope-guide-note { transition: none; }
}
