/* The splash reel, and the boot mark before it. Same rule as motion.css: an
   entrance only says where a thing comes from, so with no animation at all
   every scene is simply complete. */

/* ---------- before the first screen ---------- */

.boot {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(158deg, #1b1030 0%, #3d1f6b 57%, #5e35a8 100%);
}
.boot .wordmark { color: #fff; font-size: 34px; animation: rise-in 0.5s var(--ease-out) 0.3s backwards; }
.boot path { stroke-dasharray: 1; animation: t-draw 0.9s ease-in-out backwards; }
@keyframes t-draw { from { stroke-dashoffset: 1; } }
.boot-slow { margin: 18px 0 4px; font-size: 14px; color: #d3bfec; }

/* ---------- the frame ---------- */

.tour { position: relative; overflow: hidden; padding: 0 0 calc(18px + env(safe-area-inset-bottom)); }
.tour::before, .tour::after {
  content: ''; position: absolute; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(196, 168, 232, 0.2), transparent);
}
.tour::before { width: 420px; height: 420px; top: -150px; left: -140px; animation: t-drift 13s ease-in-out infinite alternate; }
.tour::after { width: 340px; height: 340px; bottom: -110px; right: -130px; animation: t-drift 17s ease-in-out infinite alternate-reverse; }
@keyframes t-drift { to { transform: translate(60px, 50px) scale(1.15); } }

.t-top { position: relative; z-index: 3; padding: calc(16px + env(safe-area-inset-top)) 18px 0; flex-shrink: 0; }
.t-segs { display: flex; gap: 4px; }
.t-seg { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.2); overflow: hidden; }
.t-seg i { display: block; height: 100%; background: #fff; border-radius: 2px; transform: scaleX(0); transform-origin: left; }
.t-seg.done i, .t-seg.now i { transform: none; }
.t-seg.now i { animation: t-seg var(--dur) linear; }
.tour.paused .t-seg.now i { animation-play-state: paused; }
@keyframes t-seg { from { transform: scaleX(0); } }

.t-ctl { display: flex; justify-content: flex-end; gap: 4px; margin-top: 6px; }
.t-btn {
  min-width: 44px; height: 44px; padding: 0 8px; display: grid; place-items: center;
  font-size: 14px; font-weight: 600; color: #e6daf5; border-radius: 12px;
}
.tour.t-last .t-btn { visibility: hidden; }

.t-scenes { position: relative; flex: 1; min-height: 0; display: flex; }
.t-scene { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; z-index: 1; padding: 0 26px; }
.t-scene[hidden] { display: none; }

/* Tap the left third to go back, anywhere else to go on. */
.t-zone { position: absolute; top: 0; bottom: 0; z-index: 2; }
.t-zone.prev { left: 0; width: 32%; }
.t-zone.next { right: 0; width: 68%; }
.t-zone:focus-visible { outline-offset: -6px; }
.tour.t-last .t-zone { display: none; }

.t-hint { display: none; position: relative; z-index: 1; margin: 8px 0 0; text-align: center; font-size: 13px; color: #c4a8e8; }
.tour.t-last .t-hint { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .t-hint { display: block; } }

/* ---------- scene parts ---------- */

.t-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.t-stack { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.t-stack.t-mid { gap: 16px; }
.t-stack .card, .t-stack .bubble { color: var(--ink); }
.t-stack .bubble { max-width: 84%; }
.t-stack .bubble.me { color: #fff; background: var(--plum-mid); }
.t-copy { flex-shrink: 0; min-height: 168px; padding-bottom: 12px; }
.t-copy .display { font-size: 31px; }
.t-copy .lede { font-size: 16px; margin-top: 10px; }

.t-in { animation: rise-in 0.55s var(--ease-out) var(--d, 0s) backwards; }
.t-pop { animation: t-pop 0.5s var(--spring) var(--d, 0s) backwards; }
@keyframes t-pop { from { opacity: 0; transform: scale(0.7) translateY(8px); } }

.t-glass, .t-note, .t-file {
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(196, 168, 232, 0.35); color: #e6daf5;
}
.t-glass { border-radius: 16px; padding: 14px 15px; }
.t-glass .label { color: #c4a8e8; }
.t-file, .t-note {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: 12px; font-size: 13px; font-weight: 500;
}
.t-note { align-self: center; border-radius: 999px; }
.t-sign { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #c4a8e8; }
.t-bare.t-bare { padding: 0; }
.t-name { font-family: 'Instrument Serif', Georgia, serif; font-size: 28px; line-height: 1.1; }
.t-sub { font-size: 13px; color: #d3bfec; margin-top: 2px; }

.t-done { width: 24px; height: 24px; border-radius: 50%; background: var(--green); display: grid; place-items: center; flex-shrink: 0; }

.t-line { display: block; width: 100%; height: auto; margin-top: 10px; overflow: visible; }
.t-line path { stroke-dasharray: 1; animation: t-draw 1s ease-in-out 0.3s backwards; }
.t-line circle { transform-box: fill-box; transform-origin: center; animation: dot-pop 0.35s var(--spring) backwards; }
.t-line circle:nth-of-type(1) { animation-delay: 0.3s; }
.t-line circle:nth-of-type(2) { animation-delay: 0.75s; }
.t-line circle:nth-of-type(3) { animation-delay: 1.25s; }

.t-mail {
  align-self: center; width: 70px; height: 70px; margin-bottom: 4px; border-radius: 20px;
  display: grid; place-items: center; background: rgba(255, 255, 255, 0.12);
}

.t-dots { gap: 5px; }
.t-dots .d { width: 15px; height: 15px; border-radius: 4px; }

.t-bar { display: flex; background: #fff; border-radius: 20px; padding: 12px 6px 10px; }
.t-tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--ink-2); }
.t-tab b { font-size: 11px; font-weight: 500; }
.t-swap { flex: 1; position: relative; display: flex; }
.t-swap .t-tab { width: 100%; }
.t-swap .t-out { animation: t-out 0.45s var(--ease-out) 1.6s both; }
.t-swap .t-new {
  position: absolute; inset: 0; color: var(--plum);
  animation: t-new 0.55s var(--spring) 1.9s backwards;
}
@keyframes t-out { to { opacity: 0; transform: translateY(14px); } }
@keyframes t-new { from { opacity: 0; transform: translateY(-14px) scale(0.8); } }

/* ---------- the opening and the close ---------- */

.t-intro { align-items: center; justify-content: center; text-align: center; gap: 10px; padding-bottom: 60px; }
.t-mark { margin-bottom: 6px; filter: drop-shadow(0 8px 26px rgba(196, 168, 232, 0.45)); }
.t-mark path { stroke-dasharray: 1; animation: t-draw 1.1s ease-in-out 0.1s backwards; }
.t-intro .display { font-size: 30px; }

.t-end { justify-content: center; gap: 20px; overflow-y: auto; }
.t-end > * { flex-shrink: 0; }
.t-end .display.xl { font-size: 40px; }
.t-end .f-err { color: #f0c9a0; text-align: center; margin: 0; }
.t-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.t-cap {
  display: flex; align-items: center; gap: 9px; min-width: 0; padding: 11px 12px; border-radius: 13px;
  font-size: 13px; font-weight: 500; color: #fff; background: rgba(255, 255, 255, 0.09);
}
.t-cap svg { flex-shrink: 0; }

/* short phones: the copy gives up its reserved height first */
@media (max-height: 680px) {
  .t-copy { min-height: 0; }
  .t-copy .display { font-size: 26px; }
  .t-copy .lede { font-size: 15px; }
  .t-stack { gap: 8px; }
  .t-end { justify-content: flex-start; padding-top: 4px; gap: 14px; }
  .t-end .display.xl { font-size: 32px; }
}

.tour :focus-visible { outline-color: #fff; }
