/* Sezioni della home: tre passi e fascia finale scura. */

/* Tre passi: un anello di luce pulsa attorno ai numeri, uno dopo l'altro */
.steps { --steps-gap: 72px; list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(3, 1fr); gap: var(--steps-gap); } }
.step-n::after {
  content: ""; position: absolute; inset: -7px; border-radius: 50%;
  border: 2px solid var(--vivid-sky); opacity: 0; animation: step-ping 6s ease-out infinite;
}
.step:nth-child(2) .step-n::after { animation-delay: 1.32s; }
.step:nth-child(3) .step-n::after { animation-delay: 2.64s; }
@keyframes step-ping { 0% { opacity: 0.9; transform: scale(0.9); } 15%, 100% { opacity: 0; transform: scale(1.7); } }
.step { position: relative; text-align: center; padding: 28px 24px 26px; }
.step-n {
  width: 40px; height: 40px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 50%;
  font: 700 15px/1 "JetBrains Mono", ui-monospace, monospace; color: #fff;
  background: var(--grad-vivid); box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.9), var(--glow-vivid);
  position: relative; z-index: 1;
}
.step h3 { font-size: 17px; margin-bottom: 8px; }
.step p { font-size: 14.5px; margin: 0; }

/* Ciclo di 6 s: si attiva il passo 1, un nodo corre al 2 e lo accende, poi al 3; tutto in loop.
   Solo opacity e transform (compositor): consumo minimo. Sotto 860 px niente collegamenti, resta l'accensione. */
.step::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; opacity: 0;
  border: 1.5px solid var(--vivid-sky);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--vivid-sky) 18%, transparent), 0 14px 40px -14px var(--vivid-sky);
}
.step:nth-child(1)::before { animation: ring-1 6s linear infinite; }
.step:nth-child(2)::before { animation: ring-2 6s linear infinite; }
.step:nth-child(3)::before { animation: ring-3 6s linear infinite; }
@keyframes ring-1 { 0% { opacity: 0; } 3%, 78% { opacity: 1; } 92%, 100% { opacity: 0; } }
@keyframes ring-2 { 0%, 19% { opacity: 0; } 22%, 78% { opacity: 1; } 92%, 100% { opacity: 0; } }
@keyframes ring-3 { 0%, 41% { opacity: 0; } 44%, 78% { opacity: 1; } 92%, 100% { opacity: 0; } }

.link { display: none; }
@media (min-width: 860px) {
  .link { display: block; position: absolute; left: 100%; top: 17px; width: var(--steps-gap); height: 60px; pointer-events: none; }
  .link svg { display: block; width: 100%; height: 100%; overflow: visible; fill: none; stroke-linecap: round; }
  .link .t { stroke: color-mix(in srgb, var(--text-main) 10%, transparent); stroke-width: 2; }
  .link .f { stroke: var(--vivid-sky); stroke-width: 2.5; stroke-dasharray: 1; stroke-dashoffset: 1; }
  .link i {
    position: absolute; left: 0; top: 0; width: 14px; height: 14px; border-radius: 50%; opacity: 0;
    background: radial-gradient(circle at 35% 35%, #fff 0, var(--vivid-cyan) 40%, var(--vivid-blue) 100%);
    box-shadow: 0 0 14px 3px color-mix(in srgb, var(--vivid-sky) 55%, transparent);
    offset-path: path("M0 30 C 26 2, 46 58, 72 30"); offset-rotate: 0deg; offset-distance: 0%;
  }
  .link.l1 .f { animation: fill-1 6s linear infinite; } .link.l1 i { animation: node-1 6s linear infinite; }
  .link.l2 .f { animation: fill-2 6s linear infinite; } .link.l2 i { animation: node-2 6s linear infinite; }
}
@keyframes fill-1 { 0%, 6% { stroke-dashoffset: 1; opacity: 1; animation-timing-function: ease-in-out; } 20%, 78% { stroke-dashoffset: 0; opacity: 1; } 92%, 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes fill-2 { 0%, 28% { stroke-dashoffset: 1; opacity: 1; animation-timing-function: ease-in-out; } 42%, 78% { stroke-dashoffset: 0; opacity: 1; } 92%, 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes node-1 { 0%, 6% { opacity: 0; offset-distance: 0%; transform: scale(0.4); } 8% { opacity: 1; offset-distance: 0%; transform: scale(1); animation-timing-function: ease-in-out; } 20% { opacity: 1; offset-distance: 100%; transform: scale(1); } 23%, 100% { opacity: 0; offset-distance: 100%; transform: scale(1.8); } }
@keyframes node-2 { 0%, 28% { opacity: 0; offset-distance: 0%; transform: scale(0.4); } 30% { opacity: 1; offset-distance: 0%; transform: scale(1); animation-timing-function: ease-in-out; } 42% { opacity: 1; offset-distance: 100%; transform: scale(1); } 45%, 100% { opacity: 0; offset-distance: 100%; transform: scale(1.8); } }

/* Fascia finale: l'unico fondo scuro del sito, con la luce dell'orb dietro */
.cta-dark {
  position: relative; overflow: hidden; isolation: isolate; text-align: center;
  padding: 72px 24px; border-radius: var(--radius-panel);
  background: var(--dark-panel-bg); color: var(--dark-panel-text);
  box-shadow: 0 40px 80px -30px rgba(15, 23, 42, 0.45);
}
.cta-dark::before, .cta-dark::after {
  content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(70px); opacity: 0.75;
}
.cta-dark::before {
  width: 520px; height: 420px; left: -8%; top: -30%;
  background: radial-gradient(circle, var(--vivid-cyan), transparent 65%); animation: cta-a 14s ease-in-out infinite alternate;
}
.cta-dark::after {
  width: 560px; height: 460px; right: -10%; bottom: -40%;
  background: radial-gradient(circle, var(--vivid-blue), transparent 65%); animation: cta-b 17s ease-in-out infinite alternate;
}
@keyframes cta-a { to { transform: translate(120px, 60px) scale(1.1); } }
@keyframes cta-b { to { transform: translate(-140px, -40px) scale(0.92); } }
/* Griglia tecnica sottile, sfumata al centro */
.cta-grid {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--dark-panel-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--dark-panel-border) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask: radial-gradient(ellipse at center, #000 20%, transparent 70%);
  mask: radial-gradient(ellipse at center, #000 20%, transparent 70%);
}
.cta-dark h2 { color: #fff; font-size: clamp(28px, 4vw, 44px); letter-spacing: -0.03em; max-width: 720px; margin: 0 auto 14px; }
.cta-dark p { color: #cbd5e1; max-width: 560px; margin: 0 auto 28px; font-size: 16.5px; }
.cta-dark .cta-row { justify-content: center; }
.btn-light { background: #fff; color: var(--text-main); padding: 12px 24px; box-shadow: 0 10px 30px -8px color-mix(in srgb, var(--vivid-cyan) 50%, transparent); }
.btn-light:hover { color: var(--text-main); transform: translateY(-1px); box-shadow: 0 14px 40px -8px color-mix(in srgb, var(--vivid-cyan) 70%, transparent); }
.btn-ghost { color: #fff; padding: 11px 22px; border: 1px solid rgba(255, 255, 255, 0.28); }
.btn-ghost:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.grad-text-light {
  background: var(--grad-text-light); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: grad-shift 8s ease-in-out infinite alternate;
}

@media (prefers-reduced-motion: reduce) {
  .step-n::after, .step::before, .link .f, .link i, .cta-dark::before, .cta-dark::after, .grad-text-light { animation: none !important; }
  .link .f { stroke-dashoffset: 0; }
}
