/* Recorte de la rama en la fotografía original. */
.azahar-flowers {
  background: url('/assets/images/papeleria-bosque.webp') center / 100% 100% no-repeat;
  mask-image: linear-gradient(90deg, #000 95%, transparent);
  clip-path: polygon(
    99.87% 13.51%, 99.55% 15.32%, 98.85% 18.57%, 97.45% 22.58%,
    95.67% 27.26%, 93.57% 32.80%, 93.06% 34.99%, 94.65% 32.60%,
    96.75% 29.74%, 100.00% 26.40%, 100.00% 28.88%, 97.84% 30.89%,
    95.23% 34.32%, 93.51% 36.52%, 92.49% 38.91%, 92.23% 41.77%,
    91.98% 45.69%, 92.55% 48.55%, 93.32% 49.03%, 94.02% 49.79%,
    94.46% 50.94%, 94.78% 52.47%, 95.48% 54.18%, 96.82% 56.86%,
    97.84% 58.19%, 98.98% 59.44%, 100.00% 61.35%, 100.00% 62.97%,
    98.79% 60.96%, 98.15% 60.10%, 96.75% 59.53%, 95.80% 59.15%,
    95.16% 59.34%, 94.78% 60.49%, 95.67% 60.68%, 96.12% 62.11%,
    95.93% 64.11%, 95.23% 65.55%, 94.40% 65.26%, 93.95% 64.02%,
    94.08% 62.59%, 94.27% 61.25%, 94.59% 59.82%, 94.40% 58.96%,
    93.32% 59.24%, 92.23% 61.15%, 90.52% 63.54%, 88.67% 65.64%,
    87.14% 67.17%, 85.68% 68.89%, 84.85% 70.13%, 84.91% 66.98%,
    85.30% 64.78%, 86.06% 62.59%, 87.01% 60.77%, 88.54% 59.05%,
    90.01% 58.00%, 91.47% 57.53%, 92.74% 57.43%, 93.63% 57.72%,
    94.84% 58.19%, 96.31% 58.58%, 96.94% 58.58%, 95.23% 55.14%,
    94.33% 53.13%, 93.44% 50.65%, 92.62% 49.89%, 92.11% 49.98%,
    91.92% 50.56%, 92.42% 52.18%, 92.62% 54.09%, 91.92% 55.52%,
    90.90% 55.90%, 90.26% 55.04%, 90.07% 53.61%, 90.13% 52.08%,
    90.26% 51.13%, 89.88% 51.13%, 89.69% 52.94%, 89.18% 54.18%,
    88.61% 56.48%, 87.78% 57.14%, 86.82% 56.48%, 86.82% 54.95%,
    87.20% 53.13%, 87.52% 51.89%, 86.19% 52.56%, 84.79% 52.85%,
    83.89% 52.27%, 83.64% 51.32%, 83.96% 50.17%, 84.91% 49.41%,
    86.31% 49.03%, 86.76% 48.74%, 85.93% 47.50%, 85.04% 46.55%,
    85.36% 45.59%, 86.44% 45.49%, 87.65% 46.07%, 88.61% 47.31%,
    89.31% 48.36%, 90.07% 48.36%, 90.83% 48.93%, 91.41% 48.84%,
    89.62% 47.88%, 87.71% 46.55%, 86.19% 44.92%, 85.49% 44.35%,
    84.79% 44.92%, 84.40% 45.97%, 83.45% 46.83%, 82.37% 47.31%,
    81.22% 46.74%, 80.71% 45.88%, 80.71% 45.02%, 81.16% 44.25%,
    82.56% 43.68%, 83.19% 43.68%, 83.00% 42.73%, 83.19% 41.39%,
    84.21% 40.91%, 84.91% 41.01%, 84.59% 40.53%, 83.64% 40.15%,
    82.37% 39.48%, 81.48% 38.43%, 80.97% 37.19%, 81.98% 36.71%,
    83.51% 36.61%, 84.85% 36.90%, 84.34% 35.18%, 84.66% 33.37%,
    85.30% 31.74%, 86.00% 30.69%, 86.70% 30.98%, 87.65% 32.41%,
    87.91% 34.23%, 87.71% 35.66%, 88.92% 34.51%, 90.13% 33.94%,
    91.02% 33.94%, 91.41% 34.61%, 91.09% 36.14%, 90.13% 38.24%,
    89.18% 39.10%, 89.37% 39.77%, 89.81% 40.82%, 89.69% 41.96%,
    89.62% 42.44%, 90.32% 41.96%, 90.52% 42.82%, 90.52% 43.97%,
    90.39% 44.44%, 90.45% 45.30%, 91.02% 47.12%, 91.79% 48.07%,
    91.41% 45.88%, 91.66% 43.97%, 91.85% 41.96%, 91.98% 39.48%,
    91.85% 37.76%, 91.28% 35.76%, 90.83% 34.32%, 90.13% 33.46%,
    89.24% 32.70%, 88.10% 31.36%, 87.01% 29.55%, 86.06% 27.45%,
    84.72% 24.01%, 85.93% 24.87%, 87.40% 25.73%, 88.73% 27.07%,
    89.94% 28.78%, 91.02% 30.79%, 91.72% 33.08%, 91.47% 30.22%,
    91.72% 26.97%, 92.30% 24.49%, 93.06% 21.43%, 94.33% 19.05%,
    95.93% 17.04%, 97.71% 15.13%
  );
}

#envelope-screen[data-sprig='bolsillo']:not(.has-webgl) .envelope-object::after,
#envelope-screen[data-sprig='lino']:not(.has-webgl) .envelope-stage::before,
.folded-blossom, .flight-blossom, .pressed-keepsake {
  content: '';
  position: absolute;
  width: 10%;
  aspect-ratio: .51;
  top: 7%;
  right: 4%;
  background: url('/assets/images/rama-azahar.webp') center / contain no-repeat;
  transform: rotate(-9deg);
  filter: drop-shadow(0 1px 1px #46361f55);
  pointer-events: none;
}
#envelope-screen[data-sprig='bolsillo'] .envelope-object::after {
  z-index: 5;
  top: 47%;
  right: 16%;
  width: 15%;
}
#envelope-screen[data-sprig='lino'] .envelope-stage::before {
  top: 40%;
  right: 11%;
  width: min(12%, 6rem);
  transform: rotate(27deg);
  transform-origin: 75% 85%;
}
.demo-letter .pressed-keepsake { width: clamp(1.7rem, 8%, 3.2rem); }
.flight-blossom { top: 0; left: 0; right: auto; z-index: 2; }
.has-webgl .folded-blossom, .letter-presenting .folded-blossom { visibility: hidden; }
@media (prefers-reduced-motion: no-preference) {
  #envelope-screen[data-sprig='lino'].opening:not(.has-webgl) .envelope-stage::before {
    animation: azahar-lino 1.3s ease-in-out both;
  }
}
@keyframes azahar-lino { 50% { transform: rotate(31deg); } }


/* Las ramas descansan en el lino, detrás de la escena y fuera del área táctil. */
.linen-blossoms {
  --wax-width: clamp(4.8rem, 13vmin, 10rem);
  --corner-top: max(4rem, 7%);
  --corner-right: 3%;
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.linen-blossoms::before, .linen-blossoms::after {
  content: '';
  position: absolute;
  background-repeat: no-repeat;
  filter: drop-shadow(1px 3px 2px #3e301b4d);
}
.linen-blossoms::before {
  top: calc(var(--corner-top) + var(--wax-width) * .77);
  right: calc(var(--corner-right) + var(--wax-width) * 1.16);
  width: calc(var(--wax-width) * .66);
  aspect-ratio: 204 / 202;
  background-image: url('/assets/images/azahar-abierta.webp');
  background-size: 100% auto;
  background-position: center 34.34%;
  /* El contorno sigue los dos pétalos inferiores y deja el tallo sobre la foto. */
  clip-path: polygon(0 0, 100% 0, 100% 100%, 79% 100%, 66% 94%, 54% 80%, 49% 71%, 46% 78%, 38% 86%, 25% 94%, 0 100%);
  transform: rotate(-18deg);
}
.linen-blossoms::after {
  top: var(--corner-top);
  right: var(--corner-right);
  width: var(--wax-width);
  aspect-ratio: .51;
  background-image: url('/assets/images/azahar-cera.webp');
  background-size: contain;
  transform: rotate(-151deg);
}
#envelope-screen:has(#letter-flight[data-cover-aligned].letter-readable) > .linen-blossoms { visibility: hidden; }
#guest-content > .pressed-keepsake {
  z-index: 1;
  top: clamp(1rem, 3.5svh, 2.4rem);
  width: clamp(1.7rem, 6vw, 3.2rem);
}
.app-guest:has(#envelope-screen[open] #letter-flight[data-cover-aligned].letter-readable) > #guest-content > .pressed-keepsake {
  opacity: 0;
}
