/* Shared look for the SchoolAir tutorial pages: white canvas, near-black ink, SchoolAir green for the one
   main action on each screen, softly rounded cards and pill buttons (see /DESIGN.md, green in place of Rausch). */
:root {
  --green: #2e7d32; --green-dark: #1b5e20; --green-soft: #e8f5e9;
  --ink: #222; --body: #3f3f3f; --muted: #6a6a6a; --hairline: #dddddd;
  --canvas: #fff; --soft: #f7f7f7; --star: #f5b400; --warn: #c13515;
  --radius: 14px; --font: -apple-system, system-ui, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
* { box-sizing: border-box; }
/* the owner's line on every page (Martin, 2026-11-14): a thin dark-green strip, small type, always at the very top */
:root { --by: 30px; }
.byline { height: var(--by); display: flex; align-items: center; justify-content: center; gap: .35em; padding: 0 12px;
  background: var(--green-dark); color: #dcefdc; font: 500 13px/1 var(--font); letter-spacing: .01em; white-space: nowrap; overflow: hidden; }
.byline a { color: #fff; font-weight: 700; text-decoration: none; }
.byline a:hover { text-decoration: underline; }
@media (max-width: 440px) { .byline { font-size: 11.5px; padding: 0 8px; } }
@media print { .byline { display: none !important; } }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--canvas); font-size: 17px; line-height: 1.5; }
h1 { font-size: 34px; line-height: 1.15; margin: 0 0 12px; font-weight: 700; }
h2 { font-size: 24px; line-height: 1.2; margin: 0 0 10px; font-weight: 600; }
h3 { font-size: 18px; margin: 0 0 6px; font-weight: 600; }
p { margin: 0 0 12px; color: var(--body); }
a { color: var(--green); }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 12px 22px; font: 600 16px var(--font);
  background: var(--green); color: #fff; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--green-dark); }
.btn.ghost { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--hairline); }
.btn.ghost:hover { background: var(--soft); }
.card { background: #fff; border-radius: var(--radius); box-shadow: 0 2px 10px rgba(0,0,0,.08), 0 0 0 1px rgba(0,0,0,.04); padding: 20px; }
.eyebrow { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0 0 6px; }

/* chapter pages */
.page { max-width: 1040px; margin: 0 auto; padding: 32px 24px 64px; }
.topnav { display: flex; align-items: center; gap: 16px; padding: 14px 24px; border-bottom: 1px solid var(--hairline); font-size: 15px; flex-wrap: wrap; }
.topnav .brand { font-weight: 700; color: var(--green); text-decoration: none; margin-right: auto; }
.topnav a.ch { color: var(--muted); text-decoration: none; padding: 6px 12px; border-radius: 999px; }
.topnav a.ch.on { background: var(--green-soft); color: var(--green-dark); font-weight: 600; }
.pager { display: flex; justify-content: space-between; margin-top: 40px; gap: 12px; flex-wrap: wrap; }
.pager .skip { margin-left: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 760px) { .grid2, .grid3 { grid-template-columns: 1fr; } h1 { font-size: 28px; } }
.big-emoji { font-size: 44px; line-height: 1; margin-bottom: 10px; }
.muted { color: var(--muted); }

/* The start page and the chapters as a wizard (js/wizard.js): one card on screen at a time, dots above it,
   Back and Next under it. All the cards sit in the same grid cell, so the box is as tall as the tallest card and
   the buttons never jump; each card centres its words in that space, like a slide. */
.wiz { max-width: 700px; overflow-x: clip; }      /* the waiting cards sit just off to the side: no sideways scroll */
.wiz-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.wiz-head .eyebrow { margin: 0; }
.dots { display: flex; gap: 6px; }
.dots button { width: 12px; height: 12px; padding: 0; border: 0; border-radius: 999px; background: var(--hairline); cursor: pointer;
  transition: width .25s ease, background .25s ease; }
.dots button.seen { background: #a5d6a7; }
.dots button.on { width: 30px; background: var(--green); }
.dots button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.steps { display: grid; }
.steps > .step { grid-area: 1 / 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
  padding: 32px 36px; min-height: 380px; visibility: hidden; opacity: 0; transform: translateX(36px); }
.steps > .step.past { transform: translateX(-36px); }
.steps > .step.on { visibility: visible; opacity: 1; transform: none; }
.steps.anim > .step { transition: opacity .3s ease, transform .3s ease, visibility 0s linear .3s; }
.steps.anim > .step.on { transition: opacity .3s ease, transform .3s ease, visibility 0s; }
.step-emoji { font-size: 64px; line-height: 1; margin-bottom: 14px; }
.step-emoji.hero { font-size: 96px; }
.step h1, .step h2 { font-size: 28px; line-height: 1.2; margin: 0 0 12px; font-weight: 700; }
.step p { max-width: 540px; }
.step p:last-child { margin-bottom: 0; }
.step .say { font-size: 19px; }
.step .tag { display: inline-block; margin: 0 0 8px; padding: 3px 12px; border-radius: 999px; background: var(--green-soft); color: var(--green-dark);
  font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.step .list { list-style: none; padding: 0; margin: 6px 0 0; text-align: left; max-width: 540px; width: 100%; }
.step .list li { padding: 9px 0; border-top: 1px solid var(--hairline); color: var(--body); }
.step .list li:first-child { border-top: 0; }
.step .quiz { justify-content: center; }
.step.quizstep { background: var(--green-soft); }
/* quiz screens start at the top: a reply or the trophy grows into the space below, and nothing the child is about
   to tap moves (a centred card would shift its buttons up when a reply appears) */
.steps > .step.quizstep { justify-content: flex-start; }
.step.quizstep .quiz button { padding: 10px 20px; font-size: 16px; }
.step.quizstep .tag { background: #fff; }
.step .quiz-done { margin: 0 0 12px; scroll-margin: 90px 0 130px; }   /* in the emoji's place; scrolled into view clear of the bars */
.wiz .pager { margin-top: 12px; padding: 8px 0; align-items: center; position: sticky; bottom: 0; z-index: 5; background: #fff; }   /* a short laptop screen: Next stays on screen */
.wiz [hidden] { display: none !important; }
/* "Skip to the build" becomes a quiet link under Back and Next */
.wiz .pager .skip { order: 3; flex-basis: 100%; justify-content: center; margin: 0; background: none; box-shadow: none; color: var(--muted);
  font-weight: 500; padding: 6px; }
.wiz .pager .skip:hover { background: none; color: var(--ink); text-decoration: underline; }
/* a right quiz answer: Next wiggles to show the way on */
.btn.nudge { animation: nudge 1.4s ease-in-out .3s 3; }
@keyframes nudge { 0%, 100% { transform: none; } 15% { transform: translateX(6px); } 30% { transform: none; } 45% { transform: translateX(6px); } 60% { transform: none; } }
/* phones: each card is only as tall as its own words, and Back and Next sit at the bottom of the screen, under the
   thumb, always in the same place (tapping Next again and again never misses) */
@media (max-width: 640px) {
  .wiz { padding-bottom: 140px; }
  .steps > .step { padding: 24px 18px; min-height: 0; }
  .steps > .step:not(.on) { display: none; }
  .wiz .pager { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; padding: 10px 14px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .97); border-top: 1px solid var(--hairline); row-gap: 2px; }
  .wiz .pager .skip { padding: 4px; font-size: 14.5px; }
  .step-emoji { font-size: 52px; } .step-emoji.hero { font-size: 72px; }
  .step h1, .step h2 { font-size: 24px; }
  .step .say { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .steps > .step, .steps > .step.past { transform: none; }
  .steps.anim > .step, .steps.anim > .step.on { transition: none; }
  .btn.nudge { animation: none; }
}
.quiz { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.quiz button { border: 1px solid var(--hairline); background: #fff; border-radius: 999px; padding: 8px 16px; font: 500 15px var(--font); cursor: pointer; }
.quiz button.right { background: var(--green-soft); border-color: var(--green); color: var(--green-dark); }
.quiz button.wrong { background: #fdecea; border-color: var(--warn); color: var(--warn); }
.quiz-feedback { min-height: 24px; margin-top: 8px; font-weight: 500; }
/* praise for right answers: a little pop, flying stars, and a card when the page's quizzes are all done */
.pop { animation: pop .45s ease-out; }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }
.quiz-feedback.pop { display: inline-block; transform-origin: left center; }
.quiz-star { position: fixed; z-index: 50; pointer-events: none; font-size: 18px; transform: translate(-50%, -50%);
  animation: star .9s ease-out forwards; }
@keyframes star { to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.6); opacity: 0; } }
.quiz-done { margin-top: 14px; padding: 12px 16px; border-radius: 12px; background: var(--green-soft);
  border: 1px solid var(--green); color: var(--green-dark); font-weight: 700; font-size: 17px; display: inline-block; }
@media (prefers-reduced-motion: reduce) { .pop, .quiz-star { animation: none; } .quiz-star { display: none; } }
/* phones: one-line nav that scrolls sideways, tighter page margins */
@media (max-width: 640px) {
  .topnav { flex-wrap: nowrap; overflow-x: auto; padding: 10px 12px; gap: 6px; font-size: 14px; }
  .topnav .brand, .topnav a.ch { white-space: nowrap; }
  .topnav .brand { margin-right: 8px; }
  .topnav a.ch { padding: 6px 10px; }
  .page { padding: 20px 14px 48px; }
  .card { padding: 16px; }
  .pager .btn { padding: 10px 16px; }
}
