/* The real reading switch is temporarily lifted into the dialog's top layer. */
html:has(body.journey-tour-open),
body.journey-tour-open {
  overflow: hidden !important;
  overscroll-behavior: none;
}

.journey-reading-tour {
  --tour-left: max(20px, env(safe-area-inset-left));
  --tour-top: 18px;
  --tour-size: 44px;
  --tour-card-left: 16px;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: #f5ecd9;
  overscroll-behavior: none;
  touch-action: pan-y pinch-zoom;
  font-family: JourneyOnest, Onest, Arial, sans-serif;
}
.journey-reading-tour::backdrop {
  background: #050c14a6;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}
.journey-tour-card {
  position: absolute;
  left: var(--tour-card-left);
  top: calc(var(--tour-top) + var(--tour-size) + 76px);
  bottom: auto;
  width: min(390px, calc(100% - 32px));
  max-height: calc(100% - var(--tour-top) - var(--tour-size) - 92px - env(safe-area-inset-bottom));
  padding: 28px 25px 22px;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-y pinch-zoom;
  border: 1px solid #d9c4a23b;
  border-radius: 18px;
  background: linear-gradient(140deg, #20303bea, #111c28f5 72%);
  box-shadow: 0 24px 80px #0009, inset 0 1px #f0e5d014;
  scrollbar-width: thin;
  scrollbar-color: #8d887a #17242e;
}
.journey-tour-title {
  max-width: 290px;
  margin: 0 24px 15px 0;
  color: #f7ecd8;
  font-size: clamp(25px, 3.4vw, 29px);
  font-weight: 580;
  line-height: 1.12;
  letter-spacing: -.035em;
  text-wrap: balance;
}
.journey-tour-title:focus { outline: none; }
.journey-tour-description {
  margin: 0;
  color: #bdc6cc;
  font-size: 15px;
  line-height: 1.55;
  text-wrap: pretty;
}
.journey-tour-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 10px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #bac4ca;
}
.journey-tour-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.journey-tour-close:hover { color: #fff3dc; background: #e9d8bc0b; }
.journey-tour-actions { display: flex; flex-wrap: wrap; gap: 8px 10px; margin-top: 22px; }
.journey-tour-primary,
.journey-tour-secondary {
  min-height: 44px;
  max-width: 100%;
  padding: 11px 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: 550 13px/1.35 JourneyOnest, Onest, Arial, sans-serif;
  letter-spacing: -.01em;
  touch-action: manipulation;
}
.journey-tour-primary { background: #ecd1a3; color: #18242d; }
.journey-tour-primary:hover { background: #f5dfb8; }
.journey-tour-secondary { padding-inline: 7px; background: transparent; color: #d0d8dd; }
.journey-tour-secondary:hover { color: #fff0d5; }
.journey-reading-tour button:focus-visible { outline: 2px solid #f3d8a9; outline-offset: 5px; }
.journey-reading-tour .experience-switch.journey-mode.journey-tour-target {
  position: fixed;
  left: var(--tour-left);
  right: auto;
  top: var(--tour-top);
  bottom: auto;
  z-index: 2;
  display: grid;
  place-items: center;
  width: var(--tour-size);
  height: var(--tour-size);
  min-width: var(--tour-size);
  max-width: none;
  margin: 0;
  padding: 0;
  border-color: #efd3a3;
  background: #172833;
  color: #f3d5a7;
  box-shadow: 0 0 0 6px #e5c28b0b, 0 0 34px #e6bd793b;
  filter: none;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  touch-action: manipulation;
}
.journey-tour-target .experience-switch-label { display: none; }
.journey-tour-hand {
  position: absolute;
  z-index: 3; /* Above the reading button (2), including during the pointing animation. */
  left: calc(var(--tour-left) + var(--tour-size) / 2 - 24px);
  top: calc(var(--tour-top) + var(--tour-size) - 10px);
  bottom: auto;
  width: 48px;
  height: 66px;
  fill: #172732f2;
  stroke: #f1d4a4;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 5px 10px #0005);
  pointer-events: none;
  transform: rotate(172deg);
  transform-origin: 50% 50%;
  animation: journey-tour-point 1.1s ease-in-out 3;
}
.journey-reading-tour[open] .journey-tour-card { animation: journey-tour-enter .2s ease-out both; }
@keyframes journey-tour-point {
  0%, 100% { transform: translateY(0) rotate(172deg); }
  50% { transform: translateY(-5px) rotate(175deg); }
}
@keyframes journey-tour-enter {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}
@media (max-width: 420px) {
  .journey-tour-card { padding: 26px 21px 20px; }
  .journey-tour-title { font-size: 26px; }
  .journey-tour-actions { flex-direction: column; align-items: stretch; gap: 5px; margin-top: 18px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .journey-tour-card { padding-block: 20px 18px; }
  .journey-tour-title { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .journey-reading-tour .journey-tour-hand,
  .journey-reading-tour[open] .journey-tour-card { animation: none; transition: none; }
}
