/* Paper airplanes on her page: the desk where one is written, folded and thrown (or where his unfolds), the airplane
   of his that lands in the corner, and the dotted trail behind a flying one. The folds are clip-path shapes with the
   same five corners, so each fold slides smoothly into the next; unfolding plays the same folds backwards. */
.plane-desk { position:fixed; inset:0; z-index:7; display:grid; place-items:center; overflow-y:auto; padding:24px 16px; background:rgba(53,28,43,.5); -webkit-backdrop-filter:blur(5px); backdrop-filter:blur(5px); opacity:0; transition:opacity .25s; }
.plane-desk[hidden] { display:none; }
.plane-desk.is-open { opacity:1; }
body.plane-desk-open { overflow:hidden; }
.plane-stage { display:grid; justify-items:center; gap:14px; width:100%; max-width:360px; }
.plane-desk-title { min-height:14px; margin:0; color:#fff1f6; font:500 11px "DM Mono",monospace; letter-spacing:.14em; text-transform:uppercase; }
.plane-carrier { touch-action:none; filter:drop-shadow(0 14px 18px rgba(38,20,29,.32)); }
.plane-carrier.snap-back { transition:transform .35s cubic-bezier(.34,1.56,.64,1); }
.plane-desk[data-state="ready"] .plane-carrier { cursor:grab; }
.plane-paper { position:relative; width:min(290px,80vw,44dvh); aspect-ratio:290 / 370; border-radius:2px; background:linear-gradient(90deg,transparent 38px,rgba(229,120,150,.5) 38px 39px,transparent 39px),repeating-linear-gradient(180deg,transparent 0 31px,#f2ccd8 31px 32px),#fffaf8; }
.plane-paper textarea,.plane-words { position:absolute; inset:40px 18px 18px 48px; width:auto; height:auto; min-height:0; margin:0; padding:0; overflow:hidden; border:0; border-radius:0; background:none; box-shadow:none; color:#5a2a40; font:italic 500 19px/32px "Playfair Display",serif; resize:none; outline:0; white-space:pre-wrap; overflow-wrap:anywhere; text-align:left; }
.plane-paper textarea::placeholder { color:#c99aab; }
.plane-paper textarea[hidden],.plane-words[hidden] { display:none; }
.plane-flap { position:absolute; inset:0; opacity:0; background:linear-gradient(160deg,#fde6ee,#f2bfd0); pointer-events:none; }
.plane-flap.is-left { clip-path:polygon(0 0,50% 0,0 39%); }
.plane-flap.is-right { clip-path:polygon(100% 0,50% 0,100% 39%); }
/* The folded airplane, seen from above: a soft crease down the middle, one wing a little darker than the other. */
.plane-paper::after,.plane-dart { background:linear-gradient(90deg,transparent calc(50% - .6px),rgba(170,70,105,.55) calc(50% - .6px) calc(50% + .6px),transparent calc(50% + .6px)),linear-gradient(90deg,#fdebf0 50%,#f3c1d1 50%); }
.plane-paper::after { content:""; position:absolute; inset:0; opacity:0; pointer-events:none; }

.plane-paper.is-folded { animation:plane-fold 1.1s ease-in-out forwards; }
.plane-paper.is-folded::after { animation:plane-shade 1.1s ease-in-out forwards; }
.plane-paper.is-folded .plane-flap.is-left { animation:plane-flap-left 1.1s ease-in-out forwards; }
.plane-paper.is-folded .plane-flap.is-right { animation:plane-flap-right 1.1s ease-in-out forwards; }
.plane-paper.is-folded :is(textarea,.plane-words) { animation:plane-ink 1.1s ease-in-out forwards; }
.plane-paper.is-unfolding { animation:plane-fold 1.1s ease-in-out reverse both; }
.plane-paper.is-unfolding::after { animation:plane-shade 1.1s ease-in-out reverse both; }
.plane-paper.is-unfolding .plane-flap.is-left { animation:plane-flap-left 1.1s ease-in-out reverse both; }
.plane-paper.is-unfolding .plane-flap.is-right { animation:plane-flap-right 1.1s ease-in-out reverse both; }
.plane-paper.is-unfolding :is(textarea,.plane-words) { animation:plane-ink 1.1s ease-in-out reverse both; }
.plane-paper.is-delayed,.plane-paper.is-delayed::after,.plane-paper.is-delayed :is(.plane-flap,textarea,.plane-words) { animation-delay:.45s; }
/* Corners to the middle, the long edges in again, then the wings down to a dart. */
@keyframes plane-fold {
  0% { clip-path:polygon(50% 0,100% 0,100% 100%,0 100%,0 0); transform:none; }
  35% { clip-path:polygon(50% 0,100% 39%,100% 100%,0 100%,0 39%); transform:none; }
  68% { clip-path:polygon(50% 0,80% 70%,64% 100%,36% 100%,20% 70%); transform:scale(.8); }
  100% { clip-path:polygon(50% 0,76% 100%,50% 88%,50% 88%,24% 100%); transform:scale(.34); }
}
@keyframes plane-flap-left {
  0% { opacity:0; clip-path:polygon(0 0,50% 0,0 39%); } 6% { opacity:1; }
  35% { opacity:1; clip-path:polygon(50% 39%,50% 0,0 39%); } 60%,100% { opacity:0; clip-path:polygon(50% 39%,50% 0,0 39%); }
}
@keyframes plane-flap-right {
  0% { opacity:0; clip-path:polygon(100% 0,50% 0,100% 39%); } 6% { opacity:1; }
  35% { opacity:1; clip-path:polygon(50% 39%,50% 0,100% 39%); } 60%,100% { opacity:0; clip-path:polygon(50% 39%,50% 0,100% 39%); }
}
@keyframes plane-shade { 0%,40% { opacity:0; } 75%,100% { opacity:1; } }
@keyframes plane-ink { 0% { opacity:1; } 25%,100% { opacity:0; } }

.plane-hint { min-height:18px; margin:0; color:#fde3ec; font-size:13px; text-align:center; }
.plane-actions { display:flex; align-items:center; justify-content:center; gap:18px; min-height:46px; }
.plane-actions button[hidden] { display:none; }
.plane-actions .primary-btn:disabled { opacity:.55; cursor:default; transform:none; }
.plane-actions .text-btn { color:#fde3ec; }
.plane-desk:is([data-state="folding"],[data-state="unfolding"]) .plane-actions,.plane-desk[data-state="flying"] :is(.plane-desk-title,.plane-hint,.plane-actions) { visibility:hidden; }

/* His airplane, landed in the corner: it bobs a little, and tapping it opens the desk to unfold it. */
.plane-landed { position:fixed; right:max(14px,env(safe-area-inset-right)); bottom:max(16px,env(safe-area-inset-bottom)); z-index:4; width:118px; height:92px; padding:0; border:0; background:none; cursor:pointer; -webkit-tap-highlight-color:transparent; }
.plane-landed[hidden] { display:none; }
.plane-float { position:absolute; left:24px; top:2px; width:70px; filter:drop-shadow(0 7px 6px rgba(92,44,67,.28)); }
.plane-dart { display:block; width:70px; aspect-ratio:290 / 370; clip-path:polygon(50% 0,76% 100%,50% 88%,50% 88%,24% 100%); }
.plane-landed.is-resting .plane-float { animation:plane-bob 2.8s ease-in-out infinite; }
@keyframes plane-bob { 0%,100% { transform:translateY(0); } 50% { transform:translateY(-6px); } }
.plane-landed-note { position:absolute; left:50%; bottom:0; padding:5px 11px; border:1px solid #edc9d6; border-radius:999px; background:#fff; color:#a3305a; font-size:12px; font-weight:600; white-space:nowrap; opacity:0; transform:translate(-50%,6px); transition:opacity .3s,transform .3s; }
.plane-landed.is-resting .plane-landed-note { opacity:1; transform:translate(-50%,0); }
.plane-landed-count { position:absolute; top:4px; right:6px; min-width:24px; height:20px; padding:0 6px; border-radius:999px; background:#d7537c; color:#fff; font:700 11px/20px "Plus Jakarta Sans",sans-serif; }
.plane-landed-count[hidden] { display:none; }
.plane-landed:focus-visible { outline:2px solid #d97898; outline-offset:2px; border-radius:16px; }

.plane-trail { position:fixed; z-index:8; width:5px; height:5px; margin:-2.5px 0 0 -2.5px; border-radius:50%; background:#f29bb7; pointer-events:none; animation:plane-trail .9s ease-out forwards; }
@keyframes plane-trail { from { opacity:.9; } to { opacity:0; transform:scale(.3); } }

[data-theme="night"] .plane-landed-note { border-color:#4a3346; background:#21162a; color:#f29bb7; }
[data-theme="night"] .plane-trail { background:#f6c1d3; }
@media (prefers-reduced-motion:reduce) {
  .plane-desk { transition:none; }
  .plane-paper,.plane-paper::after,.plane-paper :is(.plane-flap,textarea,.plane-words) { animation-duration:1ms !important; animation-delay:0s !important; }
  .plane-landed.is-resting .plane-float { animation:none; }
  .plane-landed-note,.plane-carrier.snap-back { transition:none; }
}
