/* Story: the year as a train ride. The stage carries the picture (src/rails.js);
   this is the caption, the progress slashes and the way out. Words only — no
   boxes — as everywhere else in Slashed. Type and tokens come from styles.css. */

#journey { touch-action: none; -webkit-user-select: none; user-select: none; cursor: grab; }
#journey.scrub { cursor: grabbing; }
/* The room is dark above the set, where the caption stands, and at the very foot. */
#journey::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(var(--scrim), .78) 0, rgba(var(--scrim), .5) 24%, rgba(var(--scrim), 0) 44%, rgba(var(--scrim), 0) 84%, rgba(var(--scrim), .5) 100%);
}

.jy { position: absolute; inset: 0; text-shadow: 0 1px 30px rgba(0, 0, 0, .85); }
.jy-ticks { z-index: 3; }
.jy-exit {
  position: absolute; z-index: 3; top: calc(var(--sat) + 11px); right: 12px; padding: 0 12px;
  font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase;
}

/* One stop's words: a kicker, one figure that counts, one line. */
.jy-cap {
  position: absolute; left: var(--pad); right: var(--pad); top: calc(var(--sat) + 78px);
  container-type: inline-size; pointer-events: none;
}
.jy-cap > * { transition: opacity .8s var(--ease), transform .8s var(--ease), filter .8s var(--ease); }
.jy-cap > :nth-child(2) { transition-delay: .07s; }
.jy-cap > :nth-child(3) { transition-delay: .16s; }
.jy-cap.out > * { opacity: 0; transform: translate3d(0, 10px, 0); filter: blur(7px); transition-duration: .28s; transition-delay: 0s; }
.jy-fig {
  font: 400 min(29cqw, calc(182cqw / var(--n, 6)), 19vh)/.92 var(--display);
  letter-spacing: -.025em; white-space: nowrap; color: var(--gold); font-variant-numeric: lining-nums;
}
.jy-line {
  margin-top: 12px; max-width: 15em;
  font: 400 clamp(20px, 6.6cqw, 31px)/1.12 var(--display); letter-spacing: -.012em; text-wrap: balance;
}

.jy-again {
  position: absolute; left: var(--pad); bottom: calc(var(--sab) + 30px); padding: 14px 0;
  opacity: 0; pointer-events: none; transition: opacity .7s var(--ease);
}
#journey.done .jy-again { opacity: 1; pointer-events: auto; }

/* Wide screens: the set sits right of centre and the caption stands to its left. */
@media (min-aspect-ratio: 9/10) {
  #journey::before {
    background:
      linear-gradient(90deg, rgba(var(--scrim), .72) 0, rgba(var(--scrim), .3) 30%, rgba(var(--scrim), 0) 50%),
      linear-gradient(180deg, rgba(var(--scrim), .5) 0, rgba(var(--scrim), 0) 22%, rgba(var(--scrim), 0) 86%, rgba(var(--scrim), .4) 100%);
  }
  .jy-cap { left: max(var(--pad), 5vw); right: auto; width: min(31vw, 430px); top: max(calc(var(--sat) + 92px), 21vh); }
  .jy-again { left: max(var(--pad), 5vw); }
}

@media (prefers-reduced-motion: reduce) {
  .jy-cap > * { transition-duration: .2s; transition-delay: 0s; filter: none; transform: none; }
}
