/* ═══════════════ FONT (self-hosted: nessuna richiesta a Google) ═══════════════ */
@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/inter-latin-var.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ═══════════════ RESET & TOKEN ═══════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #ffffff;
  --bg-alt:    #f5f7fc;
  --ink:       #0f172a;
  --ink-soft:  #475569;
  --ink-mute:  #94a3b8;
  --line:      #e2e8f0;
  --brand:     #4f46e5;
  --brand-2:   #7c3aed;
  --brand-ink: #4338ca;
  --accent:    #06b6d4;
  --good:      #059669;
  --bad:       #dc2626;
  --card:      #ffffff;
  --shadow:    0 10px 30px -12px rgba(15, 23, 42, .18);
  --shadow-lg: 0 30px 60px -22px rgba(79, 70, 229, .35);
  --radius:    16px;
  --radius-sm: 10px;
  --maxw:      1160px;
}

html:not(.js) { scroll-behavior: smooth; }
html { scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid rgba(79,70,229,.55); outline-offset: 2px; border-radius: 6px; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 780px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

.ico { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico-lg { width: 28px; height: 28px; }

/* ═══════════════ BUTTONS ═══════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; font-weight: 600; font-size: 15px; font-family: inherit;
  padding: 12px 22px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: transform .15s ease, box-shadow .2s ease, border-color .2s, color .2s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:disabled { opacity: .6; cursor: progress; transform: none; }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 8px 20px -8px rgba(79,70,229,.6); }
.btn-primary:hover { box-shadow: 0 12px 26px -8px rgba(79,70,229,.7); color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-sm { padding: 9px 16px; font-size: 14px; }
.btn-lg { padding: 15px 28px; font-size: 16px; }
.btn-block { width: 100%; }

/* ═══════════════ HEADER ═══════════════ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s;
}
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 20px -16px rgba(15,23,42,.4); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark { display: block; width: 34px; height: 34px; }
.brand-name { letter-spacing: .03em; }
.nav { display: flex; align-items: center; gap: 24px; }
.nav a { color: var(--ink-soft); font-weight: 500; font-size: 15px; }
.nav a:hover { color: var(--brand); text-decoration: none; }
.nav a.btn-primary { color: #fff; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ═══════════════ HERO ═══════════════ */
.hero { position: relative; overflow: hidden; padding: 40px 0 88px; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 55% at 12% 0%, rgba(124,58,237,.11), transparent 60%),
    radial-gradient(55% 50% at 100% 8%, rgba(6,182,212,.13), transparent 55%),
    linear-gradient(180deg, #fbfcff, #ffffff);
}
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 36px; justify-items: center; text-align: center; }
.pill {
  display: inline-block; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  color: var(--brand-ink); background: rgba(79,70,229,.09); border: 1px solid rgba(79,70,229,.18); margin-bottom: 20px;
}
.hero-copy h1 { max-width: 17ch; margin: 0 auto; font-size: clamp(2.3rem, 6vw, 4.4rem); line-height: 1.05; font-weight: 800; letter-spacing: -.03em; text-wrap: balance; }
.grad { background: linear-gradient(120deg, var(--brand), var(--brand-2) 55%, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 1.15rem; color: var(--ink-soft); margin: 18px auto 24px; max-width: 60ch; }
.lead strong { color: var(--ink); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 26px; justify-content: center; }
.hero-badges { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 20px; color: var(--ink-soft); font-size: 14.5px; font-weight: 500; }
.hero-badges li { display: inline-flex; align-items: center; gap: 6px; }
.hero-badges .ico { color: var(--good); stroke-width: 2.4; }

/* cornice "browser" per le schermate */
.frame { border-radius: 14px; overflow: hidden; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.frame-bar { display: flex; gap: 6px; padding: 10px 14px; background: #f1f5f9; border-bottom: 1px solid var(--line); }
.frame-bar i { width: 10px; height: 10px; border-radius: 50%; background: #cbd5e1; }
.frame img { width: 100%; height: auto; }

/* ═══════════════ FATTI ═══════════════ */
.facts { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; }
.facts-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding-top: 28px; padding-bottom: 28px; }
.fact { display: flex; gap: 14px; align-items: flex-start; padding: 6px 12px; }
.fact .ico { color: var(--brand); margin-top: 2px; }
.fact strong { display: block; font-size: 15px; }
.fact span { display: block; font-size: 13.5px; color: var(--ink-soft); line-height: 1.45; margin-top: 2px; }

/* ═══════════════ SECTIONS ═══════════════ */
.section { padding: 92px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { text-align: center; max-width: 700px; margin: 0 auto 52px; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); margin-bottom: 12px; }
.eyebrow-light { color: #c7d2fe; }
.section-head h2, .split-copy h2 { font-size: clamp(1.7rem, 3.2vw, 2.45rem); font-weight: 800; letter-spacing: -.025em; line-height: 1.15; text-wrap: balance; }
.section-head p { color: var(--ink-soft); font-size: 1.06rem; margin-top: 14px; }
.note { font-size: 13.5px; color: var(--ink-soft); margin-top: 14px; }
.sub { color: var(--ink-soft); font-size: 14.5px; margin: 6px 0 16px; }

/* ═══════════════ PROBLEMA ═══════════════ */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.compare-col { border-radius: var(--radius); padding: 30px; border: 1px solid var(--line); }
.compare-col h3 { font-size: 1.1rem; margin-bottom: 16px; }
.compare-col ul { list-style: none; display: grid; gap: 12px; }
.compare-col li { display: flex; gap: 10px; align-items: flex-start; }
.compare-col .ico { margin-top: 3px; stroke-width: 2.4; }
.compare-before { background: #fff; }
.compare-before .ico { color: var(--bad); }
.compare-before li { color: var(--ink-soft); }
.compare-after { background: linear-gradient(160deg, rgba(79,70,229,.07), rgba(6,182,212,.08)); border-color: rgba(79,70,229,.25); }
.compare-after .ico { color: var(--good); }

/* ═══════════════ MARGINE ═══════════════ */
.models { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.model { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; }
.tag { display: inline-block; font-size: 12.5px; font-weight: 700; padding: 4px 12px; border-radius: 999px; background: rgba(79,70,229,.1); color: var(--brand-ink); margin-bottom: 14px; }
.tag-2 { background: rgba(6,182,212,.14); color: #0e7490; }
.model h3 { font-size: 1.3rem; margin-bottom: 8px; }
.model > p { color: var(--ink-soft); margin-bottom: 14px; }
.tick { list-style: none; display: grid; gap: 9px; }
.tick li { position: relative; padding-left: 26px; font-size: 15px; color: var(--ink-soft); }
.tick li::before {
  content: ""; position: absolute; left: 0; top: 5px; width: 16px; height: 16px; border-radius: 50%;
  background: rgba(5,150,105,.14) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23059669' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center/11px no-repeat;
}
.tick li b { color: var(--ink); }

.margin-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 24px; }
.cost-rules, .calc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; }
.cost-rules h3, .calc h3 { font-size: 1.15rem; }
.cost-rules ol { list-style: none; counter-reset: r; display: grid; gap: 10px; }
.cost-rules li { counter-increment: r; display: grid; grid-template-columns: 30px 1fr; column-gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-alt); }
.cost-rules li::before { content: counter(r); grid-row: span 2; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.cost-rules li b { font-size: 15px; }
.cost-rules li span { font-size: 14px; color: var(--ink-soft); }
.cost-rules li em { font-style: normal; font-weight: 600; color: var(--brand-ink); }

.calc-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.calc-fields label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.calc-fields input {
  font: inherit; font-size: 16px; font-weight: 600; color: var(--ink); width: 100%;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff;
}
.calc-fields input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79,70,229,.18); }
.calc-out { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.calc-out div { background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.calc-out dt { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; }
.calc-out dd { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.calc-out .hl { background: linear-gradient(135deg, rgba(79,70,229,.1), rgba(6,182,212,.12)); border-color: rgba(79,70,229,.3); }
.calc-out .hl dd { color: var(--brand-ink); }
.calc-out .neg dd { color: var(--bad); }

/* ═══════════════ FEATURES ═══════════════ */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; transition: transform .18s ease, box-shadow .2s ease, border-color .2s ease;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: rgba(79,70,229,.35); }
.feature-ico { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 13px; background: linear-gradient(135deg, rgba(79,70,229,.12), rgba(6,182,212,.14)); color: var(--brand); margin-bottom: 16px; }
.feature-ico .ico { width: 24px; height: 24px; }
.feature-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.feature-card p { color: var(--ink-soft); font-size: .96rem; }

/* ═══════════════ TOUR ═══════════════ */
.tour { max-width: 1000px; margin: 0 auto; }
.tour-tabs { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 26px; }
.tour-tabs button {
  font: inherit; font-weight: 600; font-size: 14.5px; padding: 9px 18px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-soft); cursor: pointer; transition: .15s;
}
.tour-tabs button:hover { color: var(--brand); border-color: var(--brand); }
.tour-tabs button[aria-selected="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.tour-panel figcaption { text-align: center; color: var(--ink-soft); margin-top: 18px; font-size: .98rem; }
.tour-panel figcaption strong { color: var(--ink); }
.tour-panel:not([hidden]) { animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ═══════════════ AI ═══════════════ */
.split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center; }
.split-copy > p { color: var(--ink-soft); margin: 16px 0 20px; font-size: 1.04rem; }
.split-copy .tick { margin-bottom: 4px; gap: 14px; }
.ai-card { background: #0f172a; color: #e2e8f0; border-radius: 20px; padding: 26px; box-shadow: var(--shadow-lg); max-width: 440px; margin: 0 auto; }
.ai-row { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.ai-row b { color: #fff; }
.ai-row .muted { margin-left: auto; font-size: 12.5px; color: #94a3b8; }
.dot { width: 9px; height: 9px; border-radius: 50%; }
.dot-a { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245,158,11,.2); }
.ai-lines { display: grid; gap: 8px; margin: 16px 0; }
.ai-lines i { height: 8px; border-radius: 4px; background: linear-gradient(90deg, rgba(148,163,184,.35), rgba(148,163,184,.12)); }
.ai-arrow { display: grid; place-items: center; color: #a5b4fc; margin: 4px 0 10px; }
.ai-arrow .ico { transform: rotate(90deg); width: 22px; height: 22px; }
.ai-out { display: grid; gap: 8px; }
.ai-out div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.06); font-size: 13.5px; }
.ai-out span { color: #94a3b8; }
.ai-out b { color: #fff; text-align: right; }
.ai-foot { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; font-size: 13px; color: #6ee7b7; }

/* ═══════════════ SICUREZZA ═══════════════ */
.roles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 34px; }
.role { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.role h3 { font-size: 1.02rem; margin-bottom: 8px; }
.role p { font-size: 14.5px; color: var(--ink-soft); }
.sec-list { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 28px; }
.sec-list li { display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink-soft); font-size: 15px; }
.sec-list li:last-child:nth-child(odd) { grid-column: 1 / -1; }
.sec-list .ico { color: var(--brand); width: 24px; height: 24px; margin-top: 2px; }
.sec-list b { color: var(--ink); }

/* ═══════════════ STEPS ═══════════════ */
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.steps li { position: relative; padding: 30px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.step-n { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 800; margin-bottom: 16px; }
.steps h3 { font-size: 1.15rem; margin-bottom: 8px; }
.steps p { color: var(--ink-soft); font-size: .98rem; }

/* ═══════════════ FAQ ═══════════════ */
.faq details {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 4px 20px; margin-bottom: 12px; transition: border-color .2s;
}
.faq details[open] { border-color: rgba(79,70,229,.35); }
.faq summary {
  cursor: pointer; font-weight: 600; font-size: 1.03rem; padding: 16px 0; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; color: var(--brand); font-weight: 400; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--ink-soft); padding: 0 0 18px; }

/* ═══════════════ CONTATTI ═══════════════ */
.section-cta { background: radial-gradient(80% 120% at 50% 0%, #1e1b4b, #0f172a); color: #e2e8f0; }
.section-cta .section-head h2 { color: #fff; }
.section-cta .section-head p { color: #c7d2fe; }
.contact-form {
  background: rgba(255,255,255,.04); border: 1px solid rgba(199,210,254,.16);
  border-radius: var(--radius); padding: 32px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { margin-bottom: 18px; display: flex; flex-direction: column; }
.field label { font-size: 14px; font-weight: 600; margin-bottom: 7px; color: #e2e8f0; }
.field input, .field textarea, .field select {
  font-family: inherit; font-size: 16px; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid rgba(199,210,254,.22); background: rgba(15,23,42,.55); color: #fff; transition: border-color .2s, box-shadow .2s;
}
.field select option { color: #0f172a; }
.field input::placeholder, .field textarea::placeholder { color: #7c8aa5; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(124,58,237,.3); }
.field-check { margin-top: 4px; }
.check { flex-direction: row !important; align-items: flex-start; gap: 10px; font-weight: 400 !important; font-size: 13.5px !important; color: #c7d2fe !important; cursor: pointer; display: flex; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand-2); flex: none; }
.check a { color: #a5b4fc; text-decoration: underline; }
.form-note { margin-top: 14px; text-align: center; font-weight: 600; font-size: 14.5px; min-height: 20px; }
.form-note.ok { color: #6ee7b7; }
.form-note.err { color: #fca5a5; }
.contact-alt { text-align: center; margin-top: 24px; color: #c7d2fe; font-size: 15px; }
.contact-alt a { color: #a5b4fc; font-weight: 600; }

/* ═══════════════ FOOTER ═══════════════ */
.site-footer { background: #0b1220; color: #cbd5e1; padding: 48px 0 28px; }
.footer-inner { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; padding-bottom: 28px; border-bottom: 1px solid rgba(255,255,255,.08); }
.foot-logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; color: #fff; }
.foot-brand p { color: var(--ink-mute); font-size: 14px; margin-top: 12px; }
.foot-nav { display: flex; gap: 12px 26px; flex-wrap: wrap; align-items: center; }
.foot-nav a { color: #cbd5e1; font-size: 14.5px; }
.foot-nav a:hover { color: #fff; text-decoration: none; }
.foot-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 22px; color: var(--ink-mute); font-size: 13px; }

/* ═══════════════ REVEAL (solo con JS) ═══════════════ */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* ═══════════════ RESPONSIVE ═══════════════ */
@media (max-width: 980px) {
  .hero-grid, .split { grid-template-columns: 1fr; gap: 40px; }
  .facts-grid, .roles { grid-template-columns: 1fr 1fr; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .margin-grid, .models, .compare, .steps, .sec-list { grid-template-columns: 1fr; }
  .nav { display: none; }
  .nav.open {
    display: flex; flex-direction: column; align-items: stretch; gap: 4px;
    position: absolute; top: 68px; left: 0; right: 0; background: #fff;
    border-bottom: 1px solid var(--line); padding: 12px 24px 20px; box-shadow: var(--shadow);
  }
  .nav.open a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav.open a.btn-primary { border: none; margin-top: 8px; text-align: center; }
  .nav-toggle { display: flex; }
}
@media (max-width: 640px) {
  .section { padding: 64px 0; }
  .hero { padding: 36px 0 52px; }
  .feature-grid, .form-row, .facts-grid, .roles { grid-template-columns: 1fr; }
  .calc-fields { grid-template-columns: 1fr 1fr; }
  .calc-fields label:first-child { grid-column: 1 / -1; }
  .contact-form, .cost-rules, .calc, .model, .compare-col { padding: 22px; }
  .hero-cta .btn { width: 100%; }
  .tour-tabs button { padding: 8px 14px; }
}
/* ═══════════════ ANIMAZIONI ═══════════════ */
/* barra di avanzamento della lettura */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--brand), var(--brand-2), var(--accent)); }

/* header che si compatta */
.header-inner { transition: height .25s ease; }
.site-header.scrolled .header-inner { height: 58px; }

/* voce di menu attiva */
.nav a:not(.btn) { position: relative; }
.nav a:not(.btn)::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; border-radius: 2px; background: var(--brand); transform: scaleX(0); transition: transform .25s ease; }
.nav a.active:not(.btn) { color: var(--brand); }
.nav a.active:not(.btn)::after { transform: scaleX(1); }

/* hero: ingresso a cascata */
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes pop  { from { opacity: 0; transform: translateY(36px) scale(.96); } to { opacity: 1; transform: none; } }
.js .hero-copy > * { animation: rise .8s cubic-bezier(.2,.7,.2,1) both; }
.js .hero-copy > :nth-child(1) { animation-delay: .05s; }
.js .hero-copy > :nth-child(2) { animation-delay: .15s; }
.js .hero-copy > :nth-child(3) { animation-delay: .28s; }
.js .hero-copy > :nth-child(4) { animation-delay: .4s; }
.js .hero-copy > :nth-child(5) { animation-delay: .52s; }

/* sfondo che respira */
@keyframes drift { from { transform: translate3d(-4%, -2%, 0) scale(1); } to { transform: translate3d(5%, 4%, 0) scale(1.12); } }
.hero::after { content: ""; position: absolute; z-index: -1; width: 620px; height: 620px; right: -140px; top: -120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,237,.16), transparent 65%); filter: blur(20px); animation: drift 14s ease-in-out infinite alternate; pointer-events: none; }

/* titolo con gradiente che scorre */
@keyframes shift { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
.grad { background-size: 220% 100%; animation: shift 6s ease-in-out infinite alternate; }

/* hero: inclinazione al mouse + etichette flottanti */
.hero-media { position: relative; perspective: 1600px; isolation: isolate; width: 100%; max-width: 1080px; margin: 0 auto; --rx: 0deg; --ry: 0deg; --sx: 0deg; --ss: 1; }
.js .hero-media { animation: pop 1s cubic-bezier(.2,.7,.2,1) .3s backwards; }
.hero-media .frame { transform-style: preserve-3d; transform-origin: 50% 100%; will-change: transform;
  transform: rotateX(calc(var(--sx) + var(--rx))) rotateY(var(--ry)) scale(var(--ss)); transition: transform .18s ease-out; }
/* alone luminoso che ruota dietro lo schermo */
@keyframes spin { to { transform: rotate(360deg); } }
.hero-media::before { content: ""; position: absolute; z-index: -1; inset: 8% 2% -6%; border-radius: 50%; filter: blur(70px); opacity: .55;
  background: conic-gradient(from 0deg, rgba(79,70,229,.55), rgba(6,182,212,.45), rgba(124,58,237,.55), rgba(79,70,229,.55)); animation: spin 22s linear infinite; }
/* parallax con la proprietà "translate" (non interferisce con le animazioni su transform) */
.hero::after { translate: 0 var(--py, 0px); }
.split-art { translate: 0 var(--py2, 0px); }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
.chip { position: absolute; z-index: 2; display: flex; flex-direction: column; gap: 1px; padding: 10px 14px; border-radius: 14px;
  background: rgba(255,255,255,.94); border: 1px solid var(--line); box-shadow: 0 16px 34px -14px rgba(15,23,42,.35); backdrop-filter: blur(6px);
  font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; }
.chip b { font-size: 1.15rem; letter-spacing: -.02em; color: var(--ink); line-height: 1.2; }
.chip b.up { color: var(--good); }
.chip-k { font-weight: 600; }
.chip-1 { left: -30px; bottom: 16%; animation: bob 5.5s ease-in-out infinite; }
.chip-2 { right: -14px; top: 22%; animation: bob 6.5s ease-in-out -2s infinite; }
.chip-3 { left: 8%; top: -16px; flex-direction: row; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); animation: bob 7s ease-in-out -4s infinite; }
.chip-3 .ico { color: var(--brand); }
.js .chip { animation-name: chipin, bob; animation-duration: .7s, 6s; animation-delay: 1.1s, 1.8s; animation-timing-function: ease-out, ease-in-out; animation-iteration-count: 1, infinite; animation-fill-mode: backwards, none; }
@keyframes chipin { from { opacity: 0; transform: translateY(14px) scale(.92); } to { opacity: 1; transform: none; } }
.js .chip-2 { animation-delay: 1.3s, 2s; animation-duration: .7s, 7.4s; }
.js .chip-3 { animation-delay: 1.5s, 2.2s; animation-duration: .7s, 8.2s; }

/* comparsa a cascata (il ritardo arriva da --d, impostato in JS) */
.js .reveal { transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); transition-delay: var(--d, 0ms); }

/* pulsanti: riflesso al passaggio */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after { content: ""; position: absolute; top: 0; left: -80%; width: 50%; height: 100%; transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); transition: left .6s ease; }
.btn-primary:hover::after { left: 130%; }
.btn .ico { transition: transform .2s ease; }
.btn:hover .ico { transform: translateX(3px); }

/* card funzioni: icona vivace */
.feature-ico { transition: transform .25s ease, background .25s; }
.feature-card:hover .feature-ico { transform: scale(1.1) rotate(-5deg); background: linear-gradient(135deg, rgba(79,70,229,.2), rgba(6,182,212,.22)); }

/* confronto: voci che entrano una a una */
.js .compare-col li { opacity: 0; transform: translateX(-12px); transition: opacity .5s ease, transform .5s ease; }
.js .compare-col.in li { opacity: 1; transform: none; }
.compare-col li:nth-child(1) { transition-delay: .2s; } .compare-col li:nth-child(2) { transition-delay: .35s; }
.compare-col li:nth-child(3) { transition-delay: .5s; }  .compare-col li:nth-child(4) { transition-delay: .65s; }

/* regole di costo: evidenziate in sequenza */
@keyframes hl { 0% { background: var(--bg-alt); border-color: var(--line); } 35% { background: rgba(79,70,229,.12); border-color: rgba(79,70,229,.45); } 100% { background: var(--bg-alt); border-color: var(--line); } }
@keyframes bump { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.25); } }
.cost-rules.in li { animation: hl 1.1s ease both; }
.cost-rules.in li::before { animation: bump .6s ease both; }
.cost-rules.in li:nth-child(1), .cost-rules.in li:nth-child(1)::before { animation-delay: .4s; }
.cost-rules.in li:nth-child(2), .cost-rules.in li:nth-child(2)::before { animation-delay: 1s; }
.cost-rules.in li:nth-child(3), .cost-rules.in li:nth-child(3)::before { animation-delay: 1.6s; }
.cost-rules.in li:nth-child(4), .cost-rules.in li:nth-child(4)::before { animation-delay: 2.2s; }

/* calcolatore: i risultati lampeggiano quando cambiano */
@keyframes flash { from { background: rgba(79,70,229,.18); } to { background: transparent; } }
.calc-out dd.flash { animation: flash .6s ease; border-radius: 6px; }

/* AI: simulazione di lettura di un CV */
@keyframes scan { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.ai-lines i { position: relative; overflow: hidden; }
.ai-lines i::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(165,180,252,.75), transparent); }
.ai-card.in .ai-lines i::after { animation: scan 1.1s ease-in-out 2 both; }
.ai-card.in .ai-lines i:nth-child(2)::after { animation-delay: .25s; }
.ai-card.in .ai-lines i:nth-child(3)::after { animation-delay: .5s; }
.st { display: inline-grid; }
.st > span { grid-area: 1 / 1; text-align: right; }
.st-b { opacity: 0; color: #6ee7b7; }
@keyframes out { to { opacity: 0; } } @keyframes inn { to { opacity: 1; } }
@keyframes ok { to { background: #34d399; box-shadow: 0 0 0 4px rgba(52,211,153,.22); } }
.ai-card.in .st-a { animation: out .3s ease 3.2s forwards; }
.ai-card.in .st-b { animation: inn .3s ease 3.4s forwards; }
.ai-card.in .dot-a { animation: ok .3s ease 3.3s forwards; }
.js .ai-out div { opacity: 0; transform: translateY(8px); }
.ai-card.in .ai-out div { animation: rise .5s ease both; }
.ai-card.in .ai-out div:nth-child(1) { animation-delay: 3.4s; }
.ai-card.in .ai-out div:nth-child(2) { animation-delay: 3.7s; }
.ai-card.in .ai-out div:nth-child(3) { animation-delay: 4s; }
.js .ai-foot { opacity: 0; }
.ai-card.in .ai-foot { animation: inn .5s ease 4.3s forwards; }

/* passi: il filo si disegna da uno all'altro */
@media (min-width: 981px) {
  .steps li:not(:last-child)::after { content: ""; position: absolute; top: 49px; left: calc(100% - 4px); width: 32px; height: 2px;
    background: linear-gradient(90deg, var(--brand), var(--accent)); transform: scaleX(0); transform-origin: 0 50%; transition: transform .6s ease .5s; }
  .steps li.in:not(:last-child)::after { transform: scaleX(1); }
}

/* cambio scheda della galleria */
.tour-panel:not([hidden]) { animation: fade .45s cubic-bezier(.2,.7,.2,1); }

@media (max-width: 980px) { .chip { display: none; } .hero::after { width: 380px; height: 380px; right: -120px; } }


/* riflettore che segue il mouse sulle card */
.feature-card, .model, .role, .sec-list li { position: relative; }
.feature-card::before, .model::before, .role::before, .sec-list li::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .35s ease;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), rgba(79,70,229,.11), transparent 65%); }
.feature-card:hover::before, .model:hover::before, .role:hover::before, .sec-list li:hover::before { opacity: 1; }
.model, .role, .sec-list li { transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.model:hover, .role:hover, .sec-list li:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: rgba(79,70,229,.3); }

/* pulsanti "magnetici" */
.btn { translate: var(--bx, 0px) var(--by, 0px); transition: transform .15s ease, box-shadow .2s ease, border-color .2s, color .2s, translate .25s ease-out; }

/* timeline: la linea si riempie scorrendo */
.timeline { position: relative; max-width: 720px; margin: 0 auto; list-style: none; padding-left: 60px; --p: 0; }
.timeline::before, .timeline::after { content: ""; position: absolute; left: 19px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; }
.timeline::before { background: var(--line); }
.timeline::after { background: linear-gradient(var(--brand), var(--accent)); transform-origin: 50% 0; transform: scaleY(var(--p)); }
.timeline li { position: relative; padding-bottom: 26px; }
.timeline li:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: -60px; top: 0; z-index: 1; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; border: 2px solid var(--line); color: var(--ink-mute); font-weight: 800; font-size: 14px; transition: background .4s, color .4s, border-color .4s, box-shadow .4s, transform .4s; }
.tl-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; opacity: .5; transform: translateX(8px);
  transition: opacity .45s ease, transform .45s ease, border-color .35s, box-shadow .35s; }
.tl-card h3 { font-size: 1.1rem; margin: 4px 0 6px; }
.tl-card p { color: var(--ink-soft); font-size: .98rem; }
.tl-time { font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); }
.timeline li.on .tl-dot { background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-color: transparent; color: #fff; box-shadow: 0 0 0 7px rgba(79,70,229,.14); transform: scale(1.06); }
.timeline li.on .tl-card { opacity: 1; transform: none; border-color: rgba(79,70,229,.3); box-shadow: var(--shadow); }

@media (min-width: 981px) { .hero-media { margin-top: 8px; } .chip-1 { left: -4%; } .chip-2 { right: -3%; } }
@media (max-width: 640px) { .timeline { padding-left: 52px; } .tl-dot { left: -52px; width: 38px; height: 38px; } .timeline::before, .timeline::after { left: 17px; } .tl-card { padding: 16px 18px; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal, .js .compare-col li, .js .ai-out div, .js .ai-foot, .st-b { opacity: 1; transform: none; }
  .st-a { display: none; }
  .hero-media .frame { transform: none !important; }
  .tl-card { opacity: 1; transform: none; }
  .timeline::after { transform: scaleY(1); }
  .timeline li .tl-dot { background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-color: transparent; color: #fff; }
}
