/* The guided try-out on /demo. Its colour is the colour of the page it is on, from [data-page] in style.css. */
.tour { --tour-dim: rgb(15 23 42 / 0.52); position: fixed; inset: 0; z-index: 20; pointer-events: none; }
[data-theme='dark'] .tour { --tour-dim: rgb(2 5 10 / 0.7); }
.tour-block { position: absolute; inset: 0; width: 100%; height: 100%; }
/* Clear, but it still catches clicks everywhere outside the hole; inside the hole the page works as usual. */
.tour-block path { fill: transparent; fill-rule: evenodd; pointer-events: fill; }
.tour-hole { position: absolute; top: 0; left: 0; border-radius: 14px; box-shadow: 0 0 0 2px var(--tone), 0 0 0 7px color-mix(in srgb, var(--tone) 24%, transparent), 0 0 0 200vmax var(--tour-dim); transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), height 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); animation: tour-in 0.3s ease-out; }
.tour-hole-none { box-shadow: 0 0 0 200vmax var(--tour-dim); }
/* While the tour waits for the visitor's hand, a ring breathes out from what is lit: this is where to press or type. */
.tour-hole::after { content: ''; position: absolute; inset: -2px; border: 2px solid var(--tone); border-radius: 16px; opacity: 0; animation: tour-ring 1.8s ease-out infinite; }
.tour-hole-none::after, .tour-done .tour-hole::after { animation: none; }
/* Done: the light turns the green the pages use for what went well. */
.tour-done .tour-hole:not(.tour-hole-none) { box-shadow: 0 0 0 2px var(--ok), 0 0 0 7px color-mix(in srgb, var(--ok) 22%, transparent), 0 0 0 200vmax var(--tour-dim); }

.tour-card { position: fixed; top: 0; left: 0; display: grid; gap: 10px; width: 360px; padding: 16px 18px 16px; border-radius: 18px; background: var(--surface); color: var(--ink); box-shadow: 0 2px 6px rgb(15 23 42 / 0.08), 0 28px 56px -24px rgb(15 23 42 / 0.5); pointer-events: auto; transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); animation: tour-in 0.3s ease-out; }
[data-theme='dark'] .tour-card { background: var(--raised); box-shadow: 0 0 0 1px var(--line-2), 0 28px 56px -20px rgb(0 0 0 / 0.8); }
.tour-card:focus { outline: none; }
.tour-head { display: flex; align-items: center; gap: 9px; margin-right: -6px; }
/* The same tile the page has in the list of pages. */
.tour-mark { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(155deg, color-mix(in srgb, var(--tone) 72%, #fff), var(--tone)); color: #fff; }
[data-theme='dark'] .tour-mark { background: linear-gradient(155deg, var(--tone), color-mix(in srgb, var(--tone) 78%, #000)); color: #0b0f17; }
.tour-mark .icon { width: 15px; height: 15px; stroke-width: 2; }
.tour-where { flex: 1; min-width: 0; overflow: hidden; color: var(--ink-2); font-size: 13px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.tour-count { flex: none; color: var(--ink-3); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.tour-close { width: 28px; height: 28px; }
.tour-bar { display: flex; gap: 3px; }
.tour-bar i { flex: 1; height: 4px; border-radius: 99px; background: var(--over); transition: background 0.2s; }
.tour-bar .past { background: color-mix(in srgb, var(--tone) 45%, var(--surface)); }
.tour-bar .now { background: var(--tone); }
.tour-title { display: flex; align-items: flex-start; gap: 8px; margin-top: 2px; }
.tour-card h2 { font-size: 17px; font-weight: 650; line-height: 1.3; letter-spacing: -0.01em; }
.tour-check { display: none; flex: none; margin-top: 1.5px; color: var(--ok); }
.tour-done .tour-check { display: block; animation: tour-pop 0.3s cubic-bezier(0.2, 1.4, 0.4, 1); }
.tour-card p { color: var(--ink-2); font-size: 14px; line-height: 1.5; }
/* What the tour can do in the visitor's place: a question to send, or the press itself. */
.tour-tries { display: flex; flex-wrap: wrap; gap: 6px; }
.tour-tries:empty { display: none; }
.tour-try { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 7px 12px; border-radius: 10px; background: color-mix(in srgb, var(--tone) 9%, var(--surface)); color: var(--tone); font-size: 13.5px; font-weight: 500; }
.tour-try:hover:not(:disabled) { background: color-mix(in srgb, var(--tone) 16%, var(--surface)); }
.tour-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.tour-back { margin-right: auto; }
.tour-foot .main, .tour-foot .quiet { min-width: 84px; justify-content: center; text-align: center; }

/* A toast says what a press inside the light did, so it stays above the dim. */
body:has(.tour) .toast { z-index: 30; }

@keyframes tour-in { from { opacity: 0; } }
@keyframes tour-ring { from { inset: -2px; opacity: 0.7; } to { inset: -16px; opacity: 0; } }
@keyframes tour-pop { from { scale: 0.4; opacity: 0; } }

/* On a phone the card sits at the bottom, the same place every step; the page scrolls its target above it. */
@media (max-width: 640px) {
  /* !important: on a wide window the script places the card with an inline transform, which must not follow it here. */
  .tour-card { top: auto; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); width: auto; transform: none !important; transition: none; }
  .tour-card-high { top: calc(12px + env(safe-area-inset-top)); bottom: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .tour-hole, .tour-card, .tour-bar i { transition: none; animation: none; }
  .tour-hole::after, .tour-done .tour-check { animation: none; }
}
