/* ============================================================================
   HitchTour — guided walkthrough overlay.

   House chrome: the card is a .panel--home (var(--panel), 1px var(--line),
   12px radius) and the header follows the .shead idiom — mono accent kicker
   over a serif name. Nothing here invents a color; every value is a token
   from hitch-tokens.css so the tour cannot drift from the app it sits on.
   ========================================================================== */

.tour-scrim {
  position: fixed;
  inset: 0;
  z-index: 200;
  opacity: 0;
  pointer-events: auto;
  transition: opacity 0.28s var(--ease);
}
.tour-scrim.on { opacity: 1; }

/* The spotlight is one element casting an enormous shadow outward, so the
   "hole" is simply the part the shadow does not cover. Cheaper and sharper
   than an SVG mask, and it animates as a plain rect. */
.tour-hole {
  position: fixed;
  z-index: 201;
  border-radius: 12px;
  /* 0.88, not the 0.62 the whole-budget help modal uses. That overlay can lean
     on backdrop-filter because it dims everything uniformly; a spotlight cannot
     blur "all except this rect" with one element. On a #0a0b0d app the scrim
     barely moves the BACKGROUND either way — what it actually buys is muting
     the ink, and at 0.74 the surrounding text stayed comfortably readable,
     which is the one thing a spotlight must not allow. */
  box-shadow: 0 0 0 9999px rgba(6, 7, 9, 0.88);
  border: 1px solid rgba(232, 161, 60, 0.5);
  pointer-events: none;
  transition: top 0.34s var(--ease), left 0.34s var(--ease),
              width 0.34s var(--ease), height 0.34s var(--ease);
}
/* A centred step (welcome / finish) has no target: collapse the hole to
   nothing so the scrim reads as a flat dim. */
.tour-hole.none {
  width: 0; height: 0;
  border-color: transparent;
  top: 50%; left: 50%;
}

.tour-card {
  position: fixed;
  z-index: 202;
  width: min(370px, calc(100vw - 2.4rem));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.15rem 1.25rem 1.1rem;
  box-shadow: 0 30px 70px -24px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.24s var(--ease), transform 0.24s var(--ease),
              top 0.34s var(--ease), left 0.34s var(--ease);
}
.tour-card.on { opacity: 1; transform: none; }
.tour-card.mid { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.tour-card.mid.on { transform: translate(-50%, -50%); }

.tour-card__k {
  font-family: var(--mono);
  font-size:.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-ink,var(--accent));
}
/* gold as text reads 2:1 on the light card; the house light --accent-soft (2026-10-26) */
body.light .tour-card__k { color: #8a5a10; }
.tour-card__t {
  font-family: var(--serif);
  font-size: 1.32rem;
  line-height: 1.12;
  color: var(--ink);
}
.tour-card__b {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--ink-dim);
}
.tour-card__b b { font-weight: 500; color: var(--ink); }

.tour-card__foot {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 0.25rem;
}
.tour-card__step {
  font-family: var(--mono);
  font-size:.6875rem;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  flex: 1;
}

.tour-btn {
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  border-radius: 100px;
  padding: 0.5rem 1.1rem;
  border: 1px solid transparent;
  background: none;
  color: inherit;
  transition: background 0.2s var(--ease), color 0.2s var(--ease),
              border-color 0.2s var(--ease);
}
.tour-btn--go { background: var(--accent); color: #1a1206; font-weight: 500; }
.tour-btn--go:hover { background: var(--accent-soft); }
.tour-btn--ghost { color: var(--ink-dim); border-color: var(--line); }
.tour-btn--ghost:hover { color: var(--ink); border-color: var(--ink-faint); }
.tour-btn--quit {
  font-family: var(--mono);
  font-size:.6875rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 0.5rem 0;
}
.tour-btn--quit:hover { color: var(--ink-dim); }

.tour-scrim:focus-visible,
.tour-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ------------------------------------------------------------- the Help -
   One permanent header control on every surface, in the same place, opening
   the same menu. It is a labelled pill — a filled amber "?" plus the word
   HELP, in the Search pill's type — because the bare 30px "?" circle it
   replaced (2026-10-29) read as decoration and people did not find it.

   Every page's markup is still `<button class="hitch-help">?</button>`; the
   glyph and the label are drawn here so no page had to change. font-size 0
   hides the literal "?" text node, and both pseudo-elements size in rem so
   they do not inherit that 0. The class is doubled for specificity: the CIT
   workbench's button also wears .fx-gear, whose 30px circle is injected at
   runtime and would otherwise win on source order. The amber is the same in
   both themes, so the glyph's dark ink is fixed rather than a token. */
.hitch-help.hitch-help {
  width: auto; height: 30px; flex: none;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 0 12px 0 4px;
  border-radius: 100px;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--ink);
  font-size: 0; line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.hitch-help.hitch-help::before {
  content: "?";
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-grid; place-items: center;
  background: var(--accent); color: #14110a;
  font-family: var(--sans, inherit); font-size: 0.86rem; font-weight: 700;
}
.hitch-help.hitch-help::after {
  content: "Help";
  font-family: var(--mono, inherit);
  font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase;
}
.hitch-help.hitch-help:hover,
.hitch-help.hitch-help[aria-expanded="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}
.hitch-help.hitch-help:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* A phone's header has no room for the word: the filled "?" stays. */
@media (max-width: 720px) {
  .hitch-help.hitch-help { padding: 0 3px; }
  .hitch-help.hitch-help::after { content: none; }
}

/* ------------------------------------------------------------- the menu -
   The "?" names what it is about to do before it does it. That matters more
   than it would for an ordinary menu, because one of the choices takes over
   the whole screen. */
.tour-menu {
  /* Same box as the header's module menus (modules.js, `.bgroup__panel--menu`,
     2026-10-29): one 17rem column, 12px padding, 14px corners, --bg-soft with
     the tray's border and shadow. When those change, change these with them. */
  position: fixed;
  z-index: 203;
  width: 17rem;
  max-width: calc(100vw - 16px);
  box-sizing: border-box;
  background: var(--bg-soft, var(--panel));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.8), 0 0 0 1px var(--line-soft, var(--line));
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
}
.tour-menu.on { opacity: 1; transform: none; }

/* An item is a tray line: name over a one-line description. The class names are
   namespaced and the type is reset on purpose: the menu sits in <body> on every page,
   and the opportunities board's own `.mk` (uppercase mono) once turned every item
   title into capitals (2026-10-30). */
.tour-menu__item {
  display: block;
  box-sizing: border-box;
  width: 100%; margin: 0; text-align: left;
  font-family: var(--sans, inherit); color: var(--ink);
  background: none; border: 0; cursor: pointer;
  padding: 7px 30px 8px 22px;
  border-radius: 8px;
  font-size: 1rem; font-style: normal; letter-spacing: 0; text-transform: none; white-space: normal;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.tour-menu__item:hover,
.tour-menu__item:focus-visible { background: var(--line-soft, var(--panel2)); outline: none; }
.tour-menu__item .tour-menu__k { display: block; text-transform: none; letter-spacing: 0; font-size: 0.84rem; font-weight: 500; line-height: 1.25; color: var(--ink); }
.tour-menu__item .tour-menu__x { margin-left: 0.35rem; color: var(--ink-dim); font-weight: 400; }
.tour-menu__item .tour-menu__d { display: block; text-transform: none; letter-spacing: 0; margin-top: 2px; font-size: 0.74rem; font-weight: 400; line-height: 1.35; color: var(--ink-dim); }
.tour-menu__h {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 10px 4px;
  font-family: var(--sans, inherit);
  font-size:.6875rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent-soft, var(--accent));
}
.tour-menu__h::before { content: ""; width: 6px; height: 6px; background: var(--accent); }

@media (prefers-reduced-motion: reduce) { .tour-menu { transition: none; } }

/* ------------------------------------------------------- the definitions -
   Same shape as the help modal whole-budget already ships (.help-ov/.help-card
   in whole.css) — deliberately, so the two read as one thing. Namespaced apart
   from it rather than sharing the class, because that page keeps its own
   modal and two stylesheets fighting over .help-card is a bug waiting to be
   filed. */
.hdefs-ov {
  position: fixed; inset: 0; z-index: 210;
  background: rgba(6, 7, 9, 0.66);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 1.2rem;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s var(--ease);
}
.hdefs-ov.on { opacity: 1; pointer-events: auto; }

.hdefs-card {
  position: relative;
  max-width: 680px; width: 100%; max-height: 86vh;
  overflow-y: auto;
  background: var(--bg-soft, var(--panel));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.7rem 1.9rem 2rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.hdefs-card h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: 1.7rem; line-height: 1.1; margin-bottom: 0.4rem; color: var(--ink);
}
.hdefs-card h3 {
  font-family: var(--mono);
  font-size:.6875rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent-ink,var(--accent));
  margin: 1.5rem 0 0.7rem;
}
.hdefs-intro { font-size: 0.92rem; line-height: 1.6; color: var(--ink-dim); }
.hdefs-foot {
  margin-top: 1.4rem; padding-top: 0.9rem;
  border-top: 1px solid var(--line-soft, var(--line));
  font-size: 0.8rem; line-height: 1.55; color: var(--ink-faint);
}
.hdefs-def {
  display: grid; grid-template-columns: 12.5rem minmax(0, 1fr); gap: 0 1.1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line-soft, rgba(244, 241, 234, 0.06));
}
.hdefs-def:last-child { border-bottom: none; }
.hdefs-def > b { font-weight: 500; font-size: 0.88rem; color: var(--ink); }
.hdefs-def > span { font-size: 0.85rem; line-height: 1.55; color: var(--ink-dim); }
.hdefs-def em { font-style: italic; color: var(--accent-soft); }
.hdefs-card b { color: var(--ink); font-weight: 500; }

.hdefs-x {
  position: absolute; top: 0.9rem; right: 1rem;
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--line); background: transparent;
  color: var(--ink-faint); font: inherit; font-size: 0.8rem; line-height: 1;
  cursor: pointer; display: grid; place-items: center;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.hdefs-x:hover { color: var(--accent-ink,var(--accent)); border-color: var(--accent); }

@media (max-width: 620px) {
  .hdefs-def { grid-template-columns: minmax(0, 1fr); gap: 0.15rem; }
}
@media (prefers-reduced-motion: reduce) { .hdefs-ov { transition: none; } }

/* The legacy text launcher. Still bound, so a link rather than a button in the
   flow of a sentence keeps working. */
.tour-open {
  font: inherit;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-dim);
  text-decoration: none;
  padding: 0;
}
.tour-open:hover { color: var(--accent-ink,var(--accent)); }

@media (prefers-reduced-motion: reduce) {
  .tour-scrim, .tour-hole, .tour-card { transition: none; }
}

@media (max-width: 560px) {
  /* On a narrow screen there is nowhere beside the target to stand, so the
     card parks at the bottom and the spotlight does the pointing. */
  .tour-card:not(.mid) {
    left: 1.2rem !important;
    right: 1.2rem;
    width: auto;
    top: auto !important;
    bottom: 1.2rem;
  }
}
