/* The sprite changes poses on discrete frames. Moving its wrapper leaves the face crisp. */
.otter-body, .otter-face { display: block; position: absolute; inset: 0; }
.otter-body { transform-origin: 50% 92%; }
.sprite.otter-face {
  background-image: url('assets/otter-poses.webp');
  animation: otter-blink 5.6s steps(1,end) infinite;
}
@keyframes otter-blink {
  0%, 88%, 97%, 100% { background-position: 0% 0%; }
  90%, 95% { background-position: 33.3333% 0%; }
  92% { background-position: 66.6667% 0%; }
}
.pet-button.is-waving .otter-face { animation: otter-wave 1.05s steps(1,end) 1; }
.pet-button.is-waving .otter-body { animation: otter-lean 1.05s ease-in-out 1; }
@keyframes otter-wave {
  0%, 85% { background-position: 0% 100%; }
  17%, 55% { background-position: 33.3333% 100%; }
  36%, 72% { background-position: 66.6667% 100%; }
  100% { background-position: 0 0; }
}
@keyframes otter-lean { 22% { transform: rotate(-5deg); } 57% { transform: rotate(2deg); } }
/* Ripples run behind the character and its reflection. */
.otter-pond { position: relative; width: min(260px,100%); height: 160px; margin: 12px auto 16px; isolation: isolate; }
.otter-pond .pet-button { position: absolute; width: 136px; height: 136px; left: calc(50% - 68px); bottom: 16px; animation: otter-float 4.8s ease-in-out infinite; }
.pond-water { position: absolute; inset: auto 3% 2px; height: 36px; border-radius: 50%; background: radial-gradient(ellipse,#d5ded2 10%,#e3e8db 56%,transparent 72%); }
.pond-water::before,.pond-water::after { content: ''; position: absolute; inset: 13% 12%; border: 1px solid #99af9e; border-radius: 50%; animation: water-ring 4.8s ease-out infinite; }
.pond-water::after { animation-delay: -2.4s; }
@keyframes water-ring { 0% { transform:scale(.64); opacity:0; } 25% { opacity:.6; } 100% { transform:scale(1.26);opacity:0; } }
@keyframes otter-float { 50% { transform: translateY(-3px) rotate(-1.2deg); } }
/* A single visual beat marks a new reveal. The replies remain readable throughout. */
.letter-heading { display:flex; align-items:center; gap:13px; min-height:82px; margin:10px 0 8px; }
.letter-heading .badge { margin:0; }
.otter-mail { width:84px; height:83px; flex:none; position:relative; isolation:isolate; }
.otter-mail .pet-button { position:absolute; width:67px; height:67px; left:8px; top:1px; }
.envelope-back,.envelope-front { position:absolute; bottom:3px; left:7px; width:71px; height:35px; border-radius:3px 3px 8px 8px; pointer-events:none; }
.envelope-back { background:#d6ac99; transform:rotate(-5deg); }
.envelope-front { background:linear-gradient(31deg, transparent 48%,#d9b5a1 49%,transparent 51%) left bottom/52% 100% no-repeat,linear-gradient(-31deg,transparent 48%,#d9b5a1 49%,transparent 51%) right bottom/52% 100% no-repeat,#f2decb; transform:rotate(-5deg); border:1px solid #dcbda9; display:grid;place-items:center; }
.envelope-front .icon { width:12px;height:12px;fill:#b96756;stroke:#b96756; }
.new-reveal .otter-mail .pet-button { animation:otter-peek .7s cubic-bezier(.16,.75,.25,1) both; }
.new-reveal .reveal-card { animation:reply-arrive .45s ease-out both; }
.new-reveal .reveal-card + .reveal-card { animation-delay:90ms; }
@keyframes otter-peek { from { transform:translateY(18px) rotate(5deg) scale(.8); } 68% { transform:translateY(-3px) rotate(-3deg); } }
@keyframes reply-arrive { from { transform:translateY(7px); } }
@media(prefers-reduced-motion:reduce) {
  .sprite.otter-face, .otter-body, .otter-pond *, .pond-water::before, .pond-water::after, .new-reveal .pet-button, .new-reveal .reveal-card { animation:none!important; }
  .pet-button.is-waving .otter-face { background-position:66.6667% 100%; }
}
.card-kicker { display:flex;justify-content:space-between;align-items:center;min-height:54px; }
.card-kicker .pet-button { width:54px;height:54px; }
.card-kicker .badge { margin:0; }
.card-kicker ~ .answers,.card-kicker ~ form { margin-top:23px; }
.answer { transition:background-color .15s,border-color .15s; }
.answer.selected .radio { animation:choice-settle .2s ease-out; }
@keyframes choice-settle { 0% { transform:scale(.8); } 70% { transform:scale(1.1); } }
