/* PrimoSquillo · illustrazione animata dell'apertura.
   Racconta quattro passi: una persona chiama, l'AI risponde, l'AI annota la scheda, la scheda arriva all'avvocato.
   Lo stato di base (senza script, o con «riduci movimento») è quello finale, completo e fermo.
   Il movimento parte solo quando hero.js aggiunge la classe .anima. Colori: variabili di stile.css. */

.hs { margin: 0; container-type: inline-size; }
.hs-palco {
  background: var(--tenue); border-radius: 28px; padding: 26px 22px 22px;
  font-family: var(--sans); color: var(--testo); line-height: 1.4;
}
.hs p { margin: 0; }
.hs figcaption { display: block; }
.hs .nota-esempio { display: block; }

/* 1. I tre attori e ciò che li collega */
.hs-attori { display: grid; grid-template-columns: 96px minmax(0, 1fr) 96px 64px 96px; align-items: start; padding-right: 50px; }
.hs-attore { display: flex; flex-direction: column; align-items: center; text-align: center; }
.hs-attore strong { font-size: .875rem; line-height: 1.25; margin-top: 10px; white-space: nowrap; }
.hs-sotto { font-size: .75rem; line-height: 1.3; color: var(--grigio); margin-top: 2px; white-space: nowrap; }
.hs-volto { position: relative; width: 60px; height: 60px; border-radius: 50%; display: block; box-shadow: 0 0 0 1px var(--filetto), 0 8px 18px -10px rgba(40, 25, 20, .35); background: var(--bianco); }
.hs-volto > svg { width: 100%; height: 100%; border-radius: 50%; }
.hs-volto::before, .hs-volto::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid var(--accento); opacity: 0; pointer-events: none; }
.hs-f-fondo { fill: #efe9e0; }
.hs-f-bianco { fill: var(--bianco); }
.hs-f-ink { fill: var(--inchiostro); }
.hs-f-pelle { fill: #ecc9cd; }
.hs-f-abito { fill: var(--grigio); }
.hs-f-accento { fill: var(--accento); }
.hs-distintivo {
  position: absolute; right: -5px; bottom: -3px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; background: var(--inchiostro); color: #fff; box-shadow: 0 0 0 2.5px var(--tenue);
}
.hs-distintivo svg { width: 13px; height: 13px; }
.hs-sigla { width: auto; min-width: 28px; padding: 0 7px; border-radius: 999px; background: var(--accento); font-size: .6875rem; font-weight: 700; letter-spacing: .06em; line-height: 1; }
.hs-ricevuta { background: var(--ok); }

/* La voce fra chi chiama e l'assistente */
.hs-voce { display: flex; align-items: center; justify-content: center; gap: 4px; height: 60px; padding: 0 4px; }
.hs-voce i { display: block; width: 3px; height: 26px; border-radius: 2px; background: #b9b2a8; transform: scaleY(.3); transform-origin: center; }
.hs-voce i:nth-child(3n+1) { transform: scaleY(.45); }
.hs-voce i:nth-child(4n+2) { transform: scaleY(.9); }
.hs-voce i:nth-child(5n+3) { transform: scaleY(.65); }
.hs-voce i:nth-child(7) { transform: scaleY(1); }

/* L'invio fra l'assistente e l'avvocato */
.hs-filo { position: relative; height: 60px; display: block; }
.hs-filo::before { content: ""; position: absolute; left: 4px; right: 4px; top: 50%; height: 2px; margin-top: -1px; background: radial-gradient(circle, #b9b2a8 1px, transparent 1.2px) 0 0 / 7px 2px repeat-x; }
.hs-busta {
  position: absolute; top: 50%; left: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accento); color: #fff; box-shadow: 0 0 0 3px var(--tenue);
}
.hs-busta svg { width: 17px; height: 17px; }

/* 2. Il corpo: a sinistra dialogo e scheda, a destra il telefono dell'avvocato */
.hs-corpo { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 18px; margin-top: 20px; align-items: stretch; }
.hs-dialogo { display: flex; flex-direction: column; gap: 8px; position: relative; }
.hs-squillo { display: none; position: absolute; top: 0; left: 0; align-items: center; gap: 8px; padding: 9px 15px 9px 11px; border-radius: 999px; background: var(--bianco); border: 1px solid var(--filetto); box-shadow: var(--ombra); font-size: .8438rem; font-weight: 600; color: var(--inchiostro); white-space: nowrap; }
.hs-squillo svg { width: 22px; height: 22px; padding: 5px; border-radius: 50%; background: var(--accento); color: #fff; }
.hs-battuta { position: relative; display: flex; }
.hs-b-ai { justify-content: flex-end; }
.hs-fumetto { font-size: .8438rem; line-height: 1.42; padding: 9px 13px; border-radius: 15px; max-width: 88%; }
.hs-b-chi .hs-fumetto { background: var(--bianco); color: var(--testo); border: 1px solid var(--filetto); border-top-left-radius: 4px; }
.hs-b-ai .hs-fumetto { background: var(--accento); color: #fff; border-top-right-radius: 4px; }
.hs-b-ai .hs-fumetto b { font-weight: 700; color: #fff; }
.hs-punti { display: none; position: absolute; top: 0; left: 0; padding: 12px 14px; border-radius: 15px; gap: 4px; background: var(--bianco); border: 1px solid var(--filetto); }
.hs-b-ai .hs-punti { left: auto; right: 0; background: var(--accento); border-color: var(--accento); }
.hs-punti i { width: 6px; height: 6px; border-radius: 50%; background: var(--grigio); display: block; }
.hs-b-ai .hs-punti i { background: #fff; }

.hs-scheda { margin-top: 14px; background: var(--bianco); border: 1px solid var(--filetto); border-radius: 16px; box-shadow: var(--ombra); padding: 13px 14px 8px 16px; position: relative; }
.hs-scheda-testa { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-bottom: 9px; border-bottom: 1px solid var(--filetto); }
.hs-scheda-titolo { font-family: var(--serif); font-size: 1.0625rem; line-height: 1.2; color: var(--inchiostro); white-space: nowrap; }
.hs-scheda-stato { font-size: .6875rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ok); white-space: nowrap; }
.hs-scheda dl { margin: 0; }
.hs-riga { display: grid; grid-template-columns: 80px minmax(0, 1fr) 18px; align-items: center; gap: 6px; padding: 6px 0; font-size: .8125rem; line-height: 1.3; }
.hs-riga + .hs-riga { border-top: 1px solid #efebe4; }
.hs-riga dt { color: var(--grigio); }
.hs-riga dd { margin: 0; position: relative; color: var(--inchiostro); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hs-riga dd::before { content: ""; position: absolute; left: 0; top: 50%; width: 62%; height: 7px; margin-top: -3.5px; border-radius: 4px; background: #ece7df; opacity: 0; }
.hs-urgente dd { color: var(--accento); }
.hs-spunta { width: 18px; height: 18px; }
.hs-spunta circle { fill: var(--ok); stroke: var(--ok); stroke-width: 1.5; }
.hs-spunta path { fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 12; stroke-dashoffset: 0; }

/* Il telefono dell'avvocato */
.hs-destra { display: flex; flex-direction: column; align-items: center; }
.hs-telefono {
  position: relative; width: 100%; flex: 1 0 auto; min-height: 372px; border-radius: 30px; padding: 30px 9px 22px;
  background: #fbf9f6; border: 6px solid var(--inchiostro); box-shadow: var(--ombra-forte);
  display: flex; flex-direction: column;
}
.hs-tacca { position: absolute; top: 8px; left: 50%; width: 46px; height: 11px; margin-left: -23px; border-radius: 999px; background: var(--inchiostro); }
.hs-barra { position: absolute; bottom: 7px; left: 50%; width: 56px; height: 4px; margin-left: -28px; border-radius: 999px; background: #cfc9c0; }
.hs-ora { font-family: var(--serif); font-size: 2.75rem; line-height: 1; color: var(--inchiostro); text-align: center; letter-spacing: -.01em; }
.hs-giorno { font-size: .75rem; color: var(--grigio); text-align: center; margin-bottom: 16px !important; }
.hs-notifica { background: var(--bianco); border: 1px solid var(--filetto); border-radius: 13px; padding: 9px 10px 10px; box-shadow: 0 6px 16px -10px rgba(40, 25, 20, .3); }
.hs-notifica + .hs-notifica { margin-top: 8px; }
.hs-n-testa { display: flex; align-items: center; gap: 6px; font-size: .6563rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--grigio); margin-bottom: 5px !important; }
.hs-n-icona { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; background: var(--inchiostro); color: #fff; flex: none; }
.hs-n-icona svg { width: 13px; height: 13px; }
.hs-n-sms .hs-n-icona { background: var(--accento); }
.hs-n-quando { margin-left: auto; font-weight: 500; letter-spacing: 0; text-transform: none; }
.hs-n-titolo { font-size: .8125rem; line-height: 1.25; font-weight: 700; color: var(--inchiostro); }
.hs-n-sms .hs-n-titolo { color: var(--accento); }
.hs-n-testo { font-size: .75rem; line-height: 1.35; color: var(--grigio); margin-top: 2px !important; }
.hs-inviata { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px !important; font-size: .8125rem; font-weight: 600; color: var(--ok); white-space: nowrap; }
.hs-inviata svg { width: 16px; height: 16px; }

/* 3. Movimento: solo con .anima (aggiunta da hero.js quando il movimento è gradito) */
.hs.anima .hs-fumetto { transition: opacity .35s ease, transform .45s cubic-bezier(.2, .8, .2, 1); transform-origin: 0 0; }
.hs.anima .hs-b-ai .hs-fumetto { transform-origin: 100% 0; }
.hs.anima .hs-battuta:not(.on) .hs-fumetto { opacity: 0; transform: translateY(8px) scale(.96); }
.hs.anima .hs-battuta.scrive .hs-punti { display: inline-flex; }
.hs.anima .hs-punti i { animation: hs-punto 1s ease-in-out infinite; }
.hs.anima .hs-punti i:nth-child(2) { animation-delay: .15s; }
.hs.anima .hs-punti i:nth-child(3) { animation-delay: .3s; }
@keyframes hs-punto { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-3px); opacity: 1; } }

.hs.anima .hs-riga dd span { display: inline-block; transition: opacity .3s ease, transform .4s cubic-bezier(.2, .8, .2, 1); }
.hs.anima .hs-riga dd::before { transition: opacity .25s ease; }
.hs.anima .hs-riga:not(.on) dd span { opacity: 0; transform: translateX(-6px); }
.hs.anima .hs-riga:not(.on) dd::before { opacity: 1; }
.hs.anima .hs-spunta circle { transition: fill .3s ease, stroke .3s ease; }
.hs.anima .hs-spunta path { transition: stroke-dashoffset .35s ease .1s; }
.hs.anima .hs-riga:not(.on) .hs-spunta circle { fill: transparent; stroke: var(--filetto); }
.hs.anima .hs-riga:not(.on) .hs-spunta path { stroke-dashoffset: 12; transition: none; }
.hs.anima .hs-riga.on .hs-spunta { animation: hs-scatto .45s cubic-bezier(.2, .8, .2, 1); }
@keyframes hs-scatto { 0% { transform: scale(.6); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
.hs.anima .hs-scheda { transition: box-shadow .4s ease, border-color .4s ease; }
.hs.anima.st-annota .hs-scheda { border-color: #cdb9bb; box-shadow: var(--ombra), 0 0 0 4px rgba(123, 35, 49, .07); }
.hs.anima .hs-scheda-stato { transition: color .3s ease; }
.hs.anima.st-attesa .hs-scheda-stato { color: var(--grigio); }
.hs.anima.st-annota .hs-scheda-stato { color: var(--accento); }

.hs.anima .hs-notifica, .hs.anima .hs-inviata, .hs.anima .hs-ricevuta { transition: opacity .4s ease, transform .55s cubic-bezier(.2, .8, .2, 1); }
.hs.anima .hs-telefono { transition: background-color .5s ease; }
.hs.anima.st-attesa .hs-telefono, .hs.anima.st-annota .hs-telefono { background: #ece7df; }
.hs.anima .hs-ora, .hs.anima .hs-giorno { transition: opacity .5s ease; }
.hs.anima.st-attesa .hs-ora, .hs.anima.st-annota .hs-ora, .hs.anima.st-attesa .hs-giorno, .hs.anima.st-annota .hs-giorno { opacity: .45; }
.hs.anima .hs-notifica:not(.on) { opacity: 0; transform: translateY(-14px) scale(.96); }
.hs.anima .hs-inviata:not(.on) { opacity: 0; transform: translateY(4px); }
.hs.anima .hs-ricevuta:not(.on) { opacity: 0; transform: scale(.4); }

.hs.anima .hs-squillo { display: inline-flex; opacity: 0; transform: translateY(6px); transition: opacity .3s ease, transform .4s ease; }
.hs.anima.st-squilla .hs-squillo { opacity: 1; transform: none; }
.hs.anima.st-squilla .hs-squillo svg { animation: hs-trillo .5s ease-in-out infinite; }

/* Chi sta parlando: anelli attorno al volto e onde della voce */
.hs.anima .hs-volto { transition: box-shadow .35s ease; }
.hs.anima.st-squilla .hs-chi .hs-volto, .hs.anima.st-chi .hs-chi .hs-volto, .hs.anima.st-ai .hs-ai .hs-volto, .hs.anima.st-fatto .hs-avv .hs-volto { box-shadow: 0 0 0 2px var(--accento), 0 8px 18px -10px rgba(40, 25, 20, .35); }
.hs.anima.st-fatto .hs-avv .hs-volto { box-shadow: 0 0 0 2px var(--ok), 0 8px 18px -10px rgba(40, 25, 20, .35); }
.hs.anima.st-squilla .hs-chi .hs-volto::before, .hs.anima.st-squilla .hs-chi .hs-volto::after,
.hs.anima.st-ai .hs-ai .hs-volto::before { animation: hs-anello 1.6s ease-out infinite; }
.hs.anima.st-squilla .hs-chi .hs-volto::after { animation-delay: .8s; }
@keyframes hs-anello { 0% { transform: scale(1); opacity: .5; } 100% { transform: scale(1.55); opacity: 0; } }
.hs.anima.st-squilla .hs-chi .hs-distintivo { animation: hs-trillo .5s ease-in-out infinite; }
@keyframes hs-trillo { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-14deg); } 75% { transform: rotate(14deg); } }

.hs.anima .hs-voce i { transform: scaleY(.16); transition: background-color .3s ease, transform .3s ease; }
.hs.anima.st-chi .hs-voce i, .hs.anima.st-ai .hs-voce i { animation: hs-onda .9s ease-in-out infinite; }
.hs.anima.st-chi .hs-voce i { background: var(--inchiostro); }
.hs.anima.st-ai .hs-voce i { background: var(--accento); }
.hs.anima .hs-voce i:nth-child(2n) { animation-delay: -.3s; }
.hs.anima .hs-voce i:nth-child(3n) { animation-delay: -.55s; }
.hs.anima .hs-voce i:nth-child(5n) { animation-delay: -.75s; }
.hs.anima .hs-voce i:nth-child(7n) { animation-delay: -.15s; }
@keyframes hs-onda { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }

/* La busta parte dall'assistente e arriva all'avvocato */
.hs.anima .hs-busta { transition: left .9s cubic-bezier(.5, 0, .2, 1), opacity .3s ease, transform .3s ease; }
.hs.anima.st-attesa .hs-busta, .hs.anima.st-squilla .hs-busta, .hs.anima.st-chi .hs-busta, .hs.anima.st-ai .hs-busta { left: 8px; opacity: 0; transform: scale(.5); }
.hs.anima.st-invia .hs-busta { left: calc(100% - 20px); }
.hs.anima.st-fatto .hs-busta { left: 50%; background: var(--ok); }
.hs.anima.st-invia .hs-filo::before { animation: hs-scorre .5s linear infinite; }
@keyframes hs-scorre { to { background-position: 7px 0; } }

/* 4. Scena stretta (telefono, colonna sottile): tutto in verticale */
@media (min-width: 1021px) {
  .hs { margin-right: calc(-1 * clamp(0px, (100vw - 1120px) / 2 - 28px, 92px)); }
}
@media (max-width: 1020px) { .hs { max-width: 560px; } }
@container (max-width: 499px) {
  .hs-palco { padding: 22px 16px 18px; border-radius: 22px; }
  .hs-attori { grid-template-columns: 92px minmax(0, 1fr) 92px minmax(0, 1fr) 92px; padding-right: 0; margin-inline: -8px; }
  .hs-voce { gap: 3px; padding: 0; }
  .hs-voce i:nth-child(n+8) { display: none; }
  .hs-corpo { grid-template-columns: 1fr; gap: 0; }
  .hs-fumetto { font-size: .875rem; }
  .hs-riga { font-size: .875rem; grid-template-columns: 92px minmax(0, 1fr) 18px; padding: 7px 0; }
  .hs-destra { margin-top: 34px; position: relative; }
  .hs-destra::before { content: ""; position: absolute; top: -27px; left: 50%; width: 2px; height: 20px; margin-left: -1px; background: radial-gradient(circle, #b9b2a8 1px, transparent 1.2px) 0 0 / 2px 7px repeat-y; }
  .hs-telefono { width: min(100%, 270px); flex: none; min-height: 0; padding-bottom: 26px; }
  .hs-n-titolo { font-size: .875rem; }
  .hs-n-testo { font-size: .8125rem; }
}
