/* Struttura: navbar fissa, hero con chip fluttuanti, come funziona (2 card + 3 mini), display (4 card), casi d'uso (3 card), servizi Rubisco, blocco contatto scuro, footer a colonne */
:root {
  --paper: #FFF8F6;
  --ember: #FF5733;
  --ember-light: #FF7F45;
  --violet: #7B2FFF;
  --deep: #4A0EBF;
  --night: #1A0050;
  --card: #FFFFFF;
  --line: rgba(74, 14, 191, 0.14);
  --muted: #5E4F85;
  --display-font: "Bricolage Grotesque", "Arial Black", system-ui, sans-serif;
  --body-font: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--night);
  font-family: var(--body-font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 60;
  background: var(--paper);
}
.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
html { scroll-behavior: auto; }
section { scroll-margin-top: 84px; }
[tabindex="-1"]:focus { outline: none; }

/* --- navbar --- */
.nav {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  background: rgba(255, 248, 246, 0.98);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 72px; }
.nav img { height: 38px; width: auto; display: block; }
.links { display: flex; gap: 30px; }
.links a { color: var(--night); text-decoration: none; font-weight: 500; font-size: 15px; }
.links a { position: relative; }
.links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 2px; border-radius: 2px; background: var(--ember); transform: scaleX(0); transition: transform 0.2s ease; }
.links a:hover { color: var(--violet); }
.links a[aria-current="true"] { color: var(--violet); }
.links a[aria-current="true"]::after { transform: scaleX(1); }
.actions { display: flex; align-items: center; gap: 12px; }
.burger { display: none; width: 44px; height: 44px; padding: 0; border-radius: 12px; border: 1px solid var(--line); background: var(--card); cursor: pointer; place-items: center; align-content: center; gap: 4px; }
.burger span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--night); transition: transform 0.2s ease, opacity 0.2s ease; }
.burger:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; }
.nav.open .burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav.open .burger span:nth-child(2) { opacity: 0; }
.nav.open .burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* bottone unico (stessa azione ovunque) */
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px 30px;
  border-radius: 999px;
  background: var(--ember);
  color: var(--paper);
  font-family: var(--display-font);
  font-weight: 800;
  font-size: 19px;
  text-decoration: none;
  box-shadow: 0 14px 34px rgba(255, 87, 51, 0.34);
  transition: transform 0.18s ease, background-color 0.18s ease;
}
.cta:hover { background: var(--violet); transform: translateY(-2px); }
.cta:focus-visible { outline: 3px solid var(--night); outline-offset: 4px; }
.cta svg { width: 22px; height: 22px; flex: none; }
.cta.sm { padding: 10px 20px; font-size: 15px; box-shadow: none; }
.cta.sm svg { width: 18px; height: 18px; }

/* --- hero --- */
.hero { position: relative; overflow: hidden; padding-block: 96px 104px; text-align: center; }
.hero .wrap { position: relative; z-index: 1; }
.chips { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.chip {
  position: absolute;
  padding: 8px 16px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--deep);
  font-weight: 600;
  font-size: 14px;
  opacity: 0.7;
  box-shadow: 0 8px 20px rgba(74, 14, 191, 0.08);
  animation: drift 5s ease-in-out infinite;
}
.chip.o { color: var(--ember); }
.c1 { left: 4%; top: 16%; animation-delay: 0s; }
.c2 { right: 5%; top: 12%; animation-delay: -1s; }
.c3 { left: 9%; bottom: 20%; animation-delay: -2s; }
.c4 { right: 8%; bottom: 24%; animation-delay: -3s; }
.c5 { left: 30%; top: 6%; animation-delay: -4s; }
.c6 { right: 28%; bottom: 7%; animation-delay: -2.5s; }
.brand { display: block; }
footer .place { margin-top: 12px; }
@keyframes drift { 0%, 100% { translate: 0 0; } 25% { translate: 5px -8px; } 50% { translate: 0 -14px; } 75% { translate: -5px -7px; } }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  color: var(--deep);
}
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ember); }
h1, h2, h3 { font-family: var(--display-font); margin: 0; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-weight: 800; font-size: clamp(42px, 7vw, 78px); line-height: 1.02; margin-top: 26px; }
h1 .grad { display: block; background: linear-gradient(90deg, var(--violet), var(--ember)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { max-width: 40em; margin: 26px auto 36px; font-size: 20px; color: var(--muted); }
.trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 26px; margin: 40px 0 0; padding: 0; list-style: none; font-size: 15px; font-weight: 500; color: var(--muted); }
.trust li::before { content: "✓"; margin-right: 8px; font-weight: 800; color: var(--ember); }

/* --- sezioni --- */
.sec { padding-block: 96px; }
.sec.alt { background: #FBEFEB; }
.head { text-align: center; max-width: 760px; margin: 0 auto 56px; }
.head h2 { font-weight: 800; font-size: clamp(32px, 4.6vw, 50px); line-height: 1.08; margin-top: 18px; }
.head p { margin: 18px 0 0; color: var(--muted); font-size: 18px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 30px; min-width: 0; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; margin-bottom: 28px; }
.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.four { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.card h3 { font-weight: 700; font-size: 22px; line-height: 1.2; margin-bottom: 8px; }
.card p { margin: 0; color: var(--muted); font-size: 16px; }
.tagline { font-size: 13px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--violet); margin-bottom: 14px; display: block; }
.mini { display: grid; gap: 10px; margin-top: 20px; padding: 0; list-style: none; }
.mini li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; font-size: 15px; font-weight: 500; }
.mini li::before { content: "✓"; font-weight: 800; color: var(--ember); }

/* mock web app */
.field { margin-top: 18px; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); font-size: 15px; }
.field small { display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.saved { display: inline-block; margin-top: 18px; padding: 5px 14px; border-radius: 999px; background: rgba(123, 47, 255, 0.12); color: var(--deep); font-weight: 600; font-size: 13px; }

/* mock display */
.screen { aspect-ratio: 4 / 3; border-radius: 16px; border: 9px solid #0E002B; background: linear-gradient(150deg, var(--violet), var(--deep) 70%); color: var(--paper); padding: 6% 7%; display: flex; flex-direction: column; justify-content: space-between; box-shadow: 0 0 0 2px rgba(123, 47, 255, 0.5); overflow: hidden; margin-top: 18px; }
.screen .t { align-self: flex-start; padding: 3px 11px; border-radius: 999px; background: var(--ember); font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.screen .b { font-family: var(--display-font); font-weight: 800; font-size: clamp(22px, 3.4vw, 32px); line-height: 1.04; letter-spacing: -0.02em; }
.screen .s { font-size: 13px; color: rgba(255, 248, 246, 0.85); }

/* stati */
.state { display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; margin-bottom: 18px; }
.state.on { background: rgba(123, 47, 255, 0.12); color: var(--deep); }
.state.soon { background: rgba(255, 87, 51, 0.14); color: #B8300F; }
.state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.icon { width: 46px; height: 46px; border-radius: 14px; background: var(--night); display: grid; place-items: center; margin-bottom: 18px; }
.icon i { width: 18px; height: 18px; border-radius: 5px; background: var(--ember); display: block; }
.icon i.v { background: var(--violet); }
.strip { margin-top: 36px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; padding: 0; list-style: none; }
.strip li { padding: 16px 18px; border-radius: 16px; background: var(--night); color: var(--paper); font-weight: 500; font-size: 15px; }
.strip li::before { content: "✓"; margin-right: 8px; font-weight: 800; color: var(--ember); }

/* contatto */
.final { background: linear-gradient(180deg, var(--night), #2A0873); color: var(--paper); padding-block: 96px; }
.final .head p { color: rgba(255, 248, 246, 0.8); }
.final .head .pill { background: rgba(255, 248, 246, 0.1); border-color: rgba(255, 248, 246, 0.25); color: var(--paper); }
.contact { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: 28px; }
.contact .card { background: rgba(255, 248, 246, 0.07); border-color: rgba(255, 248, 246, 0.2); color: var(--paper); }
.contact .card p { color: rgba(255, 248, 246, 0.8); }
.contact .card h3 { color: var(--paper); }
.contact .cta { margin-top: 26px; }
.num { margin-top: 18px; font-family: var(--display-font); font-weight: 700; font-size: 22px; user-select: all; }

/* footer */
footer { background: var(--paper); border-top: 1px solid var(--line); padding-block: 64px 36px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 40px; }
footer img { height: 40px; width: auto; display: block; margin-bottom: 16px; }
footer h4 { margin: 0 0 14px; font-family: var(--display-font); font-size: 16px; }
footer ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 15px; color: var(--muted); }
footer ul a { color: var(--muted); text-decoration: none; }
footer ul a:hover { color: var(--violet); }
footer p { margin: 0; color: var(--muted); font-size: 15px; max-width: 28em; }
.legal { margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--muted); }

@media (max-width: 960px) {
  .four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .burger { display: grid; }
  .links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 6px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px));
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 30px rgba(26, 0, 80, 0.1);
  }
  .nav.open .links { display: flex; }
  .links a { padding: 14px 4px; font-size: 17px; border-bottom: 1px solid var(--line); }
  .links a:last-child { border-bottom: 0; }
  .links a::after { display: none; }
  .links a[aria-current="true"] { font-weight: 700; }
}
@media (max-width: 800px) {
  .sec, .final { padding-block: 64px; }
  .hero { padding-block: 64px 72px; }
  .two, .three, .contact { grid-template-columns: minmax(0, 1fr); }
  .cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .cols > :first-child { grid-column: 1 / -1; }
  .chip:nth-child(n+4) { display: none; }
  .hero .cta { width: 100%; }
}
@media (max-width: 560px) {
  .four, .strip { grid-template-columns: minmax(0, 1fr); }
  .nav img { height: 30px; }
  .cta.sm { padding: 9px 14px; font-size: 14px; }
}
@media (max-width: 420px) {
  .cta.sm svg { display: none; }
  .cta.sm .long { display: none; }
  .cta.sm .short { text-transform: capitalize; }
  .actions { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .links a::after, .burger span { transition: none; }
  .cta { transition: none; }
  .cta:hover { transform: none; }
}

/* --- animazioni allo scroll (GSAP) --- */
/* stato iniziale nascosto solo se JavaScript è attivo; la classe no-gsap lo annulla se la libreria non parte */
@media (scripting: enabled) {
  html:not(.no-gsap) :is(.hero .pill, .hero .lead, .hero .cta, .hero .trust li, .chip, .head > :not(h2), .card, .strip li, .cols > div) { opacity: 0; }
  html:not(.no-gsap) :is(h1, .head h2) { visibility: hidden; }
}
.w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0.14em 0.05em 0.18em; margin: -0.14em -0.05em -0.18em; }
.wi { display: inline-block; will-change: transform; }
.nav { transition: box-shadow 0.25s ease; }
.nav.scrolled { box-shadow: 0 10px 30px rgba(26, 0, 80, 0.08); }
.saved { transition: background-color 0.25s ease, color 0.25s ease; }
.saved.draft { background: rgba(255, 87, 51, 0.14); color: #B8300F; }
.dots { display: flex; gap: 8px; margin-top: 22px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); transition: background-color 0.25s ease, transform 0.25s ease; }
.dots i.on { background: var(--ember); transform: scale(1.35); }
.typing::after { content: ""; display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: text-bottom; background: var(--violet); animation: blink 0.9s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
/* gradiente della seconda riga del titolo: applicato a ogni parola, calcolato sull'intera riga */
.grad .wi { background-image: linear-gradient(90deg, var(--violet), var(--ember)); background-repeat: no-repeat; -webkit-background-clip: text; background-clip: text; color: transparent; }

/* bottone principale dell'hero: pulsazione +8% con lampeggio di sfondo, ciclo di 3 secondi (parte dopo l'ingresso) */
.hero .cta { position: relative; isolation: isolate; animation: cta-beat 3s ease-in-out 2.2s infinite; }
.hero .cta::before { content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: inherit; background: var(--ember-light); opacity: 0; animation: cta-flash 3s ease-in-out 2.2s infinite; }
@keyframes cta-beat {
  0%, 100% { scale: 1; box-shadow: 0 14px 34px rgba(255, 87, 51, 0.34); }
  50% { scale: 1.08; box-shadow: 0 20px 48px rgba(255, 127, 69, 0.5); }
}
/* il bottone dell'hero resta sempre arancione, anche al passaggio del mouse */
.hero .cta:hover { background: var(--ember); }
@keyframes cta-flash { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }

/* link nel footer */
.legal a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.legal a:hover { color: var(--violet); }
