/* On-ramp: first-visit introduction and guided tour.
   The only colour on the site lives here: one soft, flat brick red for highlights,
   arrows, the active button and the glossary rule. Everything else reuses the site's greys. */
:root{
  --tour-red:#B5493D;
  --tour-on-red:#FFF7F5;
  --tour-red-wash:rgba(181,73,61,.12);
  --tour-scrim:rgba(10,10,10,.58);
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){ --tour-red:#E07567; --tour-on-red:#1C0F0D; --tour-red-wash:rgba(224,117,103,.14); --tour-scrim:rgba(0,0,0,.66); }
}
:root[data-theme="dark"]{ --tour-red:#E07567; --tour-on-red:#1C0F0D; --tour-red-wash:rgba(224,117,103,.14); --tour-scrim:rgba(0,0,0,.66); }

/* Guide button, beside the Online / This device switch */
.tour-tools{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.tour-open{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--ink);background:var(--panel);color:var(--ink);border-radius:999px;padding:6px 13px 6px 9px;font:inherit;font-size:13px;cursor:pointer;white-space:nowrap}
.tour-open:hover{border-color:var(--tour-red);color:var(--tour-red)}
.tour-open .q{display:grid;place-items:center;width:18px;height:18px;border-radius:50%;background:var(--tour-red);color:var(--tour-on-red);font-weight:700;font-size:12px;line-height:1}

/* Layer */
.tour{position:fixed;inset:0;z-index:60}
.tour-svg{position:absolute;inset:0;width:100%;height:100%;display:block}
.tour-svg .scrim{fill:var(--tour-scrim)}
.tour-svg .hole{fill:none;stroke:var(--tour-red);stroke-width:3}
.tour-svg .arrow{fill:none;stroke:var(--tour-red);stroke-width:2.5;stroke-linecap:round}
.tour-svg .head{fill:var(--tour-red)}

/* Card */
.tour-card{position:absolute;background:var(--panel);color:var(--ink);border:1px solid var(--line);border-top:4px solid var(--tour-red);border-radius:12px;padding:18px 18px 14px;width:min(380px,calc(100vw - 32px));max-height:calc(100% - 32px);overflow-y:auto;box-shadow:0 18px 40px -18px rgba(0,0,0,.6);font-family:var(--f-body);font-size:14px;line-height:1.55}
.tour-card.center{left:50%;top:50%;transform:translate(-50%,-50%);width:min(520px,calc(100vw - 32px));padding:22px 22px 16px}
.tour-card.dock{left:max(12px,env(safe-area-inset-left,0px));right:max(12px,env(safe-area-inset-right,0px));width:auto;max-height:52vh}
.tour-card.dock.bottom{bottom:calc(12px + env(safe-area-inset-bottom,0px))}
.tour-card.dock.top{top:calc(12px + env(safe-area-inset-top,0px))}
.tour-eyebrow{font-size:11px;letter-spacing:.09em;text-transform:uppercase;color:var(--tour-red);font-weight:700}
.tour-card h2{font-family:var(--f-title);font-weight:800;font-size:23px;line-height:1.08;letter-spacing:-.02em;margin:6px 0 8px;text-wrap:balance}
.tour-card.center h2{font-size:clamp(24px,5.4vw,30px)}
.tour-card p{margin:0 0 10px;max-width:60ch}
.tour-card ul{margin:0 0 10px;padding-left:18px}
.tour-card li{margin:3px 0}
.tour-card b{font-weight:700}

/* Glossary: a word and its plain meaning, set off by the red rule */
.tour-terms{margin:4px 0 12px;display:grid;gap:8px}
.tour-terms div{border-left:3px solid var(--tour-red);background:var(--tour-red-wash);padding:6px 10px;border-radius:0 6px 6px 0}
.tour-terms dt{display:inline;font-weight:700}
.tour-terms dt::after{content:": "}
.tour-terms dd{display:inline;margin:0}

/* Navigation */
.tour-nav{display:flex;align-items:center;gap:8px;margin-top:6px;flex-wrap:wrap}
.tour-nav .grow{flex:1 1 auto}
.tour-btn{border:1px solid var(--line);background:var(--panel);color:var(--ink);border-radius:8px;padding:8px 14px;font:inherit;font-size:13px;cursor:pointer;line-height:1.2}
.tour-btn:hover{border-color:var(--ink)}
.tour-btn.go{background:var(--tour-red);border-color:var(--tour-red);color:var(--tour-on-red);font-weight:700}
.tour-btn.go:hover{filter:brightness(1.06)}
.tour-link{border:0;background:none;color:var(--muted);font:inherit;font-size:12.5px;cursor:pointer;padding:6px 2px;text-decoration:underline;text-underline-offset:2px}
.tour-link:hover{color:var(--ink)}
.tour-card:focus{outline:none}
.tour-btn:focus-visible,.tour-link:focus-visible,.tour-choice:focus-visible,.tour-open:focus-visible{outline:2px solid var(--tour-red);outline-offset:2px}

/* Experience fork */
.tour-choices{display:grid;gap:8px;margin:6px 0 12px}
.tour-choice{display:block;width:100%;text-align:left;border:1px solid var(--line);background:var(--ground);color:var(--ink);border-radius:10px;padding:11px 13px;font:inherit;cursor:pointer}
.tour-choice b{display:block;font-family:var(--f-title);font-weight:700;font-size:16px;letter-spacing:-.01em}
.tour-choice span{font-size:12.5px;color:var(--muted)}
.tour-choice:hover{border-color:var(--tour-red);box-shadow:inset 0 0 0 1px var(--tour-red)}

/* Illustrations on the intro cards */
.tour-figure{margin:4px 0 14px;display:flex;justify-content:center}
.tour-figure svg{max-width:100%;height:auto}
.tour-figure .sq-l{fill:var(--sq-light)}
.tour-figure .sq-d{fill:var(--subtle);opacity:.55}
.tour-figure .edge{fill:none;stroke:var(--ink);stroke-width:1.5}
.tour-figure .cit{fill:var(--tour-red-wash);stroke:var(--tour-red);stroke-width:2.5}
.tour-figure .lab{font-family:var(--f-body);font-size:10px;fill:var(--tour-red);font-weight:700}
.tour-timeline{list-style:none;margin:6px 0 14px;padding:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;position:relative}
.tour-timeline::before{content:"";position:absolute;left:6px;right:6px;top:6px;height:2px;background:var(--line)}
.tour-timeline li{position:relative;padding-top:20px;font-size:11.5px;line-height:1.35;color:var(--muted);min-width:0}
.tour-timeline li::before{content:"";position:absolute;left:0;top:0;width:14px;height:14px;border-radius:50%;background:var(--panel);border:2px solid var(--subtle);box-sizing:border-box}
.tour-timeline li b{display:block;color:var(--ink);font-size:12px}
.tour-timeline li.here::before{background:var(--tour-red);border-color:var(--tour-red)}
.tour-timeline li.here b{color:var(--tour-red)}

@media (prefers-reduced-motion: no-preference){
  .tour-card{animation:tour-in .18s ease-out}
  .tour-card.center{animation:tour-in-c .2s ease-out}
}
@keyframes tour-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@keyframes tour-in-c{from{opacity:0;transform:translate(-50%,calc(-50% + 8px))}to{opacity:1;transform:translate(-50%,-50%)}}
