/* Fixed clip and HTML motion keep Zen from rerasterizing an animated SVG group.
   The chevron is an immutable SVG mask; only its containing layer moves. */
.hero-actions .cta-arrow {
  position: relative;
  display: inline-block;
  width: 16px;
  height: 8px;
  flex: 0 0 16px;
  margin: 0 0 0 8px;
  vertical-align: -1px;
}
.cta-arrow .arrow-clip {
  position: absolute;
  top: -0.5px;
  left: 0;
  width: 12px;
  height: 9px;
  margin: 0;
  overflow: hidden;
}
.cta-arrow .arrow-group {
  position: absolute;
  inset: 0;
  width: 12px;
  height: 9px;
  margin: 0;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  transition: transform 300ms cubic-bezier(.25,1,.5,1);
}
.cta-arrow .arrow-shaft {
  position: absolute;
  top: 3.375px;
  left: -10px;
  width: 13px;
  height: 1.75px;
  margin: 0;
  background: currentColor;
  opacity: 0;
  will-change: opacity;
  transition: opacity 300ms cubic-bezier(.25,1,.5,1);
}
.cta-arrow .arrow-head {
  position: absolute;
  inset: 0;
  width: 12px;
  height: 9px;
  margin: 0;
  background: currentColor;
  /* Inline SVG keeps the standalone file:// preview usable too. */
  mask: url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%229%22%20viewBox%3D%220%200%2012%209%22%3E%0A%20%20%3Cpath%20d%3D%22M4.84766%203.63379L5.45898%204.25L4.84766%204.86621L1.24219%208.49902L0%207.2666L2.99316%204.24902L0%201.23242L1.24219%200L4.84766%203.63379Z%22%2F%3E%0A%3C%2Fsvg%3E') 0 0 / 12px 9px no-repeat;
  mask-mode: alpha;
}
a:is(:hover, :focus-visible) .arrow-group { transform: translate3d(6px, 0, 0); }
a:is(:hover, :focus-visible) .arrow-shaft { opacity: 1; }

.sticky-note.paper-ready {
  width: 56px;
  height: 56px;
  min-height: 0;
  right: auto;
  padding: 0;
  display: block;
  background: none;
  border-radius: 0;
  box-shadow: none;
  clip-path: none;
  transform: none;
  scale: 1;
  animation: none;
  transition: none;
  cursor: grab;
  touch-action: none;
}
.sticky-note.paper-ready > b,
.sticky-note.paper-ready > span,
.sticky-note.paper-ready::before,
.sticky-note.paper-ready::after { display: none; }
.paper-drawing { display: block; width: 100%; height: 100%; overflow: visible; }
.paper-ready .paper-drawing { filter: drop-shadow(1px 4px 2px rgb(42 37 30 / 14%)); }
.paper-ready:hover .paper-drawing { filter: drop-shadow(1px 5px 3px rgb(42 37 30 / 20%)); }
.sticky-note.ball-in-play { opacity: 0; cursor: grabbing; }
.sticky-note.paper-discarded { visibility: hidden; pointer-events: none; }

.paper-game { position: fixed; inset: 0; z-index: 100; pointer-events: none; isolation: isolate; contain: layout style; }
.flying-paper {
  position: absolute;
  left: 0;
  top: 0;
  width: 56px;
  height: 56px;
  z-index: 4;
  will-change: transform;
}
/* Caught paper is reparented into the bin, before its artwork, so it sinks behind it. */
.flying-paper.is-caught { z-index: auto; }
/* Own layer: spin is composited instead of re-rasterizing the drawing each frame. */
.flying-paper .paper-drawing { filter: none; will-change: transform; }
.game-guide { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; opacity: 0; }
.game-guide.is-visible { opacity: 1; }
.game-tether { position: absolute; left: 0; top: 0; width: 1px; height: 1.5px; background: #ae2448; opacity: .25; transform-origin: 0 50%; }
.game-origin { position: absolute; left: 0; top: 0; width: 8px; height: 8px; border-radius: 50%; background: #ae2448; opacity: .4; }
.flying-paper, .bin-puff, .game-confetti, .game-bin { contain: layout style; }

.game-bin {
  position: absolute;
  left: max(18px, env(safe-area-inset-left));
  bottom: max(18px, env(safe-area-inset-bottom));
  width: 150px;
  height: 160px;
  z-index: 3;
  visibility: hidden;
  will-change: transform;
}
.game-bin.is-visible { visibility: visible; }
.bin-art { position: absolute; inset: 0; transform-origin: 50% 100%; }
.is-visible .bin-art { animation: bin-arrive 550ms cubic-bezier(.16,1,.3,1) both; }
.bin-drawing { display: block; width: 150px; height: 160px; overflow: visible; }
.bin-label {
  position: absolute;
  bottom: calc(100% + 2px);
  left: 10px;
  width: 130px;
  text-align: center;
  color: #48584d;
  font: 600 27px/1.1 Caveat, cursive;
  transform: rotate(-6deg);
}
.bin-lid { transform-origin: 22px 50px; transition: transform 180ms cubic-bezier(.2,.7,.3,1); }
.is-open .bin-lid { transform: translateY(-6px) rotate(-42deg); }
.is-open .bin-label { opacity: 0; }
.game-bin.is-celebrating .bin-art { animation: bin-chomp 400ms ease-out; }
.bin-puff { position: absolute; width: 52px; height: 44px; z-index: 5; pointer-events: none; }
.game-confetti { position: absolute; left: 0; top: 0; width: 7px; height: 11px; z-index: 6; pointer-events: none; }
.note-invitation {
  position: absolute;
  top: -60px;
  left: 0;
  right: 0;
  min-height: 48px;
  padding-inline: 8px;
  color: #48584d;
  font: 600 26px/1.2 Caveat, cursive;
  transform: rotate(-3deg);
  pointer-events: none;
  user-select: none;
}
.game-done {
  width: min(calc(100% - 32px), 420px);
  padding: 28px 28px 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.game-done::backdrop { background: rgb(21 23 25 / 45%); }
.game-done h2 { margin: 0 0 10px; font: 600 34px/1.1 Caveat, cursive; color: var(--red); }
.game-done p { margin: 0 0 22px; font-size: 16px; line-height: 1.6; }
.game-done form { display: flex; flex-direction: column; }
.game-done button {
  align-self: flex-end;
  min-height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 5px;
  background: var(--red);
  color: #fff;
  font: 500 15px/1 Rubik, sans-serif;
  cursor: pointer;
}
.game-done button:hover { background: var(--red-dark); }
.game-done button:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
.note-invitation .invite-accent { color: var(--red); }
.game-status { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@keyframes bin-arrive {
  from { opacity: 0; transform: translate(-25px, 60px) rotate(-12deg); }
  to { opacity: 1; transform: translate(0, 0) rotate(0); }
}
@keyframes bin-chomp {
  0% { transform: scale(1); }
  40% { transform: scale(1.06, .93) rotate(-2deg); }
  75% { transform: scale(.98, 1.02) rotate(1deg); }
  100% { transform: scale(1); }
}
@media (max-width: 560px) {
  /* Leave room for the scattered notes' rotation without sideways scrolling. */
  .hero-notes { width: calc(100% - 32px); justify-self: center; }
}
@media (prefers-reduced-motion: reduce) {
  .arrow-group, .arrow-shaft, .bin-lid { transition: none; }
  .arrow-group, .arrow-shaft { will-change: auto; }
  .is-visible .bin-art, .game-bin.is-celebrating .bin-art { animation: none; }
}
/* The notes are charming at rest, but extra composited layers steal budget
   from the actual game on inexpensive phones. */
html.paper-game-active .sticky-note:not(.paper-ready) { animation-play-state: paused; }
