/* Kids mode's home page, around the cards (hub/kidshome.js): the rainbow, the ark, the animals, sparkles */
body.home-kids #hub { position: relative; }
body.home-kids #hub > :not(.kh-rainbow):not(.kh-animals):not(.kh-world):not(.kh-motto) { position: relative; z-index: 1; }

/* the rainbow, behind everything, its colors sparkling */
.kh-rainbow { position: absolute; left: 50%; top: 40px; z-index: 0; width: min(900px, 125vw); aspect-ratio: 800 / 420; transform: translateX(-50%); pointer-events: none; opacity: 0.62; filter: saturate(1.3) drop-shadow(0 0 10px rgba(255, 255, 255, 0.55)); transition: opacity 0.3s ease, filter 0.3s ease; }
.kh-rainbow svg { display: block; width: 100%; height: 100%; }
.kh-band { stroke-linecap: round; animation: kh-hue 6s ease-in-out infinite; transition: stroke-width 0.2s ease, opacity 0.2s ease; }
.kh-band:nth-child(2) { animation-delay: -1s; } .kh-band:nth-child(3) { animation-delay: -2s; } .kh-band:nth-child(4) { animation-delay: -3s; } .kh-band:nth-child(5) { animation-delay: -4s; } .kh-band:nth-child(6) { animation-delay: -5s; }
@keyframes kh-hue { 0%, 100% { filter: none; } 50% { filter: hue-rotate(40deg) brightness(1.15); } }
.kh-rainbow.is-held, .kh-rainbow.is-party { opacity: 0.85; }
.kh-rainbow.is-held .kh-band { opacity: 0.45; }
.kh-rainbow .kh-band.is-lit { opacity: 1; stroke-width: 34; filter: brightness(1.25) drop-shadow(0 0 10px currentColor); }
.kh-rainbow.is-party .kh-band { animation-duration: 0.9s; }
.kh-glints { position: absolute; inset: 0; }
.kh-glints i { position: absolute; width: 10px; height: 10px; background: var(--c); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation: kh-glint 3s ease-in-out infinite; opacity: 0; }
@keyframes kh-glint { 0%, 100% { opacity: 0; transform: scale(0.3) rotate(0); } 50% { opacity: 1; transform: scale(1.3) rotate(45deg); } }

/* the ark, floating along the top */
.kh-sky { position: relative; z-index: 2; height: 92px; margin: 4px 0 -10px; overflow: visible; pointer-events: none; }
.kh-ark { position: absolute; top: 4px; left: 0; width: 132px; animation: kh-sail 26s ease-in-out infinite alternate; pointer-events: auto; cursor: pointer; -webkit-tap-highlight-color: transparent; }
@keyframes kh-rock { 0% { transform: rotate(0); } 15% { transform: rotate(-16deg) translateY(-6px); } 35% { transform: rotate(14deg) translateY(2px); } 55% { transform: rotate(-9deg) translateY(-3px); } 75% { transform: rotate(5deg); } 100% { transform: rotate(0); } }
/* the boat and Noah in it move as one: bobbing, bumping, rocking */
.kh-boat { position: relative; animation: kh-bob 3s ease-in-out infinite; transform-origin: 50% 80%; }
.kh-boat svg { position: relative; display: block; width: 100%; height: auto; }
.kh-ark.is-bump .kh-boat { animation: kh-bump 0.5s cubic-bezier(0.34, 1.7, 0.64, 1), kh-bob 3s ease-in-out 0.5s infinite; }
.kh-ark-n { position: absolute; left: 50%; top: -24px; transform: translateX(-50%); margin: 0; padding: 2px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.92); color: #3A2A1E; font: 700 11.5px -apple-system, system-ui, sans-serif; white-space: nowrap; box-shadow: 0 3px 8px -3px rgba(0, 0, 0, 0.3); }
/* (the count: a rainbow sign, so it's seen; flashing when it asks for taps) */
.kh-ark-n { top: -30px !important; padding: 4px 12px !important; background: linear-gradient(90deg, #FF5E5B, #FFB347, #F9D423, #5FD068, #3FA9F5, #9B6BF2) !important; color: #fff !important; font-size: 13px !important; font-weight: 800 !important; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45); border: 2px solid #fff; box-shadow: 0 4px 12px -3px rgba(0, 0, 0, 0.45) !important; }
.kh-ark-n.is-flash { animation: kh-flash 1s ease-in-out infinite; }
/* Noah's speech bubble: grows big out of his mouth */
.kh-say { position: absolute; bottom: calc(100% + 34px); z-index: 5; width: max-content; transform-origin: 18px 100%; transform: translateX(-18px); padding: 10px 16px; border-radius: 22px; background: #fff; color: #3A2A1E; font: 900 20px/1.15 -apple-system, system-ui, sans-serif; text-align: left; white-space: normal; overflow-wrap: break-word; border: 3px solid #3A2A1E; box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.45); pointer-events: none; animation: kh-say-in 0.5s cubic-bezier(0.34, 1.6, 0.64, 1) both; }
.kh-say::after { content: ''; position: absolute; left: 10px; bottom: -13px; width: 18px; height: 18px; background: #fff; border-right: 3px solid #3A2A1E; border-bottom: 3px solid #3A2A1E; transform: skewX(25deg) rotate(45deg); border-bottom-right-radius: 4px; }
.kh-say.is-left { transform-origin: calc(100% - 18px) 100%; transform: translateX(calc(-100% + 18px)); }
.kh-say.is-left::after { left: auto; right: 10px; transform: skewX(-25deg) rotate(45deg); }
.kh-say.is-going { animation: kh-say-out 0.35s ease-in both; }
@keyframes kh-say-in { from { scale: 0.1; opacity: 0; } 60% { opacity: 1; } to { scale: 1; opacity: 1; } }
@keyframes kh-say-out { to { scale: 0.2; opacity: 0; } }
@keyframes kh-flash { 0%, 100% { opacity: 1; transform: translateX(-50%) scale(1); } 50% { opacity: 0.55; transform: translateX(-50%) scale(1.08); } }
@keyframes kh-sail { from { left: var(--sail-from, 2%); } to { left: var(--sail-to, calc(98% - 132px)); } } /* (across the Bible games card: kidshome.js floatArk) */
@keyframes kh-bob { 0%, 100% { transform: rotate(-3deg) translateY(0); } 50% { transform: rotate(3deg) translateY(-4px); } }
@keyframes kh-bump { 0% { transform: scale(1); } 40% { transform: scale(1.18, 0.86); } 100% { transform: scale(1); } }

/* sparkles and a cheer */
.kh-spark { position: fixed; z-index: 2147483000; font-style: normal; pointer-events: none; transform: translate(-50%, -50%); animation: kh-spark 0.9s ease-out forwards; }
@keyframes kh-spark { from { opacity: 1; transform: translate(-50%, -50%) scale(0.4); } to { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.2) rotate(90deg); } }
body.home-kids #hub.kh-holding { user-select: none; -webkit-user-select: none; }
.kh-cheer { position: fixed; left: 50%; top: 30%; z-index: 2147483001; padding: 14px 20px; border-radius: 999px; background: #fff; color: #3A2A1E; font: 800 18px -apple-system, system-ui, sans-serif; box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.5); transform: translate(-50%, -50%); animation: kd-cheer 2.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; pointer-events: none; text-align: center; max-width: 88vw; }

/* the Bible friends who peek around the side of a card (the ones on top are in index.html) */
.kid-peek.is-side .kid-peek-in { animation-name: kid-side; transform-origin: 100% 60%; }
.kid-peek.is-side.is-right .kid-peek-in { transform-origin: 0 60%; }
@keyframes kid-side { 0%, 100% { transform: translateX(14px) rotate(8deg); } 40%, 60% { transform: translateX(0) rotate(-6deg); } }
.kid-peek.is-side.is-right .kid-peek-in { animation-name: kid-side-r; }
@keyframes kid-side-r { 0%, 100% { transform: translateX(-14px) rotate(-8deg); } 40%, 60% { transform: translateX(0) rotate(6deg); } }

/* Read the Bible, for kids */
.hub-kread .kr-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0 4px; }
.hub-kread .kr-story { display: flex; flex-direction: column; gap: 4px; padding: 0; border: none; border-radius: 14px; background: none; color: inherit; cursor: pointer; text-align: center; -webkit-tap-highlight-color: transparent; }
.hub-kread .kr-art { position: relative; display: block; aspect-ratio: 1; overflow: hidden; border: 3px solid #fff; border-radius: 14px; background: #1A1614; box-shadow: 0 6px 14px -8px rgba(0, 0, 0, 0.5); transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1); }
.hub-kread .kr-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.hub-kread .kr-story:hover .kr-art, .hub-kread .kr-story:active .kr-art { transform: rotate(-3deg) scale(1.06); }
.hub-kread .kr-story small { font-size: 12px; font-weight: 700; line-height: 1.2; }
.hub-kread .kr-go { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.hub-kread .kr-go button { padding: 10px 16px; border: none; border-radius: 999px; background: #3DAA5C; color: #fff; font: 800 15px -apple-system, system-ui, sans-serif; box-shadow: 0 4px 0 #2C8246; cursor: pointer; }
.hub-kread .kr-go button + button { background: #3B82C4; box-shadow: 0 4px 0 #2A6399; }
@media (max-width: 420px) { .hub-kread .kr-row { grid-template-columns: repeat(2, 1fr); } }
@media (prefers-reduced-motion: reduce) { .kh-ark, .kh-boat, .kh-animal, .kh-band, .kh-glints i, .kid-peek.is-side .kid-peek-in { animation: none !important; } }

/* ---- the animals that got away: drawn, with legs that run; back and forth along the tops of
   the cards, or dashing across the page */
.kh-animals { position: absolute; inset: 0; z-index: 3; pointer-events: none; max-width: none !important; margin: 0 !important; } /* (the whole home page, where their places are measured from: not its 880px column, which moved them over on a computer) */
.kh-animal { position: absolute; width: 64px; height: 62px; padding: 0; border: none; background: none; cursor: pointer; pointer-events: auto; filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.22)); animation: kh-patrol var(--dur, 8s) linear var(--delay, 0s) infinite; -webkit-tap-highlight-color: transparent; }
.kh-dir { display: block; width: 100%; height: 100%; animation: kh-turn var(--dur, 8s) steps(1) var(--delay, 0s) infinite; }
@keyframes kh-patrol { 0% { transform: translateX(0); } 50% { transform: translateX(var(--run)); } 100% { transform: translateX(0); } }
@keyframes kh-turn { 0% { transform: scaleX(1); } 50% { transform: scaleX(-1); } }
.kh-a { display: block; width: 100%; height: 100%; overflow: visible; }
.kh-a .lg { transform-box: view-box; } /* (each leg's hip: its own transform-origin, kidshome.js) */
.kh-a .bd, .kh-a .tl { transform-box: fill-box; transform-origin: 50% 100%; }
/* running: legs swinging in pairs, the body bobbing, the tail flicking */
.kh-a.is-run .lg1, .kh-a.is-run .lg4 { animation: kh-leg 0.34s ease-in-out infinite alternate; }
.kh-a.is-run .lg2, .kh-a.is-run .lg3 { animation: kh-leg 0.34s ease-in-out infinite alternate-reverse; }
.kh-a.is-run .bd { animation: kh-trot 0.17s ease-in-out infinite alternate; }
.kh-a.is-run .tl { animation: kh-tail 0.34s ease-in-out infinite alternate; }
.kh-a.is-fast .lg { animation-duration: 0.18s !important; }
.kh-a.is-fast .bd { animation-duration: 0.09s !important; }
@keyframes kh-leg { from { transform: rotate(-30deg); } to { transform: rotate(30deg); } }
@keyframes kh-trot { from { transform: translateY(0); } to { transform: translateY(-2.5px); } }
@keyframes kh-tail { from { transform: rotate(-12deg); } to { transform: rotate(14deg); } }
/* caught: legs kicking every which way */
.kh-a.is-kick .lg1 { animation: kh-kick 0.12s ease-in-out infinite alternate; }
.kh-a.is-kick .lg2 { animation: kh-kick 0.12s ease-in-out -0.06s infinite alternate-reverse; }
.kh-a.is-kick .lg3 { animation: kh-kick 0.12s ease-in-out -0.03s infinite alternate; }
.kh-a.is-kick .lg4 { animation: kh-kick 0.12s ease-in-out -0.09s infinite alternate-reverse; }
@keyframes kh-kick { from { transform: rotate(-55deg); } to { transform: rotate(55deg); } }
.kh-runner { position: fixed; z-index: 2147483000; width: 64px; height: 62px; pointer-events: none; filter: drop-shadow(0 6px 5px rgba(0, 0, 0, 0.25)); transform-origin: 50% 90%; }

/* ---- the rainbow, pressed and held: blazing, pulsing, the lit band glowing; an orb at the finger */
.kh-shine { stroke: #fff; opacity: 0.25; stroke-dasharray: 18 70; animation: kh-shine 3s linear infinite; mix-blend-mode: screen; }
@keyframes kh-shine { to { stroke-dashoffset: -176; } }
.kh-rainbow.is-held { opacity: 1; filter: saturate(1.7) brightness(1.1) drop-shadow(0 0 22px rgba(255, 255, 255, 0.9)); }
.kh-rainbow.is-held .kh-band { opacity: 0.75; animation: kh-pulse 0.7s ease-in-out infinite alternate, kh-hue 1.6s linear infinite; }
.kh-rainbow.is-held .kh-shine { opacity: 0.8; animation-duration: 0.9s; }
.kh-rainbow .kh-band.is-lit { opacity: 1 !important; stroke-width: 40; filter: brightness(1.35) drop-shadow(0 0 16px currentColor) drop-shadow(0 0 30px currentColor); }
@keyframes kh-pulse { from { stroke-width: 22; } to { stroke-width: 30; } }
.kh-rainbow.is-held .kh-glints i { animation-duration: 0.9s; }
.kh-orb { position: fixed; z-index: 2147482990; width: 150px; height: 150px; margin: -75px 0 0 -75px; border-radius: 50%; background: radial-gradient(circle, #fff 0 8%, var(--oc, #F2B233) 25%, color-mix(in srgb, var(--oc, #F2B233) 40%, transparent) 50%, transparent 70%); mix-blend-mode: screen; opacity: 0; transform: scale(0.4); transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.25s ease; pointer-events: none; animation: kh-orb 1.2s ease-in-out infinite alternate; }
.kh-orb.on { opacity: 0.9; transform: scale(1); }
@keyframes kh-orb { from { filter: hue-rotate(0deg) blur(1px); } to { filter: hue-rotate(40deg) blur(2px); } }

/* ---- the hello card, smaller, so there's more rainbow to play with; and no text-selecting */
body.home-kids .kids-hello { max-width: 380px; margin: 0 auto 6px; padding: 9px 14px; border-radius: 18px; }
body.home-kids .kids-hello .kh-t { font-size: 18px; }
body.home-kids .kids-hello .kh-p { margin: 1px 0 6px; font-size: 12.5px; }
body.home-kids .kids-hello .kh-face { width: 24px; height: 28px; }
body.home-kids .kids-hello .kh-n { font-size: 12px; }
body.home-kids #hub { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
@media (prefers-reduced-motion: reduce) { .kh-animal, .kh-dir, .kh-a .lg, .kh-a .bd, .kh-a .tl, .kh-shine, .kh-orb { animation: none !important; } }
/* Noah, standing on the ark's deck; he jumps for joy with each animal that comes aboard */
/* (standing on the deck to the right of the cabin, just behind the rail, so the hull hides his feet) */
.kh-noah { position: absolute; left: 92px; top: 15px; z-index: 0; width: 34px; height: 40px; pointer-events: none; transform-origin: 50% 100%; }
.kh-noah svg { width: 100%; height: 100%; overflow: visible; }
.kh-noah.is-joy { animation: kh-joy 0.9s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes kh-joy { 0% { transform: translateY(0) scale(1); } 25% { transform: translateY(-26px) scale(1.15) rotate(-8deg); } 45% { transform: translateY(0) scale(1.05, 0.9); } 65% { transform: translateY(-14px) rotate(8deg); } 100% { transform: translateY(0); } }
/* the ark rides on the first card's top edge, in front of it */
body.home-kids #hub > .kh-sky { z-index: 4 !important; } /* (over the cards, so a tap reaches the ark) */
/* no double-tap zoom on the home page (reader/reader.js stops Safari's quick second tap too) */
#hub, #hub * { touch-action: manipulation; }
/* the splash when the ark is rocked */
.kh-drop { position: fixed; z-index: 2147483000; width: 8px; height: 10px; margin: -5px 0 0 -4px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: #7AC0E0; pointer-events: none; animation: kh-drop 0.9s cubic-bezier(0.2, 0.7, 0.4, 1) forwards; }
@keyframes kh-drop { 0% { transform: translate(0, 0) scale(0.6); opacity: 1; } 55% { transform: translate(calc(var(--dx) * 0.7), var(--dy)) scale(1); opacity: 1; } 100% { transform: translate(var(--dx), 30px) scale(0.8); opacity: 0; } }
/* let out a third time: they hop as they run (each its own way), harder to catch */
.kh-animals.is-hop .kh-animal { animation: kh-patrol var(--dur, 8s) linear var(--delay, 0s) infinite, kh-hop var(--hop, 1s) ease-in-out var(--hop-at, 0s) infinite; }
@keyframes kh-hop { 0%, 55%, 100% { translate: 0 0; } 70% { translate: 0 var(--hop-h, -24px); } 85% { translate: 0 0; } 90% { translate: 0 calc(var(--hop-h, -24px) * 0.3); } }

/* ---- the world behind it all (kidshome.js): heaven at the top, the sky, the garden of Eden at the
   bottom; fixed behind the page and slid as it scrolls. Pale, so the cards stay what you see. */
.kh-world { position: fixed; left: 0; top: 0; z-index: -1; width: 100%; max-width: none !important; margin: 0 !important; /* (not the home page's 880px column: the whole window) */ height: 200vh; pointer-events: none; opacity: 0.72; will-change: transform; }
body.site-dark .kh-world { opacity: 0.22; }
.khw-sky { position: absolute; inset: 0; background: linear-gradient(180deg, #FFF6DA 0%, #FFF2CC 10%, #F6F3EC 22%, #E2EFFA 36%, #D2E9F9 50%, #DCEFE0 62%, #D3EBC4 76%, #C9E6B5 100%); }
.khw-rays { position: absolute; left: 0; top: 0; width: 100%; height: 75vh; }
.khw-beams { opacity: 0.32; transform-box: view-box; transform-origin: 500px -60px; animation: khw-beam 50s ease-in-out infinite alternate; }
@keyframes khw-beam { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
.khw-clouds, .khw-birds { position: absolute; inset: 0; overflow: hidden; }
.khw-cloud { position: absolute; left: -320px; width: 200px; height: 56px; border-radius: 40px; background: #FFFFFF; opacity: 0.85; scale: var(--s, 1); box-shadow: 52px -24px 0 4px #FFFFFF, 112px -6px 0 0 #FFFFFF, -38px 6px 0 -6px #FFFFFF; animation: khw-drift var(--t, 150s) linear var(--at, 0s) infinite; }
@keyframes khw-drift { from { transform: translateX(0); } to { transform: translateX(calc(100vw + 520px)); } }
.khw-bird { position: absolute; left: -40px; width: 26px; height: 12px; opacity: 0.6; animation: khw-fly var(--t, 50s) linear var(--at, 0s) infinite; }
@keyframes khw-fly { 0% { transform: translate(0, 0); } 25% { transform: translate(28vw, -18px); } 50% { transform: translate(55vw, 6px); } 75% { transform: translate(82vw, -14px); } 100% { transform: translate(calc(100vw + 80px), 0); } }
.khw-eden { position: absolute; left: 0; bottom: 0; width: 100%; height: 85vh; }
.khw-sway { transform-box: fill-box; transform-origin: 50% 100%; animation: khw-sway var(--t, 7s) ease-in-out var(--at, 0s) infinite alternate; }
@keyframes khw-sway { from { transform: rotate(-1.6deg); } to { transform: rotate(1.6deg); } }
.khw-glint { opacity: 0.7; animation: khw-flow 7s linear infinite; }
@keyframes khw-flow { to { stroke-dashoffset: -208; } }
.khw-tree.is-life circle[fill^="url"] { animation: khw-glow 5s ease-in-out infinite alternate; }
@keyframes khw-glow { from { opacity: 0.55; } to { opacity: 1; } }
/* (the motion off: only the clouds' slow drift and a breeze in the trees) */
.kh-world.is-still .khw-birds { display: none; }
.kh-world.is-still .khw-beams, .kh-world.is-still .khw-glint, .kh-world.is-still .khw-tree.is-life circle { animation: none; }
.kh-world.is-still .khw-cloud { animation-duration: calc(var(--t, 150s) * 1.6); }
.kh-world.is-still .khw-sway { animation-duration: calc(var(--t, 7s) * 1.5); }
@media (prefers-reduced-motion: reduce) { .kh-world { transform: none !important; } .kh-world * { animation: none !important; } }

/* the grown-ups' "Calm": the rainbow and the friends hold still */
#hub.kh-still .kh-band, #hub.kh-still .kh-shine, #hub.kh-still .kh-rainbow { animation: none !important; }
#hub.kh-still .kh-glints { display: none; }
body.home-kids #hub.kh-still .kid-peek-in { animation: none; }

/* ---- the Bible games card's sea (kidshome.js seaState): rough, then calm */
body.home-kids .hub-games { overflow: hidden; }
.kh-sea { position: absolute; inset: 0; z-index: -1; overflow: hidden; border-radius: inherit; background: linear-gradient(180deg, #34426A 0%, #4A5A88 100%); pointer-events: none; }
.kh-sea::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, #6FBDEB 0%, #A9DCF6 70%, #CDEBF8 100%); opacity: 0; transition: opacity 3.5s ease; }
.kh-sea.is-calm::before { opacity: 1; }
.kh-sun { position: absolute; right: 9%; top: 14%; width: 56px; height: 56px; border-radius: 50%; background: radial-gradient(circle, #FFF6C8 0 45%, rgba(255, 228, 140, 0.55) 46%, rgba(255, 228, 140, 0) 70%); opacity: 0; transform: translateY(30px); transition: opacity 3s ease 1s, transform 3s ease 1s; }
.kh-sea.is-calm .kh-sun { opacity: 1; transform: none; }
.kh-rain { position: absolute; inset: -20px 0 0; background: repeating-linear-gradient(105deg, rgba(220, 232, 255, 0.28) 0 1.5px, transparent 1.5px 18px); opacity: 1; animation: kh-rain 0.6s linear infinite; transition: opacity 1.5s ease; }
@keyframes kh-rain { to { background-position: -10px 40px; } }
.kh-sea.is-calm .kh-rain { opacity: 0; }
.kh-mount { position: absolute; left: calc(var(--mx, 68%) - 160px); bottom: 0; width: 320px; height: 101%; transform: translateY(105%); transition: transform 3.4s cubic-bezier(0.25, 0.8, 0.3, 1) 0.6s; }
.kh-mount svg { display: block; width: 100%; height: 100%; }
.kh-sea.is-calm .kh-mount { transform: none; }
.kh-water { position: absolute; left: 0; right: 0; top: 10px; bottom: -10px; background: linear-gradient(180deg, #2F5E8E 0%, #1F416C 100%); transition: transform 3.8s cubic-bezier(0.4, 0, 0.3, 1), filter 3.5s ease; }
.kh-sea.is-calm .kh-water { transform: translateY(74%); filter: brightness(1.45) saturate(1.15); }
.kh-wave { position: absolute; left: 0; top: -24px; width: 200%; height: 30px; fill: #2F5E8E; animation: kh-roll 2.4s linear infinite; transform-origin: 50% 100%; transition: scale 3s ease; }
.kh-w2 { top: -18px; fill: #3A6C9E; opacity: 0.8; animation-duration: 3.3s; animation-direction: reverse; }
@keyframes kh-roll { to { translate: -50% 0; } }
.kh-sea.is-calm .kh-wave { scale: 1 0.3; animation-duration: 16s; }
.kh-sea.is-quick, .kh-sea.is-quick * { transition: none !important; }
#hub.kh-still .kh-wave { animation-duration: 18s; }
#hub.kh-still .kh-rain { animation: none; }
body.home-kids .hub-games .wit-banner-eyebrow, body.home-kids .hub-games .wit-banner-title { text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35); }

/* the ark: tossed on the rough sea; at rest on the mountain (no bobbing, no waves under it) */
body.home-kids #hub:not(.kh-still) .kh-sky:not(.is-settled) .kh-boat { animation: kh-toss 2.2s ease-in-out infinite; }
@keyframes kh-toss { 0%, 100% { transform: rotate(-7deg) translateY(0); } 50% { transform: rotate(6deg) translateY(-7px); } }
.kh-sky.is-settled .kh-boat { animation: none; }
.kh-sky.is-settled .kh-ark.is-bump .kh-boat { animation: kh-bump 0.5s cubic-bezier(0.34, 1.7, 0.64, 1); }
.kh-sky.is-settled .kh-ark { animation: none; }
/* afloat: down in the flood, the waterline over its hull's foot (kidshome.js floatArk measures it
   without this, where it rests on the mountain); as the water drains it rises onto the peak */
.kh-ark { translate: 0 var(--float, 0px); transition: translate 2.6s cubic-bezier(0.45, 0, 0.3, 1); }
.kh-sky:not(.is-settled) .kh-ark { --float: 12px; }
.kh-sky.is-settled .kh-ark { --float: var(--rest, 0px); }
.kh-sky.is-quick .kh-ark { transition: none; }
/* on dry land, a tap: a puff of dust as it lands */
.kh-dust { position: fixed; z-index: 2147483000; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: radial-gradient(circle, rgba(214, 196, 160, 0.95), rgba(214, 196, 160, 0) 70%); pointer-events: none; animation: kh-dust 0.9s ease-out forwards; }
@keyframes kh-dust { 0% { transform: translate(0, 0) scale(calc(var(--s) * 0.5)); opacity: 0.9; } 100% { transform: translate(var(--dx), var(--dy)) scale(calc(var(--s) * 2.2)); opacity: 0; } }
/* the doves, back with a leaf: flying in, then perched on the roof */
.kh-doves { position: absolute; left: 0; top: 0; width: 100%; height: 0; pointer-events: none; }
.kh-dove { position: absolute; width: 34px; opacity: 0; filter: drop-shadow(0 0 0.6px #5A6A7E) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.18)); }
.kh-dove svg { display: block; width: 100%; height: auto; overflow: visible; }
.kh-dove0 { left: 20px; top: 0; --dd: 1.8s; }
.kh-dove1 { left: 86px; top: -2px; --dd: 2.5s; transform: scaleX(-1); }
.kh-sky.is-settled .kh-dove { opacity: 1; animation: kh-dove-in 3s cubic-bezier(0.3, 0.6, 0.35, 1) var(--dd) both; }
.kh-sky.is-settled .kh-dove1 { animation-name: kh-dove-in1; }
.kh-sky.is-settled .kh-dove .wg { transform-box: fill-box; transform-origin: 0 100%; animation: kh-flap 0.17s ease-in-out var(--dd) 17 alternate both; }
.kh-sky.is-settled.is-quick .kh-dove, .kh-sky.is-settled.is-quick .kh-dove .wg { animation: none; }
@keyframes kh-dove-in { 0% { opacity: 0; transform: translate(260px, -170px) scale(0.6); } 15% { opacity: 1; } 60% { transform: translate(70px, -70px) scale(0.95); } 85% { transform: translate(6px, -14px); } 100% { opacity: 1; transform: none; } }
@keyframes kh-dove-in1 { 0% { opacity: 0; transform: translate(220px, -190px) scaleX(-1) scale(0.6); } 15% { opacity: 1; } 60% { transform: translate(40px, -80px) scaleX(-1) scale(0.95); } 85% { transform: translate(4px, -16px) scaleX(-1); } 100% { opacity: 1; transform: scaleX(-1); } }
@keyframes kh-flap { from { transform: rotate(0); } to { transform: rotate(-38deg); } }
@media (prefers-reduced-motion: reduce) { .kh-sea *, .kh-dove, .kh-dove .wg { animation: none !important; transition: none !important; } }

/* ---- the grown-ups' "Calm" button, and its two switches */
.kh-calm-btn { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 13px 0 10px; border: 2px solid #A5D395; border-radius: 999px; background: #F1FAEC; color: #2F6B2A; font: 800 14px var(--sans); cursor: pointer; -webkit-tap-highlight-color: transparent; box-shadow: 0 4px 12px -6px rgba(60, 130, 50, 0.6); }
.kh-calm-btn svg { width: 17px; height: 17px; }
.kh-calm-btn[aria-expanded="true"] { background: #DFF2D6; }
body.site-dark .kh-calm-btn { background: #23331F; color: #B9E3A8; border-color: #4E7A44; }
.kh-calm-pop { position: fixed; z-index: 2147483002; width: min(290px, calc(100vw - 20px)); padding: 14px 14px 8px; border: 1px solid var(--rule); border-radius: 18px; background: var(--bg-raised, #fff); color: var(--ink); box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.45); font-family: var(--sans); animation: as-rise 0.18s ease; }
.kh-calm-pop[hidden] { display: none; }
.kh-calm-h { display: block; font-size: 15px; }
.kh-calm-sub { display: block; margin: 2px 0 8px; font-size: 12.5px; color: var(--muted); }
.kh-calm-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 10px 2px; border: none; border-top: 1px solid var(--rule); background: none; color: inherit; text-align: left; font-family: inherit; cursor: pointer; }
.kh-calm-row span { display: flex; flex-direction: column; gap: 1px; }
.kh-calm-row b { font-size: 14.5px; }
.kh-calm-row small { font-size: 12px; color: var(--muted); }
.kh-calm-row i { flex: none; position: relative; width: 40px; height: 24px; border-radius: 12px; background: var(--rule); transition: background 0.2s; }
.kh-calm-row i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.2s; }
.kh-calm-row[aria-checked="true"] i { background: #4CAF50; }
.kh-calm-row[aria-checked="true"] i::after { transform: translateX(16px); }
/* (on a phone: Focus, Calm, and Kids mode on one line) */
body.home-kids .kids-switch-t { white-space: nowrap; }
@media (max-width: 420px) { body.home-kids .kids-bar { gap: 6px; } .kh-calm-btn { height: 34px; padding: 0 10px 0 8px; font-size: 13px; gap: 4px; } }

/* "All God's Children", in the rainbow's open middle (kidshome.js fitBow sets where, and how big) */
.kh-motto { position: absolute; left: 50%; z-index: 2; transform: translate(-50%, -50%); width: max-content; text-align: center; pointer-events: none; }
.kh-motto[hidden] { display: none; }
.kh-motto b { display: block; font: 900 var(--fs, 28px)/1.05 -apple-system, system-ui, sans-serif; letter-spacing: 0.01em; background: linear-gradient(90deg, #E4574E, #F28C28, #E0A41E, #3DAA5C, #3B82C4, #6A58A6); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.9)); }
.kh-motto span { display: block; margin-top: 4px; font: 700 calc(var(--fs, 28px) * 0.42 + 2px)/1.3 -apple-system, system-ui, sans-serif; color: #6A5A48; }
.kh-motto a { pointer-events: auto; }
body.site-dark .kh-motto span { color: #D8CBB5; }

/* holding the locked ark (kidshome.js): a ring fills, a countdown ticks, the padlock shakes harder */
.kh-ark { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.kh-lock { position: absolute; left: 50%; top: 52%; z-index: 6; width: 168px; height: 168px; opacity: 0; transform: translate(-50%, -50%) scale(0.6); transition: opacity 0.2s ease, transform 0.3s cubic-bezier(0.34, 1.6, 0.64, 1); pointer-events: none; }
.kh-lock.is-on, .kh-lock.is-open { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.kh-lock-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25)); }
.kh-lock-ring circle { fill: none; stroke-width: 9; }
.kh-lock-ring .bg { stroke: rgba(255, 255, 255, 0.65); }
.kh-lock-ring .fg { stroke: hsl(calc(10 + var(--p, 0) * 110), 85%, 55%); stroke-linecap: round; stroke-dasharray: 339.3; stroke-dashoffset: calc(339.3 * (1 - var(--p, 0))); }
.kh-lock-pad { position: absolute; left: 50%; top: -14px; font-size: 34px; line-height: 1; transform: translateX(-50%) rotate(calc(var(--shake, 1) * 2.5deg)); animation: kh-pad 0.14s ease-in-out infinite alternate; }
@keyframes kh-pad { to { transform: translateX(-50%) rotate(calc(var(--shake, 1) * -2.5deg)) translateY(calc(var(--shake, 1) * -0.6px)); } }
.kh-lock-n { position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #fff; color: #D6457F; font: 900 26px/1 -apple-system, system-ui, sans-serif; border: 3px solid #D6457F; box-shadow: 0 6px 14px -6px rgba(0, 0, 0, 0.4); }
.kh-lock-n:empty { display: none; }
.kh-lock-n.is-tick { animation: kh-tick 0.4s cubic-bezier(0.34, 1.8, 0.64, 1); }
@keyframes kh-tick { from { transform: translateX(-50%) scale(1.6); } to { transform: translateX(-50%) scale(1); } }
.kh-ark.is-holding .kh-boat { animation: kh-tremble 0.11s linear infinite !important; }
@keyframes kh-tremble { 0% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(-1.5px, 1px) rotate(-1.5deg); } 50% { transform: translate(1.5px, -1px) rotate(1.5deg); } 75% { transform: translate(-1px, -1px) rotate(-1deg); } 100% { transform: translate(0, 0) rotate(0); } }
.kh-lock.is-open .kh-lock-pad { animation: kh-pop 0.6s cubic-bezier(0.3, 1.5, 0.5, 1) forwards; }
@keyframes kh-pop { 0% { transform: translateX(-50%) scale(1); } 40% { transform: translateX(-50%) translateY(-24px) scale(1.7) rotate(-14deg); } 100% { transform: translateX(-50%) translateY(-70px) scale(0.6) rotate(20deg); opacity: 0; } }
.kh-lock.is-open .kh-lock-ring .fg { stroke: #3DAA5C; }
@media (prefers-reduced-motion: reduce) { .kh-lock-pad, .kh-ark.is-holding .kh-boat { animation: none !important; } }
.kh-ark .kh-ark-n { transition: opacity 0.2s ease; } .kh-ark.is-holding .kh-ark-n { opacity: 0; }
/* (the motion off: the ark and its sign hold still, even when tapped or held) */
#hub.kh-still .kh-ark-n.is-flash, #hub.kh-still .kh-ark.is-bump .kh-boat, #hub.kh-still .kh-ark.is-holding .kh-boat, #hub.kh-still .kh-lock-pad, #hub.kh-still .kh-noah.is-joy { animation: none !important; }
/* (holding the locked ark: the storm comes back as the countdown runs; let go and it calms again) */
.kh-sea.is-calm.is-storming .kh-water { transition: none; transform: translateY(calc(74% * (1 - var(--storm, 0)))); filter: brightness(calc(1.45 - 0.45 * var(--storm, 0))) saturate(1.15); }
.kh-sea.is-calm.is-storming::before { transition: none; opacity: calc(1 - var(--storm, 0)); }
.kh-sea.is-calm.is-storming .kh-rain { transition: none; opacity: var(--storm, 0); }
.kh-sea.is-calm.is-storming .kh-sun { transition: none; opacity: calc(1 - var(--storm, 0)); }
.kh-sea.is-calm.is-storming .kh-wave { transition: none; scale: 1 calc(0.3 + 0.7 * var(--storm, 0)); animation-duration: calc(16s - 13s * var(--storm, 0)); }
.kh-sea.is-calm.is-storming.is-ebb .kh-water, .kh-sea.is-calm.is-storming.is-ebb::before, .kh-sea.is-calm.is-storming.is-ebb .kh-rain, .kh-sea.is-calm.is-storming.is-ebb .kh-sun { transition: transform 1.4s ease-out, opacity 1.4s ease, filter 1.4s ease; }
