/*
 * Hello World tutorial: the guided wizard window and the printable version.
 * Uses the guide's tokens from site.css, so light and dark both work.
 */

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- the guided wizard ------------------------------------------------------------ */
body.wz { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.wz-top { flex: none; padding: 12px 18px 10px; background: var(--chrome); color: var(--chrome-text); }
.wz-head { display: flex; align-items: center; gap: 12px; }
.wz-brand { font-weight: 600; font-size: 15px; letter-spacing: 0.01em; }
.wz-jump { margin-left: auto; min-width: 0; }
.wz-jump select {
  max-width: 100%; font: inherit; font-size: 13px; padding: 4px 8px; border-radius: 6px;
  background: rgb(255 255 255 / 0.08); color: var(--chrome-text); border: 1px solid rgb(255 255 255 / 0.2);
}
.wz-jump option { color: #0f172a; }
.wz-progress { display: flex; gap: 3px; height: 8px; margin: 10px 0 6px; }
.wz-seg { position: relative; flex-basis: 0; min-width: 6px; border-radius: 4px; background: rgb(255 255 255 / 0.14); overflow: hidden; }
.wz-seg i { position: absolute; inset: 0 auto 0 0; width: 0; background: #2dd4bf; border-radius: 4px; transition: width 0.25s ease; }
.wz-seg.current { box-shadow: 0 0 0 1px rgb(45 212 191 / 0.7); }
.wz-count { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--chrome-muted); }

.wz-body { flex: 1; overflow-y: auto; padding: 18px 22px 28px; max-width: none; margin: 0; outline: none; }
.wz-body img { cursor: zoom-in; }
.wz-crumb { margin: 0 0 4px; font-size: 12.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.05em; }
.doc .wz-section { margin-top: 0; font-size: 20px; }
.wz-do {
  margin: 14px 0; padding: 14px 16px; border-radius: var(--radius); background: var(--accent-soft);
  border-left: 4px solid var(--accent); font-size: 15.5px;
}
.wz-do > :first-child { margin-top: 0; } .wz-do > :last-child { margin-bottom: 0; }
.wz-body figure img { width: 100% !important; }

.wz-foot {
  flex: none; display: flex; align-items: center; gap: 10px; padding: 12px 18px;
  border-top: 1px solid var(--border); background: var(--bg-subtle);
}
.wz-foot .btn { cursor: pointer; font: inherit; font-weight: 500; }
.wz-back { background: var(--bg); color: var(--text); border-color: var(--border-strong); }
.wz-back:disabled { opacity: 0.4; cursor: default; }
.wz-guide { margin: 0 auto; font-size: 13px; }
.wz-next { min-width: 130px; justify-content: center; }

/* ---- the celebration ---------------------------------------------------------------- */
.wz-done { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 20px; overflow: hidden;
  background: radial-gradient(circle at 50% 30%, #134e4a 0%, #0b1220 70%); color: #e2e8f0; }
.wz-done[hidden] { display: none; }
.wz-sky { position: absolute; inset: 0; pointer-events: none; }
.wz-done-card { position: relative; max-width: 460px; padding: 26px 26px 20px; border-radius: 16px; text-align: center;
  background: rgb(15 22 35 / 0.82); box-shadow: 0 10px 40px rgb(0 0 0 / 0.45); border: 1px solid rgb(255 255 255 / 0.1); }
.wz-done-kicker { margin: 0; text-transform: uppercase; letter-spacing: 0.12em; font-size: 12px; color: #5eead4; }
.wz-done h1 { margin: 4px 0 6px; font-size: 46px; line-height: 1.1; color: #fff; outline: none; }
.wz-done-lead { margin: 0 0 14px; font-size: 16px; }
.wz-ticks { list-style: none; padding: 0; margin: 0 auto 18px; text-align: left; display: inline-block; font-size: 14px; }
.wz-ticks li { margin: 4px 0; padding-left: 24px; position: relative; }
.wz-ticks li::before { content: '✓'; position: absolute; left: 0; color: #2dd4bf; font-weight: 600; }
.wz-done-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 12px; }
.wz-done-actions .btn { cursor: pointer; font: inherit; font-size: 14px; }
.wz-done-actions .btn:not(.primary) { color: #e2e8f0; border-color: rgb(226 232 240 / 0.3); background: transparent; }
.wz-done .hint { color: #94a3b8; font-size: 13px; margin: 0; }

.wz-balloon {
  position: absolute; bottom: -140px; width: calc(46px * var(--w, 1)); height: calc(58px * var(--w, 1));
  border-radius: 50% 50% 48% 48% / 55% 55% 45% 45%; background: var(--c);
  box-shadow: inset -8px -10px 0 rgb(0 0 0 / 0.12), inset 8px 8px 0 rgb(255 255 255 / 0.18);
  animation: wz-rise var(--d, 8s) ease-in infinite;
}
.wz-balloon::before { /* the knot */
  content: ''; position: absolute; left: calc(50% - 4px); top: calc(100% - 2px);
  border: 4px solid transparent; border-bottom: 6px solid var(--c); transform: rotate(180deg);
}
.wz-balloon::after { /* the string */
  content: ''; position: absolute; left: 50%; top: calc(100% + 6px); width: 1px; height: 64px; background: rgb(226 232 240 / 0.5);
}
@keyframes wz-rise {
  0% { transform: translate(0, 0) rotate(-4deg); opacity: 0; }
  8% { opacity: 1; }
  50% { transform: translate(18px, -60vh) rotate(4deg); }
  100% { transform: translate(-10px, -130vh) rotate(-3deg); opacity: 1; }
}
.wz-star { position: absolute; line-height: 1; animation: wz-twinkle 2.4s ease-in-out infinite; text-shadow: 0 0 8px currentColor; }
@keyframes wz-twinkle { 0%, 100% { transform: scale(0.4) rotate(0); opacity: 0.2; } 50% { transform: scale(1.15) rotate(25deg); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .wz-balloon { animation: none; }
  .wz-star { animation: none; opacity: 0.8; }
}

/* ---- the printable version ---------------------------------------------------------- */
.hw-print-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 10px 24px;
  background: var(--chrome); color: var(--chrome-text); }
.hw-print-bar a { color: var(--chrome-text); }
.hw-print-bar .spacer { flex: 1; }
.hw-print-bar .btn { cursor: pointer; font: inherit; }
body.hw-print .doc { max-width: 860px; margin: 0 auto; padding: 24px 24px 60px; }
.hw-part { padding-top: 12px; border-top: 2px solid var(--border); margin-top: 40px; }
.hw-cover { border-top: 0; margin-top: 0; }
.hw-kicker { margin: 0; color: var(--text-muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; }
.hw-toc li { margin: 4px 0; }

@media print {
  @page { margin: 14mm 14mm 16mm; }
  .hw-print-bar, .hw-ways, .hw-blocked { display: none !important; }
  body.hw-print .doc { max-width: none; padding: 0; }
  .hw-part { break-before: page; border-top: 0; margin-top: 0; padding-top: 0; }
  .hw-cover { break-before: auto; }
  .doc figure, .callout, .doc pre, .doc table, .doc tr { break-inside: avoid; }
  .doc h2, .doc h3 { break-after: avoid; }
  .doc figure img { box-shadow: none; max-height: 95mm; width: auto !important; max-width: 100%; }
  .doc a { color: inherit; text-decoration: none; }
  .steps > li::before { border: 1px solid #0f766e; } /* the number circle, kept when background graphics are off */
}
