@font-face {
  font-family: Fredoka;
  src: url('../fonts/fredoka.woff2') format('woff2');
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --navy: #1f2a5a;
  --cream: #fcfaf2;
  --mint: #e3f6f5;
  --orange: #ffa940;
  --gold: #ffc83d;
  --slate: #253442;
  --paper: #fffef9;
  --outline: 2px solid var(--navy);
  --sticker: 3px 4px 0 var(--navy);
  --radius: 20px;
  --display: Fredoka, ui-rounded, 'Trebuchet MS', sans-serif;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--slate); background: var(--cream); font: 1rem/1.55 system-ui, sans-serif; }
img, svg { display: block; }
img { max-width: 100%; height: auto; }
button { font: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 4px; }
[hidden] { display: none !important; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { color: var(--navy); font-family: var(--display); font-weight: 650; line-height: 1.05; }
h1 { font-size: clamp(2.4rem, 5.2vw, 4.8rem); letter-spacing: -.025em; }
h2 { font-size: clamp(2rem, 4.2vw, 3.65rem); letter-spacing: -.02em; text-wrap: balance; }
.wrap { width: min(100% - 36px, 1180px); margin-inline: auto; }
.section-pad { padding-block: clamp(48px, 7vw, 92px); }
.section-heading { text-align: center; margin-bottom: clamp(24px, 4vw, 42px); }
.section-heading p { max-width: 56ch; margin: .7rem auto 0; }
.band { border-block: var(--outline); }
.skip { position: fixed; inset: 8px auto auto 8px; z-index: 2; padding: .65rem 1rem; background: var(--gold); color: var(--navy); font-weight: 750; }
.skip:not(:focus) { clip-path: inset(50%); }

/* Header and language switch */
.site-header { border-bottom: var(--outline); color: var(--navy); }
.header-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 16px; padding-block: 12px; }
.brand { display: inline-flex; width: fit-content; gap: 8px; align-items: center; font: 650 1.85rem/1 var(--display); text-decoration: none; }
.brand img { width: 39px; border: var(--outline); border-radius: 12px; }
.main-nav { grid-column: 1 / -1; grid-row: 2; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2px 10px; font-size: .85rem; font-weight: 700; }
.main-nav a { display: inline-block; padding-block: 6px; text-decoration: none; }
.main-nav a:hover { text-decoration: underline; text-underline-offset: .24em; }
.languages { display: flex; gap: 2px; padding: 3px; background: var(--paper); color: var(--navy); border: var(--outline); border-radius: 100px; }
.languages a { min-width: 36px; padding: 4px 7px; border-radius: 100px; text-align: center; font-size: .82rem; font-weight: 800; text-decoration: none; }
.languages a[aria-current] { background: var(--gold); }
.languages a:hover { text-decoration: underline; }

/* Hero and playable keyboard */
.hero { display: grid; gap: 26px; padding-block: clamp(38px, 6vw, 85px) 34px; }
.hero-intro { display: grid; gap: 8px; align-content: end; }
.hero-kicker { color: var(--navy); font: 700 clamp(.88rem, 1.4vw, 1.05rem)/1.3 var(--display); }
.hero-demo-link { width: fit-content; color: var(--navy); font: 680 1rem/1.3 var(--display); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .22em; }
.hero-demo-link:hover { color: var(--slate); }
.hero h1 span { display: block; }
.hero h1 span:last-child { text-wrap: balance; text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: .1em; text-underline-offset: .12em; text-decoration-skip-ink: none; }
.lead { max-width: 54ch; font-size: clamp(1rem, 1.45vw, 1.16rem); }
.cta { display: inline-flex; align-items: center; gap: 14px; border: var(--outline); border-radius: 100px; color: var(--navy); background: var(--orange); box-shadow: var(--sticker); padding: .66em 1.05em; font: 620 1.2rem/1.15 var(--display); text-decoration: none; }
.hero .cta { margin-top: 22px; }
.cta:hover { background: var(--gold); }
.cta:active { transform: translate(2px, 3px); box-shadow: 1px 1px var(--navy); }
.availability { display: grid; justify-items: start; gap: 4px; margin-top: 17px; }
.soon { display: inline-flex; align-items: center; gap: .5em; color: var(--navy); font-size: .84rem; font-weight: 740; }
.soon::before { content: ''; flex: none; width: .64em; height: .64em; border-radius: 100%; background: var(--gold); box-shadow: 0 0 0 1px var(--navy); }
.availability small { font-size: .82rem; }
.demo { display: grid; align-items: center; justify-items: center; gap: 12px; }
.hero-art { position: relative; display: grid; place-items: center; width: min(100%, 144px); isolation: isolate; }
.hero-art::before { content: ''; position: absolute; inset: 8% 5% 3%; z-index: -1; border: var(--outline); border-radius: 45% 55% 51% 49% / 56% 46% 54% 44%; background: var(--mint); transform: rotate(-8deg); box-shadow: var(--sticker); }
.mascot-stage { width: 72%; }
.mascot-float { animation: float 4.8s var(--ease-in-out) both; }
@keyframes float { 50% { transform: translateY(-7px); } }
.spark { position: absolute; width: 13%; color: var(--gold); }
.spark svg, .parents-art svg { width: 100%; fill: var(--gold); stroke: var(--navy); stroke-width: 1.7; stroke-linejoin: round; }
.spark-a { inset: 11% auto auto 2%; transform: rotate(-14deg); }
.spark-b { inset: 21% 2% auto auto; width: 9%; transform: rotate(17deg); }
.spark-c { inset: auto auto 17% 8%; width: 7%; transform: rotate(21deg); }
.game { width: min(100%, 640px); margin-inline: auto; text-align: center; }
#game-hint { font-size: .9rem; font-weight: 650; margin-bottom: 9px; }
.keys { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: clamp(4px, 1vw, 11px); padding-inline: 2px; }
.key { width: 100%; min-height: 46px; aspect-ratio: 1.14; padding: 0; background: var(--paper); border: var(--outline); border-radius: clamp(8px, 1.3vw, 13px); color: var(--navy); box-shadow: 0 4px 0 var(--navy); cursor: pointer; font: 650 clamp(1.1rem, 3vw, 2rem)/1 var(--display); touch-action: manipulation; }
.key[aria-current] { background: var(--gold); box-shadow: 0 4px 0 var(--navy), 0 0 0 3px #ffdfa0; }
.key.is-entered { background: var(--mint); }
.key.is-wrong { background: var(--orange); outline: 3px dashed var(--navy); outline-offset: -5px; }
.key:active { transform: translateY(3px); box-shadow: 0 1px var(--navy); }
@keyframes key-cue {
  0%, 100% { box-shadow: 0 4px 0 var(--navy), 0 0 0 3px var(--orange); }
  40% { box-shadow: 0 4px 0 var(--navy), 0 0 0 8px var(--gold); }
}
@media (prefers-reduced-motion: no-preference) {
  .key.is-wrong { animation: key-cue 560ms var(--ease-out); }
}
.game-status { min-height: 2lh; margin-top: 12px; color: var(--navy); font: 650 1.18rem/1.4 var(--display); }
.replay { margin-top: 4px; padding: .55em 1.05em; border: var(--outline); border-radius: 100px; background: var(--orange); color: var(--navy); box-shadow: var(--sticker); cursor: pointer; font: 650 1.05rem/1.15 var(--display); }
.replay:hover { background: var(--gold); }
.replay:active { transform: translate(2px, 3px); box-shadow: 1px 1px var(--navy); }
.celebration { position: absolute; inset: 0; pointer-events: none; }
.knight-badge { position: absolute; width: 50px; inset: auto -9px 5% auto; stroke: var(--navy); stroke-width: 2.5; stroke-linejoin: round; transform: rotate(10deg); animation: badge-in 210ms var(--ease-out) both; }
.badge-ribbon { fill: var(--orange); }
.badge-shield { fill: var(--gold); }
.badge-star { fill: var(--paper); }
.confetti { position: absolute; display: grid; place-items: center; width: 16px; aspect-ratio: 1; border: 1px solid var(--navy); border-radius: 4px; box-shadow: 0 2px var(--navy); background: var(--orange); color: var(--navy); font: 650 .65rem/1 var(--display); animation: confetti-out 650ms var(--ease-out) both; }
.confetti:nth-of-type(1) { top: 28%; left: 12%; --drift: -17px; }
.confetti:nth-of-type(2) { top: 63%; left: 12%; --drift: -14px; background: var(--gold); animation-delay: 45ms; }
.confetti:nth-of-type(3) { top: 22%; right: 12%; --drift: 17px; background: var(--mint); animation-delay: 35ms; }
.confetti:nth-of-type(4) { top: 48%; right: 10%; --drift: 15px; background: var(--gold); animation-delay: 65ms; }
@keyframes badge-in { from { opacity: 0; transform: rotate(0) scale(.92); } }
@keyframes confetti-out {
  from { opacity: 0; transform: scale(.92); }
  25% { opacity: 1; }
  to { opacity: 0; transform: translate(var(--drift), -26px) rotate(23deg); }
}

/* World stickers */
.worlds { background: var(--mint); }
.world-grid, .steps, .skill-grid, .parent-list { padding: 0; margin: 0; }
.world-grid { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 12px; }
.world-card { overflow: hidden; border: var(--outline); border-radius: clamp(16px, 2vw, 21px); box-shadow: var(--sticker); background: var(--paper); }
.world-picture { width: 100%; aspect-ratio: 1.92; object-fit: cover; }
.world-label { display: flex; align-items: center; gap: 7px; padding: 8px 6px; min-height: 58px; }
.world-badge { flex: none; width: clamp(32px, 5vw, 52px); aspect-ratio: 1; object-fit: cover; border: var(--outline); border-radius: 50%; background: var(--cream); }
.world-label h3 { font-size: clamp(1.03rem, 1.85vw, 1.52rem); overflow-wrap: anywhere; }

/* Journey, screens and parent information */
.journey { border-top: 0; background: var(--navy); color: var(--cream); }
.journey h2 { color: inherit; }
.steps { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; }
.steps li { display: grid; grid-template-rows: auto 1fr; justify-items: center; gap: 11px; text-align: center; }
.step-sticker { position: relative; display: grid; place-items: center; width: clamp(75px, 12vw, 112px); aspect-ratio: 1; border: var(--outline); border-radius: 20px; background: var(--cream); box-shadow: 3px 4px 0 var(--gold); }
.step-sticker img { width: 86%; height: 86%; object-fit: contain; }
.step-sticker span { position: absolute; inset: -9px auto auto -9px; display: grid; place-items: center; width: 28px; aspect-ratio: 1; border: var(--outline); border-radius: 50%; color: var(--navy); background: var(--gold); font: 650 .95rem/1 var(--display); }
.steps p { max-width: 26ch; font-size: .94rem; }
.inside-layout { display: grid; align-items: center; gap: clamp(26px, 4vw, 48px); }
.dictation-preview { width: min(100%, 285px); margin-inline: auto; }
.devices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(0, 1.3fr); align-items: center; gap: clamp(8px, 2vw, 24px); }
.device { padding: clamp(4px, .75vw, 9px); border-radius: clamp(14px, 2vw, 27px); background: var(--navy); box-shadow: 3px 5px 0 #bddbd9; }
.device img { width: 100%; border-radius: clamp(10px, 1.5vw, 19px); }
figcaption { margin-top: 10px; color: var(--navy); text-align: center; font: 600 clamp(.98rem, 1.7vw, 1.24rem)/1.2 var(--display); }
.skills { padding-top: 0; }
.skill-grid { display: grid; gap: 12px; list-style: none; }
.skill-grid li { display: flex; align-items: center; gap: 13px; padding: 12px; border: var(--outline); border-radius: var(--radius); box-shadow: var(--sticker); background: var(--paper); font-weight: 680; }
.skill-icon { display: grid; flex: none; place-items: center; width: 44px; aspect-ratio: 1; color: var(--navy); background: var(--mint); border: var(--outline); border-radius: 13px; }
.skill-icon svg { width: 25px; }
.skill-grid li:nth-child(even) .skill-icon { background: #ffe4a3; }
.parents { background: var(--mint); }
.parents-layout { display: grid; gap: 26px; align-items: center; }
.parents h2 { max-width: 20ch; text-wrap: initial; }
.parent-list { display: grid; gap: 11px; list-style: none; margin-top: 24px; }
.parent-list li { display: flex; align-items: flex-start; gap: 10px; }
.parent-list svg { flex: none; width: 24px; padding: 2px; border: 1px solid var(--navy); border-radius: 50%; background: var(--gold); color: var(--navy); }
.parents-art { width: min(67%, 250px); position: relative; margin-inline: auto; padding: 8px 18px; }
.parents-art::before { content: ''; position: absolute; z-index: 0; inset: 12% 0 3%; border: var(--outline); border-radius: 50%; background: var(--cream); }
.parents-art img { position: relative; }
.parents-art span { position: absolute; width: 20%; inset: 12% 2% auto auto; transform: rotate(16deg); }
.faq { max-width: 790px; }
.faq details { border: var(--outline); border-radius: 16px; background: var(--paper); box-shadow: var(--sticker); margin-top: 12px; }
.faq summary { padding: 14px 44px 14px 16px; list-style: none; position: relative; cursor: pointer; color: var(--navy); font: 600 1.22rem/1.15 var(--display); border-radius: 14px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary:focus-visible { outline-offset: -4px; }
.faq summary::after { content: '+'; position: absolute; right: 14px; top: 50%; translate: 0 -50%; display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; background: var(--gold); }
.faq details[open] summary::after { content: '−'; }
.faq details p { padding: 0 16px 16px; }
.site-footer { border-top: var(--outline); background: var(--mint); color: var(--navy); }
.footer-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; padding-block: 22px; font-size: .9rem; }
.error-page { display: grid; gap: 25px; align-items: center; justify-items: start; max-width: 900px; min-height: 63vh; padding-block: 44px; }
.error-page img { width: min(210px, 70%); justify-self: center; }
.error-page h1 { font-size: clamp(2.1rem, 6vw, 4rem); }
.error-code { color: var(--navy); font: 650 1.5rem/1.4 var(--display); }
.error-page p[lang] { margin-top: 10px; }
.error-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 22px; }

@media (min-width: 500px) {
  .wrap { width: min(100% - 52px, 1180px); }
  .world-label { gap: 10px; padding-inline: 10px; }
  .skill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .error-page { grid-template-columns: 1fr 2fr; }
}
@media (min-width: 700px) {
  .hero { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "title lesson" "copy lesson"; gap: 22px clamp(28px, 4vw, 52px); }
  .hero-intro { grid-area: title; }
  .hero-copy { grid-area: copy; }
  .lesson-preview { grid-area: lesson; align-self: center; }
  .demo { grid-column: 1 / -1; grid-template-columns: 168px minmax(0, 640px); justify-content: center; gap: 24px; }
  .hero-art { width: 100%; }
  .inside-layout { grid-template-columns: minmax(0, 285px) minmax(0, 750px); justify-content: center; }
  .world-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
  .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .parents-layout { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
  .parents-art { width: min(95%, 340px); }
}
@media (min-width: 850px) {
  .header-row:not(.error-header) { grid-template-columns: 1fr auto 1fr; }
  .header-row .languages { justify-self: end; }
  .main-nav { grid-column: 2; grid-row: 1; gap: 22px; font-size: .94rem; }
}
@media (min-width: 1050px) {
  .world-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
  .world-label { min-height: 70px; }
  .skill-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .skill-grid li { align-items: flex-start; flex-direction: column; padding: 16px; }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .world-card { transition: transform 160ms var(--ease-out); }
  .world-card:hover { transform: translateY(-3px) rotate(-1deg); }
  .world-card:nth-child(even):hover { transform: translateY(-3px) rotate(1deg); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .cta:active, .key:active, .replay:active { transform: none; }
  .confetti { display: none; }
}
