/* v0.2: storybook route, illustrated courier states, accessible contour pictograms. */
:root{--station-color:#3f7d72}body{background:#d5e8df}.landscape{transition:background-position 1s,filter 1s;background-position:center 70%}body[data-station="1"] .landscape{background-position:20% 62%;filter:hue-rotate(8deg) saturate(.9)}body[data-station="2"] .landscape{background-position:80% 75%;filter:sepia(.12) saturate(1.15)}body[data-station="3"] .landscape{background-position:90% 55%;filter:hue-rotate(-10deg)}.sun-haze{background:linear-gradient(#f1f6e8a3,#fdf2cf05 35%,#e6f1dcb0)}header{background:#fffbeddd;min-height:68px}main{padding:0 3vw;min-height:calc(100svh - 68px);max-width:1800px;position:relative}.journey{min-height:48px}.journey li{border-radius:8px 8px 13px 13px;border:2px solid #72938a;width:30px;height:32px}.journey li.passed{box-shadow:0 0 16px #f6d377;background:#fff2bb}.heading{padding:0 0 5px}.heading h1{font-size:clamp(23px,2.1vw,34px)}.heading>p:last-child{font-size:15px}.flight-zone{background:none;border:0;box-shadow:none;backdrop-filter:none;border-radius:0;width:100%;max-width:1350px;min-height:260px;max-height:none;flex:1;margin:0 auto;overflow:visible}.flight-map{flex:1;min-height:210px;display:flex;align-items:center;justify-content:center}.flight-map>svg{width:100%;height:100%;max-height:430px;min-height:210px;overflow:visible;filter:drop-shadow(0 9px 8px #264a4810)}.map-top{padding:3px 8%;font-size:13px}.map-label{background:#fff9e4d9;border:1px solid #fff3d6;padding:7px 14px;border-radius:20px}.map-bottom{padding:0 8%;font-size:12px;min-height:25px}.map-bottom>span:last-child{margin-left:auto}.route-line{stroke:url(#routeGold);stroke-width:5;stroke-linecap:round;stroke-linejoin:round;fill:none;filter:drop-shadow(0 3px 0 #fff9dc)}.target-line{fill:none;stroke:#955141;stroke-width:4;stroke-dasharray:8 8}.far-ridge{fill:#669b7a26}.land-line{fill:none;stroke:#fdf4d7;stroke-width:6}.station-name{font-size:17px;fill:#244c4a;font-weight:800;paint-order:stroke;stroke:#fff8e4;stroke-width:4}.sound-node circle{fill:#366c69;stroke:#fff8db;stroke-width:5}.sound-node text{font-size:18px;fill:#244e50;font-weight:800;paint-order:stroke;stroke:#fff8e8;stroke-width:5}.sound-node.sounding circle{fill:#d6a448;stroke:#fff6ba;stroke-width:9}.empty-node{fill:#fff8e8aa;stroke:#739d93;stroke-width:2;stroke-dasharray:2 5}.error-node circle{fill:#a44d45}.error-halo{fill:none;stroke:#b65a4d;stroke-width:3;stroke-dasharray:3 5}.selected-node circle{stroke:#315e94;stroke-width:9}.courier-sprite{width:220px;height:220px;background-image:url('./courier-poses.webp');background-size:300% 200%;background-repeat:no-repeat;background-position:0 0;filter:drop-shadow(0 8px 4px #314c4426)}.courier-sprite.idle{animation:bird-breathe 3s ease-in-out infinite}.courier-sprite.takeoff{background-position:50% 0;animation:launch .35s ease-out}.courier-sprite.climbing{animation:wing-cycle .55s steps(1) infinite}.courier-sprite.gliding{background-position:50% 100%;animation:glide .8s ease-in-out infinite}.courier-sprite.descending{background-position:100% 0;transform:rotate(8deg)}.courier-sprite.waiting{background-position:100% 0;animation:hover-wait 1s ease-in-out infinite}.courier-sprite.delivered{background-position:100% 100%;animation:land .5s ease-out}.delivery-letter{animation:post-letter .7s ease-in-out both}.mail-flag{transform-origin:21px -38px}.mailbox.delivered .mail-flag{animation:flag-up .5s ease-out both}.delivery-stamp circle{fill:#fff1bc;stroke:#4d7965;stroke-width:3;stroke-dasharray:3 4}.delivery-stamp text{fill:#2d5a49;font-size:17px;font-weight:800}.delivery-stamp{transform-origin:898px 250px;animation:stamp .5s ease-out both}.editor{width:min(1050px,100%);margin:4px auto 0;padding:12px 20px;border:1.5px solid #fff9e8;background:linear-gradient(135deg,#fffbeceb,#fff7dddf);box-shadow:0 8px 22px #335e5020;border-radius:26px;backdrop-filter:blur(9px)}.editor #status{font-size:16px;min-height:25px;margin:0 0 8px}.direction-controls{justify-content:center;gap:12px}.direction{display:grid;grid-template-columns:64px auto;grid-template-rows:auto auto;gap:0 8px;min-height:78px;min-width:165px;padding:8px 15px;border-radius:18px;color:#244e50;background:#eff2df}.direction svg{width:64px;height:56px;grid-row:1/3;align-self:center}.direction strong{font-size:22px;align-self:end}.direction small{font-size:14px;text-align:left;align-self:start}.direction:enabled:hover{background:#dce9d7;color:#173f49}.direction:disabled{opacity:1;color:#607773;background:#e5e9dd;border-color:#b8c7bb}.edit-tools{gap:7px}.edit-tools button{font-size:13px;min-height:44px;padding:5px 12px}.play-controls{margin-top:9px;gap:10px;justify-content:center}.play-controls button{font-size:15px;min-height:46px}.play-controls .primary{min-width:220px}.route-chips{margin:3px 0 8px;gap:8px}.route-chips button{display:grid;grid-template-columns:42px auto;grid-template-rows:auto auto;gap:0 7px;min-width:100px;min-height:52px;border-radius:12px;padding:5px 10px;color:#284d4d;background:#fff9e9}.route-chips button svg{width:42px;height:37px;grid-row:1/3}.route-chips button small{font-size:11px;line-height:1.2}.route-chips button span{font-size:13px;line-height:1.3}.route-chips button.selected{background:#dce8ec;border:3px solid #416d8d;padding:3px 8px}.route-chips button.wrong{background:#f3dcd2;color:#873d35;border-color:#b37c6e}.feedback-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:8px}.feedback-actions button{min-height:46px;font-size:14px;min-width:0}.feedback-actions .primary{margin-left:8px;min-width:160px}body:not(.has-heard) .direction-controls{display:none}body:not(.has-heard) #hear-route,body:not(.has-heard) #send{display:none}body:not(.has-heard) #hear-target{min-width:260px;font-size:19px;background:#275e5b;color:#fff7df}footer{margin-top:6px;min-height:48px;font-size:11px}.text-button{font-size:13px}.mini-direction{display:inline-flex;vertical-align:middle;width:46px;height:40px;color:#285d62}.mini-direction svg{width:100%;height:100%}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.review-item p{display:flex;align-items:center;gap:5px;flex-wrap:wrap}.review-audio{display:flex;gap:8px;flex-wrap:wrap}.review-audio button{min-height:44px}.help-contour{height:110px;display:flex;align-items:end;justify-content:space-around;background:#e8eedc;border-radius:18px;padding:12px;margin:15px 0}.help-tone{padding:10px;border-radius:14px;background:#fff7df;border:2px solid #658982;font-size:14px}.help-tone.high{align-self:start}.help-tone.sounding{background:#315e5b;color:#fff9dd;box-shadow:0 0 0 5px #edd29b}.result-stamps{position:relative}.mission-won .result-stamps:before{content:'';height:3px;background:#618b64;position:absolute;left:20%;right:20%;top:50%;z-index:-1}#practice-missed{margin-bottom:12px}.welcome-hero img{object-fit:contain}.welcome-hero h2{font-size:28px}dialog p{font-size:16px}.sound-wave{z-index:2;pointer-events:none}.sound-wave i{background:#3d766e}
@keyframes wing-cycle{0%,100%{background-position:50% 0}33%{background-position:100% 0}66%{background-position:0 100%}}@keyframes bird-breathe{50%{transform:translateY(-5px)}}@keyframes launch{from{transform:translateY(12px) rotate(-10deg)}to{transform:translateY(0) rotate(0)}}@keyframes glide{50%{transform:translateY(-3px) rotate(-3deg)}}@keyframes hover-wait{50%{transform:translateY(-5px)}}@keyframes land{from{transform:translateY(-18px)}to{transform:translateY(0)}}@keyframes post-letter{from{transform:translate(865px,285px) rotate(-15deg);opacity:1}to{transform:translate(905px,309px) scale(.3);opacity:0}}@keyframes flag-up{from{transform:rotate(90deg)}to{transform:rotate(0)}}@keyframes stamp{from{transform:scale(1.5);opacity:0}to{transform:scale(1);opacity:1}}
@media(min-height:900px) and (min-width:701px){.flight-map>svg{max-height:550px}.flight-zone{min-height:380px}.editor{margin-top:0}.heading h1{font-size:34px}}
@media(max-width:700px){header{min-height:66px}.brand strong{font-size:16px}main{padding:0 12px;min-height:calc(100svh - 66px)}.journey{min-height:40px;font-size:11px}.journey li{width:22px;height:25px;font-size:10px}.heading h1{font-size:22px}.heading>p:last-child{font-size:13px}.heading .eyebrow{margin-bottom:5px}.flight-zone{min-height:205px;margin:0;flex:1}.flight-map,.flight-map>svg{min-height:170px}.flight-map>svg{max-height:330px;/* fill available height without shrinking character to a tiny letterboxed icon */}.map-top{padding:2px 0;font-size:11px}.map-label{padding:5px 9px}.map-bottom{padding:0;font-size:10px;min-height:22px}.map-bottom>span:last-child{font-size:10px}.editor{padding:10px 10px;border-radius:22px;margin-top:3px}.editor #status{font-size:14px;line-height:1.55;min-height:22px;margin-bottom:7px}.direction-controls{gap:6px;flex-wrap:wrap}.direction{min-width:0;min-height:72px;flex:1;grid-template-columns:37px auto;gap:0 3px;padding:7px 5px;border-radius:14px}.direction svg{width:37px;height:42px}.direction strong{font-size:19px}.direction small{font-size:13px}.edit-tools{width:100%;flex-direction:row;margin:0;gap:8px}.edit-tools button{min-height:44px;padding:4px 14px;font-size:12px}.play-controls{grid-template-columns:1fr 1fr;margin-top:6px;gap:6px}.play-controls button{font-size:13px;min-height:44px;padding:7px 5px}.play-controls .primary{min-height:46px;min-width:0;font-size:17px}.route-chips{gap:4px;justify-content:center;margin:0 0 6px}.route-chips button{min-width:0;flex:1;max-width:100px;min-height:44px;display:flex;flex-direction:column;gap:0;padding:4px}.route-chips button svg{height:26px;width:34px}.route-chips button small{font-size:10px}.route-chips button span{display:none}.feedback-actions{gap:6px}.feedback-actions button{flex:1;min-width:calc(50% - 6px);min-height:44px;font-size:12px;padding:7px 5px}.feedback-actions .primary{margin:0;min-width:100%;font-size:17px}.text-button,footer .text-button{font-size:12px;padding:6px}footer{font-size:10px;min-height:44px;gap:0}.mini-direction{width:36px}.welcome-hero h2{font-size:23px}dialog p{font-size:14px}}
@media(max-height:500px) and (min-width:701px){header{min-height:50px;padding:4px 16px}.brand+nav button{min-height:40px}main{min-height:calc(100svh - 50px);height:auto;display:grid;grid-template-columns:1.15fr 1fr;grid-template-rows:32px 54px auto 34px;column-gap:14px;padding:0 18px}.journey{grid-column:1/-1;min-height:32px}.heading{grid-column:1;grid-row:2;padding:0}.heading h1{font-size:18px}.heading .eyebrow{font-size:10px;margin:0}.heading>p:last-child{font-size:11px}.flight-zone{grid-column:1;grid-row:3;min-height:200px}.flight-map,.flight-map>svg{min-height:150px;max-height:190px}.map-top{font-size:10px;padding:0}.map-bottom{font-size:10px;padding:0}.editor{grid-column:2;grid-row:2/4;align-self:center;padding:8px;margin:0}.editor #status{font-size:12px;line-height:1.4;margin-bottom:5px}.direction-controls{gap:5px;flex-wrap:wrap}.direction{min-width:0;min-height:55px;padding:4px;grid-template-columns:32px auto;flex:1}.direction svg{width:32px;height:36px}.direction strong{font-size:17px}.direction small{font-size:11px}.edit-tools{width:100%;flex-direction:row;justify-content:center;gap:7px}.edit-tools button{min-height:44px;font-size:11px}.play-controls{display:flex;flex-wrap:wrap;gap:5px;margin-top:6px}.play-controls button{min-height:44px;min-width:0;flex:1;font-size:12px;padding:5px}.play-controls .primary{min-width:100%;font-size:15px}.route-chips{gap:3px;margin-bottom:5px}.route-chips button{min-width:0;flex:1;padding:3px;display:flex;flex-direction:column;min-height:44px}.route-chips button svg{width:30px;height:24px}.route-chips button small{font-size:10px}.route-chips button span{display:none}.feedback-actions{gap:5px}.feedback-actions button{flex:1;min-width:40%;min-height:44px;font-size:11px;padding:5px}.feedback-actions .primary{margin:0;min-width:100%}footer{grid-column:1/-1;grid-row:4;min-height:34px;margin:0;font-size:9px}.text-button,footer .text-button{min-height:32px;font-size:10px;padding:3px}body:not(.has-heard) #hear-target{min-width:0;font-size:16px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}.delivery-letter{opacity:0}.courier-sprite.climbing{background-position:100% 0}}

.courier-sprite{width:100%;height:100%}

body{background:transparent}.flight-zone:before{content:"";position:absolute;inset:0;pointer-events:none;z-index:-1;background:radial-gradient(ellipse at 26% 28%,#fffbedb3,transparent 40%),radial-gradient(ellipse at 80% 58%,#fffbed80,transparent 30%);animation:cloud-drift 16s ease-in-out infinite alternate}@keyframes cloud-drift{to{transform:translateX(15px)}}

.station-sprite{display:block;width:100%;height:100%;background-image:url(./postal-stops.webp);background-size:300% 200%;background-repeat:no-repeat;filter:drop-shadow(0 7px 3px #294d3a20)}.result-stamps{display:grid;grid-template-columns:repeat(4,1fr);gap:9px;isolation:isolate}.result-stamps .network-station{display:flex;flex-direction:column;align-items:center;width:auto;height:auto;min-height:140px;border-radius:16px;border:1.5px solid #82a28a;background:#ecf3da;transform:none;position:relative;animation:station-light .6s ease-out both;animation-delay:calc(var(--order)*.09s);padding:8px 3px}.network-station .station-sprite{width:82px;height:82px}.network-station small,.network-station b{font-size:11px;line-height:1.6}.result-stamps .network-station.missed{filter:saturate(.5);background:#f0e7dc}.network-station:before{content:"";position:absolute;left:-10px;top:50%;width:9px;border-top:3px solid #658b6d}.network-station:nth-child(4n+1):before{display:none}@keyframes station-light{from{opacity:.3;transform:translateY(8px)}to{opacity:1;transform:none}}@media(max-width:700px){.result-stamps{grid-template-columns:repeat(2,1fr)}.network-station:nth-child(2n+1):before{display:none}}

.delivery-stamp{transform-origin:898px 115px}.delivery-letter{animation-delay:.3s}
/* Scene takes the remaining viewport, instead of contributing intrinsic SVG height. */
main{height:calc(100svh - 68px);min-height:0}.flight-zone{min-height:0}.flight-map{position:relative;min-height:0}.flight-map>svg{position:absolute;inset:0;width:100%;height:100%;min-height:0;max-height:none}.flight-zone:before{inset:0}.map-top,.map-bottom{flex-shrink:0}.heading,.journey,.editor,footer{flex-shrink:0}
@media(max-width:700px){main{height:calc(100svh - 66px);min-height:0}.flight-zone,.flight-map{min-height:0}.flight-map>svg{min-height:0;max-height:none}}
@media(max-height:500px) and (min-width:701px){main{height:calc(100svh - 50px);min-height:0;grid-template-rows:30px 54px minmax(0,1fr) 34px}.flight-zone,.flight-map{min-height:0}.flight-map>svg{min-height:0;max-height:none}.play-controls{flex-wrap:nowrap}.play-controls .primary{min-width:0;font-size:12px}.editor{max-width:100%;padding:6px}.editor #status{font-size:12px;min-height:17px;margin-bottom:4px}.route-chips{margin:0 0 4px}.direction-controls{gap:4px}.edit-tools{gap:6px}.play-controls{margin-top:4px}footer{min-height:34px}}

@media(max-height:500px) and (min-width:701px){header{padding:2px 16px;min-height:50px}.brand+nav button{min-height:44px;font-size:12px}main{grid-template-rows:30px 54px minmax(0,1fr) 44px}footer,footer .text-button{min-height:44px}.direction small{font-size:12px}}
.direction:disabled{color:#45605b}footer{background:#fff9e9ed;border-radius:18px;padding:0 10px;color:#31535b}.text-button,footer .text-button{color:#244e50}

.delivery-stamp{transform-origin:740px 135px}.mail-door{transform-origin:0px -4px}.mailbox.delivered .mail-door{animation:mail-open .45s ease-out both}@keyframes mail-open{to{transform:scaleY(.12)}}@keyframes post-letter{from{transform:translate(875px,240px) rotate(-15deg);opacity:1}to{transform:translate(905px,309px) scale(.3);opacity:0}}
/* Release the carried envelope when the separate delivery letter leaves the bag. */
.courier-sprite.delivered{animation:land .5s ease-out both,finish-delivery .9s steps(1) forwards}@keyframes finish-delivery{0%,25%{background-position:100% 100%}26%,100%{background-position:0 0}}@media(prefers-reduced-motion:reduce){.courier-sprite.delivered{background-position:0 0}}
