:root {
  --paper: #fffaf3;
  --ink: #3a1d2a;
  --ink-soft: #7a5363;
  --cherry: #d93f5b;
  --blush: #f6c6d0;
  --cheek: #f5a3b5;
  --fur: #a9a4ab;
  --fur-light: #d8d4d9;
  --gingham: rgba(232, 120, 150, 0.16);
  --cat: 170px;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  font-family: var(--serif);
  color: var(--ink);
  background-color: #fff3f5;
  background-image:
    linear-gradient(90deg, var(--gingham) 50%, transparent 50%),
    linear-gradient(var(--gingham) 50%, transparent 50%);
  background-size: 44px 44px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background: var(--blush);
}

/* ---------- layout ---------- */

.scene {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px 16px 48px;
}

.stage {
  position: relative;
  width: min(440px, 100%);
  margin-top: calc(var(--cat) * 0.55 + 8px);
  transform: rotate(-1.2deg);
}

/* ---------- card ---------- */

.card {
  position: relative;
  z-index: 1;
  padding: 52px 32px 34px;
  text-align: center;
  background: var(--paper);
  border-radius: 4px;
  outline: 1.5px dashed #efb3c0;
  outline-offset: -12px;
  box-shadow:
    0 1px 0 rgba(58, 29, 42, 0.05),
    0 2px 6px rgba(120, 40, 70, 0.08),
    0 24px 48px -20px rgba(120, 40, 70, 0.4);
}

/* washi tape */
.card::before,
.card::after {
  content: "";
  position: absolute;
  top: 10px;
  width: 92px;
  height: 26px;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.45) 0 5px, transparent 5px 10px),
    rgba(240, 150, 175, 0.62);
  clip-path: polygon(0 12%, 4% 0, 96% 0, 100% 14%, 97% 50%, 100% 86%, 96% 100%, 4% 100%, 0 88%, 3% 50%);
}

.card::before {
  left: -26px;
  transform: rotate(-38deg);
}

.card::after {
  right: -26px;
  transform: rotate(36deg);
  background:
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.45) 0 5px, transparent 5px 10px),
    rgba(240, 150, 175, 0.62);
}

/* ---------- type ---------- */

.note {
  margin: 0 0 0.35rem;
  font-family: var(--hand);
  font-weight: 700;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--cherry);
  transform: rotate(-3deg);
}

h1 {
  margin: 0;
  font-size: clamp(2.25rem, 9vw, 3.4rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.02em;
  font-variation-settings: "SOFT" 100, "opsz" 144;
  text-wrap: balance;
}

.catty {
  position: relative;
  display: inline-block;
  font-style: italic;
  font-weight: 500;
  color: var(--cherry);
  white-space: nowrap;
}

.squiggle {
  position: absolute;
  left: -2%;
  bottom: -0.16em;
  width: 104%;
  height: 0.28em;
  overflow: visible;
}

.squiggle path {
  fill: none;
  stroke: var(--cherry);
  stroke-width: 3;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 140;
  stroke-dashoffset: 140;
  animation: draw 0.9s 0.35s ease-out forwards;
}

.sub {
  margin: 1.1rem 0 0;
  font-size: 1.05rem;
  color: var(--ink-soft);
  font-variation-settings: "SOFT" 100;
}

.sub span {
  font-style: italic;
}

.ps {
  margin: 1.6rem 0 0;
  font-family: var(--hand);
  font-weight: 500;
  font-size: 1.35rem;
  color: var(--ink-soft);
}

/* ---------- buttons ---------- */

.actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  margin-top: 1.7rem;
}

.btn {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
  font-variation-settings: "SOFT" 100;
  line-height: 1;
  padding: 0.85em 1.9em;
  border: 2px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  touch-action: manipulation;
}

.btn:focus-visible {
  outline: 3px dashed var(--cherry);
  outline-offset: 4px;
}

.btn-yes {
  --grow: 1;
  color: #fff;
  background: var(--cherry);
  box-shadow: 0 4px 0 var(--ink);
  transform: scale(var(--grow));
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.15s ease;
}

.btn-yes:hover {
  transform: translateY(-2px) scale(var(--grow));
  box-shadow: 0 6px 0 var(--ink);
}

.btn-yes:active {
  transform: translateY(2px) scale(var(--grow));
  box-shadow: 0 2px 0 var(--ink);
}

.btn-no {
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 4px 0 var(--ink);
}

.btn-no.is-loose {
  position: fixed;
  z-index: 50;
  margin: 0;
  transition:
    left 0.45s cubic-bezier(0.34, 1.4, 0.64, 1),
    top 0.45s cubic-bezier(0.34, 1.4, 0.64, 1),
    transform 0.45s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.btn-placeholder {
  display: inline-block;
}

/* ---------- cat ---------- */

.cat-head,
.cat-paws {
  position: absolute;
  left: 50%;
  translate: -50% 0;
  width: var(--cat);
  overflow: visible;
  pointer-events: none;
}

.cat-head {
  z-index: 0;
  bottom: calc(100% - var(--cat) * 0.15);
  animation: bob 3.2s ease-in-out infinite;
}

.cat-paws {
  z-index: 2;
  top: calc(var(--cat) * -0.085);
}

.cat-fill {
  fill: var(--fur);
  stroke: var(--ink);
  stroke-width: 3.5;
  stroke-linejoin: round;
}

.cat-muzzle {
  fill: var(--fur-light);
}

.cat-inner-ear {
  fill: var(--blush);
}

.cat-eye {
  fill: var(--ink);
}

.cat-cheek {
  fill: var(--cheek);
  opacity: 0.6;
  transition: opacity 0.3s;
}

.cat-nose {
  fill: #ee8aa0;
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-linejoin: round;
}

.cat-line,
.happy-eye {
  fill: none;
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linecap: round;
}

.cat-line.thin {
  stroke-width: 2.2;
}

.blink {
  transform-box: fill-box;
  transform-origin: center;
  animation: blink 4.6s infinite;
}

.happy-eye {
  display: none;
}

.is-happy .eye {
  display: none;
}

.is-happy .happy-eye {
  display: inline;
}

.is-happy .cat-cheek {
  opacity: 1;
}

.is-happy .cat-head {
  animation: hop 0.5s cubic-bezier(0.3, 0, 0.4, 1) 2, bob 3.2s 1s ease-in-out infinite;
}

/* ---------- answer ---------- */

.answer {
  animation: rise 0.5s ease both;
}

.stamp {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.5em 0.9em;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cherry);
  border: 2.5px solid var(--cherry);
  border-radius: 6px;
  box-shadow: inset 0 0 0 2px var(--paper), inset 0 0 0 3.5px var(--cherry);
  opacity: 0;
  animation: stamp 0.5s 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2) forwards;
}

/* ---------- confetti ---------- */

.confetti {
  position: fixed;
  inset: 0;
  z-index: 60;
  overflow: hidden;
  pointer-events: none;
}

.bit {
  position: absolute;
  top: -40px;
  width: var(--size);
  height: var(--size);
  animation: fall var(--dur) var(--delay) cubic-bezier(0.25, 0.6, 0.45, 1) both;
}

.bit svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
}

/* ---------- motion ---------- */

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

@keyframes blink {
  0%, 93%, 100% { transform: scaleY(1); }
  96% { transform: scaleY(0.1); }
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}

@keyframes hop {
  0%, 100% { transform: translateY(0); }
  45% { transform: translateY(-16px); }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes stamp {
  0% { opacity: 0; transform: rotate(-8deg) scale(2.2); }
  60% { opacity: 1; transform: rotate(-8deg) scale(0.94); }
  100% { opacity: 1; transform: rotate(-8deg) scale(1); }
}

@keyframes fall {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translate(var(--drift), calc(100vh + 80px)) rotate(var(--spin)); opacity: 0; }
}

/* ---------- small screens ---------- */

@media (max-width: 420px) {
  :root {
    --cat: 144px;
  }

  .card {
    padding: 46px 20px 28px;
  }

  .card::before,
  .card::after {
    width: 72px;
    height: 22px;
  }

  .btn {
    font-size: 1rem;
    padding: 0.85em 1.6em;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
