/* Contact letter popover (assets/contact/contact.js), after madebyadi.cc's mailer: every a[data-contact] opens a
   letter over the page; Send folds it in thirds, slides it into an envelope, closes the flap and flies it into the
   ZeroERP mark in the header. Loaded by contact.js itself, on every page. */
html.ctp-open{overflow:hidden}
dialog.ctp{position:fixed;inset:0;width:100%;height:100%;max-width:none;max-height:none;margin:0;padding:0;border:0;background:transparent;overflow:hidden;color:#202120}
dialog.ctp::backdrop{background:transparent}
.ctp .sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.ctp-bg{position:absolute;inset:0;background:rgb(250 250 249 / .62);backdrop-filter:blur(8px) saturate(1.05);-webkit-backdrop-filter:blur(8px) saturate(1.05)}
.ctp-x{all:unset;position:absolute;z-index:8;top:18px;right:18px;width:38px;height:38px;display:grid;place-items:center;border-radius:50%;cursor:pointer;color:#505050;
  background:rgb(255 255 255 / .8);box-shadow:0 0 0 1px rgb(32 33 32 / .08),0 4px 12px -6px rgb(0 0 0 / .2);transition:color .15s,background .15s}
.ctp-x:hover{color:#202120;background:#fff}
.ctp-x:focus-visible{outline:2px solid #2670e0;outline-offset:2px}
.ctp-x svg{width:14px;height:14px}
.ctp-stage{position:absolute;left:50%;top:50%;width:min(440px,calc(100vw - 32px));translate:-50% -50%}

/* the letter */
.ct-form{position:relative}
.ct-letter{position:relative;box-sizing:border-box;display:flex;flex-direction:column;width:100%;height:min(560px,calc(100dvh - 190px));min-height:320px;padding:38px 34px 28px;border-radius:3px;
  background:radial-gradient(120% 80% at 20% 0%,#fbfaf7,#f5f4f0 70%),#f6f5f1;text-align:left;
  box-shadow:0 0 0 1px rgb(30 25 15 / .05),0 1px 2px rgb(30 25 15 / .06),0 40px 80px -40px rgb(30 25 15 / .35),0 14px 28px -18px rgb(30 25 15 / .16)}
.ct-letter input,.ct-letter textarea,.ct-letter .ct-v{all:unset;box-sizing:border-box;display:block;width:calc(100% + 16px);margin:0 -8px;padding:4px 8px;border-radius:6px;color:#202120;
  font-family:Lausanne,Arial,sans-serif;transition:background .15s}
.ct-letter ::placeholder{color:#a6a49e;opacity:1}
.ct-letter input:focus-visible,.ct-letter textarea:focus-visible{background:rgb(38 112 224 / .05);box-shadow:inset 0 0 0 1px rgb(38 112 224 / .25)}
.ct-letter .ct-subj{font:500 20px/1.35 Lausanne,Arial,sans-serif;letter-spacing:-.01em}
.ct-letter .ct-msg{flex:1 1 auto;min-height:0;margin-top:12px;font:300 16px/1.65 Lausanne,Arial,sans-serif;resize:none;overflow-y:auto;white-space:pre-wrap;word-break:break-word}
.ct-letter .ct-from{display:grid;gap:4px;margin-top:16px;padding-top:14px;border-top:1px dashed rgb(30 25 15 / .12)}
.ct-letter .ct-from input,.ct-letter .ct-from .ct-v{font:400 15px/1.5 Lausanne,Arial,sans-serif}
.ct-v.ph{color:#a6a49e}
.ct-err{min-height:20px;margin:12px 0 0;text-align:center;font:400 14px/20px Lausanne,Arial,sans-serif;color:#c23934}
.ct-err a{color:inherit;text-decoration:underline;text-underline-offset:2px}
.ct-send{all:unset;box-sizing:border-box;display:flex;align-items:center;justify-content:center;height:44px;min-width:108px;padding:0 26px;margin:4px auto 0;border-radius:999px;cursor:pointer;
  font:400 15px/1 Lausanne,Arial,sans-serif;color:#fff;background:#202120;box-shadow:0 10px 15px -3px rgb(0 0 0 / .08),0 4px 6px -4px rgb(0 0 0 / .08);
  transition:background .2s,color .2s,box-shadow .2s,transform .12s cubic-bezier(.2,.8,.2,1)}
.ct-send:hover{background:#3a3b3a}.ct-send:active{transform:translateY(1px) scale(.985)}
.ct-send:disabled{cursor:default;color:#a3a3a3;background:#efefee;box-shadow:inset 0 0 0 1px rgb(32 33 32 / .05)}
.ct-send:focus-visible{outline:2px solid #2670e0;outline-offset:3px}
.ct-alt{margin:14px 0 0;text-align:center;font:400 13px/1.4 Lausanne,Arial,sans-serif;color:#8d8d8d}
.ct-alt a{color:#505050;text-decoration:underline;text-decoration-color:rgb(32 33 32 / .25);text-underline-offset:3px}
.ct-alt a:hover{color:#202120}

/* the fold and the envelope run on a fixed layer in viewport coordinates (above the header on the page, inside the popover) */
.ct-layer{position:fixed;inset:0;z-index:150;pointer-events:none}
dialog.ctp .ct-layer{z-index:7}
/* the fold: three slices of a still copy of the letter */
.ct-fold{position:absolute;z-index:3;transform-origin:0 0;transform-style:preserve-3d;perspective:1600px;pointer-events:none}
.ct-p{position:absolute;left:0;width:100%;transform-style:preserve-3d}
.ct-face,.ct-back{position:absolute;inset:0;overflow:hidden;backface-visibility:hidden;-webkit-backface-visibility:hidden}
.ct-back{transform:rotateX(180deg);background:#efeee9;box-shadow:inset 0 0 0 1px rgb(30 25 15 / .05)}
.ct-face .ct-letter{position:absolute;left:0;box-shadow:none;border-radius:0}
.ct-p:nth-child(1) .ct-face{border-radius:3px 3px 0 0}.ct-p:nth-child(3) .ct-face{border-radius:0 0 3px 3px}
.ct-fold.folded{filter:drop-shadow(0 10px 18px rgb(30 25 15 / .18))}

/* the envelope: back, flap and pocket are siblings of the fold so the letter can sit between them */
.ct-env{position:absolute;z-index:1;pointer-events:none;border-radius:4px}
.ct-env.bk{background:linear-gradient(#141518,#1b1c20);box-shadow:0 30px 50px -24px rgb(0 0 0 / .35)}
.ct-env.fr{z-index:4}
.ct-env svg{display:block;width:100%;height:100%;overflow:visible}
/* the flap starts shut (in front of everything) and is flipped open about the top edge by contact.js */
.ct-env.fl{z-index:6;transform-origin:50% 0}
/* where the envelope lands: a soft box round the ZeroERP mark */
.ctp-ring{position:fixed;z-index:120;border-radius:10px;background:rgb(32 33 32 / .07);box-shadow:inset 0 0 0 1px rgb(32 33 32 / .12);pointer-events:none}

/* after sending */
.ctp-toast{position:fixed;z-index:200;left:50%;bottom:24px;translate:-50% 0;display:flex;align-items:center;gap:12px;max-width:calc(100vw - 32px);box-sizing:border-box;
  padding:12px 12px 12px 18px;border-radius:14px;background:#202120;color:#fff;font:400 14px/1.45 Lausanne,Arial,sans-serif;box-shadow:0 18px 40px -16px rgb(0 0 0 / .45)}
.ctp-toast a{color:#fff;text-decoration:underline;text-decoration-color:rgb(255 255 255 / .4);text-underline-offset:3px}
.ctp-toast button{all:unset;flex:none;width:28px;height:28px;display:grid;place-items:center;border-radius:8px;cursor:pointer;color:rgb(255 255 255 / .7)}
.ctp-toast button:hover{color:#fff;background:rgb(255 255 255 / .1)}
.ctp-toast button:focus-visible{outline:2px solid #fff;outline-offset:1px}
.ctp-toast svg{width:12px;height:12px}

/* ---- the book-a-demo page (tools/build_pages.py demo_page): copy and topic chips on the left, the letter on the right ---- */
.ct{display:grid;grid-template-columns:minmax(0,.9fr) minmax(0,1fr);gap:72px;align-items:start;padding:88px 0 136px}
.ct-intro{padding-top:24px}
.ct-intro h1{max-width:12em}
.ct-intro .lede{margin-top:24px}
.ct-k{margin:40px 0 12px;font:500 12px/1 Lausanne,Arial,sans-serif;letter-spacing:1.2px;text-transform:uppercase;color:#8d8d8d}
.ct-chips{display:flex;flex-wrap:wrap;gap:8px}
.ct-chip{all:unset;box-sizing:border-box;height:34px;padding:0 14px;display:inline-flex;align-items:center;border-radius:999px;cursor:pointer;
  font:400 14px/1 Lausanne,Arial,sans-serif;color:#505050;background:#f6f6f5;box-shadow:inset 0 0 0 1px rgb(32 33 32 / .06);transition:background .15s,color .15s,box-shadow .15s}
.ct-chip:hover{color:#202120;background:#efefee}
.ct-chip[aria-pressed=true]{color:#fff;background:#202120;box-shadow:none}
.ct-chip:focus-visible{outline:2px solid #2670e0;outline-offset:2px}
.ct-list{margin:36px 0 0;padding:0;list-style:none;display:grid;gap:12px;font:300 16px/1.5 Lausanne,Arial,sans-serif;color:#5d6068}
.ct-list li{display:flex;gap:12px}.ct-list li::before{content:'';flex:none;width:6px;height:6px;margin-top:9px;border-radius:50%;background:var(--ink,#2670e0)}
.ct-page .ct-stage{position:relative;min-height:680px}
.ct-page .ct-form{max-width:440px;margin:0 auto;transition:opacity .35s ease}
.ct-page .ct-letter{height:560px}
.ct-done{position:absolute;inset:0;display:grid;place-items:center;text-align:center;padding:24px}
.ct-done[hidden]{display:none}
.ct-done h2{font:300 40px/1.1 ModeratSerif,Georgia,serif;letter-spacing:-.6px;color:#2a2c31;outline:0}
.ct-done-p{margin:16px auto 0;max-width:24em;font:300 17px/1.55 Lausanne,Arial,sans-serif;color:#757575;text-wrap:pretty}
.ct-done-p a{color:#202120;text-decoration:underline;text-decoration-color:rgb(32 33 32 / .25);text-underline-offset:3px}
.ct-done .b{margin-top:28px}
@media (max-width:900px){.ct{grid-template-columns:1fr;gap:48px;padding:56px 0 96px}.ct-intro{padding-top:0}.ct-k{margin-top:32px}}
@media (max-width:480px){.ct-page .ct-letter{height:480px}.ct-page .ct-stage{min-height:600px}}

@media (max-width:480px){.ct-letter{padding:30px 22px 22px}.ct-letter .ct-subj{font-size:18px}.ct-letter .ct-msg{font-size:15px}.ctp-x{top:12px;right:12px}}
