/* ============================================================
   TypeNext Help / Knowledge base
   Layers on top of styles.css — reuses its tokens, header,
   footer, .legal typography, .callout, kbd and code.
   ============================================================ */

/* ---------- landing ---------- */
.help-hero {
  text-align: center;
  padding-block: clamp(36px, 6vw, 72px) clamp(8px, 2vw, 18px);
}
.help-hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 6vw, 56px);
  letter-spacing: -0.02em;
  line-height: 1.04;
}
.help-hero .lead {
  margin: 16px auto 0;
  max-width: 52ch;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 20px);
}

.help-cat { padding-block: clamp(22px, 3vw, 34px); border-top: 1px solid var(--line); }
.help-cat:first-of-type { border-top: 0; }
.help-cat h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(22px, 3vw, 28px);
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}
.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 14px;
}
.help-card {
  display: block;
  padding: 17px 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.help-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.help-card h3 { font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.help-card p { color: var(--muted); font-size: 14.5px; line-height: 1.5; }

/* ---------- article layout ---------- */
.help-layout {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
  padding-block: clamp(18px, 3vw, 34px) clamp(44px, 6vw, 76px);
}
.help-side {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 20px;
}
.help-side .grp-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--quiet);
  margin-bottom: 7px;
}
.help-side ul { display: grid; gap: 1px; }
.help-side a {
  display: block;
  padding: 6px 11px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.35;
}
.help-side a:hover { background: rgba(28, 24, 19, 0.05); color: var(--ink); }
.help-side a.is-current {
  background: rgba(168, 60, 20, 0.1);
  color: var(--terracotta);
  font-weight: 600;
}

.help-crumb { display: inline-block; margin-bottom: 14px; color: var(--quiet); font-size: 14px; }
.help-crumb:hover { color: var(--terracotta); }

.help-head { padding-bottom: 6px; }
.help-head h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 5vw, 44px);
  letter-spacing: -0.02em;
  line-height: 1.06;
}
.help-head .lead {
  margin-top: 12px;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 19px);
  max-width: 62ch;
}

/* Reuse .legal typography, but left-aligned and full-width in the column. */
.help-main .legal { max-width: none; margin: 0; padding-block: 10px 0; }

/* A compact key/step list and a definition-style table read well in guides. */
.help-steps { counter-reset: step; display: grid; gap: 12px; margin: 4px 0 20px; padding: 0; }
.help-steps li {
  position: relative;
  padding-left: 40px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  list-style: none;
}
.help-steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(168, 60, 20, 0.1);
  color: var(--terracotta);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
}
.help-steps li strong { color: var(--ink); }

.help-more {
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  font-size: 14.5px;
}
.help-more a { color: var(--terracotta); }
.help-more a:hover { text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 860px) {
  .help-layout { grid-template-columns: 1fr; gap: 24px; }
  .help-side { position: static; top: auto; }
}

/* ============================================================
   Figures (real app screenshots) + inline demo mockups
   ============================================================ */
.help-fig { margin: 10px 0 26px; }
.help-fig img {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  background: var(--surface);
}
.help-fig figcaption {
  margin-top: 9px;
  color: var(--quiet);
  font-size: 13px;
  text-align: center;
}

.demo { margin: 4px 0 24px; }
.demo--center { text-align: center; }
.demo-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--quiet);
  margin-bottom: 9px;
}
.demo-hint { margin-top: 12px; color: var(--quiet); font-size: 14px; }
.demo .caret {
  display: inline-block;
  width: 2px; height: 1.05em;
  background: var(--terracotta);
  vertical-align: -0.16em;
  margin: 0 1px;
  border-radius: 1px;
}

/* ghost-text editor */
.demo-editor {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--ink);
}
.demo-editor .ghost { color: rgba(28, 24, 19, 0.32); }

/* voice bar */
.demo-bars { display: flex; justify-content: center; align-items: center; gap: 16px; flex-wrap: wrap; }
.vb-pill, .vb-cap {
  display: inline-flex; align-items: center;
  background: #2a2522;
  box-shadow: var(--shadow-sm);
}
.vb-pill { gap: 8px; padding: 8px 14px; border-radius: 999px; }
.vb-cap { gap: 8px; padding: 8px 10px; border-radius: 999px; }
.vb-pill svg { width: 13px; height: 13px; color: rgba(255, 255, 255, 0.85); }
.vb-wave { display: inline-flex; align-items: center; gap: 3px; height: 18px; }
.vb-wave i { width: 3px; border-radius: 2px; display: block; }
.vb-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.1); }
.vb-btn svg { width: 17px; height: 17px; color: #fff; }
.vb-btn.rec { background: rgba(232, 90, 60, 0.26); }
.vb-btn.rec svg { color: #ff9b86; }

/* emoji picker */
.demo-emoji {
  display: inline-block;
  text-align: left;
  width: 260px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.demo-emoji .de-input {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink);
}
.demo-emoji ul { padding: 6px; display: grid; gap: 1px; }
.demo-emoji li { display: flex; align-items: center; gap: 11px; padding: 7px 9px; border-radius: 8px; }
.demo-emoji li.sel { background: rgba(168, 60, 20, 0.1); }
.demo-emoji li .g { font-size: 18px; line-height: 1; }
.demo-emoji li .c { color: var(--muted); font-family: var(--mono); font-size: 13px; }
.demo-emoji .de-hint { padding: 8px 13px; border-top: 1px solid var(--line); color: var(--quiet); font-size: 12px; }

/* snippet expand */
.demo-snippet { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.snip-box { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 12px 16px; box-shadow: var(--shadow-sm); }
.snip-box .trig { font-family: var(--mono); color: var(--forest-2); background: rgba(56, 87, 63, 0.1); padding: 0.1em 0.4em; border-radius: 6px; }
.snip-box .exp { color: var(--ink); }
.snip-arrow { color: var(--terracotta); font-size: 22px; line-height: 1; }

/* read-aloud bar */
.demo-speak { display: inline-flex; align-items: center; gap: 12px; padding: 9px 16px; border-radius: 999px; background: #2a2522; box-shadow: var(--shadow); }
.demo-speak .sp-btn { width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 255, 255, 0.14); display: grid; place-items: center; }
.demo-speak .sp-btn svg { width: 13px; height: 13px; color: #fff; }
.demo-speak .sp-wave { display: inline-flex; align-items: center; gap: 3px; height: 18px; }
.demo-speak .sp-wave i { width: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.7); display: block; }
.demo-speak .sp-time { color: rgba(255, 255, 255, 0.7); font-size: 13px; font-family: var(--mono); }

/* landing card icons */
.help-card-ico {
  display: inline-flex;
  width: 32px; height: 32px;
  align-items: center; justify-content: center;
  border-radius: 9px;
  background: rgba(168, 60, 20, 0.1);
  color: var(--terracotta);
  margin-bottom: 11px;
}
.help-card-ico svg { width: 17px; height: 17px; }
