:root {
	--ink: #1B2541;
	--muted: #4A5574;
	--orange: #F47B20;
	--orange-text: #B4520A;
	--blue: #2F6BFF;
	--blue-text: #1F4FD1;
	--yellow: #FFD23F;
	--green-text: #1E7A43;
}

body { margin: 0 }
p, h1, h2, h3 { margin: 0 }
[hidden] { display: none !important }
button { cursor: pointer }
button:focus-visible, a:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px }
strong.o, .o { color: var(--orange-text) }
strong.b, .b { color: var(--blue-text) }
.muted { font-size: 18px; color: var(--muted) }
.display { font-family: 'Fredoka', 'Trebuchet MS', sans-serif }

.frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1.05; font-size: .8em; margin: 0 .12em }
.frac > span:first-child { border-bottom: .09em solid currentColor; padding: 0 .18em .06em }
.frac > span:last-child { padding-top: .06em }

@keyframes dropIn { from { transform: translateY(-56px); opacity: 0 } to { transform: none; opacity: 1 } }
.drop { animation: dropIn .55s cubic-bezier(.3, 1.45, .5, 1) both }
@keyframes popIn { from { transform: scale(.4); opacity: 0 } to { transform: none; opacity: 1 } }
.pop { animation: popIn .45s cubic-bezier(.3, 1.5, .5, 1) both }
@keyframes arcIn { from { clip-path: inset(0 100% 0 0) } to { clip-path: inset(0 0 0 0) } }
.arc { animation: arcIn .55s ease-out both }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important } }

.page {
	font-family: 'Atkinson Hyperlegible', Verdana, sans-serif;
	color: var(--ink);
	background-color: #FFFFFF;
	background-image: linear-gradient(#E6EEFB 1px, transparent 1px), linear-gradient(90deg, #E6EEFB 1px, transparent 1px);
	background-size: 32px 32px;
	min-height: 100vh;
	padding-bottom: 48px;
}

/* Header */
.top { max-width: 1120px; margin: 0 auto; padding: 20px 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink) }
.brand span { font-size: 28px; font-weight: 700 }
.top nav { display: flex; flex-wrap: wrap; gap: 8px }
.pill { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 2px solid var(--ink); background: #FFFFFF; color: var(--ink); text-decoration: none; font-weight: 700 }
.pill.yellow { background: var(--yellow) }

/* Buttons */
.btn { display: inline-flex; align-items: center; min-height: 52px; padding: 0 26px; border-radius: 999px; border: 2px solid var(--ink); background: #FFFFFF; color: var(--ink); text-decoration: none; font-family: 'Fredoka', 'Trebuchet MS', sans-serif; font-size: 20px; font-weight: 600 }
.btn.dark { background: var(--ink); color: #FFFFFF; box-shadow: 4px 4px 0 var(--orange) }
.btn.yellow { background: var(--yellow); box-shadow: 4px 4px 0 var(--ink) }
.btn.big { min-height: 56px; padding: 0 30px; font-size: 22px }
.btn.small { min-height: 48px; padding: 0 22px; font-size: 19px }
.row { display: flex; flex-wrap: wrap; gap: 12px }

/* Shared blocks */
.card { background: #FFFFFF; border: 2px solid var(--ink); border-radius: 28px; box-shadow: 8px 8px 0 var(--ink); padding: 28px; box-sizing: border-box }
.panel { background: #FFFFFF; border: 2px solid var(--ink); border-radius: 28px; padding: 28px; box-sizing: border-box }
.callout { border: 2px solid var(--ink); border-radius: 24px; padding: 24px 28px }
.callout.blue { background: #E8F0FF }
.callout.peach { background: #FFF1E5 }
.callout.cream { background: #FFF8DB }
.callout.with-frog { display: flex; flex-wrap: wrap; align-items: center; gap: 20px }
.callout.with-frog svg { flex: none }
.callout.with-frog p { flex: 1 1 300px; font-size: 20px; line-height: 1.7 }

.sec { max-width: 1120px; margin: 0 auto; padding: 56px 24px; display: flex; flex-direction: column; gap: 28px }
.sec-head { display: flex; align-items: center; gap: 16px }
.sec-head .num { flex: none; width: 56px; height: 56px; border-radius: 50%; background: var(--orange); border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700 }
.sec-head h2 { font-size: clamp(32px, 4.5vw, 48px); font-weight: 700; line-height: 1.05 }
.lead { font-size: 20px; line-height: 1.6; max-width: 40em }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 10px }
.chips .muted { margin-right: 4px }
.chip { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 2px solid var(--ink); background: #FFFFFF; color: var(--ink); font-family: 'Atkinson Hyperlegible', Verdana, sans-serif; font-size: 17px; font-weight: 700 }
.chip[aria-pressed="true"], .flip-opt[aria-pressed="true"] { background: var(--yellow) }
.eq { padding: 10px 22px; border-radius: 18px; background: var(--yellow); border: 2px solid var(--ink); font-size: 40px; font-weight: 700; display: inline-flex; align-items: center; gap: 10px }
.eq.white { background: #FFFFFF }
.eq .mixed { display: inline-flex; align-items: center }

/* Hero */
.hero { max-width: 1120px; margin: 0 auto; padding: 40px 24px 72px; display: flex; flex-wrap: wrap; align-items: center; gap: 48px }
.hero-copy { flex: 1 1 400px; min-width: 0; display: flex; flex-direction: column; gap: 24px }
.hero-copy h1 { font-weight: 700; font-size: clamp(56px, 8vw, 100px); line-height: .95; letter-spacing: -1px }
.hero-copy p { font-size: 21px; line-height: 1.6; max-width: 30em }
.hero-card { flex: 1 1 460px; min-width: 0; padding: 28px 28px 20px }
.hero-card .muted { margin-bottom: 6px }
.hero-q { font-size: 28px; font-weight: 600 }
.stage { position: relative; height: 230px; margin: 16px 14px 0 }
.stage .arc { position: absolute; bottom: 64px; width: 25%; height: 60px; box-sizing: border-box; border: 3px dashed #2FA35B; border-bottom: none; border-radius: 999px 999px 0 0 }
.stage-strip { position: absolute; left: 0; width: 75%; bottom: 44px; height: 20px; background: var(--orange); border-radius: 6px 0 0 6px }
.stage-line { position: absolute; left: 0; right: 0; bottom: 44px; height: 4px; background: var(--ink); border-radius: 2px }
.stage-tick { position: absolute; bottom: 36px; width: 4px; height: 36px; margin-left: -2px; background: var(--ink); border-radius: 2px }
.stage-label { position: absolute; bottom: 0; transform: translateX(-50%); font-size: 18px; font-weight: 700 }
.stage-frog { position: absolute; bottom: 62px; left: 0; transform: translateX(-50%); transition: left .6s ease-in-out }
.stage-frog > div { transition: transform .3s ease-out }
.stage-frog.lift > div { transform: translateY(-46px) }
.stage-frog svg { display: block }
.hero-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; min-height: 64px }
.hops { font-size: 24px; font-weight: 500 }
.hops strong { font-weight: 700; color: var(--green-text) }
.hero-eq { padding: 8px 18px; border-radius: 16px; background: var(--yellow); border: 2px solid var(--ink); font-size: 30px; font-weight: 700 }

/* 1: grouping */
.split { display: flex; flex-wrap: wrap; gap: 40px; align-items: center }
.split-copy { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 16px }
.split-copy p { font-size: 20px; line-height: 1.6; max-width: 32em }
.blocks-panel { flex: 1 1 460px; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 20px }
.groups { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; transition: gap .5s ease; min-height: 120px; align-items: flex-start }
.groups.grouped { gap: 28px }
.group { display: flex; flex-direction: column; align-items: center; gap: 8px }
.pair { display: flex; gap: 8px; padding: 0; border: 3px dashed transparent; background: transparent; border-radius: 18px; transition: all .5s ease }
.grouped .pair { padding: 10px; border-color: var(--blue-text); background: #E8F0FF }
.pair div { width: 60px; height: 60px; border-radius: 12px; background: var(--yellow); border: 2px solid var(--ink); box-sizing: border-box }
.group span { font-size: 18px; font-weight: 600; color: var(--blue-text) }
#groupEq { font-size: 34px; font-weight: 700 }

/* 2: strip measurer */
.pickers { display: flex; flex-wrap: wrap; align-items: center; gap: 20px }
.picker { display: flex; align-items: center; gap: 16px; border: 2px solid var(--ink); border-radius: 22px; padding: 14px 20px }
.picker.orange { background: #FFF1E5 }
.picker.blue { background: #E8F0FF }
.picker-col { display: flex; flex-direction: column; align-items: center; gap: 8px }
.picker-col > div:not(.bar) { display: flex; align-items: center; gap: 10px }
.picker-col span { min-width: 52px; text-align: center; font-size: 40px; font-weight: 700 }
.bar { width: 100%; height: 4px; background: var(--ink); border-radius: 2px }
.round { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--ink); background: #FFFFFF; color: var(--ink); font-size: 26px; font-weight: 600; line-height: 1; padding: 0 }
.swatch { width: 22px; height: 64px; border-radius: 8px; border: 2px solid var(--ink) }
.picker.orange .swatch { background: var(--orange) }
.picker.blue .swatch { background: var(--blue) }
.divide { font-size: 56px; font-weight: 700 }

.lab { display: flex; flex-direction: column; gap: 26px }
.strip-block { display: flex; flex-direction: column; gap: 8px }
.strip-block.measure { padding-top: 18px; border-top: 2px dashed #C9D3E6 }
.strip-title { font-size: 18px; font-weight: 700 }
.strip { position: relative; height: 56px }
.strip.tall { height: 92px }
.strip .whole, .strip .fill { position: absolute; left: 0; top: 0; bottom: 0; box-sizing: border-box; border-radius: 10px; transition: width .4s ease }
.strip.tall .whole, .strip.tall .fill { transition: none }
.strip .whole { width: var(--whole-w); border: 2px dashed #6B7591; background: #FFFFFF }
.strip .fill { border: 2px solid var(--ink) }
.strip .fill.o { width: var(--orange-w); background: var(--orange) }
.strip .fill.b { width: var(--blue-w); background: var(--blue) }
.ticks div { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: var(--ink) }
.fine div { position: absolute; top: 6px; bottom: 6px; width: 2px; margin-left: -1px; background: var(--ink); opacity: 0; transition: opacity .5s ease }
.lab.recut-on .fine div { opacity: .55 }
.piece { position: absolute; top: 12px; bottom: 12px; box-sizing: border-box; border: 3px dashed var(--blue-text); border-radius: 8px; padding: 2px }
.piece > div { height: 100%; background: var(--blue); border-radius: 5px }
.piece > span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center }
.piece > span span { background: #FFFFFF; color: var(--ink); border: 2px solid var(--ink); border-radius: 999px; padding: 2px 10px; font-family: 'Fredoka', 'Trebuchet MS', sans-serif; font-size: 18px; font-weight: 700 }
.out { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; min-height: 96px }
.out > .muted { font-size: 19px; flex: 1 1 260px }
.result { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; flex: 1 1 420px }
#resSentence { font-size: 20px; line-height: 1.5; flex: 1 1 220px }

.recut { display: flex; flex-direction: column; gap: 16px }
.recut-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px }
.recut h3 { font-size: 28px; font-weight: 600 }
#recutHint { font-size: 19px; line-height: 1.6; max-width: 40em }
.recut-body { display: flex; flex-wrap: wrap; align-items: center; gap: 24px }
#recutText { font-size: 20px; line-height: 1.7; flex: 1 1 380px; max-width: 34em }

/* 3: flip */
.flip-opt { width: 56px; height: 64px; border-radius: 16px; border: 2px solid var(--ink); background: #FFFFFF; color: var(--ink); font-family: 'Fredoka', 'Trebuchet MS', sans-serif; font-size: 22px; font-weight: 600; padding: 0 }
.flip-card { display: flex; flex-direction: column; gap: 22px }
.flip-strip { position: relative; height: 72px }
.flip-strip > div { position: absolute; top: 0; bottom: 0; padding: 0 3px; box-sizing: border-box }
.flip-strip > div > div { height: 100%; border-radius: 10px; background: var(--blue); border: 2px solid var(--ink); box-sizing: border-box; display: flex; align-items: center; justify-content: center }
.flip-strip > div:nth-child(even) > div { background: #8FB2FF }
.flip-strip span { background: #FFFFFF; border: 2px solid var(--ink); border-radius: 999px; min-width: 32px; text-align: center; padding: 2px 6px; box-sizing: border-box; font-family: 'Fredoka', 'Trebuchet MS', sans-serif; font-size: 18px; font-weight: 700 }
.flip-eq { font-size: 40px; font-weight: 700; display: flex; align-items: center; gap: 10px; flex-wrap: wrap }
.duo { display: flex; flex-wrap: wrap; gap: 24px }
.duo .callout { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 12px }
.duo h3 { font-size: 26px; font-weight: 600 }
.duo p { font-size: 19px; line-height: 1.6 }
.duo .sum { font-size: 30px; font-weight: 600; line-height: normal; display: flex; flex-wrap: wrap; align-items: center; gap: 8px }

/* 4: quiz */
.quiz-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 24px }
.qcard { background: #FFFFFF; border: 2px solid var(--ink); border-radius: 24px; padding: 24px; display: flex; flex-direction: column; gap: 18px }
.qcard .q { font-size: 34px; font-weight: 700; display: flex; align-items: center; gap: 8px }
.qstrips { display: flex; flex-direction: column; gap: 10px }
.qstrip { position: relative; height: 34px }
.qstrip .dash { position: absolute; inset: 0; box-sizing: border-box; border: 2px dashed #6B7591; border-radius: 8px }
.qstrip .fill { position: absolute; left: 0; top: 0; bottom: 0; box-sizing: border-box; border: 2px solid var(--ink); border-radius: 8px }
.qstrip .fill.o { background: var(--orange) }
.qstrip .fill.b { background: var(--blue) }
.qstrip .tick { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--ink) }
.opts { display: flex; flex-wrap: wrap; gap: 10px }
.opt { min-width: 64px; min-height: 52px; padding: 0 18px; border-radius: 16px; border: 2px solid var(--ink); background: #FFFFFF; color: var(--ink); font-family: 'Fredoka', 'Trebuchet MS', sans-serif; font-size: 24px; font-weight: 600 }
.opt.right { background: #7FDB9C }
.opt.wrong { background: #FFC9A3 }
.fb { min-height: 52px }
.fb p { font-size: 18px; line-height: 1.5 }
.fb .yes { color: var(--green-text) }
.fb .no { color: var(--orange-text) }
.champion { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; background: var(--yellow); border: 2px solid var(--ink); border-radius: 24px; padding: 20px 28px; box-shadow: 6px 6px 0 var(--ink) }
.champion svg { flex: none }
.champion p { flex: 1 1 260px; font-size: 28px; font-weight: 600 }

footer { max-width: 1120px; margin: 0 auto; padding: 32px 24px 0; border-top: 2px dashed #C9D3E6 }
footer p { font-size: 17px; line-height: 1.6; color: var(--muted); max-width: 44em }
