/* Visuals between article sections (trial; lib/visuals.mjs makes the markup, visuals.js starts them).
   House rules: house colours only, flat, no blurred shadows, solid lips, Nunito 900. Each visual plays its entrance
   once when it scrolls into view (.is-on), then at most one small loop keeps going. Without JavaScript or with reduced
   motion every visual simply shows its finished picture. */
.vz { position: relative; margin: 56px auto 8px; max-width: 720px; height: 120px; display: flex; align-items: center; justify-content: center; gap: 18px; pointer-events: none; user-select: none; }
.ar-body > .vz + h2 { margin-top: 36px; }
/* the opener sits right below the title and the answer line; the closer right above the last section */
.vz.vz--open { margin: 32px auto 8px; }
.vz.vz--close { margin: 64px auto 24px; }
.vz-flag { display: block; flex: none; width: 54px; height: 36px; border-radius: 7px; background: var(--flag) center / cover no-repeat; box-shadow: 0 0 0 2px var(--mm-bg), 0 4px 0 var(--mm-line); }

/* the entrance: everything starts in its "before" state only once visuals.js has marked the page (.vz-js), so the
   picture is complete without JavaScript */
.vz-js .vz:not(.is-on) * { animation-play-state: paused !important; }

/* ---- bunting */
.vz-bunting { display: block; height: 110px; }
.vz-bunting__string { position: absolute; inset: 0 0 auto; width: 100%; height: 44px; overflow: visible; }
.vz-bunting__string path { fill: none; stroke: var(--mm-slate); stroke-width: 2; stroke-dasharray: 760; animation: vz-draw .8s ease-out both; vector-effect: non-scaling-stroke; }
.vz-pen { position: absolute; width: 40px; height: 48px; margin-left: -20px; transform-origin: 50% 0; animation: vz-drop .5s cubic-bezier(.3, 1.6, .5, 1) both, vz-sway 3.2s ease-in-out infinite; animation-delay: calc(.25s + var(--i) * 60ms), calc(1.2s + var(--i) * 140ms); }
.vz-pen:not(.vz-pen--flag) { background: var(--c); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.vz-pen--flag { width: 50px; height: 38px; margin-left: -25px; }
.vz-pen--flag .vz-flag { width: 100%; height: 100%; border-radius: 0 0 8px 8px; }
@keyframes vz-draw { from { stroke-dashoffset: 760; } to { stroke-dashoffset: 0; } }
@keyframes vz-drop { from { transform: translateY(-30px) scaleY(.4); opacity: 0; } }
@keyframes vz-sway { 50% { transform: rotate(4deg); } }

/* ---- passport */
.vz-passport { height: auto; flex-direction: column; gap: 22px; perspective: 900px; }
.vz-passport__note { margin: 0; max-width: 100%; text-wrap: balance; text-align: center; font: 700 .875rem/1.4 var(--mm-font); color: var(--mm-slate); }
/* two upright pages of the same width: the grid tracks include each page's padding, so they stay equal */
.vz-passport__book { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; width: 300px; max-width: 100%; height: 214px; padding: 7px; border-radius: 16px; background: var(--mm-blue); box-shadow: 0 6px 0 #2B63BD; transform: rotate(-3deg); }
.vz-passport__page { position: relative; min-width: 0; background: #FFFBF2 repeating-linear-gradient(135deg, transparent 0 9px, color-mix(in srgb, var(--mm-candy-sky) 9%, transparent) 9px 10px); overflow: hidden; }
.vz-passport__page--l { border-radius: 10px 3px 3px 10px; padding: 14px 12px 12px; display: grid; grid-template-columns: 46px minmax(0, 1fr); grid-template-rows: auto 1fr auto; gap: 10px; }
.vz-passport__page--r { border-radius: 3px 10px 10px 3px; transform-origin: 0 50%; animation: vz-open .8s cubic-bezier(.3, 1.2, .5, 1) .15s both; box-shadow: inset 8px 0 8px -8px rgb(0 0 0 / .12); }
.vz-passport__photo { width: 46px; height: 58px; border-radius: 7px; background: var(--mm-candy-sky) var(--img) 0 70% / 400% auto no-repeat; box-shadow: 0 0 0 3px #fff; }
.vz-passport__lines { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.vz-passport__lines b { height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--mm-slate) 30%, transparent); }
.vz-passport__lines b:nth-child(1) { width: 90%; background: color-mix(in srgb, var(--mm-slate) 55%, transparent); } .vz-passport__lines b:nth-child(3) { width: 60%; } .vz-passport__lines b:nth-child(4) { width: 75%; }
.vz-passport__sign { grid-column: 1 / -1; align-self: end; width: 70%; height: 22px; border-bottom: 2px solid color-mix(in srgb, var(--mm-slate) 30%, transparent); }
.vz-passport__sign svg { width: 70px; height: 22px; fill: none; stroke: color-mix(in srgb, var(--mm-blue) 70%, black); stroke-width: 1.6; stroke-linecap: round; }
.vz-passport__mrz { grid-column: 1 / -1; height: 18px; background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--mm-slate) 45%, transparent) 0 4px, transparent 4px 6px) 0 0 / 100% 5px no-repeat, repeating-linear-gradient(90deg, color-mix(in srgb, var(--mm-slate) 45%, transparent) 0 4px, transparent 4px 6px) 0 12px / 100% 5px no-repeat; }
.vz-passport__old { position: absolute; right: 10px; top: 10px; display: grid; place-items: center; width: 44px; height: 44px; border: 3px solid var(--mm-candy-lavender); border-radius: 50%; transform: rotate(14deg); opacity: .45; }
.vz-passport__old svg { width: 26px; fill: var(--mm-candy-lavender); transform: rotate(-35deg); }
/* the entry stamp: worn ink (the SVG filter in lib/visuals.mjs), thudding onto the page */
.vz-visa { position: absolute; left: 3%; bottom: 9%; width: 96%; color: var(--ink); animation: vz-thud .5s cubic-bezier(.3, 1.5, .5, 1) 1s both; }
/* the postmark is wider than the page: its waves run off the edge, as on a real page */
.vz-visa--round { left: 2%; width: 168%; bottom: 12%; }
.vz-visa svg { display: block; width: 100%; height: auto; overflow: visible; }
.vz-visa text { fill: currentColor; font-family: var(--mm-font); font-weight: 900; letter-spacing: .06em; }
.vz-visa .vz-ink-line { fill: none; stroke: currentColor; }
.vz-visa .vz-ink-fill { fill: currentColor; }
@keyframes vz-open { from { transform: rotateY(-178deg); } }
@keyframes vz-thud { from { scale: 1.9; opacity: 0; } 60% { opacity: .9; } }

/* ---- talk: a 6 s conversation, side a talks in the first half, side b in the second */
.vz-talk { height: 190px; width: min(100%, 560px); justify-content: space-between; gap: 0; align-items: flex-end; padding-bottom: 12px; }
.vz-talk::after { content: ""; position: absolute; left: 4%; right: 4%; bottom: 10px; border-top: 2px solid var(--mm-line); }
.vz-talk__side { position: relative; display: flex; align-items: flex-end; gap: 10px; }
.vz-talk__side--b { flex-direction: row-reverse; }
.vz-talk__head { position: relative; z-index: 1; width: 124px; height: 124px; flex: none; background: var(--img) 0 0 / 400% 100% no-repeat; animation: vz-in .5s cubic-bezier(.3, 1.6, .5, 1) both, vz-talk-a 6s steps(1, end) .6s infinite; }
.vz-talk__side--b .vz-talk__head { animation-name: vz-in, vz-talk-b; animation-delay: .15s, .6s; }
.vz-talk__say { position: relative; display: flex; align-items: center; margin-bottom: 70px; margin-inline: -8px; transform-origin: 0 100%; animation: vz-say-a 6s ease-out .6s infinite; }
.vz-talk__side--b .vz-talk__say { flex-direction: row-reverse; transform-origin: 100% 100%; animation-name: vz-say-b; }
.vz-talk__bubble { display: flex; align-items: center; gap: 12px; margin: 0; padding: 12px 16px; background: var(--mm-bg); border: 2px solid var(--mm-bubble-line); border-radius: 14px 14px 14px 4px; box-shadow: 0 4px 0 var(--mm-line); }
.vz-talk__side--b .vz-talk__bubble { border-radius: 14px 14px 4px 14px; }
.vz-talk__bubble .vz-flag { width: 42px; height: 28px; border-radius: 4px; box-shadow: none; }
.vz-talk__bars { display: flex; align-items: center; gap: 5px; height: 30px; }
.vz-talk__bars i { width: 6px !important; }
.vz-talk__bars i { width: 5px; height: 100%; border-radius: 3px; background: var(--mm-blue); animation: vz-bounce .7s ease-in-out infinite; }
.vz-talk__side--b .vz-talk__bars i { background: var(--mm-candy-tangerine); }
.vz-talk__bars i:nth-child(2) { animation-delay: .12s; height: 70%; } .vz-talk__bars i:nth-child(3) { animation-delay: .24s; } .vz-talk__bars i:nth-child(4) { animation-delay: .08s; height: 60%; } .vz-talk__bars i:nth-child(5) { animation-delay: .2s; height: 85%; }
.vz-talk__arcs { width: 22px; height: 30px; margin: 0 4px; overflow: visible; }
.vz-talk__side--b .vz-talk__arcs { transform: scaleX(-1); }
.vz-talk__arcs path { fill: none; stroke: var(--mm-candy-sky); stroke-width: 3; stroke-linecap: round; animation: vz-arc 1s ease-out infinite; }
.vz-talk__arcs path:nth-child(2) { animation-delay: .2s; } .vz-talk__arcs path:nth-child(3) { animation-delay: .4s; }
@keyframes vz-in { from { transform: translateY(30px) scale(.6); opacity: 0; } }
@keyframes vz-bounce { 50% { transform: scaleY(.45); } }
@keyframes vz-arc { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0; } }
@keyframes vz-say-a { 0% { opacity: 0; transform: scale(.4); } 6%, 42% { opacity: 1; transform: none; } 48%, 100% { opacity: 0; transform: scale(.9); } }
@keyframes vz-say-b { 0%, 50% { opacity: 0; transform: scale(.4); } 56%, 92% { opacity: 1; transform: none; } 98%, 100% { opacity: 0; transform: scale(.9); } }
/* the four faces of the sprite: 0, 33.33, 66.67, 100% */
@keyframes vz-talk-a { 0% { background-position-x: 33.33%; } 7% { background-position-x: 66.67%; } 14% { background-position-x: 100%; } 21% { background-position-x: 33.33%; } 28% { background-position-x: 100%; } 35% { background-position-x: 66.67%; } 42%, 100% { background-position-x: 0%; } }
@keyframes vz-talk-b { 0%, 50% { background-position-x: 0%; } 57% { background-position-x: 66.67%; } 64% { background-position-x: 33.33%; } 71% { background-position-x: 100%; } 78% { background-position-x: 66.67%; } 85% { background-position-x: 33.33%; } 92%, 100% { background-position-x: 0%; } }
/* without the animation running (no JavaScript, reduced motion) side a is shown mid-sentence */
.vz-js .vz-talk:not(.is-on) .vz-talk__side--b .vz-talk__say { opacity: 0; }

/* ---- plane */
.vz-plane { display: block; }
.vz-plane__art { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.vz-plane__route { fill: none; stroke: var(--mm-candy-sky); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 2 10; }
.vz-plane__from { fill: var(--mm-candy-sky); }
.vz-plane__p { offset-distance: 86%; offset-path: path("M40 92 C200 -10 420 150 660 44"); offset-rotate: auto; animation: vz-fly 2.4s cubic-bezier(.45, 0, .3, 1) .2s both; fill: var(--mm-blue); }
.vz-plane__flag { position: absolute; left: calc(660 / 720 * 100%); top: 44px; transform: translate(-50%, -50%); animation: vz-pop .4s cubic-bezier(.3, 1.6, .5, 1) 2.4s both; }
@keyframes vz-fly { from { offset-distance: 0%; } to { offset-distance: 86%; } }
.vz-plane__p path { transform: scale(1.15); }

/* ---- pass */
.vz-pass { height: 140px; }
.vz-pass__card { display: flex; width: min(100%, 460px); height: 112px; background: var(--mm-bg); border: 2px solid var(--mm-line); border-radius: var(--mm-r-card); box-shadow: 0 6px 0 var(--mm-line); transform: rotate(-2deg); animation: vz-slide .6s cubic-bezier(.3, 1.4, .5, 1) .1s both; overflow: hidden; }
.vz-pass__main { flex: 1; padding: 18px 22px; display: flex; flex-direction: column; justify-content: space-between; border-left: 10px solid var(--mm-candy-tangerine); }
.vz-pass__main b { font: 900 1.5rem/1 var(--mm-font); }
.vz-pass__route { display: flex; align-items: center; gap: 10px; }
.vz-pass__dot { width: 12px; height: 12px; border-radius: 50%; background: var(--mm-candy-tangerine); flex: none; }
.vz-pass__line { position: relative; flex: 1; height: 2px; background: repeating-linear-gradient(90deg, var(--mm-slate) 0 6px, transparent 6px 12px); }
.vz-pass__line svg { position: absolute; top: -12px; width: 30px; height: 24px; fill: var(--mm-blue); animation: vz-cross 2.6s ease-in-out 1s infinite; }
.vz-pass__route .vz-flag { width: 42px; height: 28px; border-radius: 5px; }
.vz-pass__stub { width: 92px; border-left: 2px dashed var(--mm-line); display: grid; place-items: center; background: var(--mm-ice); }
.vz-pass__bars { width: 22px; height: 70px; background: repeating-linear-gradient(0deg, var(--mm-ink) 0 3px, transparent 3px 5px, var(--mm-ink) 5px 6px, transparent 6px 9px); opacity: .8; }
@keyframes vz-slide { from { transform: translateX(-40px) rotate(-8deg); opacity: 0; } }
@keyframes vz-cross { 0% { left: 0; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { left: calc(100% - 30px); opacity: 0; } }

/* ---- path */
.vz-path { display: block; height: 110px; }
.vz-path__line { position: absolute; inset: 0; width: 100%; height: 104px; overflow: visible; }
.vz-path__line path { fill: none; stroke: var(--mm-line); stroke-width: 10; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.vz-node { position: absolute; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: var(--mm-line); box-shadow: 0 5px 0 color-mix(in srgb, var(--mm-line) 70%, black 8%); animation: vz-light .4s cubic-bezier(.3, 1.6, .5, 1) calc(.3s + var(--i) * .35s) both; }
.vz-node::after { content: ""; position: absolute; inset: 14px; border-radius: 50%; background: #fff; opacity: .9; }
.vz-node--flag { width: 64px; height: 64px; margin: -32px 0 0 -32px; display: grid; place-items: center; background: var(--mm-bg); border: 3px solid var(--mm-candy-mustard); box-shadow: 0 5px 0 var(--mm-candy-mustard); }
.vz-node--flag::after { display: none; }
.vz-node--flag .vz-flag { width: 40px; height: 27px; border-radius: 5px; box-shadow: none; }
@keyframes vz-light { from { background: var(--mm-line); box-shadow: 0 5px 0 var(--mm-line); transform: scale(.8); } to { background: var(--c, var(--mm-bg)); box-shadow: 0 5px 0 color-mix(in srgb, var(--c, var(--mm-candy-mustard)) 60%, white); } }

/* ---- pin */
.vz-pin { height: 150px; align-items: flex-end; }
.vz-pin::after { content: ""; position: absolute; left: 0; right: 0; bottom: 10px; border-top: 2px solid var(--mm-line); }
.vz-pin__p { position: relative; z-index: 1; display: grid; place-items: center; width: 84px; height: 84px; margin-bottom: 30px; background: var(--mm-candy-coral); border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: 0 0 0 0 transparent; animation: vz-land .6s cubic-bezier(.3, 1.5, .5, 1) .2s both; }
.vz-pin__p .vz-flag { width: 48px; height: 48px; border-radius: 50%; transform: rotate(45deg); box-shadow: 0 0 0 4px #fff; }
.vz-pin__rings { position: absolute; bottom: 0; left: 50%; }
.vz-pin__rings i { position: absolute; width: 120px; height: 26px; margin: -13px 0 0 -60px; border: 3px solid var(--mm-candy-coral); border-radius: 50%; opacity: 0; animation: vz-ring 2.4s ease-out .8s infinite; bottom: -3px; }
.vz-pin__rings i + i { animation-delay: 2s; }
@keyframes vz-land { from { transform: translateY(-90px) rotate(-45deg); opacity: 0; } }
@keyframes vz-ring { from { transform: scale(.3); opacity: .9; } to { transform: scale(1.5); opacity: 0; } }

/* ---- sparkle */
.vz-sparkle { display: block; height: 100px; }
.vz-sparkle > .vz-flag { position: absolute; left: 50%; top: 50%; width: 72px; height: 48px; margin: -24px 0 0 -36px; border-radius: 9px; animation: vz-pop .45s cubic-bezier(.3, 1.6, .5, 1) both; }
.vz-sparkle::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; z-index: -1; border-top: 2px solid var(--mm-line); }
.vz-star { position: absolute; width: calc(var(--s) * 1.7); height: calc(var(--s) * 1.7); background: var(--c); clip-path: polygon(50% 0, 64% 36%, 100% 50%, 64% 64%, 50% 100%, 36% 64%, 0 50%, 36% 36%); animation: vz-pop .4s cubic-bezier(.3, 1.6, .5, 1) calc(.2s + var(--i) * 80ms) both, vz-twinkle 2.6s ease-in-out calc(1s + var(--i) * .4s) infinite; }
@keyframes vz-twinkle { 50% { transform: scale(.55) rotate(45deg); } }

/* shared entrance: a springy pop (sparkle and plane flags, the fillers) */
@keyframes vz-pop { from { transform: scale(.4); opacity: 0; } }

/* ==== character fillers (the middle of an article): the app's own art, floating, still; no ground line, no movement
   (owner, 26 Nov 2026: "cut the animations on the characters"). The strip hugs the art and has the same space above and
   below it ("make it symmetrical with the space up top"). */
.vz.vz--cast { height: auto; margin: 56px auto; align-items: flex-end; }
.ar-body > .vz--cast + h2 { margin-top: 56px; }
.vz-cast { display: block; position: relative; z-index: 1; height: auto; }

/* peek: Lou's head, glasses on */
.vz-peek__win { position: relative; display: block; width: 117px; height: 92px; overflow: hidden; }
.vz-peek__lou { width: 117px; position: absolute; left: 0; top: 4px; }

/* sit: Lou sitting */
.vz-sit__lou { width: 112px; }

/* crowd: the cast's heads in a row, Lou in the middle */
.vz-crowd__row { display: flex; align-items: flex-end; gap: 6px; }
.vz-crowd__h { display: block; width: 68px; height: 68px; background: var(--img) 0 0 / 400% 100% no-repeat; }
.vz-crowd__h--lou { width: 100px; height: 68px; background: url(/img/cast/lou-head.png) center bottom / contain no-repeat; }

/* friends: Mali, Lou and the little one */
.vz-friends { gap: 22px; }
.vz-friends__m { height: 150px; width: auto; }
.vz-friends__b { height: 124px; width: auto; }
.vz-friends__lou { height: 96px; width: auto; }

@media (max-width: 620px) {
  .vz-crowd__h { width: 50px; height: 50px; } .vz-crowd__h--lou { width: 74px; height: 50px; } .vz-crowd__row { gap: 3px; }
  .vz-friends { gap: 12px; } .vz-friends__m { height: 124px; } .vz-friends__b { height: 104px; } .vz-friends__lou { height: 80px; }
  .vz-talk__head { width: 92px; height: 92px; }
  .vz-talk__say { margin-bottom: 52px; }
  .vz-talk__bubble { padding: 8px 10px; gap: 7px; }
  .vz-talk__bubble .vz-flag { width: 30px; height: 20px; }
  .vz-talk__arcs { display: none; }
  .vz-passport__book { width: 264px; height: 188px; }
  .vz { margin-top: 44px; }
  .vz.vz--cast { margin-block: 44px; } .ar-body > .vz--cast + h2 { margin-top: 44px; }
  .vz-pen { width: 30px; height: 38px; margin-left: -15px; }
  .vz-pen--flag { width: 38px; height: 28px; margin-left: -19px; }
  .vz-pass__stub { width: 64px; } .vz-pass__main { padding: 14px 16px; } .vz-pass__main b { font-size: 1.25rem; }
  .vz-node { width: 36px; height: 36px; margin: -18px 0 0 -18px; } .vz-node::after { inset: 11px; }
  .vz-node--flag { width: 52px; height: 52px; margin: -26px 0 0 -26px; }
}
@media (prefers-reduced-motion: reduce) { .vz, .vz * { animation: none !important; } }
