/* ========== Tokens ========== */
:root {
  --bg: #040705;
  --panel: #0B130D;
  --line: rgba(124, 228, 155, .16);
  --green: #3AB766;
  --green-2: #7CE49B;
  --green-3: #1FA65A;
  --mint: #A6F0C1;
  --text: #EEF5F0;
  --muted: #9AAEA0;
  --grad: linear-gradient(90deg, #3AB766, #A6F0C1);
  --font-head: 'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r: 22px;
}

/* ========== Base ========== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--font-body); line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.08; letter-spacing: -0.02em; }
blockquote, cite { font-style: normal; }
:focus-visible { outline: 2px solid var(--green-2); outline-offset: 3px; }

.container { width: min(1120px, calc(100% - 32px)); margin-inline: auto; }
.eyebrow {
  display: inline-block; font-family: var(--font-head); font-size: .8rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .16em; color: var(--green-2); margin-bottom: .9rem;
}
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .85rem 1.4rem; border-radius: 12px; border: 1px solid transparent;
  font-family: var(--font-head); font-weight: 700; font-size: .95rem; cursor: pointer;
  transition: transform .25s ease, background .25s ease, border-color .25s ease, color .25s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--green); color: #03120A; }
.btn-primary:hover { background: var(--green-2); }
.btn-ghost { border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--green-2); }
.btn-block { width: 100%; }

/* ========== Progress & nav ========== */
.progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 60;
  background: var(--grad); transform-origin: left; transform: scaleX(0);
}
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 16px clamp(16px, 4vw, 40px);
  background: linear-gradient(to bottom, rgba(4, 7, 5, .92), rgba(4, 7, 5, 0));
}
.nav .logo img { height: 28px; width: auto; }
.nav-links { display: flex; gap: 1.6rem; list-style: none; font-size: .92rem; color: var(--muted); }
.nav-links a:hover { color: var(--text); }

/* ========== Hero ========== */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center; overflow: hidden; padding: 120px 0 60px;
}
.hero-bg span {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: .45; pointer-events: none;
  background: var(--green-3); animation: float 16s ease-in-out infinite alternate;
}
.hero-bg span:nth-child(1) { width: 46vw; height: 46vw; left: -12vw; top: -10vw; max-width: 620px; max-height: 620px; }
.hero-bg span:nth-child(2) { width: 36vw; height: 36vw; right: -10vw; bottom: -12vw; background: var(--mint); opacity: .18; animation-delay: -6s; max-width: 500px; max-height: 500px; }
@keyframes float { to { transform: translate(4vw, 3vh) scale(1.1); } }

.hero-inner { position: relative; text-align: center; display: flex; flex-direction: column; align-items: center; }
.pill {
  padding: .45rem 1rem; border: 1px solid var(--line); border-radius: 999px;
  font-size: .8rem; color: var(--muted); margin-bottom: 1.6rem;
}
.hero h1 { font-size: clamp(2.8rem, 8.4vw, 7.2rem); font-weight: 700; letter-spacing: -0.04em; line-height: .98; max-width: 14ch; }
.hero h1 .word { display: block; animation: rise .9s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i) * .14s); }
@keyframes rise { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
.hero-sub { color: var(--muted); font-size: 1.12rem; max-width: 620px; margin-top: 1.8rem; }
.hero-cta { display: flex; gap: .7rem; flex-wrap: wrap; justify-content: center; margin-top: 2rem; }

.start { margin-top: 3.5rem; display: flex; flex-direction: column; align-items: center; gap: .6rem; color: var(--muted); font-size: .85rem; }
.start-line { position: relative; width: 2px; height: 70px; background: var(--line); overflow: hidden; border-radius: 2px; }
.start-line i {
  position: absolute; left: 0; top: -30%; width: 100%; height: 30%; background: var(--grad);
  animation: fall 2s ease-in infinite;
}
@keyframes fall { to { transform: translateY(420%); } }

/* ========== Il percorso ========== */
.road { position: relative; padding: 40px 0 120px; }
.road-line {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; transform: translateX(-50%);
  background: repeating-linear-gradient(to bottom, var(--line) 0 10px, transparent 10px 18px);
}
.road-fill {
  position: absolute; top: 0; left: 50%; width: 2px; height: 0; transform: translateX(-50%);
  background: linear-gradient(to bottom, var(--green-3), var(--mint));
  box-shadow: 0 0 18px rgba(58, 183, 102, .7);
}

.stop {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr);
  align-items: start; padding-block: 44px;
}
.node {
  grid-column: 2; grid-row: 1; justify-self: center; position: relative; z-index: 2;
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg); border: 2px solid var(--line); color: var(--muted);
  font-family: var(--font-head); font-weight: 700; font-size: .8rem;
  transition: background .6s ease, border-color .6s ease, color .6s ease, box-shadow .6s ease, transform .6s ease;
}
.stop.on .node {
  background: var(--green); border-color: var(--green-2); color: #03120A; transform: scale(1.06);
  box-shadow: 0 0 0 8px rgba(58, 183, 102, .14), 0 0 34px rgba(58, 183, 102, .55);
}
.node-ai { width: 72px; height: 72px; font-size: .95rem; }
.node-end { width: 84px; height: 84px; font-size: .75rem; }

.body { grid-row: 1; grid-column: 3; max-width: 470px; padding-left: 8px; }
.stop.l .body { grid-column: 1; justify-self: end; text-align: right; padding: 0 8px 0 0; }
.stop.r .body { grid-column: 3; }
.stop.l .body .eyebrow { margin-bottom: .9rem; }

.body h2 { font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 700; margin-bottom: .9rem; }
.body h3 { font-size: clamp(1.5rem, 2.4vw, 2rem); margin-bottom: .6rem; }
.body p { color: var(--muted); }
.statement { font-size: clamp(1.9rem, 3.8vw, 2.9rem) !important; line-height: 1.12 !important; font-weight: 500; color: var(--text); margin-bottom: 1.2rem !important; }
.lead { font-size: 1.05rem; }

.k { display: inline-block; font-family: var(--font-head); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--c, var(--green-2)); margin-bottom: .7rem; }
.svc { border-left: 3px solid var(--c); padding: 26px 28px; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 8%, transparent), transparent 70%); border-radius: 0 var(--r) var(--r) 0; }
.stop.l .svc { border-left: 0; border-right: 3px solid var(--c); border-radius: var(--r) 0 0 var(--r); background: linear-gradient(270deg, color-mix(in srgb, var(--c) 8%, transparent), transparent 70%); text-align: right; }
.svc p { margin-bottom: 1rem; }
.more { font-family: var(--font-head); font-weight: 700; font-size: .95rem; color: var(--text); }
.more:hover { color: var(--c); }

.pillar { padding: 0 0 0 4px; }
.stop.l .pillar { padding: 0 4px 0 0; }

/* Tappa AI: larga, sotto al nodo */
.stop.wide { grid-template-columns: minmax(0, 1fr); padding-block: 60px; }
.stop.wide .node { grid-column: 1; grid-row: 1; }
.stop.wide .body { grid-column: 1; grid-row: 2; max-width: none; justify-self: stretch; padding: 40px 0 0; text-align: left; }
.ai-box {
  position: relative; overflow: hidden; border-radius: 34px; padding: clamp(28px, 5vw, 60px);
  background:
    radial-gradient(circle at 90% 0%, rgba(58, 183, 102, .35), transparent 50%),
    linear-gradient(160deg, #0E1E13, #060A07);
  border: 1px solid rgba(124, 228, 155, .35);
  box-shadow: 0 30px 80px -30px rgba(58, 183, 102, .45);
}
.new {
  display: inline-block; padding: .4rem .9rem; border-radius: 999px; background: var(--green); color: #03120A;
  font-family: var(--font-head); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .12em;
}
.ai-box h2 { margin: 1.2rem 0 1rem; max-width: 22ch; }
.ai-box > .lead { max-width: 640px; color: var(--muted); }
.ai-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 2.4rem 0; }
.ai-item {
  padding: 24px; border-radius: 18px; background: rgba(4, 7, 5, .55); border: 1px solid var(--line);
  transition: border-color .3s ease, transform .3s ease;
}
.ai-item:hover { border-color: var(--green-2); transform: translateY(-3px); }
.ai-item .big { font-size: 1.8rem; display: block; margin-bottom: .6rem; }
.ai-item h3 { font-size: 1.25rem; margin-bottom: .4rem; }
.ai-item p { font-size: .95rem; }
.ai-cta { display: flex; gap: .7rem; flex-wrap: wrap; }

/* Numeri */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; text-align: left; }
.stat { border-top: 2px solid var(--green-3); padding-top: 1rem; }
.stat .n { font-family: var(--font-head); font-weight: 700; font-size: clamp(2.6rem, 5vw, 3.8rem); line-height: 1; color: var(--green-2); letter-spacing: -0.04em; }
.stat .l { color: var(--muted); font-size: .9rem; margin-top: .4rem; }

/* Testimonianze */
.quote {
  margin-top: 1.2rem; padding: 18px 20px; border-left: 2px dashed var(--green-3); color: var(--text);
}
.quote cite { display: block; margin-top: .6rem; font-size: .85rem; color: var(--muted); }
.quote-note { margin-top: 1rem; font-size: .85rem; color: var(--muted); }

/* Contatti (tappa finale) */
.stop.final { grid-template-columns: minmax(0, 1fr); padding-top: 60px; }
.stop.final .node { grid-column: 1; grid-row: 1; }
.stop.final .body {
  grid-column: 1; grid-row: 2; max-width: 1000px; width: 100%; justify-self: center; text-align: left;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem);
  margin-top: 40px; padding: clamp(28px, 5vw, 56px);
  border-radius: 34px; border: 1px solid var(--line); background: var(--panel);
}
.contact-info { margin-top: 1.8rem; display: grid; gap: .5rem; color: var(--muted); }
.contact-info a { color: var(--text); font-family: var(--font-head); font-size: 1.15rem; font-weight: 500; }
.contact-info a:hover { color: var(--green-2); }

form { display: grid; gap: 1.3rem; align-content: start; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.3rem; }
.field { position: relative; }
.field input, .field textarea, .field select {
  width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line);
  color: var(--text); font: inherit; padding: 1.1rem 0 .6rem; outline: none; transition: border-color .25s;
}
.field select { appearance: none; }
.field select option { background: #0B130D; }
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--green-2); }
.field label {
  position: absolute; left: 0; top: 1.1rem; color: var(--muted); pointer-events: none; transition: all .25s ease;
}
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label {
  top: -.2rem; font-size: .75rem; color: var(--green-2);
}
.field input.invalid, .field textarea.invalid { border-color: #FF6B6B; }
.form-status { min-height: 1.4rem; font-size: .95rem; color: var(--green-2); }
.form-status.error { color: #FF8080; }

/* ========== Footer ========== */
footer { border-top: 1px solid var(--line); padding: 64px 0 28px; }
.foot { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem; }
.foot-logo { height: 34px; width: auto; margin-bottom: 1rem; }
.foot p { color: var(--muted); max-width: 320px; }
.foot h4 { font-size: .85rem; text-transform: uppercase; letter-spacing: .12em; color: var(--green-2); margin-bottom: 1rem; }
.foot a, .foot > div > p { display: block; color: var(--muted); margin-bottom: .45rem; font-size: .95rem; }
.foot a:hover { color: var(--text); }
.legal {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 3rem;
  padding-top: 1.3rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem;
}
.legal a { color: var(--muted); }
.legal a:hover { color: var(--text); }

/* ========== Reveal ========== */
.rv { opacity: 0; transform: translateY(28px); transition: opacity .9s ease, transform .9s cubic-bezier(.2, .7, .2, 1); }
.rv.in { opacity: 1; transform: none; }

/* ========== Responsive ========== */
@media (max-width: 960px) {
  .nav-links { display: none; }
  .stop.final .body { grid-template-columns: 1fr; }
  .foot { grid-template-columns: 1fr 1fr; }
  .foot > div:first-child { grid-column: 1 / -1; }
}

/* Colonna singola: linea a sinistra, testi a destra */
@media (max-width: 760px) {
  .road-line, .road-fill { left: 28px; }
  .stop, .stop.l, .stop.r { grid-template-columns: 56px minmax(0, 1fr); padding-block: 32px; }
  .node, .stop.l .node, .stop.r .node { grid-column: 1; grid-row: 1; justify-self: start; width: 56px; }
  .body, .stop.l .body, .stop.r .body {
    grid-column: 2; grid-row: 1; justify-self: stretch; max-width: none;
    text-align: left; padding: 6px 0 0 18px;
  }
  .stop.l .svc, .svc { border-right: 0; border-left: 3px solid var(--c); border-radius: 0 var(--r) var(--r) 0; text-align: left; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 8%, transparent), transparent 70%); }
  .stats { grid-template-columns: 1fr; gap: 1.4rem; text-align: left; }
  .stop.wide { grid-template-columns: 56px minmax(0, 1fr); }
  .stop.wide .node { grid-column: 1; grid-row: 1; }
  .stop.wide .body { grid-column: 2; grid-row: 1; padding: 6px 0 0 18px; }
  .stop.final { grid-template-columns: 56px minmax(0, 1fr); }
  .stop.final .node { grid-column: 1; grid-row: 1; width: 56px; height: 56px; font-size: .7rem; }
  .stop.final .body { grid-column: 1 / -1; grid-row: 2; padding: 28px; margin-top: 8px; }
  .ai-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .node-ai { width: 56px; height: 56px; font-size: .8rem; }
}
@media (max-width: 560px) {
  .nav .btn { display: none; }
  .foot { grid-template-columns: 1fr; }
  .hero h1 { font-size: clamp(2.5rem, 13vw, 3.6rem); }
}

/* ========== Reduced motion ========== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .rv { opacity: 1; transform: none; }
  .stop .node { background: var(--green); color: #03120A; border-color: var(--green-2); }
}
