/* Macro area «Sviluppo & AI» (sviluppo-ai/index.html): editor in hero, indice, gruppi di servizi, metodo.
   Animazioni solo CSS: ciclo di 24 s, quattro pannelli (sito, plugin, connettore, chatbot) da 6 s l'uno.
   Con prefers-reduced-motion resta fermo il primo pannello, tutto scritto. */

/* ---------- hero: editor che scrive codice ---------- */
.sa-hero h1 { margin-top: 18px; }
.sa-ide {
  position: relative; border-radius: 18px; overflow: hidden; color: #cbd5e1;
  background: #070c17; border: 1px solid var(--dark-line);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .02) inset;
  font-family: var(--mono); font-size: 13px; line-height: 1.75;
}
.sa-ide-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; background: rgba(255, 255, 255, .03); border-bottom: 1px solid var(--dark-line); }
.sa-ide-bar i { width: 11px; height: 11px; border-radius: 50%; display: block; background: #334155; }
.sa-ide-bar i:nth-child(1) { background: #f87171; }
.sa-ide-bar i:nth-child(2) { background: #fbbf24; }
.sa-ide-bar i:nth-child(3) { background: #34d399; }
.sa-ide-bar span { margin-left: 10px; font-size: 12px; color: var(--dark-muted); }
.sa-tabs { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--dark-line); }
.sa-tabs span {
  padding: 9px 6px; text-align: center; font-size: 11.5px; color: var(--dark-muted);
  border-bottom: 2px solid transparent; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  animation: sa-tab 24s linear infinite;
}
.sa-tabs span:nth-child(1) { animation-delay: 0s; }
.sa-tabs span:nth-child(2) { animation-delay: 6s; }
.sa-tabs span:nth-child(3) { animation-delay: 12s; }
.sa-tabs span:nth-child(4) { animation-delay: 18s; }
.sa-stage { display: grid; padding: 16px 18px 56px; min-height: 168px; } /* sotto: posto per il float-badge fb-1 */
.sa-pane { grid-area: 1 / 1; opacity: 0; animation: sa-pane 24s linear infinite; }
.sa-pane:nth-child(1) { animation-delay: 0s; }
.sa-pane:nth-child(2) { animation-delay: 6s; }
.sa-pane:nth-child(3) { animation-delay: 12s; }
.sa-pane:nth-child(4) { animation-delay: 18s; }
.sa-pane .ln {
  white-space: pre-wrap; word-break: break-word; min-height: 1.75em;
  clip-path: inset(0 100% 0 0); animation: sa-type 24s linear infinite;
}
.sa-pane:nth-child(1) .ln:nth-child(1) { animation-delay: 0s; }
.sa-pane:nth-child(1) .ln:nth-child(2) { animation-delay: .6s; }
.sa-pane:nth-child(1) .ln:nth-child(3) { animation-delay: 1.2s; }
.sa-pane:nth-child(1) .ln:nth-child(4) { animation-delay: 1.8s; }
.sa-pane:nth-child(1) .ln:nth-child(5) { animation-delay: 2.7s; }
.sa-pane:nth-child(2) .ln:nth-child(1) { animation-delay: 6s; }
.sa-pane:nth-child(2) .ln:nth-child(2) { animation-delay: 6.6s; }
.sa-pane:nth-child(2) .ln:nth-child(3) { animation-delay: 7.2s; }
.sa-pane:nth-child(2) .ln:nth-child(4) { animation-delay: 7.8s; }
.sa-pane:nth-child(2) .ln:nth-child(5) { animation-delay: 8.7s; }
.sa-pane:nth-child(3) .ln:nth-child(1) { animation-delay: 12s; }
.sa-pane:nth-child(3) .ln:nth-child(2) { animation-delay: 12.6s; }
.sa-pane:nth-child(3) .ln:nth-child(3) { animation-delay: 13.2s; }
.sa-pane:nth-child(3) .ln:nth-child(4) { animation-delay: 13.8s; }
.sa-pane:nth-child(3) .ln:nth-child(5) { animation-delay: 14.7s; }
.sa-pane:nth-child(4) .ln:nth-child(1) { animation-delay: 18s; }
.sa-pane:nth-child(4) .ln:nth-child(2) { animation-delay: 18.6s; }
.sa-pane:nth-child(4) .ln:nth-child(3) { animation-delay: 19.2s; }
.sa-pane:nth-child(4) .ln:nth-child(4) { animation-delay: 19.8s; }
.sa-pane:nth-child(4) .ln:nth-child(5) { animation-delay: 20.7s; }
.sa-ide .k { color: var(--a-hi); }
.sa-ide .s { color: #fbbf24; }
.sa-ide .c { color: #718096; }
.sa-ide .ok { color: #34d399; }

@keyframes sa-pane { 0% { opacity: 0; } 1.5% { opacity: 1; } 24% { opacity: 1; } 25% { opacity: 0; } 100% { opacity: 0; } }
@keyframes sa-tab {
  0% { color: #fff; border-bottom-color: var(--a-hi); }
  24.9% { color: #fff; border-bottom-color: var(--a-hi); }
  25% { color: var(--dark-muted); border-bottom-color: transparent; }
  100% { color: var(--dark-muted); border-bottom-color: transparent; }
}
@keyframes sa-type {
  0% { clip-path: inset(0 100% 0 0); animation-timing-function: steps(26, end); }
  4% { clip-path: inset(0 0 0 0); }
  24% { clip-path: inset(0 0 0 0); }
  24.5% { clip-path: inset(0 100% 0 0); }
  100% { clip-path: inset(0 100% 0 0); }
}

@media (prefers-reduced-motion: reduce) {
  .sa-tabs span, .sa-pane, .sa-pane .ln { animation: none; }
  .sa-tabs span:nth-child(1) { color: #fff; border-bottom-color: var(--a-hi); }
  .sa-pane:nth-child(1) { opacity: 1; }
  .sa-pane .ln { clip-path: none; }
}

/* ---------- indice dell'area ---------- */
.sa-index { background: var(--bg); border-bottom: 1px solid var(--line); }
.sa-index .container { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding-top: 18px; padding-bottom: 18px; }
.sa-index p { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sa-index ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.sa-index a {
  display: inline-flex; align-items: center; padding: 8px 16px; border-radius: 99px; text-decoration: none;
  font-size: 14.5px; font-weight: 600; color: var(--ink-2); background: #fff; border: 1px solid var(--line);
}
.sa-index a:hover { border-color: var(--a); color: var(--a); }

/* ---------- gruppi di servizi: testata a sinistra, card a destra ---------- */
.sa-group { padding: clamp(56px, 7vw, 88px) 0; }
.sa-group + .sa-group { border-top: 1px solid var(--line); }
.sa-group.alt { background: var(--bg-2); }
.sa-g { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); align-items: start; }
.sa-g-head { position: sticky; top: 104px; }
.sa-g-head .h2 { margin: 14px 0 14px; font-size: clamp(1.6rem, 2.6vw, 2.1rem); }
.sa-g-head p { color: var(--muted); margin: 0 0 18px; }
.sa-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.sa-cards .card .ico { margin-bottom: 14px; }
.sa-cards .card.sa-wide { grid-column: 1 / -1; }
.sa-cards .card h3 { font-size: 1.12rem; }
.sa-cards .card-tag { margin-bottom: 12px; }

/* ---------- come lavoro ---------- */
.sa-method { padding: clamp(56px, 7vw, 88px) 0; }
.sa-method .section-head { margin-bottom: 32px; }
.sa-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; counter-reset: sa; }
.sa-steps li {
  position: relative; counter-increment: sa; padding: 22px 22px 24px; border-radius: 18px;
  background: rgba(255, 255, 255, .035); border: 1px solid var(--dark-line);
}
.sa-steps li::before {
  content: "0" counter(sa); display: block; margin-bottom: 14px;
  font-family: var(--mono); font-size: 13px; font-weight: 700; letter-spacing: .08em; color: var(--a-hi);
}
.sa-steps h3 { font-size: 1.1rem; margin: 0 0 8px; }
.sa-steps p { margin: 0; font-size: 15px; color: var(--dark-muted); }

/* ---------- chiusura ---------- */
.sa-close { padding: clamp(48px, 6vw, 72px) 0; }

@media (max-width: 1000px) {
  .sa-g { grid-template-columns: 1fr; gap: 24px; }
  .sa-g-head { position: static; }
  .sa-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .sa-cards, .sa-steps { grid-template-columns: 1fr; }
  .sa-ide { font-size: 12px; }
  .sa-stage { min-height: 190px; padding: 14px 14px 52px; }
  .sa-tabs span { font-size: 10.5px; padding: 8px 2px; }
  .sa-index .container { padding-top: 14px; padding-bottom: 14px; }
}
