/* Training slides for the Skybots Bank exercise (help.html).
 *
 * The deck itself: top bar, step list, slide, step buttons, the prompts and
 * the checklist. The animated scenes inside each slide are in scenes.css.
 * Loaded after bank.css and uses its colour tokens. Without JavaScript every
 * slide stacks, so the page still reads as a handout; help.js adds .js to
 * <html> and shows one slide at a time.
 */

.help-page { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- top bar ---------- */
.help-top { position: relative; z-index: 6; display: flex; align-items: center; gap: 16px; height: 68px; padding: 0 28px; flex: none; background: var(--side); }
.help-logo img { display: block; width: auto; height: 40px; }
.help-top .name {
  flex: 1; margin: 0; padding-left: 18px; border-left: 1px solid rgba(255, 255, 255, .16);
  color: var(--side-ink); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.help-top .name strong { color: #fff; font-weight: 600; }
.top-link {
  padding: 10px 16px; border: 1px solid rgba(255, 255, 255, .28); border-radius: 999px; background: none;
  color: #fff; font-size: 14px; line-height: 1; text-decoration: none; white-space: nowrap;
}
.top-link:hover { background: rgba(255, 255, 255, .08); }
.top-link[hidden] { display: none; }
.top-link.answer { border-color: var(--accent); background: var(--accent); font-weight: 600; }
.top-link.answer:hover { background: #3d3db0; }

/* how far through the training you are */
.progress { height: 3px; background: rgba(28, 35, 64, .12); }
.progress i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, #6366f1, #a78bfa); transition: width .45s cubic-bezier(.2, .8, .2, 1); }

/* ---------- layout ---------- */
.help-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr); }
.js .help-body { grid-template-columns: 260px minmax(0, 1fr); }

.rail { display: none; padding: 26px 0; border-right: 1px solid var(--line); background: var(--white); }
.js .rail { display: block; }
.rail h2 { margin: 0 24px 12px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.rail ol { position: sticky; top: 16px; margin: 0; padding: 0; list-style: none; }
.rail a {
  display: flex; align-items: center; gap: 12px; padding: 9px 24px 9px 21px; border-left: 3px solid transparent;
  color: var(--ink); font-size: 14.5px; text-decoration: none;
}
.rail a:hover { background: var(--bg); }
.rail .n {
  flex: none; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%;
  background: var(--band); color: var(--muted); font-size: 12px; font-weight: 600;
}
.rail a.seen .n { background: #dcdcff; color: var(--accent); }
.rail a[aria-current="step"] { border-left-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.rail a[aria-current="step"] .n { background: var(--accent); color: #fff; }

.stage { min-width: 0; display: flex; flex-direction: column; align-items: center; padding: 30px 40px 28px; }
.slide + .slide { margin-top: 24px; }
.js .slide + .slide { margin-top: 0; }
.js-only { display: none; }
.js .js-only { display: block; }

/* ---------- a slide ---------- */
.slide {
  width: 100%; max-width: 1120px; padding: 38px 46px 40px; border-radius: 14px; background: var(--white);
  box-shadow: 0 1px 3px rgba(20, 24, 40, .06), 0 12px 36px rgba(20, 24, 40, .06);
}
.slide[hidden] { display: none; }
.js .slide:not([hidden]) { animation: slide-in .45s cubic-bezier(.2, .8, .2, 1); }
@keyframes slide-in { from { opacity: 0; transform: translateY(10px); } }

.kicker { margin: 0 0 8px; color: var(--accent); font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.slide h2 { margin: 0 0 10px; font-size: 32px; font-weight: 650; line-height: 1.18; letter-spacing: -.3px; }
.slide h3 { margin: 0 0 12px; font-size: 17px; }
.slide p, .slide li { font-size: 16px; }
.slide .lead { max-width: 72ch; margin: 0 0 22px; color: #353b4d; font-size: 18px; line-height: 1.5; }

.slide code { padding: 1px 7px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); font-family: Consolas, Menlo, monospace; font-size: .92em; }

kbd {
  display: inline-block; min-width: 24px; padding: 1px 6px; border: 1px solid #c9ccd6; border-bottom-width: 2px;
  border-radius: 5px; background: #fff; color: var(--ink); font: 600 12.5px/1.45 -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  text-align: center;
}

.note { margin: 22px 0 0; padding: 14px 18px; border-radius: 10px; background: var(--bg); color: var(--muted); font-size: 15px !important; }
.note strong { color: var(--ink); }
.note.warn { border-left: 3px solid #f2b705; border-radius: 0 10px 10px 0; background: #fff8e6; color: #6b5200; }
.note.warn strong { color: #4a3800; }
.hint { margin: 12px 0 0; color: var(--muted); font-size: 13.5px !important; }

.tips { margin: 18px 0 0; padding-left: 22px; }
.tips li { margin-bottom: 9px; padding-left: 4px; font-size: 15.5px; }
.tips li::marker { color: var(--accent); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 22px; }
.card-lite { padding: 20px 22px 8px; border: 1px solid var(--line); border-radius: 12px; }
.card-lite .tips { margin-top: 0; }

/* ---------- step buttons, pinned to the bottom of the window ---------- */
.nav {
  position: sticky; bottom: 0; z-index: 5; width: 100%; max-width: 1120px; margin-top: 6px; padding: 14px 0 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--bg);
}
.nav[hidden] { display: none; }
.nav > button {
  height: 46px; padding: 0 22px; border: 1px solid #c9ccd6; border-radius: 999px; background: var(--white);
  color: var(--ink); font-size: 15px; font-weight: 600; white-space: nowrap;
}
.nav > button:hover:not([disabled]) { border-color: var(--accent); color: var(--accent); }
.nav > .btn-next { border-color: var(--accent); background: var(--accent); color: #fff; }
.nav > .btn-next:hover:not([disabled]) { background: #3d3db0; color: #fff; }
.nav > button[disabled] { opacity: .35; cursor: default; }
.nav-mid { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.counter { color: var(--muted); font-size: 13.5px; }
.dots { display: flex; gap: 7px; }
.dots button { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 5px; background: #cfd2dc; transition: width .2s; }
.dots button[aria-current="step"] { width: 24px; background: var(--accent); }

/* ---------- the prompts ---------- */
.prompt-box { margin-top: 22px; overflow: hidden; border: 1px solid #c9cdf4; border-radius: 12px; background: #fafaff; }
.prompt-head {
  display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 10px 18px;
  border-bottom: 1px solid #d6d9f7; background: var(--accent-soft); color: var(--accent);
  font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
}
.copy { padding: 8px 18px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.copy:hover { background: #3d3db0; }
.copy.done { background: #1f8a5b; }
.prompt {
  margin: 0; padding: 18px 20px 20px; color: var(--ink); white-space: pre-wrap;
  font: 15px/1.55 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.prompt mark { padding: 1px 5px; border-radius: 4px; background: #fff1b8; color: #5c4a00; }

/* ---------- the final answer: a way out, not the answer itself ---------- */
.final-card {
  display: grid; justify-items: center; gap: 24px; padding: 40px 28px 30px; border-radius: 18px; text-align: center; color: #fff;
  background:
    radial-gradient(60% 120% at 100% 0%, rgba(167, 139, 250, .45), rgba(167, 139, 250, 0) 60%),
    radial-gradient(50% 110% at 0% 100%, rgba(56, 189, 248, .25), rgba(56, 189, 248, 0) 60%),
    linear-gradient(135deg, #1e1b4b, #312e81 55%, #4338ca);
  box-shadow: 0 22px 44px -30px rgba(30, 27, 75, .8);
}
.final-why { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 0; padding: 0; list-style: none; }
.final-why li {
  display: flex; align-items: center; gap: 11px; padding: 8px 20px 8px 8px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .08); color: #e0e7ff; font-size: 16px; font-weight: 600;
}
.final-why .ic { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; }
.final-why svg { width: 19px; height: 19px; }
.final-btn {
  display: inline-flex; align-items: center; gap: 12px; padding: 17px 30px; border-radius: 16px;
  background: #fff; color: #312e81; font-size: 18px; font-weight: 700; text-decoration: none;
  box-shadow: 0 18px 36px -16px rgba(0, 0, 0, .6); transition: transform .15s, box-shadow .15s;
}
.final-btn svg { width: 20px; height: 20px; transition: transform .2s; }
.final-btn:hover { transform: translateY(-2px); box-shadow: 0 22px 40px -16px rgba(0, 0, 0, .7); }
.final-btn:hover svg { transform: translateX(3px); }
.final-btn:focus-visible { outline: 3px solid #a5b4fc; outline-offset: 3px; }
.final-sub { margin: -10px 0 0; color: #c7d2fe; font-size: 14px !important; }
/* backwards, not both: once risen, the button's own hover lift takes over */
.final-why li, .final-btn { animation: final-rise .55s cubic-bezier(.2, .8, .2, 1) backwards; }
.final-why li:nth-child(1) { animation-delay: .12s; }
.final-why li:nth-child(2) { animation-delay: .2s; }
.final-why li:nth-child(3) { animation-delay: .28s; }
.final-btn { animation-delay: .42s; }
@keyframes final-rise { from { opacity: 0; transform: translateY(10px); } }

/* ---------- checklist ---------- */
.checks { display: grid; gap: 10px; margin: 22px 0 0; padding: 0; list-style: none; }
.checks label { display: flex; gap: 14px; align-items: flex-start; padding: 13px 16px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.checks label:hover { border-color: #c9cdf4; }
.checks input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); }
.checks input:checked + span { color: var(--muted); text-decoration: line-through; text-decoration-color: #cbd5e1; }

/* ---------- presenting, full screen ---------- */
.presenting .help-top, .presenting .rail, .presenting .progress { display: none; }
.presenting .help-body { grid-template-columns: minmax(0, 1fr); }
.presenting .stage { min-height: 100vh; justify-content: center; padding: 2vh 3vw; }
.presenting .slide, .presenting .nav { max-width: 1500px; }
.presenting .slide { padding: 4vh 4vw; }
.presenting .slide h2 { font-size: clamp(32px, 3.4vw, 54px); }
.presenting .slide .lead { font-size: clamp(19px, 1.6vw, 26px); }
.presenting .caps li { font-size: clamp(15px, 1.25vw, 21px); }
.presenting .final-card { padding: 6vh 3vw 5vh; }
.presenting .final-why li { font-size: clamp(16px, 1.3vw, 22px); }
.presenting .final-btn { font-size: clamp(18px, 1.5vw, 26px); }

/* ---------- smaller screens ---------- */
@media (max-width: 820px) {
  .js .help-body { grid-template-columns: minmax(0, 1fr); }
  .js .rail { display: none; }
  .help-top { height: 60px; padding: 0 16px; gap: 12px; }
  .help-logo img { height: 32px; }
  .help-top .name { padding-left: 12px; font-size: 13.5px; }
  #present { display: none; }
  .stage { padding: 14px 14px 0; }
  .slide { padding: 24px 18px 26px; }
  .slide h2 { font-size: 25px; }
  .slide .lead { font-size: 16.5px; }
  .two-col { grid-template-columns: minmax(0, 1fr); }
  .nav { padding: 12px 0 14px; }
  .nav > button { padding: 0 16px; }
  .dots { display: none; }
  .final-card { padding: 30px 18px 24px; }
}

@media (max-width: 560px) {
  .help-top .name { display: none; }
  .help-top .answer { margin-left: auto; }
  .top-link { padding: 9px 12px; font-size: 13px; }
  .final-why { flex-direction: column; align-items: stretch; }
  .final-btn { width: 100%; justify-content: center; padding: 16px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .dots button, .progress i { transition: none; }
  .js .slide:not([hidden]) { animation: none; }
  .final-why li, .final-btn { animation: none; }
}
