/* The crew's scenes (src/lib/crew-scenes.ts draws them; scenes.js plays them; docs/CHARACTERS.md "Scenes"). Loaded only on a page that has a scene, and
   only while the brand look (dv_brand) and Finishing touches (dv_delight) are both On. Each scene is drawn in its last picture, so this file alone shows
   it complete and still. Only transform and opacity ever move. One line weight for the crew (2.2, hands 2), one ink, one green; gold only as a thin line.
   Every scene sits in its own space in the page (never over words or buttons), is hidden from screen readers, and is clipped to its own box so nothing
   in it can reach outside (no sideways scroll). Small life (a blink, a sway) runs only after the scene has played and only while it is on screen. */
.cs{--ink:#16130F;--green:#0E5A43;--bg:#F6F3EC;position:relative;display:block;line-height:0;pointer-events:none;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}
.cs__stage{display:block;width:100%;height:auto;overflow:hidden}
.cs .cs-tap{pointer-events:visiblePainted;cursor:pointer}

/* where each scene sits */
.cs--hero{width:100%;max-width:420px;margin-inline:auto}
.cs--404{width:min(250px,64vw);margin:0 auto 10px}
.cs--stop{width:clamp(84px,24vw,128px)}
.cs--foot{width:100%;overflow:clip;padding-top:4px}
.cs--foot .cs__stage{max-width:400px;margin:0 auto;overflow:visible}
/* a page's opening scene (How it works, For Organisers, Remember people): under the first words on phones, beside the headline on wide screens */
.s-phero .s-wrap>.cs{width:min(320px,100%);margin:26px auto 0}
@media(min-width:1000px){
  .dl .s-phero .s-wrap:has(>.cs){display:grid;grid-template-columns:minmax(0,1fr) minmax(0,380px);column-gap:56px;align-items:center}
  .dl .s-phero .s-wrap:has(>.cs)>*{grid-column:1}
  .dl .s-phero .s-wrap>.cs{grid-column:2;grid-row:1/span 8;width:100%;margin:0;align-self:center}
}
/* the page not found: Latch, closed, above the words */
.cs-404-page .nmt-404{padding-top:clamp(36px,7vw,84px)}
.cs-404-page .nmt-404 h1{margin-top:0}

/* one character at a time: while a scene is on screen the companion steps aside (it never takes a tap while it is hidden) */
html.cs-onstage .dl-mascots{opacity:0;transition:opacity .4s cubic-bezier(.2,.8,.2,1)}
html.cs-onstage .dl-mas{pointer-events:none!important}

/* small life after the scene: blinks out of step, Ring sways, Wick's flame flickers, the light under Latch's door breathes */
.cs.is-live.is-rest .m-eye{transform-box:fill-box;transform-origin:center;animation:cs-blink 5.6s infinite}
.cs.is-live.is-rest .cs-bl{transform-box:fill-box;transform-origin:center;animation:cs-blink 6.4s -2.2s infinite}
.cs.is-live.is-rest .cs-c--nib .m-eye{animation-delay:-1.7s}
.cs.is-live.is-rest .cs-c--wick .m-eye{animation-delay:-3.6s;animation-duration:6s}
.cs.is-live.is-rest .cs-c--latch .m-eye{animation-delay:-.6s;animation-duration:5.2s}
.cs.is-live.is-rest .m-swing{transform-box:view-box;transform-origin:54px 0;animation:cs-sway 6.5s ease-in-out infinite alternate}
.cs.is-live.is-rest .m-flame{transform-box:view-box;transform-origin:54px 79px;animation:cs-flick 2.6s ease-in-out infinite alternate}
.cs.is-live.is-rest .m-light{animation:cs-breathe 3.6s ease-in-out infinite alternate}
.cs:not(.is-live) *{animation-play-state:paused}
@keyframes cs-blink{0%,92%,100%{transform:scaleY(1)}95%{transform:scaleY(.1)}}
@keyframes cs-sway{from{transform:rotate(-2.5deg)}to{transform:rotate(2.5deg)}}
@keyframes cs-flick{0%{transform:scale(1,1)}50%{transform:scale(.97,1.04)}100%{transform:scale(1.02,.98) rotate(-1.5deg)}}
@keyframes cs-breathe{from{opacity:.6}to{opacity:1}}

/* Nib stepping out of the logo, once (scenes-arrive.js): above the page, never taking a tap */
.cs-walker{position:fixed;left:0;top:0;z-index:60;pointer-events:none;line-height:0;transform-origin:0 0}
.cs-walker svg{display:block;width:100%;height:100%}

@media(prefers-reduced-motion:reduce){
  .cs *,.cs-walker{animation:none!important;transition:none!important}
  .cs-walker{display:none}
}
