/* KidoDino website – v6, 15 Nov 2026. Built only from tokens.css (see the rules at the top of that file).
   Layout: grape bar with the logo, then paper. Colour lives in soft bands and in the books, never in a full-bleed
   saturated hero. Accessibility target: WCAG 2.2 AA. */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper, #FFFDF6); color: var(--ink, #2B2D5C); font: var(--t-body, 500 1.125rem/1.6 "Quicksand", system-ui, sans-serif); overflow-x: clip; }
img, svg { max-width: 100%; display: block; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
/* line length only on running text, never on every <p> (bubbles and labels are <p> too) */
.lede, .prose p, .hero-copy p, .about-copy p { max-width: 62ch; }
a { color: var(--grape-deep); text-underline-offset: .18em; text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--grape); outline-offset: 3px; border-radius: 8px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--s3); top: -100px; z-index: var(--z-skip); background: var(--sun); color: var(--ink); font: var(--t-label); padding: var(--s3) var(--s4); border-radius: var(--r-sm); text-decoration: none; }
.skip:focus { top: var(--s3); }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: max(var(--s5), env(safe-area-inset-left, 0px)); }

/* text styles – the only five */
.t-display { font: var(--t-display); }
.t-h2, h2 { font: var(--t-h2); }
.t-h3, h3 { font: var(--t-h3); }
.t-small { font: var(--t-small); color: var(--muted); }
.lede { color: var(--muted); }

/* buttons – one shape, two kinds (brand book: KidButton) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 52px; padding: 0 var(--s5);
  border-radius: var(--r-pill); border: 3px solid var(--green-deep); background: var(--green-deep); color: var(--white);
  font: var(--t-label); text-decoration: none; cursor: pointer; transition: transform .15s, background-color .15s; }
.btn:active { transform: scale(.97); }
.btn-2 { background: transparent; color: var(--ink); border-color: var(--ink); }

/* header */
.site-head { background: var(--grape); position: relative; z-index: var(--z-raised); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; min-height: 72px; }
.brand img { width: 150px; height: auto; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s1); }
.nav a { color: var(--white); text-decoration: none; font: var(--t-label); display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s3); border-radius: var(--r-pill); }
.site-head :focus-visible { outline-color: var(--sun); }

/* hero – paper (option A) or soft grape (#hero-soft, option B). Ends before the fold with the buttons in view. */
.hero { background: var(--paper); }
:root[data-hero="soft"] .hero { background: var(--grape-soft); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: center; gap: var(--s6); padding-block: var(--s7) var(--s8); }
.hero-copy { display: grid; gap: var(--s5); justify-items: start; }
.hero h1 { font: var(--t-display); }
.hero p { max-width: 40ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s3); }
.hero-art { position: relative; justify-self: center; width: min(100%, 300px); }
.hero-art .sun { position: absolute; inset: 14% 4% auto; aspect-ratio: 1; border-radius: 50%; background: var(--sun-soft); }
:root[data-hero="soft"] .hero-art .sun { background: var(--paper); }
.kido { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; border-radius: var(--r-md); aspect-ratio: 851 / 1191; }
.kido-art, .kido-art svg, .kido-art img { display: block; width: 100%; height: 100%; }
.kido.hop { animation: hop .6s var(--ease); transform-origin: 50% 100%; }
.bubble { position: absolute; top: 2%; right: -6%; margin: 0; background: var(--white); color: var(--ink); font: var(--t-label);
  padding: var(--s2) var(--s4); border-radius: var(--r-md) var(--r-md) var(--r-md) 4px; box-shadow: var(--shadow); white-space: nowrap; }
@media (max-width: 760px) {
  .hero .wrap { grid-template-columns: 1fr; gap: var(--s5); padding-block: var(--s6) var(--s7); }
  .hero-art { order: -1; width: min(52vw, 210px); }
  .bubble { right: -12%; }
}

/* sections */
.section { padding-block: var(--section); }
.head { display: grid; gap: var(--s3); margin-bottom: var(--s7); }
.head.center { justify-items: center; text-align: center; }
.head.center p { margin-inline: auto; }
.band { position: relative; }
.band-sun { background: var(--sun-soft); }
.band-green { background: var(--green-soft); }
.band-grape { background: var(--grape-soft); }
/* soft wavy edges, like a torn paper band */
.band::before, .band::after { content: ""; position: absolute; left: 0; right: 0; height: 18px; background: inherit; pointer-events: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 18' preserveAspectRatio='none'%3E%3Cpath d='M0 18V10Q15 0 30 8T60 8T90 8T120 10V18Z'/%3E%3C/svg%3E") 0 0 / 240px 18px repeat-x;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 18' preserveAspectRatio='none'%3E%3Cpath d='M0 18V10Q15 0 30 8T60 8T90 8T120 10V18Z'/%3E%3C/svg%3E") 0 0 / 240px 18px repeat-x; }
.band::before { top: -17px; }
.band::after { bottom: -17px; transform: scaleY(-1); }
.band-last::after { display: none; }   /* the last band runs straight into the footer */

/* books */
.shelf { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s6); }
@media (max-width: 860px) { .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .shelf { grid-template-columns: 1fr; max-width: 320px; margin-inline: auto; } }
.shelf li { display: grid; justify-items: center; text-align: center; gap: var(--s3); }
.book { position: relative; width: min(100%, 230px); aspect-ratio: 8.5 / 11; margin-bottom: var(--s4);
  transform: perspective(1400px) rotateY(-14deg) rotateZ(-1deg); transform-origin: 40% 50%; transition: transform .35s var(--ease);
  border-radius: 2px 5px 5px 2px; box-shadow: 3px 0 0 #F2EEE3, 5px 1px 0 #DCD6C7, var(--shadow-lift); }
.book img, .book .cover3 { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
/* a soft paperback: a thin crease near the spine, no hard thickness */
.book::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(90deg, rgb(0 0 0 / .18) 0, rgb(255 255 255 / .22) 1.6%, rgb(0 0 0 / .08) 3%, transparent 6%); }
.shelf h3 { font: var(--t-h3); }
.shelf .t-small { max-width: 26ch; }
.shelf li { align-content: start; }
.shelf .btn, .soon { min-width: 11rem; }
/* not a link: same size as the Amazon button, outline only, no hover */
.soon { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 var(--s5); margin: 0;
  border-radius: var(--r-pill); border: 3px solid var(--ink); color: var(--ink); font: var(--t-label); cursor: default; }
/* a round sun sticker on the cover corner, away from the 50 badge */
.sticker { position: absolute; top: -18px; left: -18px; z-index: var(--z-raised); width: 70px; height: 70px; border-radius: 50%;
  display: grid; place-items: center; text-align: center; background: var(--sun); color: var(--ink);
  font: 700 .8rem/1.05 var(--font); transform: rotate(-12deg); box-shadow: var(--shadow); }
.cover3 { display: grid; grid-template-rows: auto auto 1fr auto; background: var(--teal); overflow: hidden; color: var(--white); text-align: center; }
.cover3-band { background: var(--grape); padding: 7% 8% 5%; display: grid; gap: 3%; justify-items: center; }
.cover3-band img { width: 70%; }
.cover3-band span { font: 700 .6rem/1 var(--font); letter-spacing: .02em; }
.cover3-title { font: 700 clamp(1.1rem, 2.4vw, 1.5rem)/1 var(--font); padding: 7% 0 0; }
.cover3-kido { width: 52%; justify-self: center; align-self: end; }
.cover3-age { justify-self: center; margin: 4% 0 7%; background: var(--paper); color: var(--ink); font: 700 .55rem/1 var(--font); padding: 4px 10px; border-radius: var(--r-pill); }

/* why parents choose Kido */
.facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s6) var(--s5); }
@media (max-width: 900px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .facts { grid-template-columns: 1fr; } }
.facts li { display: grid; gap: var(--s2); align-content: start; }
.facts .ic { width: 64px; height: 64px; margin-bottom: var(--s2); }
.facts b { font: var(--t-h3); }
.facts span { font: var(--t-small); color: var(--muted); }

/* games – colour fills the top half of the card, text below (same build as the book cards) */
.games { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s6); max-width: 880px; margin-inline: auto; }
@media (max-width: 680px) { .games { grid-template-columns: 1fr; max-width: 420px; } }
.game { display: grid; grid-template-rows: auto 1fr; background: var(--white); border-radius: var(--r-md); box-shadow: var(--shadow); overflow: hidden; }
.game .art { aspect-ratio: 16 / 10; display: grid; place-items: center; padding: var(--s5); }
.game .art svg { width: 100%; height: 100%; max-width: 360px; }
.game-body { display: flex; flex-direction: column; gap: var(--s2); align-items: flex-start; padding: var(--s5) var(--s5) var(--s6); }
.game .t-small { color: var(--muted); }
.game .btn { margin-top: auto; }
.game .t-small { margin-bottom: var(--s3); }
.tag { font: var(--t-small); font-weight: 700; color: var(--grape-deep); background: var(--grape-soft); border-radius: var(--r-pill); padding: 2px var(--s3); }

/* free pages – four whole pages in a row, one button */
.pages { list-style: none; margin: 0 auto var(--s6); padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s5); max-width: 960px; }
@media (max-width: 700px) { .pages { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 420px; } }
.pages img { width: 100%; height: auto; border-radius: 6px; background: var(--white); box-shadow: var(--shadow); transition: transform .25s var(--ease); }
.pages li:nth-child(odd) img { transform: rotate(-2deg); } .pages li:nth-child(even) img { transform: rotate(2deg); }
.center-row { display: flex; justify-content: center; }

/* quiz – its own section, the question is the loudest thing in the card */
.quiz { max-width: 760px; margin-inline: auto; background: var(--white); border-radius: var(--r-md); padding: var(--s6); box-shadow: var(--shadow); display: grid; gap: var(--s5); }
.quiz-dots { display: flex; justify-content: center; gap: var(--s2); list-style: none; margin: 0; padding: 0; }
.quiz-dots li { width: 28px; height: 8px; border-radius: var(--r-pill); background: var(--grape-soft); }
.quiz-dots li.done, .quiz-dots li.now { background: var(--grape); }
.quiz-title { font: var(--t-h2); text-align: center; margin-bottom: var(--s5); }
.answers { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); }
@media (max-width: 560px) { .answers { grid-template-columns: repeat(2, minmax(0, 1fr)); } .quiz { padding: var(--s5); } }
.answer { width: 100%; display: grid; justify-items: center; gap: var(--s2); padding: var(--s4) var(--s2); min-height: 132px; border-radius: var(--r-md);
  background: var(--paper); border: 3px solid var(--line); color: var(--ink); font: var(--t-label); cursor: pointer; transition: border-color .15s, transform .15s; }
.answer svg { width: 64px; height: 64px; }
.result { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: var(--s6); align-items: center; }
@media (max-width: 560px) { .result { grid-template-columns: 1fr; } }
.result img { width: 100%; height: auto; border-radius: 6px; box-shadow: var(--shadow); }
.result-actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s4); }
.result .t-h3 { margin: var(--s1) 0 var(--s2); }

/* fanned pages (free-pages window) */
.fan { position: relative; height: 260px; width: min(100%, 380px); }
.fan img { position: absolute; top: 0; width: 46%; height: auto; aspect-ratio: 600 / 776; object-fit: cover; border-radius: 6px; background: var(--white); box-shadow: var(--shadow); }
.fan img:nth-child(1) { left: 0; transform: rotate(-8deg); top: 18px; }
.fan img:nth-child(2) { left: 18%; transform: rotate(-2deg); }
.fan img:nth-child(3) { left: 36%; transform: rotate(4deg); top: 10px; }
.fan img:nth-child(4) { left: 54%; transform: rotate(9deg); top: 26px; }

/* about */
.about { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: var(--s7); align-items: center; }
.about-art { order: 2; justify-self: end; }
.about-art img { width: 200px; height: auto; }
@media (max-width: 640px) { .about { grid-template-columns: 1fr; } .about-art img { width: 150px; } }
.about-copy { display: grid; gap: var(--s4); }

/* footer */
.site-foot { background: var(--ink); color: var(--white); position: relative; }
.site-foot .wrap { padding-block: var(--s6); display: flex; flex-wrap: wrap; gap: var(--s3) var(--s6); align-items: center; justify-content: space-between; font: var(--t-small); }
.site-foot a { color: var(--white); }
.site-foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s1) var(--s5); }
.site-foot li a { display: inline-flex; min-height: 44px; align-items: center; }
.site-foot :focus-visible { outline-color: var(--sun); }
.peek { position: absolute; right: max(var(--s5), 6vw); bottom: 100%; width: 150px; height: 82px; overflow: hidden; pointer-events: none; }
.peek .kido-art { width: 150px; height: auto; }

/* floating "free pages" button + exit modal */
.float { position: fixed; left: max(var(--s4), env(safe-area-inset-left, 0px)); bottom: max(var(--s4), env(safe-area-inset-bottom, 0px)); z-index: var(--z-float); }
.float-btn { width: 112px; height: 112px; border-radius: 50%; border: 0; background: var(--white); color: var(--grape-deep); box-shadow: var(--shadow-lift);
  font: 700 1.05rem/1.1 var(--font); display: grid; place-items: center; text-align: center; padding: var(--s3); cursor: pointer; transition: transform .2s var(--ease); }
.float-x { position: absolute; top: -4px; right: -4px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--ink); color: var(--white); display: grid; place-items: center; cursor: pointer; }
.float-x svg { width: 14px; height: 14px; }
@media (max-width: 560px) { .float-btn { width: 92px; height: 92px; font-size: .92rem; } }

.modal { position: fixed; inset: 0; z-index: var(--z-modal); display: grid; place-items: center; padding: var(--s4); background: rgb(43 45 92 / .45); }
.modal-card { position: relative; width: min(100%, 860px); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; background: var(--paper); border-radius: var(--r-md); box-shadow: var(--shadow-lift);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.modal-copy { padding: var(--s7) var(--s6); display: grid; gap: var(--s4); align-content: center; justify-items: start; }
.modal-art { background: var(--sun-soft); display: grid; place-items: center; padding: var(--s6); min-height: 320px; border-radius: 0 var(--r-md) var(--r-md) 0; }
.modal-art .fan { margin: 0; height: 280px; }
.modal-x { position: absolute; top: var(--s3); right: var(--s3); width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--white); box-shadow: var(--shadow); display: grid; place-items: center; cursor: pointer; z-index: var(--z-raised); }
.modal-x svg { width: 16px; height: 16px; }
.modal .note { font: var(--t-small); color: var(--muted); }
@media (max-width: 680px) { .modal-card { grid-template-columns: 1fr; } .modal-art { order: -1; min-height: 0; border-radius: var(--r-md) var(--r-md) 0 0; padding: var(--s5); } .modal-art .fan { height: 200px; width: 280px; } .modal-copy { padding: var(--s5); } }

/* text pages */
.page-head { background: var(--grape-soft); }
.page-head .wrap { padding-block: var(--s7); display: grid; gap: var(--s2); }
.page-head h1 { font: var(--t-display); }
.prose { display: grid; gap: var(--s4); padding-block: var(--s7) var(--s8); }
.prose h2 { font: var(--t-h3); margin-top: var(--s4); }
.prose ul { margin: 0; padding-inline-start: 1.3em; display: grid; gap: var(--s2); max-width: 62ch; }
.he { direction: rtl; text-align: right; font-family: "Varela Round", "Arial Hebrew", system-ui, sans-serif; border-top: 1px solid var(--line); padding-top: var(--s5); display: grid; gap: var(--s3); }

@keyframes hop { 30% { transform: translateY(-7%) rotate(-2deg); } 60% { transform: translateY(0) scaleY(.97); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition-property: opacity, background-color, border-color, color !important; transition-duration: .15s !important; } html { scroll-behavior: auto; } .modal.enter .modal-card, .modal.leave .modal-card, .answer.picked { transform: none; } }

/* phone refinements */
@media (max-width: 600px) {
  .site-head .wrap { flex-wrap: nowrap; min-height: 60px; gap: var(--s2); }
  .brand img { width: 112px; }
  .nav { overflow-x: auto; scrollbar-width: none; }
  .nav ul { flex-wrap: nowrap; }
  .nav a { padding: 0 var(--s2); font-size: .9rem; white-space: nowrap; }
  .nav li:last-child { display: none; }
  .hero-art { width: min(44vw, 170px); }
  .float-btn { width: 84px; height: 84px; font-size: .85rem; padding: var(--s2); }
}
/* the floating button waits until the visitor has scrolled past the first screen */
.float { transition: opacity 200ms cubic-bezier(.23,1,.32,1), transform 200ms cubic-bezier(.23,1,.32,1); }
.float.wait { opacity: 0; transform: translateY(20px); pointer-events: none; }

/* ---- polish after the skills review (15 Nov) ---- */
/* hover only where a precise pointer can hover; on touch a tap must not leave a book tilted or an answer lifted */
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: #426C33; border-color: #426C33; transform: translateY(-1px); }
  .btn-2:hover { background: var(--grape-soft); border-color: var(--ink); }
  .nav a:hover { background: rgb(255 255 255 / .14); }
  .shelf li:hover .book { transform: perspective(1400px) rotateY(-6deg) rotateZ(0) translateY(-4px); }
  .pages li:hover img { transform: rotate(0) translateY(-4px); }
  .answer:hover { border-color: var(--ink); transform: translateY(-2px); }
  .float-btn:hover { transform: scale(1.05); }
}
/* press feedback on every touch: shown on pointer-down, short and firm */
a, button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.btn, .answer, .float-btn, .pages a, .modal-x, .float-x { transition: transform 140ms cubic-bezier(.23,1,.32,1), background-color .15s, border-color .15s; }
.answer:active, .float-btn:active, .pages a:active, .modal-x:active, .float-x:active { transform: scale(.97); }
button span, .btn { -webkit-user-select: none; user-select: none; }
/* the quiz: the chosen answer lights up, then the next question slides in */
.answer.picked { border-color: var(--grape); background: var(--grape-soft); transform: scale(.97); }
.q-in { animation: q-in 200ms cubic-bezier(.23,1,.32,1) both; }
@keyframes q-in { from { opacity: 0; transform: translateY(8px); } }
.result.q-in { animation-duration: 280ms; }
/* the free-pages window eases in from the middle and leaves quicker */
.modal { transition: opacity 200ms cubic-bezier(.23,1,.32,1); }
.modal .modal-card { transition: transform 200ms cubic-bezier(.23,1,.32,1), opacity 200ms cubic-bezier(.23,1,.32,1); }
.modal.enter, .modal.leave { opacity: 0; }
.modal.enter .modal-card, .modal.leave .modal-card { opacity: 0; transform: scale(.96); }
.modal.leave, .modal.leave .modal-card { transition-duration: 150ms; }
/* a download confirms itself for a moment */
.btn.got { background: var(--green-deep); }
.btn.got::after { content: " ✓"; }
@media (prefers-reduced-motion: reduce) { .q-in { animation: none !important; } }
