/* Hand-drawn details on the home page: notes for the game button and the chat, and ink marks on key words.
   Script: cs-hints.js. */

/* Phones and tablets: the game button used to slide away while the visitor scrolled down
   (launcher.js, under html.cs-util-away). It now stays, like the chat, in both directions. */
@media(max-width:1100px){
 html.cs-util-away .csa-launch.is-in:not(:focus-within){opacity:1;transform:none;pointer-events:auto}
}

/* ============ 1. the notes ============ */
.cs-hints{position:fixed;inset:0;z-index:68;pointer-events:none;font-family:var(--body,'DM Sans',sans-serif)}
/* a note is small and sits right by its own button, at the edge of the screen: it does not need to get out of anyone's way */
.cs-hint{appearance:none;position:absolute;margin:0;padding:0;border:0;background:none;color:#f6f1e7;font:inherit;text-align:left;cursor:pointer;pointer-events:none}
.cs-hint.is-on{pointer-events:auto}
.cs-hint--game{left:112px;bottom:21px}
.cs-hint--chat{right:18px;bottom:108px}
.cs-hint-pop{display:block;position:relative;opacity:0;transform-origin:0 100%}
.cs-hint--chat .cs-hint-pop{transform-origin:100% 100%}
.cs-hint-card{display:flex;align-items:center;gap:10px;padding:7px 14px 7px 8px;border:1px solid rgba(224,194,138,.5);border-radius:15px;
 background-color:rgba(10,24,38,.95);background-image:linear-gradient(rgba(224,194,138,.07) 1px,transparent 1px),linear-gradient(90deg,rgba(224,194,138,.07) 1px,transparent 1px);background-size:14px 14px;
 box-shadow:0 14px 32px -14px rgba(2,16,27,.7),0 0 0 4px rgba(224,194,138,.07);transform:rotate(-1.2deg)}
.cs-hint--chat .cs-hint-card{transform:rotate(1.2deg)}
.cs-hint-art{flex:none;width:56px;height:43px;overflow:visible}
.cs-hint-art path,.cs-hint-arrow path{fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1;stroke-dashoffset:1}
.cs-hint .i{stroke:#e0c28a;stroke-width:2.8}
.cs-hint .c{stroke:#1cb0c3;stroke-width:3}
.cs-hint .d{stroke:#e0c28a;stroke-width:2.2;stroke-dasharray:.035 .045;stroke-dashoffset:0;opacity:0}
.cs-hint .f{fill:#e0c28a;stroke:none;opacity:0}
.cs-hint .fly{opacity:0}
.cs-hint .fly .f{opacity:1}
.cs-hint .fly .c2{fill:#1cb0c3;stroke:none}
.cs-hint-art :is(.beat,.rock,.bob,.d1,.d2,.d3,.f:not(.fly *)){transform-box:fill-box;transform-origin:50% 50%}
.cs-hint-words{display:block;font-size:14px;line-height:1.22;letter-spacing:-.005em;white-space:nowrap}
.cs-hint-words span{display:block;color:#dbe3e8}
.cs-hint-words b{display:block;font-weight:700;color:#e0c28a}
.cs-hint-words i{display:inline-block;font-style:normal;opacity:0}
/* the arrow from the note to its button, in the film's ink */
.cs-hint-arrow{position:absolute;overflow:visible;filter:drop-shadow(0 1px 1.5px rgba(2,16,27,.75))}
.cs-hint-arrow .i{stroke-width:4}
.cs-hint--game .cs-hint-arrow.is-side{right:calc(100% + 1px);bottom:12px;width:34px;height:20px}
.cs-hint--game .cs-hint-arrow.is-down{display:none}
.cs-hint--chat .cs-hint-arrow{right:16px;top:calc(100% + 1px);width:24px;height:27px}
.cs-hint--chat .cs-hint-arrow .i{stroke-width:3.4}
.cs-hint:hover .cs-hint-card,.cs-hint:focus-visible .cs-hint-card{border-color:#e0c28a;box-shadow:0 18px 40px -14px rgba(2,16,27,.8),0 0 0 5px rgba(224,194,138,.16)}
.cs-hint:focus-visible{outline:none}
.cs-hint:focus-visible .cs-hint-card{outline:3px solid #1cb0c3;outline-offset:3px}
/* the game button's own hover label would sit under a game note: the note says it already */
.cs-hints:has(.cs-hint--game.is-on)~.csa-launch .csa-tip{display:none}

/* ---- the entrance, by time and unhurried (about 2.2 s; the same total is IN_MS in cs-hints.js):
   the card settles, the drawing draws itself stroke by stroke, the letters land, the arrow reaches its button.
   Each part then keeps its own gentle motion for as long as the note is on. */
.cs-hint.is-on .cs-hint-pop{animation:cs-hint-in .7s cubic-bezier(.2,1.2,.35,1) both,cs-hint-float 5.4s ease-in-out 2.6s infinite}
.cs-hint.is-on .cs-hint-art path{animation:cs-hint-draw .6s cubic-bezier(.4,.1,.3,1) calc(.45s + var(--t,0) * .75s) both}
.cs-hint.is-on .cs-hint-art .f{animation:cs-hint-fade .3s ease-out calc(.45s + var(--t,0) * .75s) both}
.cs-hint.is-on .cs-hint-art .f.beat{animation:cs-hint-fade .3s ease-out calc(.45s + var(--t,0) * .75s) both,cs-hint-beat 2.6s ease-in-out 2.6s infinite}
.cs-hint.is-on .cs-hint-art .d{animation:cs-hint-fade .5s ease-out .5s both}
.cs-hint.is-on .cs-hint-art .fly{animation:cs-hint-fade .4s ease-out .95s both}
.cs-hint.is-on .cs-hint-words i{animation:cs-hint-letter .34s cubic-bezier(.2,1.3,.4,1) calc(1.05s + var(--i) * 30ms) both,cs-hint-wave 3.8s ease-in-out calc(2.8s + var(--i) * 90ms) infinite}
.cs-hint.is-on .cs-hint-arrow{animation:cs-hint-nudge 2s ease-in-out 2.6s infinite}
.cs-hint.is-on .cs-hint-arrow path{animation:cs-hint-draw .42s ease-out 1.62s both}
.cs-hint.is-on .cs-hint-arrow .h{animation:cs-hint-draw .18s ease-out 2.04s both}
/* what keeps moving in each drawing */
.cs-hint.is-on .cs-hint-art .tw{animation:cs-hint-draw .6s cubic-bezier(.4,.1,.3,1) calc(.45s + var(--t,0) * .75s) both,cs-hint-twinkle 2s ease-in-out 2.6s infinite}
.cs-hint.is-on .cs-hint-art .tw2{animation-delay:calc(.45s + var(--t,0) * .75s),3.2s}
.cs-hint.is-on .cs-hint-art .tw3{animation-delay:calc(.45s + var(--t,0) * .75s),3.8s}
.cs-hint.is-on .cs-hint-art path.beat:not(.f){animation:cs-hint-draw .6s cubic-bezier(.4,.1,.3,1) calc(.45s + var(--t,0) * .75s) both,cs-hint-beat 2.6s ease-in-out 2.6s infinite}
.cs-hint.is-on .cs-hint-art .rock{animation:cs-hint-rock 3.8s ease-in-out 2.4s infinite}
.cs-hint.is-on .cs-hint-art .bob{animation:cs-hint-bob 2.8s ease-in-out 2.4s infinite}
.cs-hint.is-on .cs-hint-art .k1{animation:cs-hint-draw .6s ease-out calc(.45s + var(--t,0) * .75s) both,cs-hint-key 2.2s steps(1) 2.6s infinite}
.cs-hint.is-on .cs-hint-art .k2{animation:cs-hint-draw .6s ease-out calc(.45s + var(--t,0) * .75s) both,cs-hint-key 2.2s steps(1) 3.7s infinite}
.cs-hint.is-on .cs-hint-art .d1{animation:cs-hint-draw .3s ease-out calc(.45s + var(--t,0) * .75s) both,cs-hint-type 1.5s ease-in-out 2.3s infinite}
.cs-hint.is-on .cs-hint-art .d2{animation:cs-hint-draw .3s ease-out calc(.45s + var(--t,0) * .75s) both,cs-hint-type 1.5s ease-in-out 2.48s infinite}
.cs-hint.is-on .cs-hint-art .d3{animation:cs-hint-draw .3s ease-out calc(.45s + var(--t,0) * .75s) both,cs-hint-type 1.5s ease-in-out 2.66s infinite}
/* ---- the exit, a second (OUT_MS): the arrow lets go, the letters and the drawing go, then the card tips and drops away */
.cs-hint.is-off .cs-hint-pop{animation:cs-hint-out .5s cubic-bezier(.5,0,.75,.4) .5s both}
.cs-hint.is-off .cs-hint-arrow path{animation:cs-hint-undraw .28s ease-in both}
.cs-hint.is-off .cs-hint-arrow .h{animation:cs-hint-undraw .1s ease-in both}
.cs-hint.is-off .cs-hint-words i{animation:cs-hint-fade .2s ease-in calc(.12s + var(--i) * 9ms) reverse both}
.cs-hint.is-off .cs-hint-art path{animation:cs-hint-undraw .42s ease-in .22s both}
.cs-hint.is-off .cs-hint-art .f,.cs-hint.is-off .cs-hint-art .d,.cs-hint.is-off .cs-hint-art .fly{animation:cs-hint-fade .3s ease-in .25s reverse both}
@keyframes cs-hint-in{0%{opacity:0;transform:translate3d(0,18px,0) scale(.78) rotate(-7deg)}55%{opacity:1}100%{opacity:1;transform:none}}
@keyframes cs-hint-out{0%{opacity:1;transform:none}30%{opacity:1;transform:translate3d(0,-4px,0) scale(1.03) rotate(1.5deg)}100%{opacity:0;transform:translate3d(0,18px,0) scale(.84) rotate(-5deg)}}
@keyframes cs-hint-float{0%,100%{transform:none}50%{transform:translate3d(0,-3px,0) rotate(.6deg)}}
@keyframes cs-hint-draw{from{stroke-dashoffset:1}to{stroke-dashoffset:0}}
@keyframes cs-hint-undraw{from{stroke-dashoffset:0}to{stroke-dashoffset:1}}
@keyframes cs-hint-fade{from{opacity:0}to{opacity:1}}
@keyframes cs-hint-letter{from{opacity:0;transform:translate3d(0,7px,0) rotate(8deg)}to{opacity:1;transform:none}}
@keyframes cs-hint-wave{0%,26%,100%{transform:none}9%{transform:translate3d(0,-2.6px,0) rotate(-4deg)}18%{transform:translate3d(0,.8px,0) rotate(2deg)}}
@keyframes cs-hint-nudge{0%,100%{transform:translate3d(0,0,0)}50%{transform:translate3d(var(--nx,-4px),var(--ny,2px),0)}}
@keyframes cs-hint-twinkle{0%,100%{opacity:1}50%{opacity:.25}}
@keyframes cs-hint-beat{0%,100%{transform:scale(1)}50%{transform:scale(1.14)}}
@keyframes cs-hint-rock{0%,100%{transform:rotate(0)}30%{transform:rotate(-4deg) translate3d(0,-1px,0)}70%{transform:rotate(3.5deg)}}
@keyframes cs-hint-bob{0%,100%{transform:none}50%{transform:translate3d(0,-2.5px,0) rotate(-5deg)}}
@keyframes cs-hint-key{0%,100%{stroke:#1cb0c3;stroke-width:3}50%{stroke:#e0c28a;stroke-width:4.6}}
@keyframes cs-hint-type{0%,60%,100%{transform:none;opacity:.45}25%{transform:translate3d(0,-4px,0);opacity:1}}
.cs-hint--chat .cs-hint-arrow,.cs-hint--game .cs-hint-arrow.is-down{--nx:1px;--ny:4px}

/* phones: a short label right above its button */
@media(max-width:760px){
 .cs-hint--game{left:10px;bottom:84px}
 .cs-hint--chat{right:10px;bottom:98px}
 .cs-hint-card{gap:8px;padding:6px 11px 6px 7px;border-radius:13px}
 .cs-hint-art{width:42px;height:32px}
 .cs-hint-words{font-size:12.5px}
 .cs-hint--game .cs-hint-arrow.is-side{display:none}
 .cs-hint--game .cs-hint-arrow.is-down{display:block;left:18px;top:calc(100% + 1px);width:16px;height:18px;scale:-1 1}
 .cs-hint--chat .cs-hint-arrow{right:24px;top:calc(100% + 1px);width:16px;height:18px}
}

/* ============ 2. page ink ============ */
.cs-ink{position:absolute;left:0;top:0;width:100%;height:0;z-index:60;pointer-events:none}
.cs-ink-mark{position:absolute;left:0;top:0;width:1px;height:1px;overflow:visible}
.cs-ink .m{fill:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1;stroke-dashoffset:1;opacity:.9}
.cs-ink .g{stroke:#cfa968}
.cs-ink .c{stroke:#1cb0c3}
.cs-ink--circle .m,.cs-ink--ring .m{stroke-width:2.6}
.cs-ink .sf{fill:#1cb0c3}
.cs-ink .sk{fill:none;stroke:#0d1b28;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round}
.cs-ink .stamp{opacity:0;transform:scale(1.7) rotate(-22deg)}
/* drawn by hand, in no hurry: about 1.7 s for an underline, 1.9 s for a circle or a ring, the arrow's head after its line, the check a little quicker */
.cs-ink-mark.is-drawn .m{animation:cs-hint-draw 1.7s cubic-bezier(.45,.05,.3,1) calc(var(--t,0) * 1.7s) both}
.cs-ink--circle.is-drawn .m,.cs-ink--ring.is-drawn .m{animation-duration:1.9s}
.cs-ink-mark.is-drawn .m.h{animation-duration:.3s}
.cs-ink-mark.is-drawn .stamp{animation:cs-ink-stamp .9s cubic-bezier(.2,1.4,.4,1) both}
@keyframes cs-ink-stamp{0%{opacity:0;transform:scale(2.1) rotate(-26deg)}45%{opacity:1}100%{opacity:1;transform:scale(1) rotate(-10deg)}}
.cs-ink-mark.is-still .m,.cs-ink-mark.is-still .stamp{animation-duration:.01s!important;animation-delay:0s!important}

/* reduced motion: the notes are whole and still */
@media(prefers-reduced-motion:reduce){
 .cs-hint .cs-hint-pop,.cs-hint *{animation:none!important}
 .cs-hint.is-on .cs-hint-pop{opacity:1}
 .cs-hint.is-on .cs-hint-art path,.cs-hint.is-on .cs-hint-arrow path{stroke-dashoffset:0}
 .cs-hint.is-on .cs-hint-art .f,.cs-hint.is-on .cs-hint-art .d,.cs-hint.is-on .cs-hint-art .fly,.cs-hint.is-on .cs-hint-words i{opacity:1}
}
/* never over the page film or a dialog */
html.cs-pf-on .cs-hints,html:has(.cs-pf) .cs-hints,html:has(dialog[open]) .cs-hints,html:has(.cs-pf) .cs-ink{display:none}
@media print{.cs-hints,.cs-ink{display:none}}
