/* The two short demonstrations in the Party tour. Their illustrations keep
   the same space in every state so advancing a step never shifts the page. */
.tour-demo-head,
.tour-window .tour-demo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: var(--size-control-large);
  padding: var(--space-1) var(--space-3);
  color: var(--color-muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}
.tour-replay {
  display: inline-grid;
  place-items: center;
  width: var(--size-control);
  height: var(--size-control);
  flex: none;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
}
.tour-replay:hover { color: var(--color-primary-deep); background: var(--color-primary-soft); }
.tour-replay .icon { width: var(--space-3); height: var(--space-3); }

.tour-handoff__screen {
  position: relative;
  aspect-ratio: 1.9;
  border-block: var(--tour-rule);
  background: var(--color-surface);
  overflow: hidden;
}
.tour-handoff__shot,
.tour-handoff__shot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.tour-handoff__shot { opacity: 0; }
.tour-handoff__shot--current { opacity: 1; z-index: 1; }
.tour-handoff__shot img { object-fit: contain; }
.tour-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: var(--space-3) var(--space-2) var(--space-2);
  list-style: none;
}
.tour-steps li { position: relative; min-width: 0; }
.tour-steps li + li::before {
  content: "";
  position: absolute;
  top: calc(var(--size-control-small) / 2);
  right: calc(50% + var(--size-control-small) / 2 + var(--space-1));
  width: calc(100% - var(--size-control-small) - 2 * var(--space-1));
  height: var(--border-width);
  background: var(--color-border);
}
.tour-steps button {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: var(--space-1);
  width: 100%;
  height: 100%;
  padding: 0 var(--space-1) var(--space-2);
  border: 0;
  border-radius: var(--radius-small);
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: var(--line-height-tight);
  text-wrap: balance;
}
.tour-steps__node {
  display: grid;
  place-items: center;
  width: var(--size-control-small);
  height: var(--size-control-small);
  border: var(--tour-rule);
  border-radius: 50%;
  background: var(--color-surface);
}
.tour-steps__node .icon { width: var(--space-3); height: var(--space-3); }
.tour-steps button:is(:hover, [aria-pressed="true"]) { color: var(--color-primary-deep); }
.tour-steps button[aria-pressed="true"] .tour-steps__node { border-color: currentColor; background: var(--color-primary-soft); }

.tour-recognition { padding-block: clamp(3.5rem, 7cqw, 7rem); }
.tour-recognition .tour-copy { width: min(100%, 52rem); margin-inline: auto; justify-items: center; text-align: center; }
.tour-recognition .tour-copy > p:not(.tour-label) { text-wrap: balance; }
.tour-recognition .tour-mat { margin-top: var(--space-5); padding: clamp(.85rem, 3cqw, 3rem); }
.tour-credit { max-width: 54rem; padding: clamp(1rem, 2.3cqw, 2.5rem); overflow: visible; }
.tour-credit .tour-demo-head { padding: 0; }
.tour-demo-controls { display: flex; }
.tour-credit__raw { display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: var(--space-1) var(--space-2); padding-block: 5rem; font-size: clamp(1.15rem, 2.5cqw, 2.5rem); line-height: 1.45; font-weight: var(--weight-semibold); }
.tour-credit__raw > small { color: var(--color-muted); font-size: var(--text-sm); font-weight: var(--weight-medium); white-space: nowrap; }
.tour-word--song { --credit-fill: var(--color-primary-soft); --credit-ink: var(--color-primary-deep); --word-travel: var(--space-3); }
.tour-word--artist { --credit-fill: var(--color-glow-secondary); --credit-ink: var(--color-secondary-strong); --word-travel: calc(-1 * var(--space-3)); }
.tour-credit__artist, .tour-term { display: inline-block; white-space: nowrap; }
.tour-term { position: relative; }
.tour-term mark { color: var(--color-fg); border-radius: var(--radius-small); background: var(--credit-fill); box-shadow: inset 0 -.095em var(--credit-ink); }
.tour-callout {
  display: grid; position: absolute; z-index: 1;
  padding: var(--space-2) var(--space-3); border: 1px solid var(--credit-ink); border-radius: var(--radius);
  background: var(--color-surface-raised); color: var(--color-fg); box-shadow: var(--shadow-menu);
  font-size: var(--text-sm); line-height: 1.3; text-align: start;
}
.tour-callout small { font-size: var(--text-xs); color: var(--credit-ink); }
.tour-callout::after { content: ""; position: absolute; width: .68rem; height: .68rem; rotate: 45deg; background: inherit; }
.tour-word--song .tour-callout { bottom: calc(100% + .6rem); left: 0; transform-origin: 25% 100%; }
.tour-word--song .tour-callout::after { bottom: -.4rem; left: 22%; border-right: 1px solid var(--credit-ink); border-bottom: 1px solid var(--credit-ink); }
.tour-word--artist .tour-callout { top: calc(100% + .6rem); right: 0; transform-origin: 70% 0; }
.tour-word--artist .tour-callout::after { top: -.4rem; right: 22%; border-left: 1px solid var(--credit-ink); border-top: 1px solid var(--credit-ink); }
.tour-credit__rows { display: grid; width: min(100%, 31rem); margin-inline: auto; }
.tour-credit__rows img { grid-area: 1/1; }
.tour-credit__result p { color: var(--color-muted); font-size: var(--text-sm); }
.tour-credit__result { border-top: var(--tour-rule); padding-top: var(--space-3); }
.tour-credit__result p { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); }
.tour-credit__result .icon { color: var(--color-primary-deep); }
.tour-credit img { border-radius: var(--radius-small); }

@media (prefers-reduced-motion: no-preference) {
  .tour-handoff__shot { transform: translateY(var(--space-2)); transition: opacity .32s, transform .4s var(--ease-out); }
  .tour-handoff__shot--current { transform: none; }
  .tour-handoff__shot--current img:last-child { animation: tour-handoff-complete .36s ease-out .78s both paused; }
  .tour-handoff--visible .tour-handoff__shot--current img:last-child { animation-play-state: running; }
  .tour-steps__node { transition: background var(--duration-enter), border-color var(--duration-enter), transform var(--duration-enter); }
  .tour-steps button[aria-pressed="true"] .tour-steps__node { transform: translateY(-.15rem); }
  .tour-credit mark { transition: background .42s, box-shadow .42s; }
  .tour-callout { opacity: 0; transform: translateY(var(--word-travel)) scale(.84); transition: opacity .22s, transform .42s var(--ease-out); }
  .tour-credit:is([data-step="1"],[data-step="2"],[data-step="3"],[data-step="4"]) .tour-word--song .tour-callout,
  .tour-credit:is([data-step="2"],[data-step="3"]) .tour-word--artist .tour-callout { opacity: 1; transform: none; }
  .tour-credit:is([data-step="2"],[data-step="3"]) .tour-word--artist .tour-callout { transition-delay: .12s; }
  .tour-credit:is([data-step="0"],[data-step="5"]) mark,
  .tour-credit:is([data-step="1"],[data-step="4"]) .tour-word--artist mark { background: transparent; box-shadow: inset 0 0 transparent; }
  .tour-credit__rows img:last-child { transition: opacity .45s, transform .45s var(--ease-out); }
  .tour-credit:is([data-step="0"],[data-step="1"],[data-step="2"]) .tour-credit__rows img:last-child { opacity: 0; transform: translateY(var(--space-2)); }
}
@keyframes tour-handoff-complete { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .tour-replay { display: none; }
}
