/* journey.css: the walk through the garden (journey engine builder).
   .jw is the painted world: fixed, full screen, behind the page. journey.js places and moves its layers
   (transforms and opacity only). .jw-fly is the little blue butterfly guide. */

/* the world: one painted garden behind everything */
.jw{position:fixed;left:0;top:0;width:100%;height:100vh;height:100lvh;z-index:var(--z-world);overflow:hidden;pointer-events:none;
  contain:strict;isolation:isolate;opacity:0;transition:opacity 1.4s ease;
  background:linear-gradient(#DCE7F3 0%, #F3F7FB var(--hz,48%), #FAF8F2 calc(var(--hz,48%) + 6%), #F7F5EE 100%)}
.jw.on{opacity:1}
.world-on .backdrop{opacity:0;visibility:hidden;transition:opacity 1.4s ease, visibility 0s 1.4s}
.jw > div{position:absolute;left:0;top:0;width:100%;height:100%}
.jw img{position:absolute;left:0;top:0;max-width:none;display:block;user-select:none;-webkit-user-drag:none;transform-origin:0 0}
.jw img:not(.ok){visibility:hidden}

/* sky: four lights of the same clouds, crossfaded; a little oversized so it can drift */
.jw > .jw-sky{height:55%;transform-origin:50% 40%;will-change:transform}
.jw-sky img{width:100%;height:100%;object-fit:cover;object-position:50% 100%}

/* the house in the distance, behind the garden wall */
/* its painting stops in a straight line at the left and right (the trees are painted right up to the edge),
   so the sides are feathered into the sky here */
.jw > .jw-house{width:auto;height:auto;will-change:transform;
  -webkit-mask-image:linear-gradient(90deg, transparent 1%, #000 20%, #000 80%, transparent 99%);
          mask-image:linear-gradient(90deg, transparent 1%, #000 20%, #000 80%, transparent 99%)}
.jw-house img{transform-origin:50% 100%}

/* the path: its painted paper above the horizon is clear, so the sky shows through */
.jw-path img{will-change:transform}
.jw-far img{will-change:transform}

/* flower clumps along the path, foreground blooms, wisteria overhead */
.jw-clump, .jw-bloom, .jw-wisteria{will-change:transform,opacity;opacity:0}
.jw-clump{transform-origin:0 0}

/* the light falls: tints laid over the garden (not the open sky) with multiply, only their opacity changes */
.jw > .jw-tint{mix-blend-mode:multiply;opacity:0;visibility:hidden}
.jw-tint-golden{background:linear-gradient(rgba(246,210,160,.45) 0%, rgba(246,210,160,0) 22%, rgba(246,210,160,0) calc(var(--hz,48%) - 4%), #F8DDB4 calc(var(--hz,48%) + 10%), #F2D0A4 100%)}
.jw-tint-dusk{background:linear-gradient(#B9AEDA 0%, rgba(185,174,218,0) 24%, rgba(185,174,218,0) calc(var(--hz,48%) - 4%), #C4B8E0 calc(var(--hz,48%) + 10%), #B3A6D6 100%)}
.jw-tint-night{background:linear-gradient(#34426F 0%, rgba(52,66,111,0) 24%, rgba(52,66,111,0) calc(var(--hz,48%) - 6%), #7383B4 calc(var(--hz,48%) + 8%), #6676AA 100%)}

/* phones and slow devices: the same garden with fewer layers, and plain fades instead of blending where it costs */
.jw-lite .jw-sky{will-change:auto}

/* reduced motion: a still garden; only the light changes */
.jw-still img, .jw-still > div{will-change:auto}

/* ---------- the little blue butterfly guide ---------- */
.jw-fly{position:fixed;left:0;top:0;width:0;height:0;z-index:calc(var(--z-station) + 5);pointer-events:none;will-change:transform;transition:opacity .9s ease}
.jw-fly.gone{opacity:0}
.jw-fly-w{position:absolute;left:-19px;top:-16px;width:38px;height:38px;animation:jw-wander 3.4s ease-in-out infinite}
.jw-fly-b{position:absolute;inset:0;transform-origin:50% 50%}
.jw-fly.flying .jw-fly-b{animation:jw-flap .17s ease-in-out infinite alternate}
.jw-fly img{position:absolute;left:0;top:0;width:100%;height:auto;max-width:none;filter:drop-shadow(0 0 2px rgba(255,254,250,.95)) drop-shadow(0 3px 3px rgba(27,42,74,.22))}
.jw-fly img + img{filter:none}
.jw-fly-w{animation-play-state:paused}
.jw-fly.flying .jw-fly-w{animation-play-state:running}
/* settled: a few slow folds of the wings, then still (nothing runs while it rests) */
.jw-fly.rest .jw-fly-b{animation:jw-rest 4.2s ease-in-out 3}
@media (min-width:700px){.jw-fly-w{left:-21px;top:-17px;width:42px;height:42px}}
@keyframes jw-flap{from{transform:scaleX(1)}to{transform:scaleX(.26)}}
@keyframes jw-wander{0%,100%{transform:translate(0,0)}25%{transform:translate(5px,-6px)}50%{transform:translate(-3px,-2px)}75%{transform:translate(-6px,-7px)}}
@keyframes jw-rest{0%,62%,100%{transform:rotate(0) scaleX(1)}70%{transform:rotate(-4deg) scaleX(.82)}78%{transform:rotate(0) scaleX(1)}86%{transform:rotate(-3deg) scaleX(.86)}}

@media (prefers-reduced-motion: reduce){.jw{transition:opacity .6s}.jw-fly{display:none}}

/* ---------- cards step onto the path and off again (journey.js glide) ----------
   journey.js sets translate, rotate and opacity on each .paper as it scrolls (the separate properties, so a
   station's own transform is untouched) and will-change only while it moves. Nothing else is needed here. */

/* pinch zoom (journey.js adds html.zoomed): the extras rest so the phone doesn't run out of memory and reload */
html.zoomed .jw > .jw-tint, html.zoomed #petals, html.zoomed #mg-front, html.zoomed .mg-glow{display:none}
html.zoomed .jw *, html.zoomed .jw > div{will-change:auto}
