/* The header's "What's this?" bubble, the "Ask about this site" helper and the intro tour's extras (#439).
   Colours come from the tokens in styles.css, so day and night mode follow. */

/* The logo row: mark, name and the line under it, then a bare "?" at the end of that line.
   hub-intro.js pins the "?" next to the line's last word; until it runs, it sits at the row's right. */
.brand { position: relative; display: flex; align-items: center; gap: 10px; padding-right: 24px; }
.brand__ver { font: inherit; color: inherit; }
.brand__what {
  position: absolute; right: 0; top: calc(50% - 9px); display: grid; place-items: center; width: 18px; height: 18px; padding: 0;
  border: 0; border-radius: 50%; background: none; color: var(--top-muted); cursor: pointer;
}
.brand__what-q { display: grid; place-items: center; width: 16px; height: 16px; border: 1.5px solid currentColor; border-radius: 50%; font: 800 10.5px/1 system-ui, -apple-system, "Segoe UI", sans-serif; }
.brand__what:hover .brand__what-q, .brand__what[aria-expanded="true"] .brand__what-q { background: var(--cyan); border-color: var(--cyan); color: var(--navy); }
.brand__what:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
/* First visit: one small wave, then still. */
.brand__what.is-new .brand__what-q { animation: hub-wave 1.6s ease-in-out 2; }
@keyframes hub-wave { 0%, 100% { transform: rotate(0) scale(1); } 15% { transform: rotate(-14deg) scale(1.12); } 30% { transform: rotate(12deg) scale(1.12); } 45% { transform: rotate(-6deg) scale(1.05); } 60% { transform: rotate(0) scale(1); } }

/* The bubble: a card with a little tail pointing back at the button. */
.hub-what {
  position: fixed; z-index: 40; width: min(370px, calc(100vw - 24px));
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--ink);
  box-shadow: 0 14px 40px rgba(15, 25, 35, .18), 0 2px 6px rgba(15, 25, 35, .08); font-size: 15.5px; line-height: 1.5;
  animation: hub-pop .16s ease-out;
}
.hub-what::before {
  content: ""; position: absolute; top: -8px; left: calc(var(--tip, 40px) - 7px); width: 14px; height: 14px;
  background: var(--panel); border-left: 1px solid var(--line); border-top: 1px solid var(--line); transform: rotate(45deg);
}
.hub-what__in { position: relative; max-height: calc(100vh - 110px); overflow-y: auto; padding: 18px 18px 16px; border-radius: var(--radius); }
@keyframes hub-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .hub-what { animation: none; } }
.hub-what__x { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 23px; line-height: 1; cursor: pointer; }
.hub-what__x:hover { background: var(--bg); color: var(--ink); }
.hub-what__head { display: flex; align-items: center; gap: 12px; margin: 0 28px 10px 0; }
.hub-what__mark { width: 40px; height: 40px; flex: none; color: var(--accent); }
.hub-what__mark circle:not([r="6"]) { fill: var(--panel); stroke: currentColor; stroke-width: 2; }
.hub-what h2 { margin: 0; font-size: 20px; line-height: 1.2; }
.hub-what__in > p.hub-what__lead { font-size: 16.5px; }
.hub-what__ver { display: inline-block; padding: 1px 7px; border-radius: var(--r-tag); background: var(--accent-soft); color: var(--accent); font-size: 13px; vertical-align: 2px; }
.hub-what__by { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.hub-what__in > p { margin: 0 0 12px; }
.hub-what__acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.hub-what__tour { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 16px 0 12px; border: 0; border-radius: var(--radius); background: var(--accent); color: var(--panel); font: inherit; font-weight: 700; cursor: pointer; }
.hub-what__tour svg { width: 16px; height: 16px; }
.hub-what__tour:hover { filter: brightness(1.08); }
.hub-what__tour:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.hub-what__acts a { font-weight: 600; }
.hub-what__ask { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.hub-what__ask h3 { margin: 0 0 8px; font-size: 14px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }

/* The helper: a box, a few starter questions, and the answer. */
.hub-ask__form { display: flex; gap: 6px; }
.hub-ask__form input { flex: 1; min-width: 0; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--ink); font: inherit; font-size: 15.5px; }
.hub-ask__form input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.hub-ask__form button { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--accent); color: var(--panel); cursor: pointer; }
.hub-ask__form button svg { width: 18px; height: 18px; }
.hub-ask__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hub-ask__chips button { padding: 4px 10px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--panel); color: var(--ink); font: inherit; font-size: 14px; line-height: 1.3; text-align: left; cursor: pointer; }
.hub-ask__chips button:hover { border-color: var(--accent); color: var(--accent); }
.hub-ask__out:empty { display: none; }
.hub-ask__a { margin-top: 10px; padding: 10px 12px; border-radius: var(--radius) var(--radius) var(--radius) var(--r-tag); background: var(--accent-soft); color: var(--ink); font-size: 15px; }
.hub-ask__a p { margin: 0 0 6px; }
.hub-ask__a p:last-child { margin: 0; }
.hub-ask__q { font-weight: 700; }
.hub-ask__a--miss { background: var(--bg); }
.hub-ask__acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.hub-ask__acts a { font-weight: 600; color: var(--accent); }
.hub-ask__send, .hub-ask__tour { padding: 5px 12px; border: 1px solid var(--accent); border-radius: var(--r-ctl); background: var(--panel); color: var(--accent); font: inherit; font-weight: 700; font-size: 14.5px; cursor: pointer; }

/* In the tour: the helper rides along under each card's text. */
.hub-tag { margin: 10px 0 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.hub-tag summary { display: flex; align-items: center; gap: 8px; padding: 8px 10px; color: var(--accent); font-size: 15px; font-weight: 600; cursor: pointer; list-style: none; }
.hub-tag summary::-webkit-details-marker { display: none; }
.hub-tag__face { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--panel); font-size: 13px; font-weight: 800; }
.hub-tag[open] summary { border-bottom: 1px solid var(--line); }
.hub-tag .hub-ask { padding: 10px; }
.hub-slide__note { color: var(--vst-muted, var(--muted)); font-size: 15px; }
.vst-body kbd { padding: 0 5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: var(--r-tag); font: 600 13px/1.4 ui-monospace, monospace; }

/* The graph on the tour's third slide. */
.hub-graph { display: block; width: 100%; max-width: 340px; height: auto; margin: 4px auto 10px; font: 600 10px system-ui, -apple-system, "Segoe UI", sans-serif; }
.hub-graph__e path { stroke: var(--accent); stroke-width: 1.3; stroke-dasharray: 3 3; opacity: .55; }
.hub-graph__l text { fill: var(--muted); font-size: 8px; font-style: italic; paint-order: stroke; stroke: var(--panel); stroke-width: 3px; stroke-linejoin: round; }
.hub-graph__n rect { fill: var(--panel); stroke: var(--accent); stroke-width: 1.3; }
.hub-graph__n text { fill: var(--ink); }
.hub-graph__n .hub-graph__t { fill: var(--muted); font-size: 7px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.hub-graph__n--campaign rect { fill: var(--accent-soft); }
.hub-graph__n--public rect { fill: var(--o-public-bg); stroke: var(--o-public); }
.hub-graph__n--commercial rect { fill: var(--o-commercial-bg); stroke: var(--o-commercial); }
.hub-graph__n--nonprofit rect { fill: var(--o-nonprofit-bg); stroke: var(--o-nonprofit); }
.hub-graph__n--study rect { stroke: var(--muted); stroke-dasharray: 4 2; }
.hub-graph__n--help rect { stroke-width: 2.2; }
.hub-graph__n--topic rect { fill: var(--accent); }
.hub-graph__n--topic text, .hub-graph__n--topic .hub-graph__t { fill: var(--panel); }
.hub-graph__n--topic text { font-size: 13px; font-weight: 800; }
.hub-graph__n--topic .hub-graph__t { font-size: 7.5px; opacity: .85; }
@media (prefers-reduced-motion: no-preference) {
  .hub-graph__e path { animation: hub-flow 1.4s linear infinite; }
  @keyframes hub-flow { to { stroke-dashoffset: -12; } }
}
