/* ===== Animazioni ===== */
/* Apertura: lo slogan entra riga per riga */
.js .slogan span, .js .hero .label, .js .hero-row { opacity: 0; transform: translateY(18px); }
.js .hero.in .slogan span, .js .hero.in .label, .js .hero.in .hero-row { animation: rise .7s var(--ease) forwards; }
.js .hero.in .slogan span:nth-child(1) { animation-delay: .08s; }
.js .hero.in .slogan span:nth-child(2) { animation-delay: .18s; }
.js .hero.in .slogan span:nth-child(3) { animation-delay: .28s; }
.js .hero.in .hero-row { animation-delay: .45s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* Comparsa allo scroll con piccolo ritardo a cascata */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s var(--ease), transform .6s var(--ease), border-color .25s var(--ease); transition-delay: var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }

/* Competenze: le tacche si riempiono una dopo l'altra */
.js .lvl .pip.on { transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease); }
.js .lvl.in .pip.on { transform: scaleX(1); }
.js .lvl.in .pip.on:nth-child(2) { transition-delay: .08s; }
.js .lvl.in .pip.on:nth-child(3) { transition-delay: .16s; }
.js .lvl.in .pip.on:nth-child(4) { transition-delay: .24s; }
.js .lvl.in .pip.on:nth-child(5) { transition-delay: .32s; }

/* Metodo: la linea che unisce i passaggi si disegna */
@media (min-width: 1100px) {
  .js .steps::before { transform: scaleX(0); transform-origin: left; transition: transform 1.2s var(--ease) .2s; }
  .js .steps.in::before { transform: scaleX(1); }
}

/* Progetti: gli anelli curati si accendono in sequenza */
.js .chain li.on::before { transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ease); }
.js .chain.in li.on::before { transform: scaleX(1); }
.js .chain.in li:nth-child(2)::before { transition-delay: .1s; }
.js .chain.in li:nth-child(3)::before { transition-delay: .2s; }
.js .chain.in li:nth-child(4)::before { transition-delay: .3s; }
.js .chain.in li:nth-child(5)::before { transition-delay: .4s; }

/* Risposta al passaggio del mouse */
.js .reveal.in.project:hover, .js .reveal.in.step:hover { transform: translateY(-4px); transition-delay: 0ms; }
.project:hover, .step:hover, .service:hover, .lvl-group:hover { border-color: #3A4350; }
.btn { transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .15s var(--ease); }
.btn:active { transform: scale(.97); }
.dot, .logo-mark { animation: breathe 2.6s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 0 6px rgba(94, 234, 212, .12); } }

/* Competenze in crescita: freccia verso l'alto */
.lvl { grid-template-columns: 1fr auto auto 18px; }
.lvl-up { display: inline-grid; place-items: center; width: 18px; height: 18px; color: var(--accent); }
.lvl-ui .lvl-up { color: var(--ui); }
.lvl-up svg { animation: blink 1.1s steps(1, end) infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .15; } }
@keyframes up { 0%, 100% { transform: translateY(2px); opacity: .6; } 50% { transform: translateY(-2px); opacity: 1; } }

/* Apertura: dati che cambiano */
.raw tr td:nth-child(2) { transition: color .3s var(--ease), background-color .3s var(--ease); }
.raw tr.changed td:nth-child(2) { color: var(--accent); background: var(--accent-tint); }
.tf-chain li { transition: background-color .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease); }
.tf-chain li.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-tint); }
.tf-chain li:last-child.active { background: var(--ui); border-color: var(--ui); box-shadow: 0 0 0 4px var(--ui-tint); }
.bar { transition: height .7s var(--ease); }
.mock-total { transition: color .3s var(--ease); }
.ui-update .mock-total { color: var(--ui); }
.month-code { color: #F5C987; }
.tf-foot { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; margin-top: 16px; }
.tf-foot .tf-cap { margin-top: 0; }
.tf-toggle { min-height: 40px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: transparent; color: var(--muted); font: 400 .8rem var(--mono); cursor: pointer; transition: border-color .2s var(--ease), color .2s var(--ease); }
.tf-toggle:hover { border-color: var(--accent); color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .js .slogan span, .js .hero .label, .js .hero-row, .js .reveal { opacity: 1 !important; transform: none !important; }
  .js .lvl .pip.on, .js .chain li.on::before, .js .steps::before { transform: none !important; }
}

.contact-accent { color: var(--accent); }
