/* Spots website. Paper, ballpoint-blue ink, one sunflower accent. Mobile first. One small script
   (/js/site.js) adds the toys; without it every page is complete. */

@font-face {
  font-family: 'Patrick Hand';
  src: url('/fonts/PatrickHand-latin.woff2') format('woff2');
  font-display: swap;
}

:root {
  --paper: #F4EEE2;
  --card: #FFFDF7;
  --ink: #27306D;
  --ink-soft: #4A5285;          /* 6.4:1 on paper */
  --line: rgba(39, 48, 109, 0.22);
  --accent: #F3C33B;            /* sunflower: the one accent */
  --hand: 'Patrick Hand', 'Chalkboard SE', 'Comic Sans MS', cursive;
  --body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --gutter: clamp(16px, 4.5vw, 32px);
  --r1: 18px 22px 16px 24px / 22px 16px 24px 18px;   /* hand-drawn corners, like the app's sheets */
  --r2: 22px 16px 24px 18px / 16px 24px 18px 22px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper) url('/img/paper.png') repeat;
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--body);
  overflow-wrap: break-word;
}
@media (min-width: 720px) { body { font-size: 1.125rem; } }

img { max-width: 100%; height: auto; display: block; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- type ---------- */
h1, h2, h3 {
  font-family: var(--hand);
  font-weight: 400;
  line-height: 1.12;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.6rem, 9vw, 4.2rem); }
h2 { font-size: clamp(2rem, 6vw, 2.75rem); }
h3 { font-size: clamp(1.5rem, 4.4vw, 1.8rem); margin-top: 1.6em; }
p, ul, ol { margin: 0 0 1.1em; }
ul, ol { padding-left: 1.3em; }
li { margin-bottom: 0.45em; }
li > ul, li > ol { margin-top: 0.45em; }
strong { font-weight: 650; }

a { color: var(--ink); text-decoration-thickness: 1.5px; text-underline-offset: 0.18em; }
a:hover { background: rgba(243, 195, 59, 0.45); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
main:focus { outline: none; }

.mark {
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-size: 100% 0.62em;
  background-position: 0 88%;
  padding: 0 0.12em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.lead { font-size: 1.15em; line-height: 1.6; }
.small { font-size: 0.9em; }
.muted { color: var(--ink-soft); }
.hand { font-family: var(--hand); font-size: 1.3em; line-height: 1.3; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 10;
  background: var(--accent); padding: 10px 16px; border-radius: 12px; font-weight: 600;
}
.skip:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
.site-header { padding: 16px 0 8px; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; padding: 4px 6px 4px 0; border-radius: 14px; }
.brand:hover { background: transparent; }
.brand img { width: 44px; height: 44px; }
.brand span { font-family: var(--hand); font-size: 2rem; line-height: 1; }
.lang-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
.lang-nav li { margin: 0; }
.lang-nav a {
  display: inline-block; min-width: 44px; min-height: 44px; padding: 10px 8px; text-align: center;
  font-family: var(--hand); font-size: 1.15rem; line-height: 1.1; text-decoration: none;
  border: 2px solid transparent; border-radius: var(--r1);
}
.lang-nav a[aria-current="page"] { border-color: var(--ink); background: var(--card); }

/* ---------- landing ---------- */
.hero { padding: 24px 0 8px; }
.hero-grid { display: grid; gap: 24px; align-items: center; }
.hero .eyebrow { font-family: var(--hand); font-size: 1.35rem; color: var(--ink-soft); margin-bottom: 0.4em; }
.hero h1 { margin-bottom: 0.35em; }
.hero-art { justify-self: center; width: min(78vw, 420px); }
.hero-note { margin-top: 14px; }
@media (min-width: 860px) {
  .hero { padding-top: 48px; }
  .hero-grid { grid-template-columns: 1.2fr 1fr; gap: 48px; }
  .hero-art { width: 100%; max-width: 440px; }
}

.section { padding: 56px 0 8px; }
.section > .wrap > h2 { max-width: 22ch; }
.section-intro { max-width: 40rem; }
.split { display: grid; gap: 32px; align-items: start; }
@media (min-width: 860px) { .split { grid-template-columns: 1.15fr 1fr; gap: 56px; } }

.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.steps li { position: relative; padding-left: 64px; margin-bottom: 26px; counter-increment: step; }
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: -2px;
  width: 46px; height: 46px; display: grid; place-items: center;
  font-family: var(--hand); font-size: 1.7rem; line-height: 1;
  background: var(--accent); border-radius: 52% 48% 55% 45% / 47% 55% 45% 53%;
}
.steps li:nth-child(2)::before { border-radius: 46% 54% 48% 52% / 55% 45% 53% 47%; }
.steps li:nth-child(3)::before { border-radius: 55% 45% 50% 50% / 45% 52% 48% 55%; }
.steps h3 { margin: 0 0 4px; font-size: 1.55rem; }
.steps p { margin: 0; }

.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 0; }
.shots figure { margin: 0; }
.shots img {
  width: 100%; border-radius: 16px;
  box-shadow: 0 0 0 1px rgba(39, 48, 109, 0.14), 0 12px 28px rgba(39, 48, 109, 0.16);
}
.shots figure:nth-child(2) { margin-top: 28px; }
.shots figcaption { font-size: 0.85em; color: var(--ink-soft); margin-top: 10px; line-height: 1.4; }

.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
@media (min-width: 640px) { .cards { grid-template-columns: 1fr 1fr; } }
.card {
  background: var(--card); border: 2px solid var(--ink); border-radius: var(--r1);
  padding: 20px 22px; margin: 0;
}
.cards > li:nth-child(even) .card, .cards > .card:nth-child(even), .card.alt { border-radius: var(--r2); }
.card h3 { margin: 0 0 6px; font-size: 1.5rem; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.card .quote { font-family: var(--hand); font-size: 1.25rem; line-height: 1.3; margin: 6px 0 0; }
/* every card in a row is as tall as the tallest (the white card fills its grid cell) */
.cards > li { margin: 0; display: flex; }
.cards > li > .card { flex: 1; }
/* a card lifts a little under the pointer, like a sheet of paper */
.cards .card { transition: transform 0.18s ease-out, box-shadow 0.18s ease-out; }
@media (hover: hover) {
  .cards > li:nth-child(odd) .card:hover { transform: translateY(-3px) rotate(-0.4deg); box-shadow: 5px 6px 0 var(--accent); }
  .cards > li:nth-child(even) .card:hover { transform: translateY(-3px) rotate(0.4deg); box-shadow: -5px 6px 0 var(--accent); }
}

.calm { list-style: none; padding: 0; display: grid; gap: 10px 32px; }
@media (min-width: 720px) { .calm { grid-template-columns: 1fr 1fr; } }
.calm li { padding-left: 34px; position: relative; margin: 0; }
.calm li::before {
  content: ''; position: absolute; left: 4px; top: 0.45em; width: 16px; height: 15px;
  background: var(--accent); border: 2px solid var(--ink);
  border-radius: 55% 45% 52% 48% / 48% 56% 44% 52%;
}

.plans { display: grid; gap: 16px; margin: 8px 0 20px; }
@media (min-width: 860px) { .plans { grid-template-columns: repeat(3, 1fr); } }
.free-card { background: var(--card); border: 2px solid var(--ink); border-radius: var(--r2); padding: 22px; margin: 0 0 20px; box-shadow: 6px 6px 0 var(--accent); }
.free-card h3 { margin-top: 0; }
.plan h3 { font-size: 1.6rem; }
.plan .kind { font-family: var(--hand); font-size: 1.15rem; color: var(--ink-soft); margin: 0 0 6px; }

/* App Store badge placeholder (replace with Apple's official badge once the app has an ID) */
.store { margin: 22px 0 6px; }
.store-badge {
  display: inline-flex; flex-direction: column; justify-content: center; gap: 2px;
  min-height: 56px; padding: 10px 20px;
  border: 2px dashed var(--ink); border-radius: 14px; background: var(--card);
  font-family: var(--hand); font-size: 1.35rem; line-height: 1.1; text-decoration: none;
}
.store-badge small { font-family: var(--body); font-size: 0.85rem; color: var(--ink-soft); }
a.store-badge { border-style: solid; background: var(--accent); }
.store img { height: 54px; width: auto; }

.closing { text-align: center; padding: 64px 0 24px; }
.closing .store { display: flex; justify-content: center; }
.closing img.closing-art { width: 160px; margin: 0 auto 12px; }

/* ---------- legal and help pages ---------- */
.doc { padding: 28px 0 24px; }
.doc .wrap { max-width: 760px; }
.doc h1 { font-size: clamp(2.4rem, 8vw, 3.4rem); }
.doc h2 { font-size: clamp(1.8rem, 5.5vw, 2.2rem); margin-top: 1.9em; scroll-margin-top: 16px; }
.doc h3 { scroll-margin-top: 16px; }
.doc .updated { color: var(--ink-soft); margin-top: -0.2em; }
.toc { background: var(--card); border: 2px solid var(--ink); border-radius: var(--r2); padding: 18px 22px 8px; margin: 24px 0 8px; }
.toc h2 { font-size: 1.5rem; margin: 0 0 8px; }
.toc ol, .toc ul { margin: 0 0 10px; padding-left: 1.3em; }
.toc li { margin-bottom: 0.3em; }
.short { background: var(--card); border: 2px solid var(--ink); border-radius: var(--r1); padding: 18px 22px; margin: 24px 0; box-shadow: 6px 6px 0 var(--accent); }
.short h2 { margin: 0 0 8px; font-size: 1.7rem; }
.short ul { margin-bottom: 0; }
.path { font-weight: 600; }
.note { border-left: 4px solid var(--accent); padding: 4px 0 4px 16px; margin: 0 0 1.1em; }
.faq h2 { font-size: clamp(1.6rem, 5vw, 2rem); }
.back-top { font-size: 0.9em; }
.contact-block { background: var(--card); border: 2px solid var(--ink); border-radius: var(--r2); padding: 18px 22px; }
.contact-block p:last-child { margin-bottom: 0; }

/* ---------- footer ---------- */
.site-footer { margin-top: 64px; padding: 28px 0 40px; border-top: 2px solid var(--line); font-size: 0.95rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.site-footer li { margin: 0; }
.site-footer a { display: inline-block; padding: 8px 0; }
.foot-lang a[aria-current="page"] { font-weight: 650; text-decoration: none; }
.foot-small { color: var(--ink-soft); font-size: 0.85rem; margin: 0; }

/* ---------- 404 ---------- */
.lost { text-align: center; padding: 48px 0; }
.lost img { width: 220px; margin: 0 auto 20px; }

@media print {
  body { background: #fff; }
  .site-header .lang-nav, .skip, .store { display: none; }
  .card, .toc, .short, .free-card { box-shadow: none; }
  a { text-decoration: none; }
}
.lost-links { list-style: none; padding: 0; margin: 0 auto; max-width: 320px; }
.lost-links li { margin: 0 0 6px; font-size: 1.1em; }
@media (min-width: 960px) { .cards-3 { grid-template-columns: repeat(3, 1fr); } }
.shots-pair { max-width: 600px; margin: 36px auto 0; }
.renewal p { margin: 0; }
.renewal strong { font-weight: 650; }

/* ---------- toys (like the app's tappable doodles) ---------- */
/* the hero ladybug: a button around the picture; /js/ladybug.js draws it live over the picture
   with the app's own engine (it blinks and glances; a tap makes it hop, say "wow" and sparkle) */
.hero-toy { position: relative; overflow: visible; justify-self: center; background: none; border: 0; padding: 0; cursor: pointer; border-radius: 24px; -webkit-tap-highlight-color: transparent; }
.hero-toy .hero-art { width: min(78vw, 420px); }
@media (min-width: 860px) { .hero-toy .hero-art { width: 100%; max-width: 440px; } }
.hero-live { position: absolute; left: 0; bottom: 0; width: 100%; height: 145%; pointer-events: none; }
/* phones: the hop and its sparkles have the paper above to themselves, clear of the text */
@media (max-width: 859px) { .hero-toy { margin-top: 52px; } }
.hero-toy.live .hero-art { visibility: hidden; }
/* the numbered blobs wiggle under the pointer */
@media (hover: hover) { .steps li:hover::before { animation: wiggle 0.5s ease-in-out; } }
@keyframes wiggle { 25% { transform: rotate(-9deg); } 60% { transform: rotate(7deg); } 100% { transform: rotate(0); } }

/* try the fact map: 55 spots in a triangle, tap one to colour it in and see its fact */
.factmap { background: var(--card); border: 2px solid var(--ink); border-radius: var(--r2); padding: 20px 22px 18px; margin: 28px auto 0; max-width: 600px; text-align: center; }
.factmap[hidden] { display: none; }
.factmap h3 { margin: 0 0 4px; font-size: 1.6rem; }
.factmap .fm-hint { margin: 0 0 14px; color: var(--ink-soft); }
.fm-grid { display: inline-flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.fm-row { display: flex; gap: 6px; }
.fm-dot {
  width: 34px; height: 34px; padding: 0; cursor: pointer;
  background: var(--card); border: 2px solid var(--ink);
  border-radius: 52% 48% 55% 45% / 47% 55% 45% 53%;
  transition: background-color 0.15s ease-out, transform 0.12s ease-out;
  -webkit-tap-highlight-color: transparent;
}
.fm-dot:nth-child(3n+2) { border-radius: 46% 54% 48% 52% / 55% 45% 53% 47%; }
.fm-dot:nth-child(3n) { border-radius: 55% 45% 50% 50% / 45% 52% 48% 55%; }
.fm-dot[aria-pressed="true"] { background: var(--accent); }
.fm-dot:active { transform: scale(0.88); }
@media (hover: hover) { .fm-dot:hover { transform: scale(1.12); } }
.fm-say { font-family: var(--hand); font-size: 2.1rem; line-height: 1.1; min-height: 1.2em; margin: 14px 0 2px; }
.fm-count { margin: 0; color: var(--ink-soft); font-size: 0.95em; }
@media (max-width: 400px) { .factmap { padding: 18px 14px 16px; } .fm-dot { width: 26px; height: 26px; } .fm-grid, .fm-row { gap: 4px; } }

@media (prefers-reduced-motion: reduce) {
  .cards .card, .fm-dot { transition: none; }
  .steps li:hover::before { animation: none; }
  .cards .card:hover, .fm-dot:hover { transform: none; }
}


/* ---------- free practice pages (practice.py; the card is /js/practice.js) ---------- */
.nav-practice {
  margin-left: auto; display: inline-flex; align-items: center; min-height: 44px; padding: 6px 14px;
  font-family: var(--hand); font-size: 1.2rem; line-height: 1.1; text-decoration: none;
  background: var(--accent); border: 2px solid var(--ink); border-radius: var(--r1);
}
.nav-practice:hover { background: var(--accent); box-shadow: 3px 3px 0 var(--ink); }
.narrow { max-width: 760px; }
.pr-hero { padding: 20px 0 8px; }
.pr-hero h1 { margin-bottom: 0.2em; }
.pr-hero .lead { margin-bottom: 0.4em; }
.crumbs { margin: 0 0 6px; font-size: 0.95em; }
.crumbs a { color: var(--ink-soft); }
.pick { font-size: clamp(1.5rem, 4.4vw, 1.8rem); margin: 22px 0 0; }

/* the practice card */
.practice {
  background: var(--card); border: 2px solid var(--ink); border-radius: var(--r2);
  padding: 14px 14px 18px; margin: 18px 0 8px; max-width: 540px; box-shadow: 6px 6px 0 var(--accent);
}
.pr-fallback { margin: 0; color: var(--ink-soft); }
.pr-dots { list-style: none; display: flex; justify-content: center; gap: 8px; padding: 0; margin: 2px 0 4px; }
.pr-dots li {
  width: 14px; height: 14px; margin: 0; border: 2px solid var(--line);
  border-radius: 52% 48% 55% 45% / 47% 55% 45% 53%;
}
.pr-dots li.now { border-color: var(--ink); }
.pr-dots li.known { border-color: var(--ink); background: var(--accent); }
.pr-dots li.helped { border-color: var(--ink); background: linear-gradient(to top, var(--accent) 50%, transparent 50%); }
.pr-canvas { display: block; width: 100%; height: clamp(170px, 44vw, 240px); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pr-q { font-family: var(--hand); font-size: clamp(2.6rem, 11vw, 3.3rem); line-height: 1.1; text-align: center; margin: 2px 0 0; }
.pr-ans { display: inline-block; min-width: 2.1ch; padding: 0 0.1em; text-align: center; border-bottom: 3px solid var(--ink); }
.pr-ans.empty { color: var(--ink-soft); }
.pr-ans.ok { background: var(--accent); border-radius: 10px 12px 9px 13px; }
.pr-ans.nope { animation: pr-shake 0.4s ease-in-out; }
@keyframes pr-shake { 20% { transform: translateX(-7px); } 45% { transform: translateX(6px); } 70% { transform: translateX(-4px); } 100% { transform: none; } }
.pr-say { min-height: 1.6em; margin: 4px 0 10px; text-align: center; color: var(--ink-soft); font-size: 0.95em; line-height: 1.4; }
.pr-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 330px; margin: 0 auto; }
.pr-key {
  min-height: 56px; padding: 0; cursor: pointer; color: var(--ink);
  font-family: var(--hand); font-size: 1.9rem; line-height: 1;
  background: var(--paper); border: 2px solid var(--ink); border-radius: var(--r1);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.pr-key:nth-child(even) { border-radius: var(--r2); }
.pr-key:active { transform: scale(0.94); }
.pr-key.pr-ok { background: var(--accent); }
.pr-show {
  display: block; min-height: 44px; margin: 10px auto 0; padding: 6px 12px; cursor: pointer;
  background: none; border: 0; color: var(--ink); font: inherit; font-family: var(--hand); font-size: 1.3rem;
  text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 0.18em;
}
.pr-end { text-align: center; }
.pr-end[hidden], .pr-ask[hidden] { display: none; }
.pr-score { font-family: var(--hand); font-size: 1.6rem; line-height: 1.25; margin: 4px 0 14px; }
.pr-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 14px; }
.pr-btn, .print-btn {
  min-height: 48px; padding: 8px 20px; cursor: pointer; color: var(--ink);
  font-family: var(--hand); font-size: 1.3rem; line-height: 1.1;
  background: var(--accent); border: 2px solid var(--ink); border-radius: var(--r1);
}
.pr-print, .print-btn { background: var(--card); }
.print-btn:hover, .pr-btn:hover { box-shadow: 3px 3px 0 var(--ink); }
.pr-next { font-family: var(--hand); font-size: 1.3rem; padding: 10px 4px; }

/* the table tiles: the number and its spots, set out like a ten-frame */
.tiles { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; max-width: 640px; }
.tiles li { margin: 0; }
.tile {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  min-height: 90px; padding: 10px 4px 12px; text-decoration: none;
  background: var(--card); border: 2px solid var(--ink); border-radius: var(--r1);
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
}
.tiles li:nth-child(even) .tile { border-radius: var(--r2); }
.tile:hover { background: var(--card); transform: translateY(-2px) rotate(-1deg); box-shadow: 3px 4px 0 var(--accent); }
.tile[aria-current="page"] { background: var(--accent); }
.tile-n { font-family: var(--hand); font-size: 1.75rem; line-height: 1; }
.tile-dots { display: grid; grid-template-columns: repeat(5, 8px); gap: 3px; }
.tile-dots i { width: 8px; height: 8px; background: var(--ink); border-radius: 52% 48% 55% 45% / 47% 55% 45% 53%; }
.tile-dots i:nth-child(3n+2) { border-radius: 46% 54% 48% 52% / 55% 45% 53% 47%; }
/* a badge earned on this device (site.js reads the practice card's best scores) */
.tile.earned::after {
  content: ''; position: absolute; top: -8px; right: -8px; width: 20px; height: 20px;
  background: var(--accent); border: 2px solid var(--ink); border-radius: 55% 45% 52% 48% / 48% 56% 44% 52%;
}
@media (max-width: 420px) { .tiles { gap: 6px; } .tile { min-height: 78px; } .tile-n { font-size: 1.5rem; } .tile-dots { grid-template-columns: repeat(5, 6px); gap: 2px; } .tile-dots i { width: 6px; height: 6px; } }
.hub-link { font-family: var(--hand); font-size: 1.35rem; margin: 18px 0 0; }

/* the whole table, the trick, the questions */
.ttable { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px 32px; max-width: 520px; }
@media (min-width: 560px) { .ttable { grid-template-columns: 1fr 1fr; grid-auto-flow: column; grid-template-rows: repeat(5, auto); } }
.ttable li { margin: 0; font-family: var(--hand); font-size: 1.7rem; line-height: 1.5; }
.ttable .tt-eq { color: var(--ink-soft); }
.ttable strong { font-weight: 400; background-image: linear-gradient(var(--accent), var(--accent)); background-repeat: no-repeat; background-size: 100% 0.5em; background-position: 0 85%; padding: 0 0.1em; }
.trick-steps { list-style: none; padding: 0; margin: 0 0 1.1em; }
.trick-steps li { position: relative; padding-left: 30px; margin: 0 0 6px; font-family: var(--hand); font-size: 1.45rem; line-height: 1.35; }
.trick-steps li::before {
  content: ''; position: absolute; left: 2px; top: 0.42em; width: 15px; height: 14px;
  background: var(--accent); border: 2px solid var(--ink); border-radius: 55% 45% 52% 48% / 48% 56% 44% 52%;
}
.faq .qa h3 { font-family: var(--body); font-weight: 650; font-size: 1.05em; line-height: 1.4; margin: 1.3em 0 0.3em; }
.faq .qa p { margin: 0; }

/* the times table chart */
.chart-wrap { overflow-x: auto; }
.chart { border-collapse: collapse; margin: 4px 0 0; font-family: var(--hand); font-size: clamp(1rem, 3.6vw, 1.45rem); background: var(--card); }
.chart caption { caption-side: bottom; text-align: left; padding-top: 8px; font-family: var(--body); font-size: 0.85rem; color: var(--ink-soft); }
.chart th, .chart td { border: 1.5px solid var(--line); text-align: center; padding: 0.22em 0.3em; min-width: 1.9em; }
.chart thead th, .chart tbody th { background: var(--accent); font-weight: 400; border-color: var(--ink); }
.chart .corner { background: var(--card); }
.chart tbody tr:nth-child(even) td { background: rgba(243, 195, 59, 0.12); }
.chart-wrap .sheet-foot { display: none; }

/* the order to learn them */
.order { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; max-width: 640px; }
.order li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0; }
.chips { display: inline-flex; gap: 6px; }
.chip {
  display: inline-grid; place-items: center; min-width: 48px; min-height: 44px; padding: 2px 8px;
  font-family: var(--hand); font-size: 1.35rem; text-decoration: none;
  background: var(--card); border: 2px solid var(--ink); border-radius: var(--r1);
}
.chip:hover { background: var(--accent); }

.plug-p { max-width: 36rem; margin: 0 auto 0.6em; }
.plug .store { display: flex; justify-content: center; }

/* the worksheet: printed only (the Print button, or the browser's own print) */
.sheet { display: none; }
@media print {
  @page { margin: 14mm; }
  .page-table .site-header, .page-table .site-footer, .page-hub .site-header, .page-hub .site-footer { display: none !important; }
  .page-table main > section:not(#worksheet), .page-hub main > section:not(#chart) { display: none !important; }
  .page-table #worksheet .wrap > :not(.sheet), .page-hub #chart .wrap > :not(.chart-wrap) { display: none !important; }
  .page-table .sheet { display: block; color: #000; }
  .page-table #worksheet, .page-hub #chart { padding: 0; }
  body { background: #fff; }
  .sheet-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4mm 12mm; margin: 0 0 8mm; }
  .sheet-title { font-family: var(--hand); font-size: 26pt; flex: 1 0 100%; }
  .sheet-line { font-size: 12pt; }
  .sheet-sums { columns: 2; column-gap: 18mm; list-style: none; padding: 0; margin: 0; font-family: var(--hand); font-size: 21pt; }
  .sheet-sums li { margin: 0 0 5.5mm; break-inside: avoid; }
  .blank { display: inline-block; width: 2.6em; border-bottom: 1.5px solid #000; vertical-align: baseline; }
  .blank-s { width: 1.6em; }
  .blank-l { width: 14em; }
  .sheet-count { font-family: var(--hand); font-size: 18pt; margin: 8mm 0 0; }
  .sheet-foot, .chart-wrap .sheet-foot { display: block; margin-top: 8mm; font-size: 10pt; color: #444; }
  .chart { font-size: 17pt; background: #fff; }
  .chart thead th, .chart tbody th { background: #eee; }
  .chart { width: 100%; }
  .chart caption { caption-side: top; text-align: left; font-family: var(--hand); font-size: 24pt; color: #000; padding: 0 0 6mm; }
  .chart-wrap { overflow: visible; }
}
@media (prefers-reduced-motion: reduce) { .tile, .pr-key { transition: none; } .tile:hover { transform: none; } .pr-ans.nope { animation: none; } }

/* ---------- free tools, school years, comparisons (practice.py) ---------- */
.pr-dots.many { gap: 4px; flex-wrap: wrap; max-width: 330px; margin-left: auto; margin-right: auto; }
.pr-dots.many li { width: 11px; height: 11px; }
.pr-start { text-align: center; }
.pr-start[hidden] { display: none; }
.pr-start .pr-score { margin-top: 0; }
.pr-btn.pr-alt { background: var(--card); }
a.pr-btn { display: inline-flex; align-items: center; text-decoration: none; }
.pr-chips { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; max-width: 330px; margin: 0 auto 16px; }
.pr-chip {
  min-height: 48px; cursor: pointer; color: var(--ink); font-family: var(--hand); font-size: 1.4rem;
  background: var(--card); border: 2px solid var(--ink); border-radius: var(--r1);
}
.pr-chip[aria-pressed="true"] { background: var(--accent); }
.pr-clock { height: 12px; margin: 4px auto 8px; max-width: 330px; border: 2px solid var(--ink); border-radius: 10px 12px 9px 13px; overflow: hidden; background: var(--paper); }
.pr-clock span { display: block; height: 100%; background: var(--accent); transform-origin: left center; }
.pr-form { display: grid; gap: 8px; max-width: 330px; margin: 0 auto 14px; text-align: left; }
.pr-form[hidden] { display: none; }
.pr-label { font-weight: 600; font-size: 0.95em; }
.pr-input {
  min-height: 52px; padding: 8px 14px; font-family: var(--hand); font-size: 1.6rem; color: var(--ink);
  background: var(--paper); border: 2px solid var(--ink); border-radius: var(--r1);
}
.link-btn { background: none; border: 0; padding: 4px 0; min-height: 44px; font: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; }
.blank-cert { margin-top: 10px; }

/* cards to the free tools */
.tools { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 12px; }
@media (min-width: 720px) { .tools { grid-template-columns: repeat(3, 1fr); } }
.tools li { margin: 0; display: flex; }
.tool {
  flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; text-decoration: none;
  background: var(--card); border: 2px solid var(--ink); border-radius: var(--r2);
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
}
.tools li:nth-child(even) .tool { border-radius: var(--r1); }
.tool:hover { background: var(--card); transform: translateY(-2px); box-shadow: 4px 5px 0 var(--accent); }
.tool-name { font-family: var(--hand); font-size: 1.5rem; line-height: 1.15; }
.tool-p { color: var(--ink-soft); font-size: 0.95em; line-height: 1.45; }
.tools-sub { font-family: var(--hand); font-size: 1.3rem; margin: 18px 0 6px; }
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.chip-wide { padding: 6px 14px; font-size: 1.2rem; min-height: 44px; }
.calm-1 { grid-template-columns: 1fr !important; }

/* the worksheet generator: the sheet shows on the page as a paper preview */
.wsgen { margin: 16px 0 18px; padding: 16px 16px 6px; background: var(--card); border: 2px solid var(--ink); border-radius: var(--r2); box-shadow: 6px 6px 0 var(--accent); }
.ws-tables { border: 0; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; max-width: 420px; }
.ws-tables legend { font-weight: 650; margin-bottom: 8px; padding: 0; }
.ws-chip { position: relative; display: block; }
.ws-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.ws-chip span {
  display: grid; place-items: center; min-height: 48px; font-family: var(--hand); font-size: 1.35rem;
  background: var(--paper); border: 2px solid var(--ink); border-radius: var(--r1);
}
.ws-chip input:checked + span { background: var(--accent); }
.ws-chip input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }
.ws-opts { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 4px 0 8px; }
.ws-opt { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.ws-opt input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--ink); }
.ws-count { min-height: 40px; font: inherit; padding: 2px 8px; border: 2px solid var(--ink); border-radius: 10px; background: var(--paper); color: var(--ink); }
.ws-acts { display: flex; flex-wrap: wrap; gap: 10px; }
.sheet.sheet-preview { display: block; background: #fff; color: var(--ink); padding: 22px 20px; border: 1.5px solid var(--line); border-radius: 6px; box-shadow: 0 10px 26px rgba(39, 48, 109, 0.14); }
.sheet-preview .sheet-head { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; margin: 0 0 14px; }
.sheet-preview .sheet-title { font-family: var(--hand); font-size: 1.7rem; flex: 1 0 100%; }
.sheet-preview .sheet-line { font-size: 0.9rem; color: var(--ink-soft); }
.sheet-preview .sheet-sums { columns: 2; column-gap: 28px; list-style: none; padding: 0; margin: 0; font-family: var(--hand); font-size: 1.35rem; }
.sheet-preview .sheet-sums li { margin: 0 0 8px; break-inside: avoid; }
.sheet-preview .blank { display: inline-block; width: 2.4em; border-bottom: 1.5px solid var(--ink); }
.sheet-preview .blank-s { width: 1.5em; }
.sheet-preview .blank-l { width: 9em; }
.sheet-preview .sheet-foot { font-size: 0.8rem; color: var(--ink-soft); margin: 14px 0 0; }

/* comparisons */
.apps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.app-card { margin: 0; padding: 16px 18px; background: var(--card); border: 2px solid var(--ink); border-radius: var(--r1); }
.app-card:nth-child(even) { border-radius: var(--r2); }
.app-ours { box-shadow: 6px 6px 0 var(--accent); }
.app-card h3 { margin: 0 0 2px; font-size: 1.6rem; }
.app-n { color: var(--ink-soft); }
.ours { font-family: var(--body); font-size: 0.55em; color: var(--ink-soft); vertical-align: middle; }
.app-by { margin: 0 0 8px; color: var(--ink-soft); font-size: 0.9em; }
.app-card p { margin: 0 0 6px; }
.app-link { margin-top: 8px !important; }
.cmp { border-collapse: collapse; width: 100%; font-size: 0.92em; background: var(--card); }
.cmp th, .cmp td { border: 1.5px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.cmp thead th { background: var(--accent); border-color: var(--ink); font-weight: 650; }
.cmp tbody th { font-weight: 650; }

/* the certificate: printed only (a landscape page of its own) */
.cert { display: none; }
@page cert { size: A4 landscape; margin: 10mm; }
@media print {
  body.printing-cert > *:not(main), body.printing-cert main > *:not(#cert) { display: none !important; }
  .page-diploma .site-header, .page-diploma .site-footer, .page-diploma main > :not(#cert) { display: none !important; }
  .page-diploma .cert { display: block; page: cert; color: #000; }
  .cert-in { border: 3px solid #27306D; outline: 1.5px solid #27306D; outline-offset: 5px; border-radius: 22px 30px 20px 28px / 28px 20px 30px 22px; padding: 14mm 18mm 10mm; text-align: center; position: relative; min-height: 172mm; }
  .cert-logo { width: 16mm; height: 16mm; margin: 0 auto 2mm; }
  .cert-title { font-family: var(--hand); font-size: 40pt; margin: 0; color: #27306D; }
  .cert-for, .cert-knows { font-size: 14pt; margin: 4mm 0 0; }
  .cert-name { font-family: var(--hand); font-size: 46pt; margin: 3mm auto 0; min-height: 18mm; max-width: 200mm; border-bottom: 1.5px solid #27306D; color: #27306D; }
  .cert-level { font-family: var(--hand); font-size: 20pt; }
  .cert-art { width: 60mm; margin: 6mm auto 0; }
  .cert-foot { display: flex; justify-content: space-between; gap: 10mm; font-size: 12pt; margin: 6mm 0 0; }
  .cert-site { position: absolute; bottom: 5mm; left: 0; right: 0; font-size: 9pt; color: #555; margin: 0; }
  /* the worksheets page prints the sheet, then the answers on their own page */
  .page-worksheets .site-header, .page-worksheets .site-footer, .page-worksheets main > section:not(.pr-hero) { display: none !important; }
  .page-worksheets .pr-hero .wrap > :not(.sheet) { display: none !important; }
  .page-worksheets .sheet { display: block; box-shadow: none; border: 0; padding: 0; color: #000; }
  .page-worksheets .ws-answers-sheet { break-before: page; }
  .page-worksheets .ws-answers-sheet.off { display: none !important; }
  .page-worksheets .sheet-preview .sheet-sums { font-size: 21pt; column-gap: 18mm; }
  .page-worksheets .sheet-preview .sheet-sums li { margin: 0 0 5mm; }
  .page-worksheets .sheet-preview .sheet-title { font-size: 26pt; }
  .page-worksheets .sheet-preview .sheet-sums[data-n="30"] { font-size: 18pt; }
  .page-worksheets .sheet-preview .sheet-sums[data-n="30"] li { margin: 0 0 3.4mm; }
  .page-worksheets .sheet-preview .sheet-sums[data-n="40"] { columns: 3; column-gap: 10mm; font-size: 16pt; }
  .page-worksheets .sheet-preview .sheet-sums[data-n="40"] li { margin: 0 0 3.6mm; }
  .page-worksheets .ws-answers-sheet .sheet-sums { font-size: 14pt; }
  /* the speed test page prints its test sheet */
  .page-test .site-header, .page-test .site-footer, .page-test main > section:not(#worksheet) { display: none !important; }
  .page-test #worksheet .wrap > :not(.sheet) { display: none !important; }
  .page-test #worksheet { padding: 0; }
  .page-test .sheet { display: block; color: #000; }
  .sheet-sums.dense { columns: 3; column-gap: 10mm; font-size: 16pt; }
  .sheet-sums.dense li { margin: 0 0 3.6mm; }
}
.ws-answers-sheet { display: none; }
