/* La busta con il sigillo d'edera: comune a tutte le versioni.
   Richiede le variabili --notte, --avorio, --avorio-soft, --oro, --carta, --inchiostro, --soft, --display, --testo, --ease
   definite dalla pagina che la usa. */
/* ============================================================
   LA BUSTA · prima di entrare
   ============================================================ */
html.busta-chiusa, html.busta-chiusa body { overflow: hidden; }
.busta-scena {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; align-content: center; gap: 2rem;
  background: radial-gradient(ellipse at 50% 40%, #1c3027 0%, var(--notte) 70%); color: var(--avorio);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
}
.busta-scena.is-gone { opacity: 0; transform: scale(1.03); pointer-events: none; }
.busta-scena.is-zooming { transition: opacity .9s var(--ease) .3s; opacity: 0; }
.busta-sopra { font-style: italic; color: var(--oro); font-size: clamp(1.15rem, 1.8vw, 1.5rem); letter-spacing: .02em; }
.busta-sotto { font-size: .9rem; letter-spacing: .18em; text-transform: uppercase; color: var(--avorio-soft); transition: opacity .4s; }
.busta-salta { position: absolute; right: 1.5rem; bottom: 1.5rem; color: var(--avorio-soft); font-style: italic; font-size: .95rem; text-decoration: underline; text-underline-offset: .25em; padding: .5rem; }
.busta {
  position: relative; width: min(86vw, 560px); aspect-ratio: 3 / 2; perspective: 1400px; cursor: pointer;
  filter: drop-shadow(0 30px 50px rgba(0,0,0,.45));
  transition: transform .5s var(--ease);
}
.busta:hover { transform: translateY(-4px); }
.busta:focus-visible { outline: 2px solid var(--oro); outline-offset: 10px; }
.busta > span { position: absolute; display: block; }
.busta-corpo { inset: 0; background: #ece6d8; }
.busta-tasca, .busta-lembo, .busta-corpo { background-blend-mode: multiply; }
.busta-lembo::before { content: ""; position: absolute; inset: 0; clip-path: polygon(0 0, 100% 0, 50% 100%); background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .4 0 0 0 0 .37 0 0 0 0 .3 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.busta .busta-carta {
  left: 5%; right: 5%; top: 6%; height: 94%; background: var(--carta); display: grid; align-content: center; justify-items: center; gap: .6rem; text-align: center;
  color: var(--inchiostro); padding: 1.5rem; transform: translateY(0); transition: transform 1.2s var(--ease) .1s;
  box-shadow: 0 4px 18px rgba(0,0,0,.12);
}
.busta .busta-carta-nomi { display: block; font-family: var(--display); font-size: clamp(1.8rem, 5vw, 3rem); line-height: 1; }
.busta-carta-nomi i { font-style: normal; color: var(--oro); font-size: .6em; padding: 0 .1em; }
.busta .busta-carta-riga { display: block; font-style: italic; color: var(--soft); font-size: clamp(.95rem, 2vw, 1.1rem); }
.busta-tasca {
  inset: 0; background: linear-gradient(170deg, #efe9dc 0%, #e4ddcd 100%);
  clip-path: polygon(0 0, 50% 52%, 100% 0, 100% 100%, 0 100%);
}
.busta-tasca::after { content: ""; position: absolute; inset: 0; clip-path: polygon(0 100%, 50% 52%, 100% 100%); background: rgba(27,42,34,.05); }
.busta-lembo {
  left: 0; right: 0; top: 0; height: 55%; background: linear-gradient(180deg, #f4efe4 0%, #e9e3d5 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%); transform-origin: top center; transform: rotateX(0deg);
  transition: transform 1s var(--ease); backface-visibility: hidden; z-index: 3;
}
.busta-lembo::after { content: ""; position: absolute; inset: 0; background: rgba(27,42,34,.06); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.sigillo {
  left: 50%; top: 55%; width: clamp(78px, 19%, 118px); aspect-ratio: 1; transform: translate(-50%, -50%); z-index: 4;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,.35)); transition: transform .6s var(--ease), opacity .5s var(--ease);
}
.sigillo svg { width: 100%; height: 100%; }
@media (prefers-reduced-motion: no-preference) {
  .busta:not(.is-opening) .sigillo { animation: sigillo-respira 3.2s ease-in-out infinite; }
  @keyframes sigillo-respira { 0%, 100% { filter: drop-shadow(0 3px 6px rgba(0,0,0,.35)) drop-shadow(0 0 0 rgba(214,185,138,0)); } 50% { filter: drop-shadow(0 4px 8px rgba(0,0,0,.4)) drop-shadow(0 0 14px rgba(214,185,138,.35)); } }
  .busta:not(.is-opening) { animation: busta-galleggia 6s ease-in-out infinite; }
  @keyframes busta-galleggia { 0%, 100% { transform: translateY(0) rotate(-.4deg); } 50% { transform: translateY(-8px) rotate(.4deg); } }
}
.busta.is-opening .sigillo { transform: translate(-50%, -50%) scale(1.25) rotate(-8deg); opacity: 0; transition-delay: 0s; }
.busta.is-opening .busta-lembo { transform: rotateX(-178deg); z-index: 0; transition-delay: .25s; }
.busta.is-rising .busta-carta { transform: translateY(-78%); }
.busta.is-zooming .busta-carta { transform: translateY(-78%) scale(2.6); opacity: 0; transition: transform 1.1s var(--ease), opacity .9s var(--ease) .15s; }
.busta.is-zooming { filter: none; }
.busta.is-opening, .busta.is-opening:hover { animation: none; transform: none; }
.busta.is-opening { cursor: default; }
.busta.is-opening ~ .busta-sotto { opacity: 0; }

