/* Quester motion language: a measured entrance, a route through the quests,
   and one-time section reveals. Content stays visible without JavaScript. */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 106px;
}
.mitra-opening .opening-photo img {
  will-change: transform;
}
.mitra-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--color-accent);
  transform: scaleX(var(--page-progress, 0));
  transform-origin: left center;
  pointer-events: none;
}

.quest-path {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 34px;
  margin: calc(-1 * var(--space-lg)) 0 var(--space-xl);
}
.quest-path::before,
.quest-path::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 14px;
  right: 14px;
  height: 2px;
  background: var(--color-rule);
}
.quest-path::after {
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 1.35s var(--ease-out);
}
.quest-path span {
  position: relative;
  z-index: 1;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--color-rule);
  border-radius: 50%;
  background: var(--color-paper);
  color: var(--color-muted);
  font-size: .63rem;
  line-height: 1;
  letter-spacing: .04em;
  transition: border-color .3s ease, color .3s ease, background-color .3s ease;
}
.quest-path.is-visible::after { transform: scaleX(1); }
.quest-path.is-visible span {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: var(--color-accent-ink);
}
.quest-path.is-visible span:nth-child(2) { transition-delay: .35s; }
.quest-path.is-visible span:nth-child(3) { transition-delay: .7s; }

.mitra-actions a span,
.mitra-header .mitra-nav-cta span,
.text-link span {
  display: inline-block;
  transition: transform .25s var(--ease-out);
}
.mitra-actions a:hover span,
.mitra-actions a:focus-visible span,
.mitra-header .mitra-nav-cta:hover span,
.mitra-header .mitra-nav-cta:focus-visible span,
.text-link:hover span,
.text-link:focus-visible span {
  transform: translate(5px, -5px);
}

@media (prefers-reduced-motion: no-preference) {
  .motion-ready .mitra-opening .opening-photo img {
    animation: hero-settle 1.8s var(--ease-out) both;
  }
  .motion-ready .mitra-opening .mitra-kicker,
  .motion-ready .mitra-opening h1,
  .motion-ready .mitra-opening .opening-copy > p:not(.mitra-kicker),
  .motion-ready .mitra-opening .mitra-actions,
  .motion-ready .mitra-opening .opening-note {
    animation: hero-enter .8s var(--ease-out) both;
  }
  .motion-ready .mitra-opening h1 { animation-delay: .08s; }
  .motion-ready .mitra-opening .opening-copy > p:not(.mitra-kicker) { animation-delay: .17s; }
  .motion-ready .mitra-opening .mitra-actions { animation-delay: .26s; }
  .motion-ready .mitra-opening .opening-note { animation-delay: .33s; }

  .motion-ready .motion-reveal {
    opacity: .85;
    transform: translateY(16px);
    transition: opacity .5s ease, transform .6s var(--ease-out);
  }
  .motion-ready .motion-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
  }
  .motion-ready .quest-entry:nth-of-type(2) { transition-delay: .08s; }
  .motion-ready .quest-entry:nth-of-type(3) { transition-delay: .16s; }
  .quest-path.is-visible span { animation: route-stop .55s var(--ease-out) both; }
  .quest-path.is-visible span:nth-child(2) { animation-delay: .4s; }
  .quest-path.is-visible span:nth-child(3) { animation-delay: .8s; }
}

@keyframes hero-enter {
  from { opacity: .35; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes hero-settle {
  from { transform: scale(1.04); }
  to { transform: scale(1); }
}
@keyframes route-stop {
  from { transform: scale(.7); }
  to { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .quest-path::after { transform: scaleX(1); }
  .quest-path span { border-color: var(--color-accent); background: var(--color-accent); color: var(--color-accent-ink); }
  .mitra-opening .opening-photo img { will-change: auto; }
}
@media (max-width: 640px) {
  html { scroll-padding-top: 92px; }
}
