/* ============================================
   ANIMAZIONI HERO DEI SERVIZI (web, ads, reel, opt)
   Scena disegnata su 520x420 e scalata con --s (vedi servizi-anim.js).
   Le fasi sono classi .is-s1 ... .is-s7 aggiunte in sequenza sul contenitore.
   ============================================ */

/* Hero a due colonne nelle pagine servizi */
.page-hero.svc-hero { text-align: left; padding: var(--space-6) 0 var(--space-5); }
.svc-hero__grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: var(--space-5); align-items: center; }
.svc-hero .eyebrow { margin-left: 0; }
.svc-hero h1 { margin-bottom: var(--space-2); }
.svc-hero .lede { margin-left: 0; }
.svc-hero .hero__cta { justify-content: flex-start; }

@media (max-width: 980px) {
  .page-hero.svc-hero { text-align: center; }
  .svc-hero__grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
  .svc-hero .eyebrow, .svc-hero .lede { margin-left: auto; margin-right: auto; }
  .svc-hero .hero__cta { justify-content: center; }
}

/* Contenitore e scena */
.hs-anim { position: relative; width: 100%; max-width: 520px; height: calc(420px * var(--s, 1)); margin: 0 auto; }
.hs-anim__stage {
  position: absolute; top: 0; left: 0; width: 520px; height: 420px;
  transform: scale(var(--s, 1)); transform-origin: top left;
  font-family: var(--font-sans); text-align: left; transition: opacity 0.4s ease;
}
.hs-anim.is-out .hs-anim__stage { opacity: 0; }
.hs-anim svg { display: block; }

/* Cursore e notifica (comuni) */
.ha-cursor { position: absolute; width: 24px; height: 24px; opacity: 0; z-index: 5; transition: left 0.8s cubic-bezier(0.4, 0, 0.2, 1), top 0.8s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease; }
.ha-cursor svg { width: 24px; height: 24px; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5)); }
.ha-ripple { position: absolute; left: -10px; top: -10px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #FF883A; opacity: 0; }
.ha-toast {
  position: absolute; right: 0; bottom: 0; z-index: 6; display: flex; align-items: center; gap: 12px;
  padding: 12px 16px 12px 12px; background: #1C1D21; border: 1px solid rgba(255, 136, 58, 0.5); border-radius: 14px;
  box-shadow: 0 24px 48px -18px rgba(0, 0, 0, 0.9); opacity: 0; transform: translateY(16px) scale(0.96);
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ha-toast__icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: rgba(255, 136, 58, 0.15); color: #FF883A; }
.ha-toast__icon svg { width: 18px; height: 18px; }
.ha-toast strong { display: block; font-size: 13.5px; color: #F2F3F5; letter-spacing: -0.01em; }
.ha-toast small { display: block; font-size: 11.5px; color: #A1A4AB; margin-top: 2px; }
@keyframes haShimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes haBlink { 50% { opacity: 0; } }
@keyframes haRipple { 0% { opacity: 1; transform: scale(0.4); } 100% { opacity: 0; transform: scale(2.6); } }

/* ---------- WEB: il sito che si costruisce ---------- */
.wa-browser { position: absolute; left: 0; top: 0; width: 500px; height: 386px; background: #17181B; border: 1px solid #2A2B31; border-radius: 16px; overflow: hidden; opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
.wa-bar { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; background: #1C1D21; border-bottom: 1px solid #2A2B31; }
.wa-bar i { width: 9px; height: 9px; border-radius: 50%; background: #3A3B42; }
.wa-url { flex: 1; display: flex; align-items: center; height: 20px; margin-left: 14px; padding-left: 10px; border-radius: 6px; background: #121214; color: #A1A4AB; font-size: 11px; }
.wa-page { position: relative; padding: 16px 20px; }
.wa-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.wa-logo { width: 70px; height: 12px; border-radius: 4px; background: #FF883A; }
.wa-links b { display: inline-block; width: 34px; height: 7px; margin-left: 8px; border-radius: 4px; background: #2E2F36; }
.wa-hero { position: relative; height: 60px; }
.wa-skel { position: absolute; left: 0; border-radius: 6px; background: linear-gradient(90deg, #24252B 0%, #31323A 50%, #24252B 100%); background-size: 200% 100%; animation: haShimmer 1.4s linear infinite; transition: opacity 0.4s ease; }
.wa-skel--1 { top: 0; width: 300px; height: 24px; }
.wa-skel--2 { top: 36px; width: 200px; height: 12px; }
.wa-title { position: absolute; top: 0; left: 0; font-size: 23px; font-weight: 800; letter-spacing: -0.04em; color: #F2F3F5; opacity: 0; transform: translateY(6px); transition: opacity 0.45s ease, transform 0.45s ease; white-space: nowrap; }
.wa-sub { position: absolute; top: 34px; left: 0; font-size: 12.5px; color: #A1A4AB; opacity: 0; transition: opacity 0.45s ease 0.1s; }
.wa-photos { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 10px; height: 136px; margin-top: 12px; }
.wa-ph { position: relative; overflow: hidden; border-radius: 10px; background: #24252B; }
.wa-ph::after { content: ""; position: absolute; inset: 0; opacity: 0; transform: scale(1.08); transition: opacity 0.5s ease, transform 0.9s ease; }
.wa-ph--1::after { background: radial-gradient(circle at 74% 26%, #FFE3BD 0 9%, transparent 10%), linear-gradient(180deg, #F7B884 0%, #E58049 52%, #7A4128 53%, #4D2B1F 100%); }
.wa-ph--2::after { background: linear-gradient(180deg, #A9DCEA 0 32%, #EDE4D5 32% 42%, #3DB8AD 42% 100%); transition-delay: 0.15s; }
.wa-ph--3::after { background: radial-gradient(ellipse at 50% 92%, #F4ECDF 0 32%, transparent 33%), linear-gradient(180deg, #E9DECD 0 58%, #C8B497 58% 100%); transition-delay: 0.3s; }
.wa-cta { display: flex; justify-content: center; margin-top: 18px; }
.wa-btn { display: inline-block; padding: 11px 28px; border-radius: 10px; background: #FF883A; color: #241205; font-size: 13px; font-weight: 700; opacity: 0; transform: scale(0.85); transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease; }
.hs-anim--web .ha-cursor { left: 450px; top: 400px; }

.hs-anim--web.is-s1 .wa-browser { opacity: 1; transform: none; }
.hs-anim--web.is-s2 .wa-skel { opacity: 0; }
.hs-anim--web.is-s2 .wa-title, .hs-anim--web.is-s2 .wa-sub { opacity: 1; transform: none; }
.hs-anim--web.is-s3 .wa-ph::after { opacity: 1; transform: none; }
.hs-anim--web.is-s4 .wa-btn { opacity: 1; transform: none; }
.hs-anim--web.is-s5 .ha-cursor { opacity: 1; left: 262px; top: 318px; }
.hs-anim--web.is-s6 .wa-btn { transform: scale(0.93); background: #FFA968; }
.hs-anim--web.is-s6 .ha-ripple { animation: haRipple 0.6s ease-out; }
.hs-anim--web.is-s7 .wa-btn { transform: none; }
.hs-anim--web.is-s7 .ha-toast { opacity: 1; transform: none; }

/* ---------- ADS: la ricerca Google dal vivo ---------- */
.ga-card { position: absolute; left: 0; top: 0; width: 500px; height: 370px; padding: 18px; background: #17181B; border: 1px solid #2A2B31; border-radius: 16px; opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
.ga-search { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 16px; border-radius: 24px; background: #202127; border: 1px solid #33343B; color: #F2F3F5; font-size: 15px; }
.ga-search__icon { color: #A1A4AB; }
.ga-search__icon svg { width: 18px; height: 18px; }
.ga-query { white-space: pre; }
.ga-caret { width: 2px; height: 18px; margin-left: -8px; background: #FF883A; animation: haBlink 1s steps(1) infinite; }
.ga-results { margin-top: 16px; }
.ga-ad { padding: 14px; border: 1px solid transparent; border-radius: 12px; opacity: 0; transform: translateY(10px); transition: opacity 0.45s ease, transform 0.45s ease, border-color 0.4s ease, background 0.4s ease; }
.ga-ad__label { margin-bottom: 8px; font-size: 11.5px; font-weight: 700; color: #F2F3F5; }
.ga-ad__src { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.ga-fav { width: 24px; height: 24px; border-radius: 50%; background: #FF883A; }
.ga-ad__src b { display: block; font-size: 12.5px; color: #F2F3F5; }
.ga-ad__src small { display: block; font-size: 11px; color: #A1A4AB; }
.ga-ad__title { margin-bottom: 4px; font-size: 18px; font-weight: 500; color: #8AB4F8; letter-spacing: -0.01em; }
.ga-ad__desc { font-size: 12.5px; line-height: 1.45; color: #BDC1C6; }
.ga-org { padding: 10px 14px; opacity: 0; transition: opacity 0.45s ease 0.2s; }
.ga-org + .ga-org { transition-delay: 0.35s; }
.ga-org b { display: block; width: 180px; height: 10px; margin-bottom: 9px; border-radius: 5px; background: #2E2F36; }
.ga-org i { display: block; width: 92%; height: 7px; margin-bottom: 6px; border-radius: 4px; background: #26272D; }
.ga-org i + i { width: 68%; }
.hs-anim--ads .ha-cursor { left: 470px; top: 400px; }

.hs-anim--ads.is-s1 .ga-card { opacity: 1; transform: none; }
.hs-anim--ads.is-s2 .ga-ad, .hs-anim--ads.is-s2 .ga-org { opacity: 1; transform: none; }
.hs-anim--ads.is-s2 .ga-caret { opacity: 0; animation: none; }
.hs-anim--ads.is-s3 .ga-ad { border-color: rgba(255, 136, 58, 0.55); background: rgba(255, 136, 58, 0.06); }
.hs-anim--ads.is-s4 .ha-cursor { opacity: 1; left: 158px; top: 160px; }
.hs-anim--ads.is-s5 .ga-ad__title { text-decoration: underline; }
.hs-anim--ads.is-s5 .ha-ripple { animation: haRipple 0.6s ease-out; }
.hs-anim--ads.is-s6 .ha-toast { opacity: 1; transform: none; }

/* ---------- REEL: la timeline di montaggio ---------- */
.rl-editor { position: absolute; left: 0; top: 62px; width: 300px; padding: 16px; background: #17181B; border: 1px solid #2A2B31; border-radius: 16px; opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
.rl-editor__head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 12px; font-weight: 700; color: #A1A4AB; letter-spacing: 0.03em; }
.rl-dot { width: 8px; height: 8px; border-radius: 50%; background: #FE5454; animation: haBlink 1.2s steps(1) infinite; }
.rl-track { position: relative; display: flex; gap: 4px; height: 92px; padding: 6px; border-radius: 10px; background: #121214; }
.rl-clip { flex: 1; border-radius: 6px; background-size: cover; background-position: center; opacity: 0; transform: translateY(-26px) scale(0.9); transition: opacity 0.4s ease, transform 0.45s cubic-bezier(0.34, 1.4, 0.64, 1), flex 0.45s ease; }
.rl-clip--2 { transition-delay: 0.12s; } .rl-clip--3 { transition-delay: 0.24s; } .rl-clip--4 { transition-delay: 0.36s; }
.rl-clip--5 { transition-delay: 0.48s; } .rl-clip--6 { transition-delay: 0.6s; }
.rl-playhead { position: absolute; top: -4px; bottom: -4px; left: 6px; width: 2px; background: #FF883A; box-shadow: 0 0 0 3px rgba(255, 136, 58, 0.2); opacity: 0; }
.rl-wave { display: flex; align-items: center; gap: 3px; height: 44px; margin-top: 12px; padding: 0 10px; border-radius: 10px; background: #121214; }
.rl-wave__icon { margin-right: 6px; color: #FF883A; }
.rl-wave__icon svg { width: 16px; height: 16px; }
.rl-wave i { flex: 1; height: var(--h); border-radius: 2px; background: #3A3B42; transform: scaleY(0.2); transition: transform 0.4s ease var(--d), background 0.3s ease; }
.rl-steps { display: flex; gap: 6px; margin-top: 14px; }
.rl-steps span { flex: 1; padding: 6px 0; border-radius: 6px; background: #202127; color: #A1A4AB; font-size: 10.5px; font-weight: 600; text-align: center; transition: background 0.3s ease, color 0.3s ease; }
.rl-phone { position: absolute; right: 0; top: 0; width: 200px; height: 410px; padding: 8px; border-radius: 30px; background: #0D0D0F; border: 2px solid #2A2B31; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9); opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease 0.15s, transform 0.5s ease 0.15s; }
.rl-screen { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 22px; background: #202127; }
.rl-frame { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.35s ease; }
.rl-frame.is-on { opacity: 1; }
.rl-ui { position: absolute; inset: 0; color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6); }
.rl-ui__top { position: absolute; left: 14px; top: 14px; font-size: 13px; font-weight: 700; }
.rl-ui__side { position: absolute; right: 10px; bottom: 66px; display: flex; flex-direction: column; gap: 14px; }
.rl-ui__side svg { width: 20px; height: 20px; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6)); }
.rl-ui__cap { position: absolute; left: 12px; bottom: 18px; font-size: 11.5px; }
.rl-ready { position: absolute; left: 50%; top: 46%; display: flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 100px; background: rgba(18, 18, 20, 0.85); border: 1px solid rgba(255, 136, 58, 0.6); color: #FF883A; font-size: 12px; font-weight: 700; white-space: nowrap; opacity: 0; transform: translate(-50%, -50%) scale(0.8); transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
.rl-ready svg { width: 14px; height: 14px; }
.rl-heart { position: absolute; right: 12px; bottom: 150px; color: #FE5454; opacity: 0; }
.rl-heart svg { width: 30px; height: 30px; fill: currentColor; }
@keyframes rlPlay { from { left: 6px; } to { left: calc(100% - 8px); } }
@keyframes rlBeat { to { transform: scaleY(0.5); } }
@keyframes rlHeart { 0% { opacity: 0; transform: scale(0.4); } 30% { opacity: 1; transform: scale(1.2); } 100% { opacity: 0; transform: translateY(-70px) scale(1); } }

.hs-anim--reel.is-s1 .rl-editor, .hs-anim--reel.is-s1 .rl-phone { opacity: 1; transform: none; }
.hs-anim--reel.is-s2 .rl-clip { opacity: 1; transform: none; }
.hs-anim--reel.is-s2 .rl-steps span:nth-child(1) { background: rgba(255, 136, 58, 0.15); color: #FF883A; }
.hs-anim--reel.is-s3 .rl-clip--2, .hs-anim--reel.is-s3 .rl-clip--5 { flex: 0.7; }
.hs-anim--reel.is-s3 .rl-wave i { transform: scaleY(1); background: #FF883A; }
.hs-anim--reel.is-s3 .rl-steps span:nth-child(2), .hs-anim--reel.is-s3 .rl-steps span:nth-child(3) { background: rgba(255, 136, 58, 0.15); color: #FF883A; }
.hs-anim--reel.is-s4 .rl-playhead { opacity: 1; animation: rlPlay 3.6s linear forwards; }
.hs-anim--reel.is-s4 .rl-wave i { animation: rlBeat 0.6s ease-in-out infinite alternate; animation-delay: var(--d); }
.hs-anim--reel.is-s5 .rl-steps span:nth-child(4) { background: rgba(255, 136, 58, 0.15); color: #FF883A; }
.hs-anim--reel.is-s5 .rl-ready { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.hs-anim--reel.is-s5 .rl-heart { animation: rlHeart 1.3s ease-out 0.3s both; }
.hs-anim--reel.is-s5 .rl-wave i { animation: none; }

/* ---------- OPT: la scansione dell'annuncio ---------- */
.op-listing { position: absolute; left: 0; top: 20px; width: 300px; height: 380px; overflow: hidden; background: #17181B; border: 1px solid #2A2B31; border-radius: 16px; opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
.op-photos { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 4px; height: 172px; padding: 4px; }
.op-ph { border-radius: 4px; transition: box-shadow 0.3s ease; }
.op-ph--main { grid-row: 1 / span 2; border-radius: 12px 4px 4px 12px; background: linear-gradient(160deg, #5C5F68, #3B3D44); }
.op-ph--a { border-radius: 4px 12px 4px 4px; background: linear-gradient(160deg, #E8D8C0, #B99C78); }
.op-ph--b { border-radius: 4px 4px 12px 4px; background: linear-gradient(160deg, #A2D5DF, #4A9AA8); }
.op-body { padding: 14px 16px; }
.op-title { margin-bottom: 4px; font-size: 16px; font-weight: 700; letter-spacing: -0.02em; color: #F2F3F5; transition: color 0.3s ease; }
.op-meta { margin-bottom: 12px; font-size: 12px; color: #A1A4AB; }
.op-chips span { display: inline-block; margin: 0 4px 6px 0; padding: 5px 10px; border: 1px solid #33343B; border-radius: 100px; color: #D8DADF; font-size: 11px; }
.op-scan { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: #FF883A; box-shadow: 0 0 18px 5px rgba(255, 136, 58, 0.5); opacity: 0; }
.op-flag { position: absolute; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #FF883A; color: #241205; font-size: 0; opacity: 0; transform: scale(0.4); transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
.op-flag svg { width: 15px; height: 15px; }
.op-flag--1 { left: 178px; top: 12px; }
.op-flag--2 { left: 262px; top: 186px; }
.op-flag--3 { left: 262px; top: 246px; }
.op-panel { position: absolute; right: 0; top: 56px; width: 200px; padding: 14px; background: #1C1D21; border: 1px solid #2A2B31; border-radius: 14px; opacity: 0; transform: translateX(14px); transition: opacity 0.5s ease 0.2s, transform 0.5s ease 0.2s; }
.op-panel__head { margin-bottom: 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #A1A4AB; }
.op-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-top: 1px solid #2A2B31; opacity: 0; transform: translateY(8px); transition: opacity 0.4s ease, transform 0.4s ease; }
.op-item b { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #FF883A; color: #241205; font-size: 12px; }
.op-item span { font-size: 12px; line-height: 1.38; color: #F2F3F5; }
.op-done { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12px; font-weight: 700; color: #5BD08C; opacity: 0; transition: opacity 0.4s ease; }
.op-done svg { width: 14px; height: 14px; }
@keyframes opScan { from { top: 0; } to { top: 100%; } }

.hs-anim--opt.is-s1 .op-listing, .hs-anim--opt.is-s1 .op-panel { opacity: 1; transform: none; }
.hs-anim--opt.is-s2 .op-scan { opacity: 1; animation: opScan 2.4s linear forwards; }
.hs-anim--opt.is-s3 .op-flag--1, .hs-anim--opt.is-s4 .op-flag--2, .hs-anim--opt.is-s5 .op-flag--3 { opacity: 1; transform: none; }
.hs-anim--opt.is-s3 .op-ph--main { box-shadow: inset 0 0 0 2px #FF883A; }
.hs-anim--opt.is-s4 .op-title { color: #FFB07A; }
.hs-anim--opt.is-s3 .op-item--1, .hs-anim--opt.is-s4 .op-item--2, .hs-anim--opt.is-s5 .op-item--3 { opacity: 1; transform: none; }
.hs-anim--opt.is-s6 .op-scan { opacity: 0; }
.hs-anim--opt.is-s6 .op-done { opacity: 1; }

/* Chi preferisce meno movimento vede la scena finale, ferma. */
@media (prefers-reduced-motion: reduce) {
  .hs-anim *, .hs-anim *::before, .hs-anim *::after { animation: none !important; transition: none !important; }
  .hs-anim .op-scan, .hs-anim .rl-playhead, .hs-anim .ha-cursor, .hs-anim .rl-heart { display: none; }
}
