/* ================================================================
   hibackup.html — pagina prodotto Backup & Disaster Recovery.
   Riusa .reveal/.reveal.visible, .eyebrow, .section*, .btn, .cta,
   .spot-card, .service-icon, .live-dot (keyframe sec-live-pulse
   condivisa) dal design system in css/style.css. Tutto lo stile qui
   sotto è specifico di questa pagina: concetto "Piano B" nell'hero,
   count-up "glitch" nella stripe statistiche, diagramma 3-2-1-1-0,
   pattern cifrato nel bento, collegamento cloud-to-cloud animato,
   card problema/risposta a dissolvenza incrociata.
   ================================================================ */

.hero--hibackup { padding-bottom: 56px; }
.lede-text { max-width: 760px; margin: 0 auto; font-size: 1.02rem; color: var(--text-muted); line-height: 1.7; text-align: center; }

/* ---------- Hero: illustrazione "Piano B", due percorsi paralleli ---------- */
.planb-wrap { position: relative; z-index: 2; margin-top: 48px; }
.planb { position: relative; opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.planb.visible { opacity: 1; transform: none; }
.planb__svg { width: 100%; height: auto; display: block; overflow: visible; }
.planb-caption { margin-top: 14px; font-size: .82rem; color: rgba(255,255,255,.55); text-align: center; }

.planb-label { font-size: 12px; font-weight: 700; letter-spacing: .5px; fill: rgba(255,255,255,.55); }
.planb-label--b { fill: var(--orange); }
.planb-origin { fill: rgba(255,255,255,.4); }
.planb-line-static { stroke: rgba(255,255,255,.18); stroke-width: 1.5; stroke-dasharray: 3 5; }

.planb-node { transition: transform .35s ease; transform: translate(calc(var(--px,0)*1px), calc(var(--py,0)*1px)); }

/* Nodo "senza Piano B": pulsa un paio di cicli poi si frattura, in loop lento */
.planb-node--fail .planb-node__body { fill: rgba(233,96,74,.16); stroke: #e9604a; stroke-width: 1.6; transform-box: fill-box; transform-origin: 50% 50%; }
.planb-node--fail .planb-crack { stroke: #e9604a; stroke-width: 1.4; stroke-linecap: round; fill: none; opacity: 0; }
.planb.visible .planb-node--fail .planb-node__body { animation: planb-fail-pulse 8s ease-in-out infinite; }
.planb.visible .planb-node--fail .planb-crack { animation: planb-crack-flash 8s ease-in-out infinite; }
@keyframes planb-fail-pulse {
  0%, 62% { transform: scale(1); opacity: .85; }
  15%, 46% { transform: scale(1.09); opacity: 1; }
  65% { transform: translate(-1.5px,1px) scale(.96); }
  68% { transform: translate(1.5px,-1px) scale(1.05); }
  71% { transform: translate(-1px,-1.5px) scale(.97); }
  74% { transform: translate(1px,1.5px) scale(1.03); }
  78%, 100% { transform: scale(1); opacity: .85; }
}
@keyframes planb-crack-flash {
  0%, 63% { opacity: 0; }
  66%, 76% { opacity: 1; }
  79%, 100% { opacity: 0; }
}

/* Nodo sorgente e copie: brand orange */
.planb-node--source .planb-node__body { fill: var(--orange); stroke: none; }
.planb-node--source .planb-node__mark circle { fill: var(--navy-dark); }

.planb-branch {
  fill: none; stroke: var(--orange); stroke-width: 2; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  transition: stroke-dashoffset .9s ease; transition-delay: var(--bd, 0s);
}
.planb-branch.is-drawn { stroke-dashoffset: 0; }

.planb-node--copy .planb-node__body { fill: var(--white); stroke: var(--orange); stroke-width: 2; }
.planb-node--copy .planb-node__icon { fill: none; stroke: var(--orange); stroke-width: 1.6; stroke-linejoin: round; }
.planb-node--lock .planb-node__body { fill: var(--navy-dark); stroke: var(--orange); stroke-width: 2; }
.planb-node--lock .planb-node__lock { fill: none; stroke: var(--orange); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.planb-node--copy, .planb-node--lock {
  opacity: 0; transform: scale(.5) translate(calc(var(--px,0)*1px), calc(var(--py,0)*1px));
  transition: opacity .5s cubic-bezier(.34,1.56,.64,1), transform .5s cubic-bezier(.34,1.56,.64,1);
  transition-delay: var(--nd, 0s);
}
.planb.visible .planb-node--copy, .planb.visible .planb-node--lock {
  opacity: 1; transform: scale(1) translate(calc(var(--px,0)*1px), calc(var(--py,0)*1px));
}

@media (prefers-reduced-motion: reduce) {
  .planb { transition: none; opacity: 1; transform: none; }
  .planb-node { transition: none; }
  .planb-node--fail .planb-node__body, .planb-node--fail .planb-crack { animation: none !important; }
  .planb-node--fail .planb-crack { opacity: .7; }
  .planb-branch { transition: none; stroke-dasharray: none; stroke-dashoffset: 0; }
  .planb-node--copy, .planb-node--lock { transition: none; opacity: 1; transform: none; }
}

/* ---------- Il problema: stripe statistiche con scanline e count-up "glitch" ---------- */
.problem-stats { position: relative; padding: 90px 0; background: var(--navy-dark); overflow: hidden; }
.problem-stats__scanlines {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0px, rgba(255,255,255,.025) 1px, transparent 1px, transparent 3px);
  animation: problem-scan-drift 9s linear infinite;
}
@keyframes problem-scan-drift { from { background-position: 0 0; } to { background-position: 0 120px; } }

.problem-stats .eyebrow { color: var(--orange); text-align: center; display: block; }
.problem-stats__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; margin-top: 28px; }
.problem-stats__group h3 { color: var(--white); font-size: 1.05rem; margin-bottom: 22px; text-align: center; }
.problem-stats__items { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.problem-stats__item { text-align: center; }
.problem-stats__num {
  font-size: 2.6rem; font-weight: 800; color: var(--white); font-variant-numeric: tabular-nums;
  letter-spacing: .5px;
}
.problem-stats__num.is-glitching { color: var(--orange); text-shadow: 1px 0 0 rgba(233,96,74,.7), -1px 0 0 rgba(18,181,166,.6); }
.problem-stats__label { font-size: .85rem; color: rgba(255,255,255,.6); line-height: 1.5; margin-top: 4px; }
.problem-stats__source { font-size: .75rem; color: rgba(255,255,255,.4); text-align: center; margin-top: 18px; }
.problem-stats__closing { max-width: 720px; margin: 44px auto 0; text-align: center; color: rgba(255,255,255,.75); font-size: 1rem; line-height: 1.7; }

@media (max-width: 860px) {
  .problem-stats__grid { grid-template-columns: 1fr; gap: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .problem-stats__scanlines { animation: none; }
}

/* ---------- Come funziona: diagramma 3-2-1-1-0 ---------- */
.strategy-diagram { position: relative; max-width: 980px; margin: 56px auto 0; padding-top: 10px; }
.strategy-diagram__rail { width: 100%; height: 14px; display: block; overflow: visible; }
.strategy-rail__bg { stroke: var(--border); stroke-width: .6; }
.strategy-rail__fill {
  stroke: var(--orange); stroke-width: .6;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  transition: stroke-dashoffset 2.2s ease;
}
.strategy-rail__fill.is-drawn { stroke-dashoffset: 0; }

.strategy-spark {
  position: absolute; top: 3px; left: 6%; width: 9px; height: 9px; margin-left: -4.5px;
  border-radius: 50%; background: var(--orange); box-shadow: 0 0 10px 2px rgba(255,130,0,.7);
  opacity: 0;
}
.reveal.visible .strategy-spark { animation: strategy-spark-travel 2.4s ease-in-out forwards; }
@keyframes strategy-spark-travel {
  0% { left: 6%; opacity: 1; }
  4% { opacity: 1; }
  18% { left: 27%; }
  22% { left: 27%; }
  38% { left: 50%; }
  42% { left: 50%; }
  58% { left: 73%; }
  62% { left: 73%; }
  78% { left: 94%; }
  96%, 100% { left: 94%; opacity: 0; }
}

.strategy-diagram__nodes { display: flex; justify-content: space-between; margin-top: -7px; }
.strategy-node {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--white); border: 2px solid var(--border); border-radius: 50%;
  width: 76px; height: 76px; cursor: pointer; font-family: inherit;
  transition: background .4s ease, border-color .4s ease, transform .4s ease, box-shadow .4s ease;
}
.strategy-node__num { font-size: 1.5rem; font-weight: 800; color: var(--navy-mid); transition: color .4s ease; }
.strategy-node__label { display: none; }

.strategy-diagram__nodes .strategy-node:nth-child(1) { transition-delay: 0s; }
.strategy-diagram__nodes .strategy-node:nth-child(2) { transition-delay: .45s; }
.strategy-diagram__nodes .strategy-node:nth-child(3) { transition-delay: .9s; }
.strategy-diagram__nodes .strategy-node:nth-child(4) { transition-delay: 1.4s; }
.strategy-diagram__nodes .strategy-node:nth-child(5) { transition-delay: 1.85s; }

.reveal.visible .strategy-node {
  background: var(--navy-dark); border-color: var(--orange);
  animation: strategy-node-light .7s ease-out;
}
.reveal.visible .strategy-node:nth-child(1) { animation-delay: 0s; }
.reveal.visible .strategy-node:nth-child(2) { animation-delay: .45s; }
.reveal.visible .strategy-node:nth-child(3) { animation-delay: .9s; }
.reveal.visible .strategy-node:nth-child(4) { animation-delay: 1.4s; }
.reveal.visible .strategy-node:nth-child(5) { animation-delay: 1.85s; }
.reveal.visible .strategy-node .strategy-node__num { color: var(--white); }
@keyframes strategy-node-light {
  0% { box-shadow: 0 0 0 0 rgba(255,130,0,.55); }
  100% { box-shadow: 0 0 0 16px rgba(255,130,0,0); }
}

.strategy-node:hover, .strategy-node:focus-visible, .strategy-node.is-open { transform: scale(1.1); border-color: var(--orange); }

.strategy-node--final .strategy-node__burst {
  position: absolute; inset: -10px; border-radius: 50%; border: 2px solid var(--orange); opacity: 0; pointer-events: none;
}
.reveal.visible .strategy-node--final .strategy-node__burst {
  animation: strategy-burst 1s ease-out 1.9s;
}
@keyframes strategy-burst {
  0% { opacity: 0; transform: scale(.6); }
  40% { opacity: .9; }
  100% { opacity: 0; transform: scale(1.7); }
}

.strategy-detail {
  margin-top: 34px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 28px; position: relative;
  opacity: 0; transform: translateX(-16px);
  transition: opacity .3s ease, transform .3s ease;
}
.strategy-detail.is-visible { opacity: 1; transform: none; }
.strategy-detail h3 { font-size: 1.1rem; margin-bottom: 8px; color: var(--orange-dark); }
.strategy-detail p { font-size: .95rem; color: var(--navy-mid); line-height: 1.6; margin: 0; padding-right: 24px; }
.strategy-detail__close {
  position: absolute; top: 14px; right: 16px; width: 26px; height: 26px; border-radius: 50%;
  border: none; background: var(--off-white); color: var(--navy-mid); font-size: 1.1rem; line-height: 1; cursor: pointer;
}
.strategy-detail__close:hover { background: var(--border); }

@media (max-width: 720px) {
  .strategy-diagram__nodes { flex-wrap: wrap; justify-content: center; gap: 18px; }
  .strategy-diagram__rail, .strategy-spark { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .strategy-rail__fill { transition: none; stroke-dashoffset: 0; }
  .strategy-spark { display: none; }
  .strategy-node { transition: background .3s ease, border-color .3s ease; animation: none !important; }
  .reveal.visible .strategy-node { animation: none; }
  .strategy-node--final .strategy-node__burst { display: none; }
  .strategy-detail { transition: none; }
}

/* ---------- Funzionalità principali: bento con pattern cifrato ---------- */
.backup-bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 44px; }
.backup-bento__card {
  position: relative; overflow: hidden;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px 28px; display: flex; flex-direction: column; gap: 12px;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.backup-bento__card:hover, .backup-bento__card.is-touched { transform: translateY(-5px); box-shadow: var(--shadow); border-color: rgba(255,130,0,.35); }
.backup-bento__card h3 { font-size: 1.05rem; }
.backup-bento__card p { font-size: .88rem; color: var(--text-muted); line-height: 1.6; }

.backup-bento__pattern {
  position: absolute; inset: 0; z-index: 0; overflow: hidden;
  font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; line-height: 1.6;
  color: var(--navy-dark); opacity: .035; word-break: break-all; padding: 10px;
  transition: opacity .4s ease; pointer-events: none;
}
.backup-bento__card:hover .backup-bento__pattern, .backup-bento__card.is-touched .backup-bento__pattern { opacity: .09; }
.backup-bento__card .service-icon, .backup-bento__card h3, .backup-bento__card p { position: relative; z-index: 1; }

.backup-bento__card .service-icon svg [pathLength] {
  stroke-dasharray: 1; stroke-dashoffset: 1;
  transition: stroke-dashoffset .7s ease; transition-delay: calc(var(--i,0) * .1s);
}
.reveal.visible .backup-bento__card .service-icon svg [pathLength].is-drawn { stroke-dashoffset: 0; }

@media (max-width: 960px) { .backup-bento { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .backup-bento { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) {
  .backup-bento__card { transition: none; }
  .backup-bento__card .service-icon svg [pathLength] { stroke-dasharray: none; stroke-dashoffset: 0; transition: none; }
  .backup-bento__pattern { transition: none; }
}

/* ---------- Backup Microsoft 365: split screen con collegamento animato ---------- */
.m365-split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center; }
.m365-split__copy p { color: var(--navy-mid); font-size: 1rem; line-height: 1.75; }
.m365-split__art { display: flex; justify-content: center; }
.m365-split__art svg { width: 100%; max-width: 380px; height: auto; overflow: visible; }

.m365-node__ring { fill: none; stroke: var(--orange); stroke-width: 2; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .8s ease; }
.m365-node__ring.is-drawn { stroke-dashoffset: 0; }
.m365-node__icon { fill: none; stroke: var(--orange); stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.m365-node--repo .m365-node__ring { stroke: var(--navy-dark); }
.m365-node--repo .m365-node__icon { stroke: var(--navy-dark); }

.m365-link {
  fill: none; stroke: var(--orange); stroke-width: 2;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  transition: stroke-dashoffset .9s ease;
}
.m365-link.is-drawn { stroke-dashoffset: 0; }
.reveal.visible .m365-link.is-drawn { animation: m365-dash-march 1.3s linear .9s infinite; }
@keyframes m365-dash-march { from { stroke-dasharray: 6 6; stroke-dashoffset: 0; } to { stroke-dasharray: 6 6; stroke-dashoffset: -24; } }

.m365-packet { fill: var(--orange); opacity: 0; transform: translate(92px, 90px); }
.reveal.visible .m365-packet { animation: m365-packet-travel 3s linear infinite; animation-delay: calc(.9s + var(--pd, 0s)); }
@keyframes m365-packet-travel {
  0% { transform: translate(92px, 90px); opacity: 0; }
  6% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translate(228px, 90px); opacity: 0; }
}
.m365-caption { font-size: 11px; font-weight: 600; fill: var(--text-muted); }

@media (max-width: 860px) {
  .m365-split { grid-template-columns: 1fr; text-align: center; }
  .m365-split__art { order: -1; }
}
@media (prefers-reduced-motion: reduce) {
  .m365-node__ring { transition: none; stroke-dashoffset: 0; }
  .m365-link { transition: none; stroke-dashoffset: 0; }
  .reveal.visible .m365-link.is-drawn { animation: none; }
  .m365-packet { display: none; }
}

/* ---------- Servizi aggiuntivi ---------- */
.addon-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 40px; }
.addon-card { background: var(--off-white); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.addon-card h3 { font-size: 1.05rem; margin-bottom: 10px; }
.addon-card p { font-size: .9rem; color: var(--text-muted); line-height: 1.6; }
@media (max-width: 700px) { .addon-grid { grid-template-columns: 1fr; } }

/* ---------- Perché HiBackup: card problema/risposta a dissolvenza incrociata ---------- */
.why-flip-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 44px; }
.why-flip {
  position: relative; min-height: 220px; border-radius: var(--radius); cursor: pointer;
  background: var(--off-white); border: 1px solid var(--border);
  transition: background .45s ease, border-color .45s ease;
  outline-offset: 3px;
}
.why-flip.is-active { background: var(--navy-dark); border-color: var(--navy-dark); }

.why-flip__face {
  position: absolute; inset: 0; padding: 26px 24px; display: flex; flex-direction: column; gap: 14px;
  opacity: 1; transform: translateY(0);
  transition: opacity .4s ease, transform .4s ease;
}
.why-flip__icon { width: 26px; height: 26px; flex-shrink: 0; }

.why-flip__face--problem { color: var(--navy-mid); }
.why-flip__face--problem .why-flip__icon { color: #e9604a; }
.why-flip__face--problem p { font-size: .92rem; line-height: 1.55; font-weight: 600; }

.why-flip__face--answer { color: rgba(255,255,255,.9); opacity: 0; transform: translateY(10px); }
.why-flip__face--answer .why-flip__icon { color: var(--orange); }
.why-flip__face--answer p { font-size: .9rem; line-height: 1.6; }

.why-flip.is-active .why-flip__face--problem { opacity: 0; transform: translateY(-10px); }
.why-flip.is-active .why-flip__face--answer { opacity: 1; transform: translateY(0); }

.why-flip-hint { text-align: center; margin-top: 22px; font-size: .82rem; color: var(--text-muted); }

@media (max-width: 960px) { .why-flip-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .why-flip-grid { grid-template-columns: 1fr; } .why-flip { min-height: 180px; } }
@media (prefers-reduced-motion: reduce) {
  .why-flip, .why-flip__face { transition: none; }
}

/* ---------- Chiusura ---------- */
.hibackup-closing { padding: 60px 0; }
.hibackup-closing__text { font-size: 1.2rem; font-weight: 700; color: var(--navy-dark); display: flex; align-items: center; justify-content: center; gap: 12px; }
.hibackup-closing__text .live-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #2ecc71; box-shadow: 0 0 0 0 rgba(46,204,113,.6); animation: sec-live-pulse 2.2s infinite; flex-shrink: 0; }
@media (prefers-reduced-motion: reduce) {
  .hibackup-closing__text .live-dot { animation: none; box-shadow: none; }
}
