@font-face { font-family: "TinkerRead"; src: url("/fonts/tinkerread-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "TinkerRead"; src: url("/fonts/tinkerread-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #FFF9F0; --card: #FFFFFF; --ink: #1E2A3A; --ink-2: #3E4C61; --muted: #6B7689;
  --line: #EADFCF; --line-2: #9FAEC3; --brand: #F2683A; --brand-ink: #FFFFFF; --brand-soft: #FFE6DA;
  --teal: #127C82; --teal-soft: #DDF1F1; --ok: #2E8B57; --ok-soft: #E1F3E8; --no: #B4442B; --no-soft: #FBE7E1;
  /* names the picture renderer (render.js) draws with */
  --primary: #3866C2; --accent: #E08A1E; --accent-soft: #FDEBD3; --surface: #FFFFFF; --surface-2: #EEF3F8;
  --shadow: 0 1px 2px rgba(30, 42, 58, .06), 0 6px 20px rgba(30, 42, 58, .08);
  --radius: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14181F; --card: #1D232D; --ink: #EEF2F7; --ink-2: #C9D3E0; --muted: #94A0B3;
    --line: #2C3441; --line-2: #56637A; --brand: #FF7D4F; --brand-soft: #3A2620;
    --teal: #4FC1C6; --teal-soft: #173337; --ok: #5FC48C; --ok-soft: #173426; --no: #F08A6E; --no-soft: #3A211B;
    --primary: #7FA5F0; --accent: #F2A64A; --accent-soft: #3A2E1B; --surface: #1D232D; --surface-2: #283141;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14181F; --card: #1D232D; --ink: #EEF2F7; --ink-2: #C9D3E0; --muted: #94A0B3;
  --line: #2C3441; --line-2: #56637A; --brand: #FF7D4F; --brand-soft: #3A2620;
  --teal: #4FC1C6; --teal-soft: #173337; --ok: #5FC48C; --ok-soft: #173426; --no: #F08A6E; --no-soft: #3A211B;
  --primary: #7FA5F0; --accent: #F2A64A; --accent-soft: #3A2E1B; --surface: #1D232D; --surface-2: #283141;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 18px/1.5 "TinkerRead", system-ui, sans-serif; }
a { color: var(--teal); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 8px; }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 680px; }

/* header */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 14px 0; }
.top nav { margin-left: auto; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 22px; letter-spacing: -.01em; }
.brand svg { width: 36px; height: 36px; flex: none; }
.brand b { color: var(--brand); }
.top nav { display: flex; gap: 14px; font-size: 16px; }
.top nav a { color: var(--ink-2); text-decoration: none; }
.top nav a:hover { color: var(--brand); }

/* home */
.hero { padding: 28px 0 8px; }
.hero h1 { font-size: clamp(34px, 7vw, 54px); line-height: 1.05; margin: 0 0 10px; letter-spacing: -.02em; }
.hero h1 b { color: var(--brand); }
.hero p { font-size: clamp(18px, 3.2vw, 21px); color: var(--ink-2); margin: 0 0 6px; max-width: 34em; }
.section { margin: 30px 0; }
.section h2 { font-size: 22px; margin: 0 0 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.tile { display: block; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 18px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .12s ease, border-color .12s ease; }
.tile:hover { transform: translateY(-2px); border-color: var(--brand); }
.tile .big { font-size: 22px; font-weight: 700; }
.tile .sub { color: var(--muted); font-size: 16px; }
.tile .emoji { font-size: 30px; line-height: 1; margin-bottom: 8px; display: block; }
.tile.wide { grid-column: 1 / -1; background: var(--teal-soft); border-color: transparent; }
.notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 22px; color: var(--ink-2); font-size: 16px; }
.notes b { color: var(--ink); display: block; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { background: var(--card); border: 1.5px solid var(--line); border-radius: 999px; padding: 10px 16px; text-decoration: none; color: var(--ink); }
.chip:hover { border-color: var(--brand); }
.chip.main { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 700; }
.chip small { color: var(--muted); }
.chip.main small { color: inherit; opacity: .85; }

/* practice */
.bar { display: flex; align-items: center; gap: 12px; margin: 6px 0 14px; color: var(--muted); font-size: 15px; }
.track { flex: 1; height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.track i { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .25s ease; }
.qcard { background: var(--card); border: 1.5px solid var(--line); border-radius: 22px; padding: 20px; box-shadow: var(--shadow); }
.qhead { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.qtext { font-size: clamp(22px, 4.6vw, 28px); line-height: 1.3; font-weight: 700; margin: 0 0 12px; white-space: pre-line; }
.say { flex: none; border: 1.5px solid var(--line); background: var(--bg); border-radius: 999px; padding: 6px 12px; font-size: 15px; color: var(--ink-2); }
.say[aria-pressed="true"] { border-color: var(--teal); color: var(--teal); }
.pic { margin: 6px 0 14px; display: flex; justify-content: center; overflow-x: auto; }
.pic svg { max-width: 100%; height: auto; }

.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.opts.two { grid-template-columns: 1fr 1fr; }
.opt { background: var(--bg); border: 2px solid var(--line); border-radius: 16px; padding: 14px 12px; font-size: 21px; font-weight: 700; min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.opt:hover:not([disabled]) { border-color: var(--brand); }
.opt .l { font-size: 14px; color: var(--muted); font-weight: 700; }
.opt svg { max-width: 100%; height: auto; }
.opt.right { border-color: var(--ok); background: var(--ok-soft); }
.opt.wrong { border-color: var(--no); background: var(--no-soft); opacity: .8; }
.opt[disabled] { cursor: default; }
.opts.pics { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }

.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 320px; margin: 0 auto; }
.screen { grid-column: 1 / -1; background: var(--bg); border: 2px solid var(--line); border-radius: 14px; min-height: 64px; font-size: 34px; font-weight: 700; display: flex; align-items: center; justify-content: center; letter-spacing: .04em; }
.key { background: var(--bg); border: 1.5px solid var(--line); border-radius: 14px; font-size: 26px; font-weight: 700; min-height: 58px; }
.key:active { transform: scale(.97); }
.key.check { grid-column: 1 / -1; background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-size: 21px; }
.key.check[disabled] { opacity: .45; }

.feedback { min-height: 32px; margin: 14px 0 0; font-size: 20px; font-weight: 700; }
.feedback.yes { color: var(--ok); }
.feedback.no { color: var(--no); }
.feedback .why { display: block; font-weight: 400; color: var(--ink-2); font-size: 17px; margin-top: 4px; }
.next { margin-top: 14px; width: 100%; background: var(--teal); color: #fff; border: 0; border-radius: 14px; padding: 14px; font-size: 20px; font-weight: 700; }

.done h2 { font-size: 30px; margin: 0 0 8px; }
.tally { display: grid; gap: 8px; margin: 14px 0; font-size: 19px; }
.tally div { background: var(--bg); border-radius: 12px; padding: 10px 14px; }
.again { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 8px; }
.again li { border-left: 4px solid var(--accent); padding: 4px 12px; color: var(--ink-2); font-size: 17px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.btn { background: var(--brand); color: var(--brand-ink); border: 0; border-radius: 14px; padding: 12px 18px; font-size: 18px; font-weight: 700; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }

.prose { max-width: 680px; }
.prose h1 { font-size: 34px; margin: 10px 0; }
.prose h2 { font-size: 22px; margin: 24px 0 6px; }
.prose p, .prose li { color: var(--ink-2); }

footer { margin: 40px 0 26px; color: var(--muted); font-size: 15px; display: flex; flex-wrap: wrap; gap: 14px; }
footer a { color: var(--muted); }
.loading { color: var(--muted); padding: 40px 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 520px) {
  body { font-size: 17px; } .qcard { padding: 16px; } .top nav { gap: 10px; font-size: 15px; }
  /* on a phone the read-aloud button sits above the question, not beside it */
  .qhead { flex-direction: column-reverse; align-items: flex-end; gap: 6px; }
  .qhead .qtext { align-self: stretch; }
  .brand { font-size: 20px; } .brand svg { width: 30px; height: 30px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* parents */
.who { margin-left: 4px; font-size: 14px; background: var(--teal-soft); color: var(--teal); border-radius: 999px; padding: 3px 10px; text-decoration: none; white-space: nowrap; }
.prose.wide { max-width: 820px; }
.muted { color: var(--muted); }
.consent { display: flex; gap: 10px; align-items: flex-start; background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 14px; margin: 16px 0 4px; color: var(--ink); }
.consent input { width: 22px; height: 22px; margin-top: 3px; flex: none; accent-color: var(--brand); }
.kid { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 14px 0; box-shadow: var(--shadow); }
.kidhead { display: flex; align-items: baseline; gap: 10px; }
.kidhead h2 { margin: 0; }
table.prog { width: 100%; border-collapse: collapse; font-size: 16px; margin: 8px 0; }
table.prog th, table.prog td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.prog th { color: var(--muted); font-weight: 700; }
table.prog td + td, table.prog th + th { text-align: right; }
.addkid { display: flex; flex-wrap: wrap; gap: 10px; }
.addkid input, .addkid select { font: inherit; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); }
.addkid input { flex: 1 1 180px; }
.btn.danger { color: var(--no); border-color: var(--no-soft); }
.btn[disabled] { opacity: .5; cursor: default; }

/* review and reports */
.rev { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 12px 0 0; padding: 10px 14px; border: 1.5px dashed var(--line-2); border-radius: 14px; font-size: 15px; color: var(--ink-2); }
.rev .revnav { margin-left: auto; display: flex; gap: 8px; }
.rev .btn { padding: 8px 14px; font-size: 16px; }
.report { margin: 12px 0 0; font-size: 16px; }
.linkbtn { background: none; border: 0; padding: 4px 0; color: var(--muted); text-decoration: underline; font-size: 15px; }
.reportform { display: grid; gap: 8px; max-width: 520px; }
.reportform select, .reportform textarea { font: inherit; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); }
.reportform .btn { justify-self: start; }
.note { font-style: italic; color: var(--ink); }

/* who is practising */
.whopill { border: 1.5px solid var(--line); background: var(--card); color: var(--ink-2); border-radius: 999px; padding: 7px 14px; font-size: 15px; font-weight: 700; white-space: nowrap; }
.whopill.named { background: var(--teal); border-color: var(--teal); color: #fff; font-size: 17px; }
.who { font-weight: 700; font-size: 15px; }
.who.guest { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
button.whotile { text-align: left; font: inherit; cursor: pointer; }
@media (max-width: 520px) { .whopill { padding: 5px 11px; font-size: 14px; } .whopill.named { font-size: 15px; } }

/* topic tiles with progress */
.tile.topic { position: relative; display: flex; flex-direction: column; gap: 6px; }
.tile.topic.recommended { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft), var(--shadow); }
.tile.topic.complete { background: var(--ok-soft); border-color: transparent; }
.tile.topic.mix { background: var(--teal-soft); border-color: transparent; }
.badge { align-self: flex-start; background: var(--brand); color: var(--brand-ink); border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 700; }
.badge.donebadge { background: var(--ok); color: #fff; }
.track.small { height: 6px; flex: none; margin-top: 4px; }
.track.small i { background: var(--teal); }
.setsdone { white-space: nowrap; }

/* finishing a set */
.done { text-align: center; }
.done .party { font-size: 64px; line-height: 1; margin: 4px 0 6px; animation: pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.done h2 { font-size: clamp(28px, 6vw, 38px); }
.done .tally { max-width: 360px; margin-left: auto; margin-right: auto; text-align: left; }
.done .again { text-align: left; }
.done .row { justify-content: center; }
.sproutline { font-size: 20px; font-weight: 700; margin: 10px 0 2px; }
.sprouts { letter-spacing: 2px; }
.btn.big { font-size: 21px; padding: 15px 24px; }
@keyframes pop { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
.confetti i { position: absolute; top: -24px; width: 10px; height: 14px; opacity: .92; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(112vh) rotate(760deg); } }
@media (prefers-reduced-motion: reduce) { .done .party { animation: none; } .confetti { display: none; } }

/* the first-visit choice */
.hero { padding: 18px 0 6px; }
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 14px 0 6px; }
.mode { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.mode.main { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft), var(--shadow); }
.mode h2 { margin: 0; font-size: 24px; }
.mode p { margin: 0; }
.benefits { margin: 0; padding-left: 20px; color: var(--ink-2); }
.benefits li { margin: 2px 0; }
.guestline { margin-top: 18px; font-size: 15px; }
.savecard { margin: 18px auto 0; max-width: 460px; background: var(--teal-soft); border-radius: 14px; padding: 12px 14px; text-align: left; font-size: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.savecard .btn { padding: 8px 14px; font-size: 16px; background: var(--card); }
.keepnote { font-size: 15px; color: var(--ink-2); background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.mode .row { margin-top: 4px; }
.mode .btn { font-size: 18px; padding: 12px 16px; }
.small { font-size: 14px; }
@media (max-width: 520px) { .hero h1 { font-size: 30px; } .mode { padding: 14px; } .mode h2 { font-size: 21px; } .benefits { font-size: 16px; } }
/* phones: the logo already leads home, so the header keeps one link and the name badge on one row */
@media (max-width: 520px) { .top { flex-wrap: nowrap; gap: 8px; } .top nav a:first-child { display: none; } .top nav { margin-left: auto; } }
