/* Fling note stack - the pile, the notes and the reset sticker underneath. Motion lives in part.js. */
.fns {
  --fns-w: 620px;                 /* note width cap (desktop; 480px at <= 1024px) */
  --fns-gutter: 16px;             /* page margin: notes are at most 100vw - 4 x gutter wide */
  --fns-paper: #eedfca;           /* note base under the colour wash */
  --fns-wash-alpha: .8;           /* wash opacity over the paper */
  --fns-ink: #352207;
  --fns-pad: 32px 32px 64px;      /* 24px 24px 48px at <= 1024px */
  --fns-quote-size: 32px;         /* 20px at <= 1024px */
  --fns-indent: 2.5rem;           /* first-line indent (1.5rem at <= 1024px) */
  --fns-font: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fns-shadow: 0 1px 0 rgba(0, 0, 0, .04);
  --fns-shadow-held: 0 18px 40px -14px rgba(40, 20, 0, .35);
  --fns-reset-w: 220px;           /* 160px at <= 1024px */
  --fns-reset-dur: 300ms;
  --fns-reset-ease: cubic-bezier(.34, 1.56, .64, 1);
  position: relative;
  display: grid;
  place-items: center;
  overflow: clip;                 /* thrown notes leave through the section edge */
}
@media (max-width: 1024px) {
  .fns { --fns-w: 480px; --fns-pad: 24px 24px 48px; --fns-quote-size: 20px; --fns-indent: 1.5rem; --fns-reset-w: 160px; }
}

.fns__pile {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: var(--fns-w);
  pointer-events: none;
}
.fns__note {
  grid-area: 1 / 1;
  position: relative;
  width: min(var(--fns-w), calc(100vw - 4 * var(--fns-gutter)));
  box-sizing: border-box;
  padding: var(--fns-pad);
  background: var(--fns-paper);
  color: var(--fns-ink);
  font-family: var(--fns-font);
  box-shadow: var(--fns-shadow);
  transform-origin: 50% 50%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
  cursor: grab;
  will-change: transform;
  transition: box-shadow .2s ease-out;
}
.fns__note::before {             /* the colour wash: --fns-wash at 80% over the paper */
  content: "";
  position: absolute;
  inset: 0;
  background: var(--fns-wash, transparent);
  opacity: var(--fns-wash-alpha);
  pointer-events: none;
}
.fns__note > * { position: relative; }
.fns__note.is-top { pointer-events: auto; }
.fns__note.is-held { cursor: grabbing; box-shadow: var(--fns-shadow-held); }
.fns__note.is-gone { opacity: 0; pointer-events: none; visibility: hidden; }
.fns__note:focus-visible { outline: 2px solid var(--fns-ink); outline-offset: 4px; }

.fns__who {
  margin: 0 0 2rem;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.fns__quote {
  margin: 0;
  font-size: var(--fns-quote-size);
  line-height: 1.3;
  text-indent: var(--fns-indent);
  text-wrap: pretty;
}

.fns__reset {                    /* sits under the pile; live once at least one note is gone */
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 0;
  width: var(--fns-reset-w);
  margin: calc(var(--fns-reset-w) / -2) 0 0 calc(var(--fns-reset-w) / -2);
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  transition: transform var(--fns-reset-dur) var(--fns-reset-ease);
}
.fns__reset > * { display: block; width: 100%; height: auto; }
.fns__reset:hover, .fns__reset:focus-visible { transform: scale(1.1); }
.fns__reset:active { transform: scale(.95); }
.fns__reset:focus-visible { outline: 2px solid var(--fns-ink); outline-offset: 6px; border-radius: 50%; }
.fns__reset:disabled { cursor: default; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .fns__reset { transition: none; }
}
