.footer-signoff { display: flex; align-items: center; gap: 6px; }
.train-discovery { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; color: var(--color-muted); border-radius: 50%; cursor: pointer; touch-action: manipulation; }
.train-discovery:hover, .train-discovery:focus-visible { color: var(--color-lavender); background: var(--color-lilac); }
.train-is-open { overflow: hidden; }
.train-dialog {
  position: fixed;
  inset: 0;
  width: min(640px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--color-ink);
  background: var(--color-paper);
  border: 1px solid #c4c9b8;
  border-radius: 12px;
  box-shadow: 0 24px 100px rgb(22 34 25 / 25%);
}
.train-dialog::backdrop { background: rgb(32 43 32 / 60%); backdrop-filter: blur(5px); }
.train-ticket { position: relative; padding: 38px 0 26px; text-align: center; }
.train-close { position: absolute; top: 9px; right: 9px; display: grid; place-items: center; width: 44px; height: 44px; color: var(--color-muted); border-radius: 50%; cursor: pointer; touch-action: manipulation; }
.train-close:hover { background: #e9e9df; color: var(--color-ink); }
.train-close:focus-visible { outline-offset: -4px; border-radius: 50%; }
.train-intro { padding-inline: 32px; }
.train-secret { color: var(--color-lavender); font-size: 12px; margin-bottom: 12px; }
#train-heading { font-family: var(--font-display); font-size: clamp(33px, 6vw, 49px); font-weight: 500; line-height: 1.1; letter-spacing: -.03em; text-wrap: balance; }
#train-description { margin-top: 10px; color: var(--color-muted); font-size: 13px; }
.train-scene { overflow: hidden; margin-top: 2px; }
.train-illustration { display: block; width: 100%; height: auto; }
.train-resting-steam { opacity: .8; }
.train-puff, .train-steam-heart { opacity: 0; transform-box: fill-box; transform-origin: center; }
.train-ticket-details { position: relative; margin: 0 32px; padding: 6px 12px 22px; border-bottom: 1px dashed #b9bfac; }
.train-ticket-details::before, .train-ticket-details::after { content: ""; position: absolute; width: 12px; height: 12px; bottom: -7px; border: 1px solid #b9bfac; border-radius: 50%; background: var(--color-paper); }
.train-ticket-details::before { left: -6px; }
.train-ticket-details::after { right: -6px; }
.train-passengers { font-family: var(--font-display); font-size: 31px; line-height: 1.2; overflow-wrap: anywhere; }
.train-ticket-date { margin-top: 8px; font-size: 11px; color: var(--color-muted); line-height: 1.7; }
.train-ticket-date time { white-space: nowrap; }
.train-controls { padding: 24px 24px 0; }
.train-whistle { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 12px 24px; background: #3e5344; color: var(--color-paper); border: 1px solid #3e5344; border-radius: 999px; font-size: 13px; cursor: pointer; touch-action: manipulation; }
.train-whistle:hover { background: #2c3b30; }
.train-whistle:active { background: var(--color-olive); }
.train-whistle[aria-disabled="true"] { cursor: default; }
.train-whistle-note { min-height: 2.8em; max-width: 32ch; margin: 12px auto 0; color: var(--color-muted); font-size: 11px; line-height: 1.4; }
.is-arriving .train-engine { animation: train-arrive 2.8s cubic-bezier(.22, .61, .36, 1) both; }
.is-arriving .train-wheel { animation: train-wheel-turn .7s linear 4; }
.is-arriving .train-connecting-rod { animation: train-rod-turn .7s linear 4; }
.is-arriving .train-puff { animation: train-steam-rise 1.6s var(--steam-delay, 0s) ease-out 2; }
.is-whistling .train-steam-heart { animation: train-heart-rise 1.6s var(--steam-delay, 0s) ease-out both; }

@keyframes train-arrive {
  from { transform: translateX(-90%); }
  to { transform: translateX(0); }
}
@keyframes train-wheel-turn { to { transform: rotate(360deg); } }
@keyframes train-rod-turn {
  0%, 100% { transform: translate(0, 5px); }
  25% { transform: translate(-5px, 0); }
  50% { transform: translate(0, -5px); }
  75% { transform: translate(5px, 0); }
}
@keyframes train-steam-rise {
  0% { opacity: 0; transform: translate(0, 0) scale(.5); }
  18% { opacity: .85; }
  100% { opacity: 0; transform: translate(-80px, -65px) scale(2.1); }
}
@keyframes train-heart-rise {
  0% { opacity: 0; transform: translate(0, 0) scale(.35) rotate(-12deg); }
  20% { opacity: .9; }
  100% { opacity: 0; transform: translate(-100px, -62px) scale(1.2) rotate(-24deg); }
}
@media (prefers-reduced-motion: reduce) {
  .train-dialog *, .train-dialog *::before, .train-dialog *::after { animation: none !important; }
  .is-whistling .train-steam-heart:first-child { opacity: .9; transform: translate(-35px, -22px) scale(.8); }
}
