/* Hoofdstuk 1: het erf en kamer Paardenstal. Alles wat beweegt is een CSS-animatie (zie css/animations.css). */

/* ---- het erf ---- */
@keyframes efDrift{0%{transform:translateX(-30px)}100%{transform:translateX(60px)}}
.ef-cloud{animation:efDrift 38s ease-in-out infinite alternate}
.ef-cloud.b{animation-duration:52s;animation-delay:-12s}
.ef-cloud.c{animation-duration:44s;animation-delay:-20s}
@keyframes efHydroDrive{0%,2%{transform:translateX(200px);opacity:0}4%{transform:translateX(170px);opacity:1}46%{transform:translateX(-1700px);opacity:1}48%,50%{transform:translateX(-1700px);opacity:0}94%{transform:translateX(170px);opacity:1}96%,100%{transform:translateX(200px);opacity:0}}
.ef-hydro84-drive{animation:efHydroDrive 36s linear infinite}
@keyframes efHydroFace{0%,46%{transform:scaleX(1);animation-timing-function:steps(1,end)}48%,96%{transform:scaleX(-1);animation-timing-function:steps(1,end)}98%,100%{transform:scaleX(1)}}
.ef-hydro84-facing{transform-box:fill-box;transform-origin:center;animation:efHydroFace 36s steps(1,end) infinite}
@keyframes efSwallow{0%{transform:translate(-120px,30px) scaleX(1)}25%{transform:translate(80px,-10px)}50%{transform:translate(260px,40px)}75%{transform:translate(90px,70px)}100%{transform:translate(-120px,30px)}}
.ef-sw{animation:efSwallow 9s ease-in-out infinite}
.ef-sw.b{animation-duration:11s;animation-delay:-3s}
.ef-sw.c{animation-duration:7.5s;animation-delay:-5s}
.ef-swallows.swoop .ef-sw{animation-duration:2.5s}
@keyframes efSway{0%,100%{transform:rotate(-1deg)}50%{transform:rotate(1.2deg)}}
.ef-leaf{transform-box:fill-box;transform-origin:50% 100%;animation:efSway 6s ease-in-out infinite}
.ef-leaf.b{animation-duration:7.5s;animation-delay:-2s}
@keyframes efSmoke{0%{transform:translateY(0) scale(.8);opacity:.6}100%{transform:translate(18px,-40px) scale(1.4);opacity:0}}
.ef-smoke circle{transform-box:fill-box;transform-origin:center;animation:efSmoke 4s ease-out infinite}
.ef-smoke circle:nth-child(2){animation-delay:-1.3s}
.ef-smoke circle:nth-child(3){animation-delay:-2.6s}
@keyframes efDrip{0%{transform:translateY(0);opacity:1}80%{transform:translateY(240px);opacity:1}100%{transform:translateY(260px);opacity:0}}
.ef-drip{animation:efDrip 1.4s ease-in infinite}
@keyframes efBob{0%,100%{transform:translateY(0) rotate(-2deg)}50%{transform:translateY(-8px) rotate(2deg)}}
.ef-ball{transform-box:fill-box;transform-origin:50% 100%;animation:efBob 3.2s ease-in-out infinite}
.ef-ball.b{animation-duration:2.6s;animation-delay:-1s}
#ef-balloons.bob .ef-ball{animation-duration:.5s}
@keyframes efSpin{to{transform:rotate(360deg)}}
.ef-wheel.spin{transform-box:fill-box;transform-origin:center;animation:efSpin 2.2s cubic-bezier(.2,.7,.4,1)}
@keyframes efSpark{0%,70%,100%{opacity:0}80%{opacity:1}}
.ef-spark{animation:efSpark 2.4s infinite}
@keyframes efGraze{0%,60%,100%{transform:rotate(0)}70%,90%{transform:rotate(38deg)}}
#ef-reehead{transform-box:fill-box;transform-origin:10% 90%;animation:efGraze 7s ease-in-out infinite}
@keyframes efFlee{0%{transform:translate(0,0)}10%{transform:translate(60px,-40px)}20%{transform:translate(120px,0)}30%{transform:translate(180px,-40px)}40%{transform:translate(260px,0);opacity:1}45%{opacity:0}85%{transform:translate(0,0);opacity:0}100%{opacity:1}}
.ef-ree.flee{animation:efFlee 5s ease-in-out}
@keyframes efHammer{0%,100%{transform:rotate(0)}50%{transform:rotate(-24deg)}}
#ef-arm{transform-box:fill-box;transform-origin:0% 0%;animation:efHammer 1.1s ease-in-out infinite}
@keyframes efRock{0%,100%{transform:rotate(-6deg)}50%{transform:rotate(6deg)}}
.ef-paardje{transform-box:fill-box;transform-origin:50% 100%}

/* ---- het moment van de dag op het erf en achter de buitendeur van de hal (dagdeel() in chapter1.js) ---- */
#sc-erf.t-ochtend #efSky stop:nth-child(1){stop-color:#8ec5ea}
#sc-erf.t-ochtend #efSky stop:nth-child(2){stop-color:#d6e9f0}
#sc-erf.t-ochtend #efSky stop:nth-child(3){stop-color:#ffe2c4}
#sc-erf.t-middag #efSky stop:nth-child(1){stop-color:#3f8fd6}
#sc-erf.t-middag #efSky stop:nth-child(2){stop-color:#8cc4ea}
#sc-erf.t-middag #efSky stop:nth-child(3){stop-color:#dcecf2}
#sc-erf.t-nacht #efSky stop:nth-child(1){stop-color:#0e1a3a}
#sc-erf.t-nacht #efSky stop:nth-child(2){stop-color:#2a3a6a}
#sc-erf.t-nacht #efSky stop:nth-child(3){stop-color:#b8705a}
#sc-erf.t-nacht #ef-wolken{fill:#8a96b8;opacity:.35}
#sc-erf.t-ochtend #ef-wolken{fill:#fff4ec}
@keyframes efStar{0%,100%{opacity:.3}50%{opacity:1}}
.ef-star{animation:efStar 3s ease-in-out infinite}
.ef-star.b{animation-delay:-1s}.ef-star.c{animation-delay:-2s}
#sc-hal.t-ochtend #hlEvening stop:nth-child(1){stop-color:#9ccbe8}
#sc-hal.t-ochtend #hlEvening stop:nth-child(2){stop-color:#f4e6cc}
#sc-hal.t-middag #hlEvening stop:nth-child(1){stop-color:#4a96d8}
#sc-hal.t-middag #hlEvening stop:nth-child(2){stop-color:#bcdcf0}
#sc-hal.t-nacht #hlEvening stop:nth-child(1){stop-color:#0e1a3a}
#sc-hal.t-nacht #hlEvening stop:nth-child(2){stop-color:#2a3a6a}
#sc-hal.t-nacht #hlEvening stop:nth-child(3){stop-color:#1e3a24}
#sc-hal.t-ochtend .hl-sun{transform:translate(50px,10px)}
#sc-hal.t-middag .hl-sun{transform:translate(20px,-24px);fill:#fff4c4}
#sc-hal.t-nacht .hl-sun{fill:#f4f0dc}

/* ---- de lucht achter de boogramen van de Paardenstal (op het oosten) ---- */
#sc-stal.t-avond #psDusk stop:nth-child(1){stop-color:#4a6aa8}
#sc-stal.t-avond #psDusk stop:nth-child(2){stop-color:#9aaed4}
#sc-stal.t-avond #psDusk stop:nth-child(3){stop-color:#f0c4a4}
#sc-stal.t-ochtend #psDusk stop:nth-child(1){stop-color:#8ec5ea}
#sc-stal.t-ochtend #psDusk stop:nth-child(2){stop-color:#e4eef0}
#sc-stal.t-ochtend #psDusk stop:nth-child(3){stop-color:#ffe0bc}
#sc-stal.t-middag #psDusk stop:nth-child(1){stop-color:#4a96d8}
#sc-stal.t-middag #psDusk stop:nth-child(2){stop-color:#9cc8ea}
#sc-stal.t-middag #psDusk stop:nth-child(3){stop-color:#dcecf2}
#sc-stal.t-ochtend .ps-wei,#sc-stal.t-middag .ps-wei{fill:#6a9a4a}
#sc-stal.t-avond .ps-wei{fill:#4a6a40}

/* ---- de hal (in elk hoofdstuk) ---- */
@keyframes hlGlow{0%,100%{opacity:.85}50%{opacity:1}}
.hl-glow{animation:hlGlow 4s ease-in-out infinite}
.hl-twinkle{animation:psTwinkle 2.4s ease-in-out infinite}
.hl-twinkle.b{animation-delay:-1.2s}

/* ---- de Paardenstal ---- */
@keyframes psSwing{0%,100%{transform:rotate(-1.5deg)}50%{transform:rotate(1.5deg)}}
.ps-lamp{transform-box:fill-box;transform-origin:50% 0%;animation:psSwing 5s ease-in-out infinite}
@keyframes psCurtain{0%,100%{transform:skewX(0)}50%{transform:skewX(1.5deg)}}
.ps-curtain{transform-box:fill-box;transform-origin:50% 0%;animation:psCurtain 7s ease-in-out infinite}
.ps-curtain.b{animation-delay:-3s}
@keyframes psTwinkle{0%,100%{opacity:.3}50%{opacity:1}}
.ps-star{animation:psTwinkle 3s ease-in-out infinite}
.ps-star.b{animation-delay:-1s}.ps-star.c{animation-delay:-2s}
@keyframes psRock{0%,100%{transform:translate(760px,466px) scale(.42) rotate(-7deg)}50%{transform:translate(760px,466px) scale(.42) rotate(7deg)}}
#ps-paardje.rocking{animation:psRock .6s ease-in-out 4}
@keyframes psBoing{0%,100%{transform:translateY(0)}40%{transform:translateY(8px)}70%{transform:translateY(-4px)}}
#ps-bed.boing{animation:psBoing .5s ease-out}
@keyframes psNotes{0%{opacity:0;transform:translateY(0)}20%{opacity:1}100%{opacity:0;transform:translate(20px,-60px)}}
#ps-notes.notes{animation:psNotes 1.6s ease-out}
@keyframes psGlow{0%,100%{opacity:.8}50%{opacity:1}}
#ps-torchglow{animation:psGlow 1.8s ease-in-out infinite}
@keyframes psReeGraze{0%,100%{transform:rotate(0)}50%{transform:rotate(7deg)}}
.ps-ree-head{transform-box:fill-box;transform-origin:0% 65%;animation:psReeGraze 6s ease-in-out infinite}
@keyframes efFlag{0%,100%{transform:translate(800px,470px) skewY(0) scaleX(1)}50%{transform:translate(800px,470px) skewY(4deg) scaleX(.92)}}
.ef-flag{animation:efFlag 2.2s ease-in-out infinite}
@keyframes efMek{0%,100%{transform:translateY(0)}30%{transform:translateY(-8px)}60%{transform:translateY(0)}80%{transform:translateY(-4px)}}
#ef-geiten.mek g g{animation:efMek .5s ease-out 2}
@keyframes efGoat{0%,70%,100%{transform:rotate(0)}80%,90%{transform:rotate(28deg)}}
.ef-goathead{transform-box:fill-box;transform-origin:0% 100%;animation:efGoat 5s ease-in-out infinite}
