/* ChixyFX - help site.
   Plain static pages, no build step. Colors and fonts follow src/styles.css so the
   help looks like the tool; --accent is set per page from body[data-accent]. */

:root {
  --bg: #eef2f6;
  --panel: #ffffff;
  --ink: #13202f;
  --muted: #687586;
  --line: #d5dce5;
  --accent: #0f766e;
  --shot: #c81e1e;
}

/* Tab accents copied from src/styles.css so each help page matches its tab. */
body[data-accent="board"] { --accent: #8b5a2b; }
body[data-accent="paths"] { --accent: #65a30d; }
body[data-accent="lines"] { --accent: #0d9488; }
body[data-accent="atmospheric"] { --accent: #4f46e5; }
body[data-accent="flow"] { --accent: #0891b2; }
body[data-accent="coin"] { --accent: #c99a06; }
body[data-accent="trails"] { --accent: #c026d3; }
body[data-accent="sparks"] { --accent: #ea8a00; }
body[data-accent="hit"] { --accent: #dc2626; }
body[data-accent="settings"] { --accent: #6b7280; }

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

.help-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

/* ---------- sidebar (injected by help.js) ---------- */

.help-nav {
  position: sticky;
  top: 24px;
  align-self: start;
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.help-nav .brand {
  display: block;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  color: var(--ink);
  margin-bottom: 2px;
}

.help-nav .brand-sub {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--muted);
}

.help-nav h2 {
  margin: 16px 0 6px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.help-nav ul { list-style: none; margin: 0; padding: 0; }

.help-nav a {
  display: block;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 14px;
  text-decoration: none;
  color: var(--ink);
}

.help-nav a:hover { background: #eef2f6; }

.help-nav a.current {
  background: color-mix(in srgb, var(--accent) 14%, #ffffff);
  color: var(--accent);
  font-weight: 600;
}

.help-nav .pending {
  display: block;
  padding: 5px 8px;
  font-size: 14px;
  color: #a3adbb;
}

.help-nav .pending::after {
  content: " (soon)";
  font-size: 11px;
}

/* ---------- content ---------- */

.help-main {
  min-width: 0;
  padding: 28px 32px 40px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: 10px;
  background: var(--panel);
}

.help-main h1 {
  margin: 0 0 4px;
  font-size: 30px;
  line-height: 1.25;
}

.help-main .lede {
  margin: 0 0 28px;
  font-size: 18px;
  color: var(--muted);
}

.help-main h2 {
  margin: 36px 0 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 21px;
  color: var(--accent);
}

.help-main h3 {
  margin: 24px 0 6px;
  font-size: 17px;
}

.help-main p { margin: 0 0 12px; }

.help-main ul, .help-main ol { margin: 0 0 14px; padding-left: 22px; }
.help-main li { margin-bottom: 6px; }

.help-main a { color: var(--accent); }

kbd {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: #f8fafc;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 13px;
}

.ui {
  padding: 1px 6px;
  border-radius: 4px;
  background: #eef2f6;
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
}

/* ---------- one knob = one entry ---------- */

.knob {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: #fbfcfe;
}

.knob > p { margin: 0 0 6px; }
.knob > p:last-child { margin-bottom: 0; }
.knob .name { font-weight: 700; }
.knob .try, .knob .watch { font-size: 15px; color: #3d4b5c; }
.knob .try::before { content: "Try this: "; font-style: italic; color: var(--muted); }
.knob .watch::before { content: "Watch out: "; font-style: italic; color: var(--muted); }

/* ---------- callout boxes ---------- */

.note, .tip, .warn {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 8px;
  border-left: 4px solid;
  font-size: 15px;
}

.note { background: #f1f5f9; border-color: #94a3b8; }
.tip { background: #f0fdf4; border-color: #16a34a; }
.warn { background: #fff7ed; border-color: #ea580c; }

.note p:last-child, .tip p:last-child, .warn p:last-child { margin-bottom: 0; }

/* ---------- code, file listings and the render dialog sample (Settings: render) ---------- */

code {
  padding: 1px 5px;
  border-radius: 4px;
  background: #eef2f6;
  font-family: Consolas, "Courier New", monospace;
  font-size: 14px;
}

pre.files,
pre.dialog-sample {
  margin: 0 0 16px;
  padding: 12px 14px;
  /* Commands and file names wrap at spaces instead of running off the column or growing a scrollbar. */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.5;
}

pre.dialog-sample {
  border-left: 4px solid #94a3b8;
  background: #f1f5f9;
}

.help-main h3 {
  margin: 22px 0 10px;
  font-size: 18px;
}

/* ---------- screenshots ---------- */

figure.shot {
  margin: 0 0 20px;
  padding: 0;
}

/* Every picture fills the column, whatever its pixel size: a 2500 px window capture and a
   1200 px re-capture of the same thing render identically, so swapping an image never moves
   the page. Panel and detail crops are capped so a narrow picture is not blown up and blurred. */
figure.shot img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

/* The frame hugs the picture so the hotspot layer and the zoom hint line up with the picture
   itself, not with the text column. */
.shot-frame {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
}

.shot-frame img {
  cursor: zoom-in;
}

.shot-zoom-hint {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(19, 32, 47, 0.78);
  color: #fff;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.12s;
  cursor: zoom-in;
  pointer-events: none;
}

.shot-frame:hover .shot-zoom-hint {
  opacity: 1;
}

/* Clickable areas over a picture. Invisible until the pointer is near, so they never fight
   with the highlight boxes drawn into the picture itself. */
.shot-hotspots {
  position: absolute;
  inset: 0;
  /* Only the areas themselves take clicks, so a click anywhere else on the picture still
     opens the full-size viewer. */
  pointer-events: none;
}

.shot-hotspot {
  position: absolute;
  display: block;
  pointer-events: auto;
  border: 2px solid transparent;
  border-radius: 6px;
  text-decoration: none;
}

.shot-hotspot:hover,
.shot-hotspot:focus-visible {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  outline: none;
}

.shot-hotspot span {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}

.shot-hotspot:hover span,
.shot-hotspot:focus-visible span {
  opacity: 1;
}

figure.shot.has-hotspots figcaption::after {
  content: " The marked areas in this picture are links.";
  color: var(--accent);
}

/* Full-size viewer, opened by a click on a picture. */
.shot-viewer {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 40px 20px;
  background: rgba(11, 18, 26, 0.86);
  cursor: zoom-out;
}

.shot-viewer-body {
  max-width: 100%;
  max-height: 100%;
  overflow: auto;
}

.shot-viewer img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 80px);
  border-radius: 6px;
  background: #fff;
  cursor: zoom-in;
}

.shot-viewer.actual-size img {
  max-width: none;
  max-height: none;
  cursor: zoom-out;
}

.shot-viewer-close {
  position: fixed;
  top: 14px;
  right: 18px;
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font: 14px "Segoe UI", Arial, sans-serif;
  cursor: pointer;
}

figure.shot[data-frame="panel"] img {
  max-width: 420px;
}

figure.shot[data-frame="detail"] img {
  max-width: 560px;
}

/* Locks the height as well: the box keeps its shape even if a later capture has a slightly
   different aspect, and the picture is letterboxed inside it instead of resizing the page. */
figure.shot[data-ratio] img {
  aspect-ratio: var(--shot-ratio);
  object-fit: contain;
}

.shot-todo {
  margin: 0;
  padding: 14px 16px;
  border: 2px dashed var(--shot);
  border-radius: 8px;
  background: #fff5f5;
  color: var(--shot);
  font-weight: 700;
  font-size: 15px;
}

figure.shot figcaption {
  margin-top: 6px;
  font-size: 14px;
  color: var(--muted);
}

/* ---------- index cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.card {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
  text-decoration: none;
  color: var(--ink);
}

.card:hover { border-color: var(--accent); }
.card strong { display: block; margin-bottom: 2px; color: var(--accent); }
.card span { font-size: 14px; color: var(--muted); }

.card.pending { opacity: 0.55; pointer-events: none; }
.card.pending strong::after { content: " (soon)"; font-size: 12px; color: var(--muted); }

/* ---------- footer / prev-next ---------- */

.help-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-top: 36px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.help-foot a { color: var(--accent); text-decoration: none; }
.help-foot a:hover { text-decoration: underline; }
.help-foot .version { color: var(--muted); }

@media (max-width: 900px) {
  .help-shell { grid-template-columns: minmax(0, 1fr); }
  .help-nav { position: static; max-height: none; }
  .help-main { padding: 20px 18px 28px; }
}
