(()=>{
const rng=seed=>()=>{seed=(seed*1664525+1013904223)>>>0;return seed/4294967296};
const sandRidge=(y,i,w)=>{
const silhouettes=[
'M-350 35C-120 42 90 72 230 4C352 -56 359 -126 507 -139C680 -154 827 -71 979 -62C1122 -53 1114 -212 1242 -227C1367 -244 1464 -150 1582 -175C1735 -207 1765 -320 1930 -311C2091 -302 2229 -220 2398 -248C2531 -270 2650 -343 2950 -318L2950 -154C2670 -176 2544 -102 2385 -89C2180 -70 2075 -142 1914 -146C1737 -150 1692 -39 1558 -26C1400 -11 1339 -94 1228 -63C1119 -33 1159 94 992 104C819 114 670 28 510 51C360 72 340 150 212 179C43 216 -133 175 -350 190Z',
'M-350 40C-131 14 63 112 238 43C380 -14 409 -91 539 -102C674 -114 772 -18 899 -47C1000 -70 1002 -186 1113 -206C1241 -229 1365 -151 1499 -164C1652 -179 1681 -285 1829 -304C1998 -325 2121 -220 2292 -255C2445 -285 2571 -366 2950 -325L2950 -165C2601 -202 2485 -113 2308 -97C2134 -82 1981 -168 1833 -122C1692 -77 1673 7 1511 16C1341 24 1233 -56 1139 -9C1063 29 1070 121 927 137C780 155 675 60 534 83C407 104 364 183 223 211C39 248 -138 178 -350 205Z'
];
const crest=[
'M-350 35C-120 42 90 72 230 4C352 -56 359 -126 507 -139C680 -154 827 -71 979 -62C1122 -53 1114 -212 1242 -227C1367 -244 1464 -150 1582 -175C1735 -207 1765 -320 1930 -311C2091 -302 2229 -220 2398 -248C2531 -270 2650 -343 2950 -318L2950 -296C2650 -321 2537 -245 2401 -225C2220 -198 2089 -279 1927 -286C1776 -293 1738 -183 1588 -150C1462 -123 1360 -219 1244 -202C1125 -184 1137 -25 982 -35C819 -27 675 -127 510 -112C372 -99 361 -27 241 31C93 101 -121 70 -350 61Z',
'M-350 40C-131 14 63 112 238 43C380 -14 409 -91 539 -102C674 -114 772 -18 899 -47C1000 -70 1002 -186 1113 -206C1241 -229 1365 -151 1499 -164C1652 -179 1681 -285 1829 -304C1998 -325 2121 -220 2292 -255C2445 -285 2571 -366 2950 -325L2950 -304C2574 -342 2455 -260 2295 -231C2110 -196 1997 -301 1833 -276C1696 -257 1655 -152 1501 -139C1358 -124 1241 -200 1118 -180C1014 -163 1016 -41 904 -20C764 7 673 -88 541 -75C421 -63 393 10 246 69C63 140 -132 40 -350 65Z'
];
return ``;
};
const sandGrains=(count,w,h,start,r)=>{let s='';for(let i=0;i`;}return s;};
document.querySelectorAll(".learn__bg").forEach(svg=>{
const W=2600,H=2400,r=rng(5);
const step=o=>`M-300 ${120+o}C400 ${60+o} 800 ${110+o} 1150 ${330+o}S1800 ${640+o} 2900 ${600+o}L2900 ${H}L-300 ${H}Z`;
let stripes='';
for(let y=980,i=0;y${stripes}${grains}`;
});
const jit=rng(29);
const jitter=()=>`translate(0 ${((jit()-.5)*9).toFixed(1)}) rotate(${((jit()-.5)*7).toFixed(1)} 20 100) scale(1 ${(.94+jit()*.1).toFixed(3)})`;
const BRUSH=window.brushTable({"П":{w:76,d:"M14 92V10H62V92"},"А":{w:80,d:"M10 92L40 8L70 92M22 62H58"},"Й":{w:76,d:"M14 12L14 92L62 12L62 92M24 -26Q38 -12 52 -26"},"С":{w:70,d:"M60 18C28 -6 10 20 10 52C10 83 32 109 61 84"},"Ё":{w:62,d:"M50 10L14 10L14 92L52 92M14 50L44 50M22 -8L22 -7M42 -8L42 -7"}});
document.querySelectorAll(".learn__brush").forEach((svg,n)=>{
const word=svg.dataset.word;let cx=0,h="";
[...word].forEach(ch=>{const g=BRUSH[ch],t=`translate(${cx} 0) ${jitter()}`;h+=``;cx+=g.w+16});
svg.setAttribute("viewBox",`-24 -48 ${cx-16+48} 160`);svg.setAttribute("role","img");svg.setAttribute("aria-label",word.charAt(0)+word.slice(1).toLowerCase());
svg.innerHTML=`${h}`;
});
const W="#FFFFFF",P="#F69971",T="#84CAC8",D="#3E5F5C";
const ICONS={
speak:``,
listen:``,
read:``,
write:``
};
document.querySelectorAll(".learn [data-icon]").forEach(el=>{el.outerHTML=``});
const PD="#F19C77",C="#FFFFFF",S="#F19C77";
const THINGS={
book:``,
hello:`Hello!`,
pencil:`
`,
phones:`
`
};
document.querySelectorAll("[data-thing]").forEach(el=>{el.setAttribute("aria-hidden","true");el.innerHTML=``});
const wob=rng(41);
const wrap=node=>[...node.childNodes].forEach(n=>{
if(n.nodeType===3){const f=document.createDocumentFragment();[...n.textContent].forEach(ch=>{if(ch===" "){f.append(" ");return}const s=document.createElement("span");s.className="learn__char";s.style.cssText=`--y:${((wob()-.5)*.09).toFixed(3)}em;--a:${((wob()-.5)*7).toFixed(1)}deg;--s:${(.94+wob()*.1).toFixed(3)}`;s.textContent=ch;f.append(s)});n.replaceWith(f)}
else if(n.nodeType===1)wrap(n);
});
document.querySelectorAll("[data-wobble]").forEach(wrap);
const io=new IntersectionObserver(es=>es.forEach(e=>{if(e.isIntersecting){e.target.classList.add("learn--play");io.unobserve(e.target)}}),{threshold:.4});
document.querySelectorAll("[data-learn]").forEach(s=>io.observe(s));
})();