/* The welcome tour (js/welcome-tour.js, data/tour.json): a small guide beside a speech card, and a soft ring round
   what it points at. Tokens from css/tokens.css; the guide's colours come from the brand's accent (--accent, --accent-2),
   so Dew's drop is blue and Meridian's globe is amber. Everything decorative lets clicks through
   (nothing-covers-what-you-press.md); reduced motion (the device's or Settings → Accessibility) animates nothing. */

/* ---- the offer: "take a 2-minute tour?" (bottom left, above the dock, like the other calm cards) ---- */
.tour-offer {
  position: fixed; z-index: 46; left: 14px; bottom: calc(var(--dock-h) + 14px); max-width: min(460px, calc(100% - 28px));
  display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 16px;
  background: var(--glass-strong); border: 1px solid var(--line); box-shadow: 0 12px 34px var(--shadow); color: var(--text);
  animation: tour-in var(--mo-base) var(--mo-ease) both;
}
body.earth-desk .tour-offer { bottom: calc(var(--dock-h) + var(--earth-foot, 72px)); }
body.module-open .tour-offer { visibility: hidden; pointer-events: none; }
.tour-offer-pic { flex: none; width: 40px; height: 46px; pointer-events: none; }
.tour-offer-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tour-offer-text { margin: 0; font-size: calc(14px * var(--ts, 1)); line-height: 1.4; }
.tour-offer-btns { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 900px) { .tour-offer { bottom: calc(var(--dock-h) + 72px); } }
@media (max-width: 760px) { .tour-offer { left: 16px; right: 16px; max-width: none; } }

/* ---- the guide and its card ---- */
.tour {
  position: fixed; z-index: 84; left: 0; top: 0; width: min(540px, calc(100vw - 32px));
  display: flex; align-items: flex-end; gap: 10px; color: var(--text);
  animation: tour-in var(--mo-base) var(--mo-ease) both;
  transition: left var(--mo-slow) var(--mo-ease), top var(--mo-slow) var(--mo-ease);
}
.tour-guide { flex: none; width: 66px; height: 74px; pointer-events: none; animation: tour-bob 4.2s ease-in-out infinite; filter: drop-shadow(0 6px 10px var(--shadow)); }
.tour-guide .tg-eyes { transform-origin: 32px 46px; animation: tour-blink 5.5s infinite; }
.tour-card {
  flex: 1; min-width: 0; padding: 14px 16px 12px; border-radius: 18px;
  background: var(--glass-strong); border: 1px solid var(--line); box-shadow: 0 14px 40px var(--shadow), var(--sheen, none);
  backdrop-filter: blur(10px);
}
.tour-head { display: flex; align-items: flex-start; gap: 8px; }
.tour-title { margin: 0; flex: 1; min-width: 0; font: 700 calc(17px * var(--ts, 1))/1.25 var(--font-head, var(--font)); color: var(--text); }
.tour-tools { display: flex; gap: 2px; flex: none; margin: -4px -6px 0 0; }
.tour-tool { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.tour-tool:hover, .tour-tool:focus-visible { background: rgba(var(--tint), .1); color: var(--text); }
.tour-tool[aria-pressed="false"] { opacity: .7; }
.tour-live { margin: 6px 0 4px; }
.tour-text { margin: 0; font-size: calc(14.5px * var(--ts, 1)); line-height: 1.5; color: var(--text); }
.tour-count { display: block; margin: 8px 0 0; font-size: calc(12px * var(--ts, 1)); color: var(--muted); }
.tour-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.tour-dots { display: flex; gap: 6px; pointer-events: none; }
.tour-dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(var(--tint), .22); transition: background var(--mo-base), transform var(--mo-base); }
.tour-dots span.done { background: rgba(var(--tint), .5); }
.tour-dots span.on { background: var(--accent); transform: scale(1.35); }
.tour-btns { display: flex; gap: 8px; margin-left: auto; }
.tour-btns button[hidden] { display: none; }
.tour button:focus-visible, .tour-offer button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* the ring round what the card points at: soft, and never in the way of a click */
.tour-ring {
  position: fixed; z-index: 83; pointer-events: none; border-radius: 18px;
  border: 2px solid var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent), 0 0 24px color-mix(in srgb, var(--accent) 45%, transparent);
  animation: tour-glow 2.4s ease-in-out infinite;
  transition: left var(--mo-base) var(--mo-ease), top var(--mo-base) var(--mo-ease), width var(--mo-base) var(--mo-ease), height var(--mo-base) var(--mo-ease);
}
.tour-ring[hidden] { display: none; }
.tour *, .tour-ring, .tour-guide, .tour-offer-pic { -webkit-tap-highlight-color: transparent; }

@keyframes tour-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes tour-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes tour-blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@keyframes tour-glow { 0%, 100% { opacity: .85; } 50% { opacity: .5; } }

/* phone: the card runs the width of the screen between 16px gutters, above the dock (or at the top when the dock is what it shows) */
@media (max-width: 760px) {
  .tour { width: calc(100vw - 32px); max-width: none; left: 16px; padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
  .tour[data-pos="bc"] { padding-bottom: env(safe-area-inset-bottom); }
  .tour-guide { width: 46px; height: 52px; }
  .tour-card { padding: 12px 14px 10px; }
  .tour-tool { width: 44px; height: 44px; }
  .tour-tools { margin: -10px -12px 0 0; }
  .tour .tour-btns button, .tour-offer button { min-height: 44px; }
}

/* reduced motion: nothing moves, nothing fades */
html[data-motion="reduce"] :is(.tour, .tour-offer, .tour-guide, .tour-guide .tg-eyes, .tour-ring, .tour-dots span) { animation: none; transition: none; }
@media (prefers-reduced-motion: reduce) {
  html:not([data-motion="full"]) :is(.tour, .tour-offer, .tour-guide, .tour-guide .tg-eyes, .tour-ring, .tour-dots span) { animation: none; transition: none; }
}
/* high contrast and forced colours: a plain, solid ring */
html[data-contrast="high"] .tour-ring { box-shadow: none; border-width: 3px; }
@media (forced-colors: active) { .tour-ring { border-color: Highlight; box-shadow: none; } .tour-card, .tour-offer { border-color: CanvasText; } }

/* ---- "Check it out" on an update note (js/update-tour.js): the same card without the guide, an arrow and a picture ---- */
.tour.ut { align-items: stretch; }
.tour.ut .tour-card { width: 100%; }
.ut-ring { z-index: 85; }
.ut-arrows { position: fixed; z-index: 86; left: 0; top: 0; width: 100vw; height: 100vh; pointer-events: none; overflow: visible; }
.ut-arrows line { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; fill: none; }
.ut-arrows path { fill: var(--accent); }
.ut-arrows g { filter: drop-shadow(0 1px 3px var(--shadow)); }
.tour.ut { z-index: 87; }
.ut-pic { display: block; max-width: 100%; max-height: 40vh; margin: 0 0 8px; border-radius: 10px; border: 1px solid var(--line); }
.ut-pic[hidden] { display: none; }
@media (forced-colors: active) { .ut-arrows line { stroke: Highlight; } .ut-arrows path { fill: Highlight; } }
