/* Cachet Card hero, performed: the QR is scanned, the sample card plays its opening, Save contact
   is tapped and the card lands in the phone's Contacts. Default markup is the finished state, so
   no script and reduced motion both show the result. Script adds .is-armed to start from the top.
   Transform and opacity only, inside fixed frames. */
.cs-art{flex-direction:column;gap:14px}
.cs-ph{position:relative}
.cs-ph .ph-scr{isolation:isolate}
.cs-card{transition:background-color .35s,color .35s}
.cs-mono{position:relative;width:66px;height:66px;margin:16px 0 12px;display:grid;place-items:center}
.cs-mono span{position:relative;font:400 24px/1 'Fraunces',Georgia,serif;color:var(--cgold);letter-spacing:.02em}
.cs-ring{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
.cs-ring circle{fill:none;stroke:var(--cgold);stroke-width:1.5}
.cs-ring .cs-halo{stroke-width:5;opacity:.18}
.cs-save{border:0;cursor:pointer;position:relative;font:700 12px/1 'Instrument Sans',system-ui,sans-serif}
.cs-save:focus-visible{outline:2px solid var(--cink);outline-offset:3px}
.cs-tap{position:absolute;left:50%;bottom:21px;width:46px;height:46px;margin-left:-23px;border-radius:50%;background:color-mix(in srgb,var(--cink) 28%,transparent);opacity:0;transform:scale(.3);pointer-events:none}

/* the phone's Contacts sheet */
.cs-sheet{position:absolute;left:0;right:0;bottom:0;height:63%;background:#fff;color:#111;border-radius:22px 22px 0 0;padding:8px 16px 14px;text-align:center;
  font-family:-apple-system,'Instrument Sans',system-ui,sans-serif;box-shadow:0 -18px 40px -18px rgba(0,0,0,.45);transform:none;transition:transform .42s cubic-bezier(.2,.8,.2,1)}
.cs-grab{width:36px;height:5px;border-radius:3px;background:#D1D1D6;margin:0 auto 6px}
.cs-sheet-hd{display:flex;align-items:center;justify-content:space-between;font-size:13px;color:#6C6C70;margin-bottom:6px}
.cs-sheet-hd button{appearance:none;border:0;background:none;font:600 14px/1 -apple-system,'Instrument Sans',system-ui,sans-serif;color:#0A64D8;padding:8px 2px;cursor:pointer}
.cs-sheet-hd button:focus-visible{outline:2px solid #0A64D8;outline-offset:2px;border-radius:4px}
.cs-av{width:58px;height:58px;margin:0 auto 8px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(180deg,#A5A9B4,#858A96);color:#fff;font:600 21px/1 -apple-system,'Instrument Sans',system-ui,sans-serif;letter-spacing:.02em}
.cs-sheet .sv-n{margin:0;font-size:19px;font-weight:600}
.cs-sheet .sv-r{margin:3px 0 10px;font-size:12px;color:#5E5E63}
.cs-sheet .sv-rows{text-align:left;background:#F2F2F6;border-radius:12px;padding:2px 12px}
.cs-sheet .sv-rows p{margin:0;padding:6px 0;font-size:12.5px;color:#0A5CC4}
.cs-sheet .sv-rows p+p{border-top:1px solid #DEDEE3}
.cs-sheet .sv-rows small{display:block;color:#5E5E63;font-size:10.5px}
.cs-sheet .sv-ok{margin:10px 0 0;transition:opacity .3s,transform .3s}

/* QR scan line */
.cs-qr{overflow:hidden}
.cs-scan{position:absolute;left:8px;right:8px;top:12px;height:3px;border-radius:2px;background:#C9A227;box-shadow:0 0 12px 2px rgba(201,162,39,.65);opacity:0;transform:translateY(0)}
.cs-ini{width:34px;height:34px;border-radius:50%;flex:none;display:grid;place-items:center;background:linear-gradient(180deg,#A5A9B4,#858A96);color:#fff;font:600 13px/1 'Instrument Sans',system-ui,sans-serif}
.cs-toast{left:-48px;top:96px;bottom:auto;width:198px;transition:opacity .35s,transform .45s cubic-bezier(.2,.8,.2,1)}

/* controls under the phone */
.cs-ctl{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:10px 18px;position:relative;z-index:2}
.cs-replay{appearance:none;display:inline-flex;align-items:center;gap:8px;min-height:42px;padding:0 15px;border-radius:99px;border:0;cursor:pointer;
  background:rgba(245,239,227,.08);box-shadow:0 0 0 1.5px rgba(245,239,227,.28) inset;color:#F5EFE3;font:600 14.5px/1 'Instrument Sans',system-ui,sans-serif}
.cs-replay svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.cs-replay:hover{background:rgba(245,239,227,.14)}
.cs-replay:focus-visible,.cs-moods button:focus-visible{outline:2px solid #F5EFE3;outline-offset:3px}
.cs-moods{display:flex;align-items:center;gap:6px;font:600 12px/1 'Instrument Sans',system-ui,sans-serif;letter-spacing:.08em;text-transform:uppercase;color:#B9BFD3}
.cs-moods>span{margin-right:2px}
.cs-moods button{appearance:none;width:36px;height:40px;padding:0;border:0;background:none;cursor:pointer;display:grid;place-items:center;border-radius:50%}
.cs-moods button i{width:22px;height:22px;border-radius:50%;background:var(--m);box-shadow:inset 0 0 0 1px rgba(128,128,128,.45),inset -7px 0 0 var(--mg);transition:transform .2s}
.cs-moods button[aria-pressed="true"] i{transform:scale(1.18);box-shadow:inset 0 0 0 1px rgba(128,128,128,.45),inset -7px 0 0 var(--mg),0 0 0 2px #0C1530,0 0 0 3.5px #F5EFE3}
.cs-vh{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;margin:0}

/* the start of the story (script only) */
.cs-art.is-armed .cs-in{opacity:0;transform:translateY(18px)}
.cs-art.is-armed .cs-mono span{opacity:0;transform:scale(.6)}
.cs-art.is-armed .cs-ring{opacity:0;transform:rotate(-140deg) scale(.55)}
.cs-art.is-armed .cs-sheet{transform:translateY(104%)}
.cs-art.is-armed .cs-sheet .sv-ok{opacity:0;transform:translateY(6px)}
.cs-art.is-armed .cs-toast{opacity:0;transform:translateY(14px) scale(.96)}
.cs-in,.cs-mono span,.cs-ring{transition:opacity .5s cubic-bezier(.2,.7,.2,1),transform .6s cubic-bezier(.2,.7,.2,1);transition-delay:calc(var(--d,0)*55ms)}
.cs-ring{transition-duration:.6s,.8s}

/* beats */
.cs-art.is-scan .cs-scan{animation:cs-scan .62s cubic-bezier(.4,0,.4,1) both}
@keyframes cs-scan{0%{opacity:0;transform:translateY(0)}15%{opacity:1}85%{opacity:1}100%{opacity:0;transform:translateY(96px)}}
.cs-art.is-open .cs-in,.cs-art.is-open .cs-mono span{opacity:1;transform:none}
.cs-art.is-open .cs-ring{opacity:1;transform:none}
.cs-art.is-tap .cs-tap{animation:cs-tap .5s ease-out both}
.cs-art.is-tap .cs-save{animation:cs-press .3s ease-out both}
@keyframes cs-tap{0%{opacity:.9;transform:scale(.3)}100%{opacity:0;transform:scale(2.2)}}
@keyframes cs-press{50%{transform:scale(.95)}100%{transform:none}}
.cs-art.is-saved .cs-sheet{transform:none}
.cs-art.is-saved .cs-sheet .sv-ok{opacity:1;transform:none;transition-delay:.38s}
.cs-art.is-saved .cs-toast{opacity:1;transform:none;transition-delay:.55s}
/* loading hint on the blank card before its opening; the tagline steps back under the sheet */
.cs-load{position:absolute;left:0;right:0;top:46%;margin:0;text-align:center;font:500 12px/1 'Instrument Sans',system-ui,sans-serif;letter-spacing:.04em;color:var(--cmu);opacity:0;transition:opacity .3s}
.cs-art.is-armed:not(.is-open) .cs-load{opacity:1}
.cs-art .cs-card .cc-t{transition:opacity .3s}
.cs-art:not(.is-armed) .cs-card .cc-t,.cs-art.is-armed.is-saved .cs-card .cc-t{opacity:0}
.cs-art.is-instant *,.cs-art.is-instant{transition:none!important;animation:none!important}

@media (max-width:900px){.cs-art{margin-top:20px}}
@media (max-width:700px){
  .cs-toast{display:none}
  .cs-ctl{gap:4px 10px;margin-top:-30px}
  .cs-moods button{width:44px;height:44px}
}
@media (prefers-reduced-motion:reduce){
  .cs-art *,.cs-card{transition:none!important;animation:none!important}
}
