/* Ready, Set, Maths! site styles (Home and year pages): brand from the game (Fredoka + Andika, river / sand / sunset) */
@font-face { font-family: 'Fredoka'; src: url(brand/fredoka-400-700.woff2) format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Andika'; src: url(brand/andika-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Andika'; src: url(brand/andika-700.woff2) format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --river: #2b7fb8; --river-dark: #1d5f8c; --river-pale: #e6f2fb;
  --sand: #e8b04b; --sand-pale: #fdf4e3;
  --accent: #e4572e; --accent-dark: #c4431e;
  --leaf: #3f9d5a; --leaf-pale: #e8f6ec;
  --ink: #1f2a37; --ink-soft: #4b5563; --line: #e5e7eb; --page: #fffdf8; --card: #ffffff;
  --radius: 18px; --shadow: 0 10px 30px rgba(31, 42, 55, .10);
  --head: 'Fredoka', system-ui, sans-serif; --body: 'Andika', system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; font: 17px/1.6 var(--body); color: var(--ink); background: var(--page); }
img { max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--head); line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }
p { margin: 0 0 1em; }
a { color: var(--river-dark); }
.wrap { width: min(1140px, 100% - 40px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--sand); outline-offset: 3px; border-radius: 6px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: .5em; justify-content: center; font: 600 1rem var(--head); border: 2px solid transparent; border-radius: 999px; padding: .7em 1.3em; cursor: pointer; text-decoration: none; transition: transform .15s, box-shadow .15s, background .15s; }
.btn svg { width: 1.1em; height: 1.1em; fill: currentColor; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--river); color: #fff; box-shadow: 0 6px 0 var(--river-dark); }
.btn-primary:hover { background: #3189c4; }
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 6px 0 var(--accent-dark); }
.btn-ghost { background: #fff; color: var(--river-dark); border-color: var(--river); }
.btn-lg { font-size: 1.15rem; padding: .85em 1.6em; }
.btn-sm { font-size: .95rem; padding: .5em 1.1em; box-shadow: 0 4px 0 var(--river-dark); }
.btn-small-ghost { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.4); padding: .35em .9em; font-size: .9rem; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 253, 248, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 600 1.3rem var(--head); color: var(--ink); text-decoration: none; }
.brand b { color: var(--accent); }
.brand.small { font-size: 1.05rem; }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { font: 500 1rem var(--head); color: var(--ink-soft); text-decoration: none; }
.nav a:hover { color: var(--river); }

/* Hero */
.hero { position: relative; background: linear-gradient(160deg, var(--river-pale) 0%, #f5fbff 55%, var(--sand-pale) 100%); padding: 56px 0 110px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 22px; }
.badge { font: 600 .9rem var(--head); padding: .35em .9em; border-radius: 999px; border: 2px solid; }
.badge-sand { background: var(--sand-pale); border-color: var(--sand); color: #8a5a00; }
.badge-river { background: #fff; border-color: var(--river); color: var(--river-dark); }
.badge-leaf { background: var(--leaf-pale); border-color: var(--leaf); color: #22693a; }
.hl { color: var(--accent); position: relative; white-space: nowrap; }
.hl::after { content: ''; position: absolute; left: 0; right: 0; bottom: .05em; height: .22em; background: var(--sand); opacity: .55; border-radius: 4px; z-index: -1; }
.lead { font-size: 1.2rem; color: var(--ink-soft); max-width: 36em; }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin: 26px 0 12px; }
.fine { font-size: .92rem; color: var(--ink-soft); }
.center { text-align: center; }
.hero-hoot { position: relative; margin: 0; display: grid; justify-items: center; }
.hero-hoot img { width: min(330px, 80%); filter: drop-shadow(0 18px 24px rgba(31,42,55,.18)); animation: bob 4s ease-in-out infinite; }
.bubble { position: relative; background: #fff; border: 3px solid var(--river); border-radius: 20px; padding: 12px 18px; font: 500 1.05rem var(--head); max-width: 280px; margin-bottom: 12px; box-shadow: var(--shadow); }
.bubble::after { content: ''; position: absolute; bottom: -14px; left: 50%; border: 12px solid transparent; border-top-color: var(--river); border-bottom: 0; transform: translateX(-50%); }
.wave { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 90px; fill: var(--page); }
@keyframes bob { 50% { transform: translateY(-10px) rotate(-1.5deg); } }

/* Sections */
section { padding: 72px 0; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 36px; }
.section-head p:last-child { color: var(--ink-soft); }
.eyebrow { font: 600 .9rem var(--head); text-transform: uppercase; letter-spacing: .12em; color: var(--accent); margin-bottom: .4em; }

/* Player */
.play { padding-top: 24px; }
.player { position: relative; border-radius: 24px; overflow: hidden; background: linear-gradient(160deg, var(--river), var(--river-dark)); box-shadow: var(--shadow); aspect-ratio: 16 / 10; min-height: 420px; }
.player-poster { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; color: #fff; text-align: center; padding: 20px; }
.player-poster[hidden] { display: none; }
.player-poster img { width: 140px; }
.player-poster p { margin: 0; opacity: .9; }
.player iframe { position: absolute; inset: 44px 0 0 0; width: 100%; height: calc(100% - 44px); border: 0; background: #fff; }
.player-bar { position: absolute; top: 0; left: 0; right: 0; height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 10px; background: var(--river-dark); color: #fff; }
.player-bar[hidden] { display: none; }
.player-title { font: 600 1rem var(--head); margin-right: auto; }
.player:fullscreen { border-radius: 0; aspect-ratio: auto; }

/* Features */
.cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: 0 2px 0 var(--line); }
.card p { color: var(--ink-soft); margin: 0; }
.icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; font-size: 1.5rem; margin-bottom: 12px; }
.i-river { background: var(--river-pale); } .i-sand { background: var(--sand-pale); } .i-accent { background: #fde9e3; } .i-leaf { background: var(--leaf-pale); }
.chapters { margin-top: 44px; text-align: center; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; counter-reset: ch; }
.chips li { counter-increment: ch; font: 500 .95rem var(--head); background: #fff; border: 2px solid var(--line); border-radius: 999px; padding: .3em .85em; }
.chips li::before { content: counter(ch); font-weight: 700; color: var(--river); margin-right: .45em; }

/* Book */
.book { background: var(--sand-pale); }
.book-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 48px; align-items: center; }
.book-cover { display: grid; place-items: center; }
.cover { width: 260px; aspect-ratio: 3 / 4; border-radius: 10px 18px 18px 10px; background: linear-gradient(150deg, var(--river), var(--river-dark)); color: #fff; padding: 26px 22px; display: flex; flex-direction: column; position: relative; box-shadow: 18px 18px 0 rgba(232,176,75,.45), var(--shadow); transform: rotate(-3deg); }
.cover::before { content: ''; position: absolute; left: 12px; top: 0; bottom: 0; width: 4px; background: rgba(255,255,255,.25); }
.cover-kicker { font: 600 1.2rem var(--head); }
.cover-title { font: 700 3rem/1 var(--head); color: var(--sand); }
.cover-year { margin-top: 10px; align-self: flex-start; font: 700 1rem var(--head); background: var(--accent); padding: .25em .8em; border-radius: 999px; }
.cover img { position: absolute; right: 14px; bottom: 14px; width: 110px; }
.ticks { list-style: none; padding: 0; margin: 0 0 22px; }
.ticks li { padding-left: 1.7em; position: relative; margin: .35em 0; }
.ticks li::before { content: '✓'; position: absolute; left: 0; font-weight: 700; color: var(--leaf); }
.price-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.price { font: 700 1.6rem var(--head); }

/* Plans */
.plan-grid { list-style: none; padding: 0; margin: 0 0 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: stretch; }
.plan { position: relative; background: #fff; border: 2px solid var(--line); border-radius: var(--radius); padding: 28px 24px; display: flex; flex-direction: column; }
.plan .ticks { flex: 1; }
.plan-best { border-color: var(--accent); box-shadow: var(--shadow); }
.ribbon { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; font: 600 .85rem var(--head); padding: .3em .9em; border-radius: 999px; }
.amount { font: 700 2.2rem var(--head); margin: 0 0 14px; }
.amount small { font-size: 1rem; font-weight: 500; color: var(--ink-soft); }

/* Grown-ups */
.grownups { background: var(--river-pale); }
.gu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.trust { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.trust li { background: #fff; border-radius: 14px; padding: 14px 18px; border-left: 5px solid var(--river); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 26px 0; color: var(--ink-soft); font-size: .95rem; }
.foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Responsive */
@media (max-width: 900px) {
  .hero-grid, .book-grid, .gu-grid { grid-template-columns: 1fr; }
  .hero-hoot { order: -1; } .hero-hoot img { width: 200px; }
  .cards, .plan-grid { grid-template-columns: 1fr 1fr; }
  .nav { display: none; }
  .bar .btn { margin-left: auto; }
}
@media (max-width: 600px) {
  .cards, .plan-grid { grid-template-columns: 1fr; }
  .player { aspect-ratio: auto; height: 78vh; min-height: 0; }
  section { padding: 52px 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-hoot img { animation: none; }
  .btn { transition: none; }
}

/* ===== Years: tabs, cards, year pages ===== */
.tone-river { --tone: var(--river); --tone-pale: var(--river-pale); }
.tone-sand { --tone: #c98a17; --tone-pale: var(--sand-pale); }
.tone-accent { --tone: var(--accent); --tone-pale: #fde9e3; }
.tone-leaf { --tone: var(--leaf); --tone-pale: var(--leaf-pale); }

.year-menu { position: relative; }
.year-menu-btn { display: inline-flex; align-items: center; gap: 6px; font: 600 1rem var(--head); color: var(--ink); background: #fff; border: 2px solid var(--line); border-radius: 999px; padding: .45em .8em .45em 1em; cursor: pointer; }
.year-menu-btn:hover, .year-menu-btn[aria-expanded="true"] { border-color: var(--river); }
.year-menu-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.year-menu-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.year-menu-list { position: absolute; top: calc(100% + 8px); left: 0; z-index: 60; width: 320px; list-style: none; margin: 0; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 16px 40px rgba(31, 42, 55, .18); }
.year-option { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; color: var(--ink); text-decoration: none; }
.year-option:hover, .year-option:focus-visible { background: var(--tone-pale); outline: none; }
.year-option[aria-current="page"] { background: var(--tone-pale); }
.year-option-n { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--tone-pale); color: var(--tone); font: 700 1.1rem var(--head); }
.year-option.is-live .year-option-n { background: var(--tone); color: #fff; }
.year-option-text { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.year-option-label { font: 600 1rem var(--head); }
.year-option-ages { font-size: .85rem; color: var(--ink-soft); }
.year-option .status { margin: 0 !important; }

.year-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.year-card { position: relative; background: #fff; border: 2px solid var(--line); border-radius: var(--radius); padding: 22px 20px 20px; display: flex; flex-direction: column; gap: 4px; }
.year-card.is-live { border-color: var(--tone); box-shadow: var(--shadow); }
.year-card-n { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--tone-pale); color: var(--tone); font: 700 1.8rem var(--head); margin-bottom: 8px; }
.year-card.is-live .year-card-n { background: var(--tone); color: #fff; }
.year-card h3 { margin: 0; font-size: 1.35rem; }
.year-card p { margin: 0; }
.year-card-ages { color: var(--ink-soft); }
.year-card-alt { font-size: .85rem; color: var(--ink-soft); }
.year-card-app { font: 600 .95rem var(--head); color: var(--tone); }
.year-card .btn { margin-top: auto; align-self: flex-start; }
.status { display: inline-block; align-self: flex-start; font: 600 .8rem var(--head); padding: .2em .7em; border-radius: 999px; margin: 6px 0 10px !important; }
.status-live { background: var(--leaf-pale); color: #22693a; }
.status-soon { background: #f3f4f6; color: var(--ink-soft); }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.step p { color: var(--ink-soft); margin: 0; }
.step-n { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--sand); color: #fff; font: 700 1.2rem var(--head); margin-bottom: 10px; }

.hero.tone-sand, .hero.tone-accent, .hero.tone-leaf, .hero.tone-river { background: linear-gradient(160deg, var(--tone-pale) 0%, #fffdf8 60%, var(--sand-pale) 100%); }
.crumb { font: 500 .95rem var(--head); color: var(--ink-soft); margin-bottom: 14px; }
.crumb a { color: var(--ink-soft); }
.soon-card { max-width: 760px; text-align: center; background: #fff; border: 2px dashed var(--line); border-radius: var(--radius); padding: 36px 28px; }
.year-pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0 40px; }
.year-pager a { font: 600 1rem var(--head); color: var(--river-dark); text-decoration: none; padding: .5em 1em; border: 2px solid var(--line); border-radius: 999px; background: #fff; }
.year-pager a:hover { border-color: var(--river); }
.pager-all { margin-inline: auto; }
.foot-years { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.foot-years a { color: var(--ink-soft); font-size: .9rem; }

@media (max-width: 900px) { .steps { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .brand span { display: none; } .year-menu-list { position: fixed; top: 76px; left: 12px; right: 12px; width: auto; } }

/* ===== Added for the live site: continue banner, game module, 404 ===== */
.continue { background: var(--leaf-pale); border-bottom: 1px solid #cfe9d7; }
.continue .wrap { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 0; }
.continue p { margin: 0; font: 600 1.05rem var(--head); }
.continue .btn { padding: .45em 1.1em; }
.module { display: grid; grid-template-columns: 1fr 1.3fr; gap: 0; background: #fff; border: 2px solid var(--river); border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); }
.module-art { background: linear-gradient(160deg, var(--river), var(--river-dark)); display: grid; place-items: center; padding: 28px; color: #fff; text-align: center; }
.module-art img { width: 170px; filter: drop-shadow(0 12px 18px rgba(0,0,0,.25)); }
.module-art .tag { font: 600 .85rem var(--head); background: rgba(255,255,255,.18); border-radius: 999px; padding: .25em .8em; margin-top: 12px; }
.module-body { padding: 30px 32px; }
.module-body h3 { font-size: 1.6rem; margin-bottom: .3em; }
.module-body .cta-row { margin: 18px 0 0; }
.notfound { text-align: center; padding: 80px 0; }
.notfound .year-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 20px; }
@media (max-width: 760px) { .module { grid-template-columns: 1fr; } }

/* ===== Maths games page ===== */
.nav a[aria-current="page"] { color: var(--river-dark); font-weight: 600; text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; text-decoration-color: var(--sand); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 10px; }
.filter { font: 600 .95rem var(--head); padding: .45em 1em; border-radius: 999px; border: 2px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.filter:hover { border-color: var(--river); }
.filter[aria-pressed="true"] { background: var(--river); border-color: var(--river); color: #fff; }
.games .fine { text-align: center; margin-bottom: 22px; }
.game-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 20px; }
.game-card { display: grid; grid-template-columns: 120px 1fr; background: #fff; border: 2px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.game-card.is-live { border-color: var(--tone); box-shadow: var(--shadow); }
.game-card-art { position: relative; display: grid; place-items: center; background: var(--tone-pale); padding: 14px; }
.game-card.is-live .game-card-art { background: linear-gradient(160deg, var(--tone), var(--river-dark)); }
.game-card:not(.is-live) .game-card-art img { opacity: .45; filter: grayscale(.6); }
.game-card-art .year-card-n { position: absolute; top: 10px; left: 10px; width: 36px; height: 36px; font-size: 1.1rem; border-radius: 10px; margin: 0; }
.game-card.is-live .game-card-art .year-card-n { background: #fff; color: var(--tone); }
.game-card-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.game-card-body h3 { margin: 0; font-size: 1.25rem; }
.game-card-body p { margin: 0; color: var(--ink-soft); }
.game-card-year { font: 600 .85rem var(--head); color: var(--tone) !important; }
.game-card-body .btn { margin-top: 6px; align-self: flex-start; padding: .5em 1em; font-size: .95rem; }
@media (max-width: 420px) { .game-grid { grid-template-columns: 1fr; } .game-card { grid-template-columns: 1fr; } }

/* ===== Professor Hoot, alive (Home page hero) ===== */
.hoot-live { display: grid; justify-items: center; }
.hoot-btn { background: none; border: 0; padding: 0; margin: 0; cursor: pointer; width: min(330px, 80%); border-radius: 28px; -webkit-tap-highlight-color: transparent; }
.hoot-btn:focus-visible { outline: 3px solid var(--sand); outline-offset: 6px; }
.hoot-svg { display: block; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 18px 24px rgba(31, 42, 55, .18)); }
.hoot-svg .mood { transform-origin: 150px 355px; transition: transform .35s cubic-bezier(.3, .7, .4, 1); }
.hoot-svg .lean { transform-origin: 150px 330px; transition: transform .3s ease-out; }
.hoot-svg .breathe { transform-origin: 150px 355px; animation: hoot-breathe 3.2s ease-in-out infinite; }
.hoot-svg .nod { transform-origin: 150px 330px; animation: hoot-tilt 7s ease-in-out infinite; }
.hoot-svg .wing { transform-origin: 212px 236px; }
.hoot-svg .look { transition: transform .18s ease-out; }
.hoot-svg .lid { transition: transform .07s ease-in; }
.hoot-live.blink .hoot-svg .lid { transform: translateY(68px); }
/* hover: perks up */
.hoot-btn:hover .mood { transform: translateY(-6px) scale(1.025); }
/* one-off actions (a class on the figure for a moment) */
.hoot-live.do-wave .wing { animation: hoot-wave .38s ease-in-out 3; }
.hoot-live.do-hop .mood { animation: hoot-hop .5s cubic-bezier(.3, .7, .4, 1) 2; }
.hoot-live.do-tilt .mood { animation: hoot-head .9s ease-in-out; }
.hoot-live.do-ruffle .mood { animation: hoot-ruffle .6s ease-in-out; }
.hoot-live.do-cheer .mood { animation: hoot-hop .45s cubic-bezier(.3, .7, .4, 1) 2; }
.hoot-live.do-cheer .wing { animation: hoot-flap .2s ease-in-out 6; }
.hoot-live.do-spin .mood { animation: hoot-spin .7s ease-in-out; }
.hoot-live.do-bow .mood { animation: hoot-bow 1s ease-in-out; }
@keyframes hoot-breathe { 50% { transform: scale(1.012, .99); } }
@keyframes hoot-tilt { 0%, 38%, 62%, 88%, 100% { transform: rotate(0); } 46%, 54% { transform: rotate(-4deg) translateX(-3px); } 94% { transform: rotate(3deg) translateX(2px); } }
@keyframes hoot-wave { 50% { transform: rotate(-26deg); } }
@keyframes hoot-flap { 50% { transform: rotate(-30deg); } }
@keyframes hoot-hop { 50% { transform: translateY(-16px); } }
@keyframes hoot-head { 30%, 70% { transform: rotate(-8deg) translateX(-4px); } }
@keyframes hoot-ruffle { 20% { transform: rotate(3deg) scale(1.02, .98); } 40% { transform: rotate(-3deg) scale(.98, 1.02); } 60% { transform: rotate(2deg); } 80% { transform: rotate(-1deg); } }
@keyframes hoot-spin { 50% { transform: scaleX(-1) translateY(-10px); } }
@keyframes hoot-bow { 40%, 60% { transform: translateY(10px) rotate(6deg) scale(1, .95); } }
/* bubble and hint */
.hoot-bubble { max-width: 340px; text-align: left; }
.hoot-bubble p { margin: 0; }
.hoot-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.hoot-actions .btn { font-size: .9rem; padding: .45em 1em; box-shadow: none; }
.hoot-live[data-state="fact"] .hoot-bubble { border-color: var(--accent); }
.hoot-live[data-state="fact"] .hoot-bubble::after { border-top-color: var(--accent); }
.hoot-hint { margin: 10px 0 0; font: 600 1rem var(--head); color: var(--river-dark); background: #fff; border: 2px dashed var(--river); border-radius: 999px; padding: .35em 1em; animation: hoot-pulse 2.2s ease-in-out infinite; }
.hoot-live[data-state="fact"] .hoot-hint { visibility: hidden; }
@keyframes hoot-pulse { 50% { transform: scale(1.05); } }
@media (max-width: 900px) { .hoot-btn { width: 220px; } }
@media (prefers-reduced-motion: reduce) {
  .hoot-svg *, .hoot-live *, .hoot-hint { animation: none !important; transition: none !important; }
  .hoot-btn:hover .mood { transform: none; }
}

/* Hoot talking: the moving mouth shows only while he speaks; his head nods along like in the game */
.hoot-svg .mouth { opacity: 0; transition: opacity .15s; }
.hoot-live.talking .hoot-svg .mouth { opacity: 1; }
.hoot-live.talking .hoot-svg .nod { animation: hoot-talk .95s ease-in-out infinite; }
@keyframes hoot-talk { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-2.2deg) translateY(1.5px); } 70% { transform: rotate(1.6deg); } }
.hoot-sound { margin-top: 8px; font: 600 .85rem var(--head); color: var(--ink-soft); background: transparent; border: 0; cursor: pointer; padding: .3em .6em; border-radius: 999px; }
.hoot-sound:hover { color: var(--river-dark); background: #fff; }

/* ===== Maths games: coming soon (animated) ===== */
.soon-badge { display: inline-flex; align-items: center; gap: 8px; font: 600 .95rem var(--head); color: var(--accent-dark); background: #fde9e3; border: 2px solid var(--accent); border-radius: 999px; padding: .3em .9em; margin: 0 0 16px; }
.soon-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: soon-ping 1.4s ease-out infinite; }
@keyframes soon-ping { 0% { box-shadow: 0 0 0 0 rgba(228, 87, 46, .6); } 100% { box-shadow: 0 0 0 10px rgba(228, 87, 46, 0); } }
.build-bar { margin: 6px 0 24px; max-width: 460px; }
.build-label { display: block; font: 600 .95rem var(--head); color: var(--river-dark); margin-bottom: 6px; }
.build-track { display: block; height: 14px; border-radius: 999px; background: #fff; border: 2px solid var(--river); overflow: hidden; }
.build-fill { display: block; height: 100%; width: 100%; background: repeating-linear-gradient(-45deg, var(--river) 0 12px, #5aa3d4 12px 24px); background-size: 34px 34px; animation: build-stripes 1s linear infinite; }
@keyframes build-stripes { to { background-position: 34px 0; } }

.soon-stage { position: relative; min-height: 380px; display: grid; place-items: center; }
.soon-hoot { position: relative; z-index: 2; display: grid; justify-items: center; }
.soon-hoot img { width: min(240px, 60vw); filter: drop-shadow(0 18px 24px rgba(31, 42, 55, .18)); animation: soon-bob 3.2s ease-in-out infinite; transform-origin: 50% 100%; }
.soon-shadow { width: 150px; height: 16px; border-radius: 50%; background: rgba(31, 42, 55, .14); margin-top: -6px; animation: soon-shadow 3.2s ease-in-out infinite; }
@keyframes soon-bob { 0%, 100% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-14px) rotate(-3deg); } 50% { transform: translateY(-4px) rotate(0); } 75% { transform: translateY(-16px) rotate(3deg); } }
@keyframes soon-shadow { 0%, 50%, 100% { transform: scale(1); opacity: 1; } 25%, 75% { transform: scale(.82); opacity: .7; } }

.floater { position: absolute; z-index: 1; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; font: 700 1.7rem var(--head); color: #fff; box-shadow: 0 8px 18px rgba(31, 42, 55, .15); animation: float-drift 6s ease-in-out infinite; }
.floater:nth-child(4n+1) { background: var(--river); }
.floater:nth-child(4n+2) { background: var(--accent); }
.floater:nth-child(4n+3) { background: var(--sand); }
.floater:nth-child(4n) { background: var(--leaf); }
.f1 { top: 4%; left: 8%; animation-delay: 0s; }
.f2 { top: 2%; right: 12%; animation-delay: -1.2s; animation-duration: 7s; }
.f3 { top: 30%; left: 0; animation-delay: -2.4s; animation-duration: 5.5s; }
.f4 { top: 26%; right: 0; animation-delay: -3.1s; }
.f5 { bottom: 18%; left: 6%; animation-delay: -0.6s; animation-duration: 6.5s; }
.f6 { bottom: 12%; right: 8%; animation-delay: -4s; animation-duration: 7.5s; }
.f7 { top: 56%; left: 18%; width: 44px; height: 44px; font-size: 1.3rem; animation-delay: -1.8s; }
.f8 { top: 60%; right: 20%; width: 44px; height: 44px; font-size: 1.3rem; animation-delay: -2.9s; animation-duration: 5s; }
.f9 { top: 12%; left: 42%; width: 40px; height: 40px; font-size: 1.2rem; animation-delay: -3.6s; animation-duration: 8s; }
.f10 { bottom: 2%; left: 44%; width: 40px; height: 40px; font-size: 1.2rem; animation-delay: -5s; animation-duration: 6.8s; }
@keyframes float-drift { 0%, 100% { transform: translate(0, 0) rotate(-8deg); } 25% { transform: translate(8px, -16px) rotate(6deg); } 50% { transform: translate(-6px, -24px) rotate(-4deg); } 75% { transform: translate(-10px, -8px) rotate(10deg); } }

.mystery-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.mystery-card { display: grid; justify-items: center; gap: 10px; padding: 34px 20px 26px; border-radius: var(--radius); background: #fff; border: 2px dashed var(--line); animation: mystery-wobble 4s ease-in-out infinite; }
.mystery-card.m2 { animation-delay: -1.3s; }
.mystery-card.m3 { animation-delay: -2.6s; }
.mystery-q { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 22px; font: 700 2.8rem var(--head); color: #fff; background: linear-gradient(150deg, var(--river), var(--river-dark)); }
.m2 .mystery-q { background: linear-gradient(150deg, var(--accent), var(--accent-dark)); }
.m3 .mystery-q { background: linear-gradient(150deg, var(--sand), #c98a17); }
.mystery-label { font: 600 1.05rem var(--head); color: var(--ink-soft); }
.mystery-card:hover .mystery-q { animation: mystery-spin .8s ease-in-out; }
@keyframes mystery-wobble { 0%, 100% { transform: rotate(0) translateY(0); } 25% { transform: rotate(-1.5deg) translateY(-4px); } 75% { transform: rotate(1.5deg) translateY(-2px); } }
@keyframes mystery-spin { 50% { transform: rotateY(180deg) scale(1.08); } }

@media (max-width: 900px) { .soon-stage { min-height: 300px; } .mystery-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) {
  .soon-dot, .build-fill, .soon-hoot img, .soon-shadow, .floater, .mystery-card, .mystery-card:hover .mystery-q { animation: none !important; }
}

/* ===== Navigation v2: utility bar, main menu, account links, mobile menu ===== */
.utility-bar { background: var(--river-dark); color: #dbeaf6; font: 500 .85rem var(--head); }
.utility { display: flex; justify-content: space-between; align-items: center; min-height: 32px; gap: 16px; }
.utility nav { display: flex; gap: 18px; }
.utility a { color: #fff; text-decoration: none; }
.utility a:hover, .utility a[aria-current="page"] { text-decoration: underline; text-underline-offset: 3px; }
.site-header .bar { gap: 18px; }
.site-header .nav { display: flex; align-items: center; gap: 4px; margin-left: 18px; margin-right: auto; }
.site-header .nav > a, .nav-years { font: 500 1rem var(--head); color: var(--ink-soft); text-decoration: none; padding: .45em .7em; border-radius: 10px; background: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.site-header .nav > a:hover, .nav-years:hover, .nav-years[aria-expanded="true"] { color: var(--river-dark); background: var(--river-pale); }
.site-header .nav > a[aria-current="page"], .nav-years[aria-current="page"] { color: var(--river-dark); font-weight: 600; text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; text-decoration-color: var(--sand); }
.nav-years .chev { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.nav-years[aria-expanded="true"] .chev { transform: rotate(180deg); }
.account-links { display: flex; align-items: center; gap: 14px; }
.nav-signin { font: 600 1rem var(--head); color: var(--river-dark); text-decoration: none; }
.nav-signin:hover { text-decoration: underline; }
.join, .menu-toggle { display: none; }
.menu-toggle { background: #fff; border: 2px solid var(--line); border-radius: 12px; width: 44px; height: 44px; place-items: center; cursor: pointer; }
.menu-toggle svg { width: 24px; height: 24px; fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; }
.menu-toggle[aria-expanded="true"] { border-color: var(--river); background: var(--river-pale); }
.mobile-menu { border-top: 1px solid var(--line); background: #fff; max-height: calc(100vh - 68px); overflow-y: auto; padding: 18px 0 28px; }
.mm-title { font: 600 .9rem var(--head); text-transform: uppercase; letter-spacing: .1em; color: var(--accent); margin: 0 0 10px; }
.mm-years { list-style: none; padding: 0; margin: 0 0 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mm-year { display: flex; align-items: center; gap: 10px; padding: 10px; border: 2px solid var(--line); border-radius: 14px; color: var(--ink); text-decoration: none; font: 600 1rem var(--head); }
.mm-year small { display: block; font: 500 .78rem var(--body); color: var(--ink-soft); }
.mm-year[aria-current="page"] { border-color: var(--tone); background: var(--tone-pale); }
.mm-links { display: grid; border-top: 1px solid var(--line); }
.mm-links a { font: 600 1.15rem var(--head); color: var(--ink); text-decoration: none; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.mm-links a[aria-current="page"] { color: var(--river-dark); }
.mm-sub { display: flex; gap: 18px; padding: 16px 4px; }
.mm-sub a { color: var(--ink-soft); }
.mm-account { display: grid; gap: 12px; justify-items: center; padding-top: 6px; }
.mm-account .btn { width: 100%; }
body.menu-open { overflow: hidden; }
@media (max-width: 1024px) {
  .utility-bar, .site-header .nav, .account-links { display: none; }
  .join { display: inline-flex; margin-left: auto; }
  .join[hidden] { display: none !important; }
  .menu-toggle { display: grid; }
}
@media (min-width: 1025px) { .mobile-menu { display: none !important; } }
@media (max-width: 900px) { .bar .btn { margin-left: 0; } .bar .join { margin-left: auto; } }

/* ===== Footer v2 ===== */
.site-footer { background: #fff; padding: 40px 0 20px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
.foot-grid h2 { font: 600 .9rem var(--head); text-transform: uppercase; letter-spacing: .08em; color: var(--ink); margin: 0 0 10px; }
.foot-grid nav { display: grid; align-content: start; gap: 6px; }
.foot-grid nav a { color: var(--ink-soft); text-decoration: none; font-size: .95rem; }
.foot-grid nav a:hover { color: var(--river-dark); text-decoration: underline; }
.foot-brand p { color: var(--ink-soft); font-size: .95rem; margin-top: 10px; }
.foot-base { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--line); margin-top: 28px; padding-top: 16px; font-size: .88rem; color: var(--ink-soft); }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; } }

/* ===== Content pages: Books, Pricing, For parents, Help, Account, Privacy, Terms ===== */
.page-hero { padding: 44px 0 100px; }
.page-hero h1 { margin-bottom: .3em; }
.narrow { max-width: 780px; }
.book-grid { list-style: none; padding: 0; margin: 0 0 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.book-card { display: grid; grid-template-columns: 120px 1fr; gap: 18px; align-items: center; background: #fff; border: 2px solid var(--line); border-radius: var(--radius); padding: 18px; }
.book-card.is-live { border-color: var(--tone); box-shadow: var(--shadow); }
.book-card:not(.is-live) .cover { filter: grayscale(.7); opacity: .6; }
.book-card h2 { font-size: 1.2rem; margin: 0 0 4px; }
.book-card p { margin: 0 0 6px; }
.book-card .cta-row { margin: 8px 0 0; }
.book-card .btn { padding: .5em 1em; font-size: .95rem; }
.cover-sm { width: 120px; padding: 14px 12px; transform: rotate(-2deg); box-shadow: 8px 8px 0 rgba(232,176,75,.45); }
.cover-sm .cover-kicker { font-size: .8rem; } .cover-sm .cover-title { font-size: 1.5rem; } .cover-sm .cover-year { font-size: .75rem; margin-top: 6px; }
.faq { display: grid; gap: 10px; margin-top: 12px; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; }
.faq summary { font: 600 1.05rem var(--head); cursor: pointer; }
.faq details[open] summary { color: var(--river-dark); margin-bottom: 8px; }
.faq details p { margin: 0; color: var(--ink-soft); }
.story-grid { display: grid; grid-template-columns: 150px 1fr; gap: 28px; align-items: start; }
.story { background: var(--sand-pale); }
.progress-info .btn { margin-top: 6px; }
.contact-form, .acct-form { display: grid; gap: 14px; margin-top: 14px; }
.contact-form label, .field { display: grid; gap: 6px; font: 600 .95rem var(--head); }
.contact-form select, .contact-form textarea, .field input { font: 400 1rem var(--body); padding: .65em .8em; border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }
.contact-form select:focus, .contact-form textarea:focus, .field input:focus { border-color: var(--river); outline: none; }
.contact-form .btn, .acct-form .btn { justify-self: start; }
.form-status { margin: 0; font-weight: 700; color: var(--river-dark); min-height: 1.4em; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.account { padding: 48px 0 72px; }
.acct-card { background: #fff; border: 2px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); margin: 18px 0; }
.acct-tabs { display: flex; gap: 6px; background: var(--river-pale); border-radius: 999px; padding: 4px; width: fit-content; margin-bottom: 8px; }
.acct-tab { font: 600 .95rem var(--head); border: 0; background: none; padding: .5em 1.1em; border-radius: 999px; cursor: pointer; color: var(--ink-soft); }
.acct-tab.on { background: #fff; color: var(--river-dark); box-shadow: 0 2px 6px rgba(31,42,55,.12); }
.acct-note { background: var(--sand-pale); border-left: 4px solid var(--sand); padding: 10px 14px; border-radius: 8px; }
.acct-plan { background: var(--river-pale); border-radius: 14px; padding: 18px; margin: 14px 0; }
.acct-plan h2 { font-size: 1.25rem; margin-bottom: .3em; }
.acct-small { font-size: .9rem; color: var(--ink-soft); }
.acct-who { margin: 0; }
.code-input { font-size: 1.4rem !important; letter-spacing: .25em; max-width: 220px; }
.linkish { background: none; border: 0; padding: 0; color: var(--river-dark); text-decoration: underline; cursor: pointer; font: inherit; }
.legal h2 { font-size: 1.3rem; margin-top: 1.4em; }
.legal ul { padding-left: 1.2em; }
.draft-note { background: #fff4d6; border: 2px dashed var(--sand); border-radius: 14px; padding: 14px 18px; margin-bottom: 10px; }
@media (max-width: 600px) { .field-row, .story-grid { grid-template-columns: 1fr; } .book-card { grid-template-columns: 1fr; justify-items: start; } }
