.scenarios {
  --pin-top: clamp(0px, 5svh, 3rem);
  --travel: clamp(30rem, 102svh, 60rem);
  color: #302139;
  background: #f3eef6;
}
.scenario-sticky { padding-block: clamp(3rem, 5.4vw, 5rem); }
.scenarios.is-scroll-sequence::after { content: ""; display: block; height: var(--travel); }
.is-scroll-sequence .scenario-sticky { position: sticky; top: var(--pin-top); }
.scenario-reader {
  display: grid;
  grid-template: "heading art" auto "phrase art" auto "steps art" auto / minmax(0,.94fr) minmax(0,1.06fr);
  column-gap: clamp(1.8rem,5.3vw,5rem);
  align-items: center;
}
.scenarios h2 {
  grid-area: heading; align-self: end; max-width: 16ch;
  font-size: clamp(2.45rem,4.15vw,4rem);
  line-height: 1.06; text-wrap: balance;
}
.scenarios h2 em { color: #67428b; font-style: normal; }
.scenario-sequence { display: contents; margin: 0; padding: 0; list-style: none; }
.scenario-scene { display: none; }
.scenario-reader:has(input[value="1"]:checked) li:nth-child(1),
.scenario-reader:has(input[value="2"]:checked) li:nth-child(2),
.scenario-reader:has(input[value="3"]:checked) li:nth-child(3),
.scenario-reader:has(input[value="4"]:checked) li:nth-child(4),
.scenario-reader:has(input[value="5"]:checked) li:nth-child(5),
.scenario-reader:has(input[value="6"]:checked) li:nth-child(6) { display: contents; }
.scenario-scene p {
  grid-area: phrase; align-self: start;
  margin-block: clamp(1.1rem,2.1vw,2rem) 0;
  min-height: 3.9em; max-width: 31ch;
  font-size: clamp(1.24rem,1.65vw,1.58rem);
  font-weight: 450; line-height: 1.3; letter-spacing: -.024em;
  color: #49394f; text-wrap: pretty;
}
.scenario-scene img {
  grid-area: art; justify-self: center;
  display: block; object-fit: contain;
  width: 100%; height: clamp(16rem,27vw,25rem);
}
.scenario-steps {
  grid-area: steps; place-self: start; display: flex; flex-wrap: wrap;
  min-width: 0; max-width: 100%; margin: .2rem 0 0; padding: 0; border: 0;
}
.scenario-steps label {
  position: relative; display: grid; place-items: center; width: 2.8rem; height: 44px;
  font-size: .86rem; font-variant-numeric: tabular-nums; line-height: 1;
}
.scenario-steps input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.scenario-steps label span {
  width: 100%; text-align: center; padding-block: .5rem; pointer-events: none;
  color: #706177; border-top: 1px solid #b6a8bf;
}
.scenario-steps input:checked + span { color: #422055; font-weight: 680; box-shadow: inset 0 2px #684481; border-color: #684481; }
.scenario-steps label:hover span { color: #422055; }
.scenario-steps label:has(input:focus-visible) { outline: 2px solid #63477b; outline-offset: -2px; border-radius: 3px; }
@media (prefers-reduced-motion: no-preference) {
  .scenario-scene.is-entering img { animation: scene-in .32s cubic-bezier(.2,.7,.24,1) both; }
  .scenario-scene.is-entering p { animation: phrase-in .19s ease-out both; }
  [data-direction="back"] { --scene-offset: -.65rem; }
}
@keyframes scene-in { from { opacity: .5; transform: translateY(var(--scene-offset,.65rem)); } to { opacity: 1; transform: none; } }
@keyframes phrase-in { from { opacity: .65; } to { opacity: 1; } }
@media (max-width: 45rem) {
  .scenario-sticky { padding-block: clamp(1.85rem,6vw,3rem); }
  .scenario-reader { grid-template: "heading" auto "art" auto "phrase" auto "steps" auto / minmax(0,1fr); }
  .scenarios h2 { max-width: 18ch; font-size: clamp(1.95rem,6.8vw,3.1rem); }
  .scenario-scene img { width: min(100%,26rem); height: clamp(9rem,26svh,15.5rem); margin-block: .8rem; }
  .scenario-scene p { font-size: clamp(1.1rem,4.4vw,1.38rem); max-width: 35ch; margin: 0; }
  .scenario-steps { margin-top: .2rem; }
}
@media (forced-colors: active) {
  .scenario-steps input:checked + span { color: Highlight; border-top: 3px solid Highlight; }
}
@media print {
  .scenarios.is-scroll-sequence::after, .scenario-steps { display: none; }
  .is-scroll-sequence .scenario-sticky { position: static; }
  .scenario-reader, .scenario-sequence { display: block; }
  .scenarios .scenario-scene:nth-child(n) { display: block; break-inside: avoid; }
  .scenario-scene p { min-height: 0; max-width: none; margin-block: 1rem .4rem; }
  .scenario-scene img { width: 9rem; height: 6rem; }
}
