/* =========================================================
   Mattia Bigi — Home
   ========================================================= */

:root {
  --bg: #f4f3ef;
  --bg-2: #ecebe5;
  --surface: #ffffff;
  --surface-2: #f8f7f4;
  --ink: #111214;
  --ink-2: #3a3b40;
  --muted: #6d6e73;
  --line: rgba(17, 18, 20, 0.09);
  --line-2: rgba(17, 18, 20, 0.16);
  --accent: #2b4bff;
  --accent-ink: #ffffff;
  --accent-soft: #e6eaff;
  --ok: #1f9d55;
  --ok-soft: #e3f4ea;
  --warn: #e0522f;
  --warn-soft: #fbe7e1;
  --wa: #1fae5b;
  --shadow: 0 1px 2px rgba(17, 18, 20, 0.04), 0 12px 32px -12px rgba(17, 18, 20, 0.14);
  --shadow-lg: 0 2px 4px rgba(17, 18, 20, 0.04), 0 30px 60px -20px rgba(17, 18, 20, 0.22);
  --band-bg: #111214;
  --band-ink: #f4f3ef;
  --tools-bg: #111214;
  --tools-ink: #f2f2f0;
  --tools-muted: #9a9ba1;
  --tools-surface: #1a1b1f;
  --tools-line: rgba(255, 255, 255, 0.08);
  --logo-filter: brightness(0) opacity(0.55);
  --postit: #fde68a;
  color-scheme: light;
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .4s ease, color .4s ease;
}

img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-family: "Inter Tight", "Inter", sans-serif; letter-spacing: -0.025em; }
p { margin: 0; }

em {
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.wrap { width: min(1200px, 100% - 48px); margin-inline: auto; }

.section { padding: clamp(80px, 11vw, 140px) 0; }

.eyebrow,
.chip,
.mock__title,
.pill,
.case__tags span,
.roles__when,
.proof__label {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  margin-bottom: 18px;
}
.eyebrow::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  box-shadow: 10px 0 0 var(--warn);
  margin-right: 10px;
}

.h-display {
  font-size: clamp(42px, 5.6vw, 76px);
  line-height: 1.02;
  font-weight: 600;
}
.h-display em { color: var(--accent); }

.h2 {
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.06;
  font-weight: 600;
}
.h2 em { color: var(--muted); }

.lead { font-size: clamp(18px, 1.5vw, 20px); color: var(--ink-2); max-width: 560px; }
.lead strong { color: var(--ink); font-weight: 600; }
.micro { font-size: 14px; color: var(--muted); max-width: 460px; }

.sec-head { max-width: 760px; margin-bottom: clamp(40px, 6vw, 72px); }
.sec-head--center { margin-inline: auto; text-align: center; }
.sec-head--split {
  max-width: none;
  display: flex; justify-content: space-between; align-items: end; gap: 40px; flex-wrap: wrap;
}
.sec-head--split .sec-sub { max-width: 360px; }
.sec-sub { margin-top: 20px; color: var(--muted); font-size: 18px; max-width: 620px; }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--ok); }
.dot--live { box-shadow: 0 0 0 0 var(--ok); animation: pulse 2.4s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ---------- Bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 24px;
  border-radius: 999px;
  font-weight: 600; font-size: 16px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--wa { background: var(--wa); color: #fff; box-shadow: 0 8px 24px -10px var(--wa); }
.btn--wa:hover { box-shadow: 0 14px 30px -10px var(--wa); }
.btn--ghost { border-color: var(--line-2); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--sm { padding: 10px 16px; font-size: 14px; }
.btn--lg { padding: 18px 30px; font-size: 17px; }
.ico { width: 18px; height: 18px; fill: currentColor; flex: none; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 14px; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: center;
  pointer-events: none;
}
.nav__inner {
  pointer-events: auto;
  width: min(1200px, 100% - 28px);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 10px 10px 10px 18px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  border: 1px solid var(--line);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  transition: box-shadow .3s ease;
}
.nav.is-scrolled .nav__inner { box-shadow: var(--shadow); }

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand__mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--ink); color: var(--bg);
  font-family: "Inter Tight", sans-serif; font-weight: 700; font-size: 13px; letter-spacing: 0;
}
.brand__name { font-family: "Inter Tight", sans-serif; font-weight: 600; font-size: 15px; line-height: 1.1; display: flex; flex-direction: column; }
.brand__name small { font-family: "Inter", sans-serif; font-weight: 400; font-size: 12px; color: var(--muted); }

.nav__links { display: flex; gap: 4px; }
.nav__links a {
  text-decoration: none; font-size: 14px; color: var(--ink-2);
  padding: 8px 12px; border-radius: 999px;
  transition: background-color .2s ease, color .2s ease;
}
.nav__links a:hover { background: var(--bg-2); color: var(--ink); }

.nav__actions { display: flex; align-items: center; gap: 8px; }

/* ---------- Hero ---------- */
.hero { padding: 140px 0 70px; }
.hero__grid {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
}
.hero__copy { display: flex; flex-direction: column; gap: 26px; }

.chip {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink-2);
  text-transform: none; letter-spacing: 0.01em; font-size: 12.5px;
}

.hero__ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }

.stats {
  display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 40px;
  margin: 10px 0 0; padding-top: 26px; border-top: 1px solid var(--line);
}
.stats dt { font-family: "Inter Tight", sans-serif; font-weight: 600; font-size: 30px; letter-spacing: -0.03em; line-height: 1.1; }
.stats dd { margin: 4px 0 0; font-size: 14px; color: var(--muted); }

.hero__visual { position: relative; padding: 20px 30px 40px 0; }

.portrait {
  position: relative; margin: 0;
  aspect-ratio: 4 / 5;
  border-radius: 28px; overflow: hidden;
  background: var(--bg-2);
  box-shadow: var(--shadow-lg);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.portrait::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.55) 0%, rgba(0,0,0,0) 38%);
  pointer-events: none;
}
.portrait__tag {
  position: absolute; left: 22px; bottom: 20px; z-index: 1;
  display: flex; flex-direction: column; color: #fff;
}
.portrait__name { font-family: "Inter Tight", sans-serif; font-weight: 600; font-size: 20px; }
.portrait__role { font-size: 13px; opacity: .85; }

.float {
  position: absolute; z-index: 2;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 18px; padding: 14px 16px;
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  animation: bob 7s ease-in-out infinite;
}
.float__head { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.float__body { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.float__body strong { font-weight: 600; font-size: 14px; }
.float__body span { color: var(--muted); }
.float__meta { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-top: 10px; border-top: 1px dashed var(--line-2); color: var(--muted); }
.float__meta b { color: var(--ink); font-family: "Inter Tight", sans-serif; font-size: 18px; }

.float--lead { left: -56px; top: 46%; width: 250px; }
.float--chart { right: -4px; top: -6px; width: 240px; animation-delay: -3.5s; }
.float--chart .float__meta b { color: var(--ok); }
.float--chart .float__head, .float--chart .float__meta span { white-space: nowrap; }

.spark { width: 100%; height: 56px; display: block; margin-bottom: 8px; }
.spark__line { fill: none; stroke: var(--ok); stroke-width: 2.4; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.spark__area { fill: var(--ok-soft); }

@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---------- Prova ---------- */
.proof { padding: 30px 0 10px; }
.proof__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 40px; flex-wrap: wrap;
  padding: 26px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.proof__partners { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.proof__label { color: var(--muted); }
.proof__partners ul { display: flex; gap: 8px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.proof__partners li {
  font-size: 13px; font-weight: 500; padding: 6px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
}
/* ogni logo ha un'altezza propria (--h) così che a occhio pesino tutti uguale */
.proof__logos { flex: 1 1 100%; display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.proof__logos img { height: var(--h, 26px); width: auto; object-fit: contain; filter: var(--logo-filter); transition: filter .3s ease; }
@media (max-width: 900px) {
  .proof__logos { display: grid; grid-template-columns: repeat(3, 1fr); justify-items: center; row-gap: 28px; column-gap: 16px; }
  .proof__logos img { height: calc(var(--h, 26px) * .82); max-width: 100%; }
}

/* ---------- Problema ---------- */
.desk {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px;
  align-items: start;
}
.desk__item { display: flex; flex-direction: column; gap: 18px; }
.desk__item--wa { transform: rotate(-1.5deg); margin-top: 30px; }
.desk__item--mail { transform: rotate(1deg); }
.desk__item--sheet { transform: rotate(-0.8deg); margin-top: 46px; }
.desk__item--note { transform: rotate(2deg); margin-top: 10px; }
.desk__item > :first-child { box-shadow: var(--shadow); transition: transform .35s ease, box-shadow .35s ease; }
.desk__item:hover > :first-child { transform: translateY(-4px) rotate(0.5deg); box-shadow: var(--shadow-lg); }
.desk__caption { font-size: 15px; color: var(--ink-2); line-height: 1.5; padding: 0 4px; }

.wa-bubble {
  position: relative;
  background: #d9fdd3; color: #111;
  padding: 12px 14px 22px; border-radius: 14px 14px 14px 4px;
  font-size: 15px; line-height: 1.45;
}
.wa-bubble__time { position: absolute; right: 10px; bottom: 5px; font-size: 11px; opacity: .6; display: inline-flex; gap: 4px; align-items: center; }
.wa-bubble__time svg { width: 14px; height: 10px; }

.mail { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px 16px; font-size: 14px; }
.mail__bar { display: flex; gap: 5px; margin-bottom: 12px; }
.mail__bar span { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.mail__from { display: flex; gap: 8px; align-items: baseline; }
.mail__from span { color: var(--muted); font-size: 12px; }
.mail__subj { font-weight: 600; margin: 4px 0 8px; }
.mail p { color: var(--ink-2); line-height: 1.5; }

.sheet { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; font-size: 13px; }
.sheet__file { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); font-family: "JetBrains Mono", monospace; font-size: 11.5px; color: var(--ink-2); }
.sheet__icon { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 4px; background: #1d7044; color: #fff; font-weight: 700; font-size: 11px; font-family: "Inter", sans-serif; }
.sheet__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; }
.sheet__grid span { padding: 8px 10px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
.sheet__grid span:nth-child(3n) { border-right: 0; text-align: center; color: var(--warn); font-weight: 600; }
.sheet__grid span:nth-child(-n+3) { background: var(--surface-2); font-weight: 600; color: var(--muted); font-size: 12px; }
.sheet__grid span:nth-child(3) { color: var(--muted); }

.postit {
  background: var(--postit); color: #2b2410;
  padding: 22px 20px 26px; border-radius: 3px;
  font-family: "Caveat", cursive; font-size: 25px; line-height: 1.15;
}

/* ---------- Band ---------- */
.band { background: var(--band-bg); color: var(--band-ink); padding: clamp(80px, 12vw, 150px) 0; transition: background-color .4s ease; }
.band__text {
  font-family: "Inter Tight", sans-serif; font-weight: 600;
  font-size: clamp(32px, 4.6vw, 62px); line-height: 1.08; letter-spacing: -0.03em;
  max-width: 1000px;
}
.band__text em { opacity: .72; }

/* ---------- Storia ---------- */
.story__grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(40px, 7vw, 110px); align-items: start; }
.story__side { position: sticky; top: 120px; }
.case-ab { display: flex; flex-direction: column; gap: 14px; }
.case-ab__item { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px 22px; }
.case-ab__item p { color: var(--ink-2); font-size: 16px; margin-top: 10px; }
.case-ab__item b { color: var(--ink); }
.case-ab__tag { font-family: "JetBrains Mono", monospace; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 4px 9px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); }
.case-ab__tag--b { background: var(--warn-soft); color: var(--warn); }

.scrub {
  font-family: "Inter Tight", sans-serif; font-weight: 600;
  font-size: clamp(26px, 2.9vw, 40px); line-height: 1.25; letter-spacing: -0.025em;
}
.scrub .w { color: var(--line-2); transition: color .25s ease; }
.scrub .w.on { color: var(--ink); }
.no-js .scrub, .scrub:not(.is-ready) { color: var(--ink); }
.story__sign { margin-top: 36px; font-size: 20px; color: var(--muted); }
.story__sign em { color: var(--ink); font-size: 24px; }

/* ---------- Metodo ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step {
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px;
  padding: 30px 28px 28px; display: flex; flex-direction: column; gap: 14px;
}
.step__num { font-family: "JetBrains Mono", monospace; font-size: 13px; color: var(--accent); }
.step h3 { font-size: 26px; font-weight: 600; }
.step > p { color: var(--ink-2); font-size: 16px; line-height: 1.55; }

.mock {
  margin-top: auto;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px; font-size: 13px;
}
.mock__title { color: var(--muted); margin-bottom: 12px; font-size: 11px; }

.fbar { position: relative; display: flex; align-items: center; gap: 10px; height: 28px; margin-bottom: 6px; }
.fbar span { position: absolute; left: 0; top: 0; bottom: 0; width: var(--w); border-radius: 6px; background: var(--accent-soft); }
.fbar em { position: relative; font-family: "Inter", sans-serif; font-style: normal; font-size: 12.5px; padding-left: 10px; color: var(--ink-2); }
.fbar b { position: relative; margin-left: auto; font-family: "JetBrains Mono", monospace; font-size: 10.5px; text-transform: uppercase; color: var(--warn); background: var(--warn-soft); padding: 2px 7px; border-radius: 999px; }
.fbar--warn span { background: var(--warn-soft); }

.flow { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.flow li {
  position: relative; padding: 7px 12px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 13px; font-weight: 500;
}
.flow li:not(:last-child)::after {
  content: ""; position: absolute; left: 20px; bottom: -7px; width: 1px; height: 7px; background: var(--line-2);
}
.flow__end { background: var(--accent) !important; color: var(--accent-ink); border-color: transparent !important; }

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kpis--4 { grid-template-columns: repeat(4, 1fr); }
.kpis div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.kpis span { font-size: 11.5px; color: var(--muted); }
.kpis b { font-family: "Inter Tight", sans-serif; font-size: 20px; color: var(--ok); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpis b.down { color: var(--ok); }

/* Animazioni dei widget del metodo: partono una volta, quando il widget è visibile.
   Senza JS (niente data-play) si vede direttamente lo stato finale. */
.mock[data-play] .fbar span { width: 0; transition: width 1s cubic-bezier(.2,.7,.2,1); }
.mock[data-play].is-play .fbar span { width: var(--w); }
.mock[data-play].is-play .fbar:nth-child(3) span { transition-delay: .25s; }
.mock[data-play].is-play .fbar:nth-child(4) span { transition-delay: .5s; }
.mock[data-play].is-play .fbar:nth-child(5) span { transition-delay: .75s; }
.mock[data-play] .fbar b { opacity: 0; transform: scale(.6); transition: opacity .35s ease, transform .45s cubic-bezier(.3,1.6,.5,1); }
.mock[data-play].is-play .fbar b { opacity: 1; transform: none; transition-delay: 1.15s; animation: buco 1.4s ease-out 1.6s 2; }
@keyframes buco { 0% { box-shadow: 0 0 0 0 rgba(224,82,47,.35); } 100% { box-shadow: 0 0 0 9px rgba(224,82,47,0); } }

.mock[data-play] .flow li { opacity: .3; transform: translateX(-6px); transition: opacity .45s ease, transform .45s ease, background-color .5s ease, color .5s ease; }
.mock[data-play].is-play .flow li { opacity: 1; transform: none; }
.mock[data-play].is-play .flow li:nth-child(2) { transition-delay: .25s; }
.mock[data-play].is-play .flow li:nth-child(3) { transition-delay: .5s; }
.mock[data-play].is-play .flow li:nth-child(4) { transition-delay: .75s; }
.mock[data-play].is-play .flow li:nth-child(5) { transition-delay: 1s; }
.mock[data-play] .flow__end { background: var(--surface) !important; color: var(--ink); border-color: var(--line) !important; }
.mock[data-play].is-play .flow__end { background: var(--accent) !important; color: var(--accent-ink); border-color: transparent !important; }

.mock[data-play] .kpis div { opacity: 0; transform: translateY(8px); transition: opacity .5s ease, transform .5s ease; }
.mock[data-play].is-play .kpis div { opacity: 1; transform: none; }
.mock[data-play].is-play .kpis div:nth-child(2) { transition-delay: .15s; }
.mock[data-play].is-play .kpis div:nth-child(3) { transition-delay: .3s; }

/* ---------- Strumenti AI ---------- */
.tools__panel {
  background: var(--tools-bg); color: var(--tools-ink);
  border-radius: 36px; padding: clamp(36px, 6vw, 80px);
  border: 1px solid var(--tools-line);
  transition: background-color .4s ease;
}
.tools .h2 em { color: var(--tools-muted); }
.tools .sec-sub { color: var(--tools-muted); }
.tools .eyebrow { color: #9aa6ff; }

.tabs { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(24px, 4vw, 56px); align-items: start; }
.tabs__list { display: flex; flex-direction: column; gap: 10px; }
.tab {
  position: relative; text-align: left; cursor: pointer;
  background: transparent; color: inherit; font: inherit;
  border: 1px solid var(--tools-line); border-radius: 18px;
  padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 4px; overflow: hidden;
  transition: background-color .25s ease, border-color .25s ease;
}
.tab:hover { background: rgba(255, 255, 255, 0.03); }
.tab.is-active { background: var(--tools-surface); border-color: rgba(255, 255, 255, 0.14); }
.tab__title { font-family: "Inter Tight", sans-serif; font-weight: 600; font-size: 18px; }
.tab__desc { font-size: 14.5px; color: var(--tools-muted); line-height: 1.45; }
.tab__bar { position: absolute; left: 20px; right: 20px; bottom: 9px; height: 2px; background: rgba(255,255,255,.08); border-radius: 2px; opacity: 0; }
.tab.is-active .tab__bar { opacity: 1; }
.tab__bar i { display: block; height: 100%; width: 0; background: #9aa6ff; border-radius: 2px; }
.tab.is-active .tab__bar i { animation: tabfill var(--tab-dur, 7s) linear forwards; }
.tabs.is-paused .tab.is-active .tab__bar i { animation-play-state: paused; }
@keyframes tabfill { to { width: 100%; } }

.tabs__stage { position: relative; }
.pane { animation: paneIn .5s cubic-bezier(.2,.7,.2,1); }
@keyframes paneIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.pane__note { margin-top: 16px; font-size: 14.5px; color: var(--tools-muted); }
.pane__note b { color: var(--tools-ink); font-weight: 600; }

/* App mock (sempre chiara, come un software vero) */
.app {
  background: #ffffff; color: #111214;
  border-radius: 20px; padding: 18px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.6);
  font-size: 14px;
  --m-line: rgba(17,18,20,.08); --m-muted: #6d6e73; --m-soft: #f5f5f2;
}
.app__top { display: flex; justify-content: space-between; align-items: center; font-weight: 600; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--m-line); }
.pill { font-size: 10.5px; padding: 4px 9px; border-radius: 999px; background: var(--m-soft); color: var(--m-muted); }
.pill--live { background: #e3f4ea; color: #1f9d55; }
.pill--hot { background: #fbe7e1; color: #d24726; }
.pill--ok { background: #e3f4ea; color: #1f9d55; }

.lead-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--m-soft); margin-bottom: 16px; }
.lead-row > div:nth-child(2) { display: flex; flex-direction: column; line-height: 1.3; }
.lead-row span:not(.pill) { font-size: 12.5px; color: var(--m-muted); }
.lead-row .pill { margin-left: auto; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #2b4bff; color: #fff; font-weight: 600; font-size: 13px; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
.timeline li { position: relative; padding: 0 0 12px 24px; font-size: 13.5px; color: #3a3b40; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 5px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #1f9d55; background: #fff; }
.timeline li::after { content: ""; position: absolute; left: 5px; top: 17px; bottom: -1px; width: 1px; background: var(--m-line); }
.timeline li:last-child::after { display: none; }
.timeline li.done::before { background: #1f9d55; }
.timeline li.next::before { border-color: #c9cacf; }
.timeline li.next { color: var(--m-muted); }
.timeline b { font-family: "JetBrains Mono", monospace; font-weight: 500; font-size: 12px; margin-right: 8px; color: var(--m-muted); }
.is-active .timeline li { opacity: 0; animation: tl .45s ease forwards; }
.is-active .timeline li:nth-child(1) { animation-delay: .15s; }
.is-active .timeline li:nth-child(2) { animation-delay: .55s; }
.is-active .timeline li:nth-child(3) { animation-delay: .95s; }
.is-active .timeline li:nth-child(4) { animation-delay: 1.35s; }
.is-active .timeline li:nth-child(5) { animation-delay: 1.75s; }
@keyframes tl { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }

.app .kpis div { background: var(--m-soft); border-color: transparent; }
.app .kpis span { color: var(--m-muted); }
.app .kpis b { color: #111214; font-size: 18px; }

.bars { display: flex; align-items: end; gap: 8px; height: 90px; margin: 16px 0; padding: 0 4px; }
.bars i { flex: 1; height: var(--h); background: linear-gradient(to top, #2b4bff, #7d8cff); border-radius: 6px 6px 2px 2px; transform-origin: bottom; }
.is-active .bars i { animation: grow .7s cubic-bezier(.2,.7,.2,1) both; }
.is-active .bars i:nth-child(2) { animation-delay: .05s; } .is-active .bars i:nth-child(3) { animation-delay: .1s; }
.is-active .bars i:nth-child(4) { animation-delay: .15s; } .is-active .bars i:nth-child(5) { animation-delay: .2s; }
.is-active .bars i:nth-child(6) { animation-delay: .25s; } .is-active .bars i:nth-child(7) { animation-delay: .3s; }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.ai-note { background: #eef0ff; border-radius: 14px; padding: 14px; font-size: 13.5px; line-height: 1.5; color: #23243a; }
.ai-note__tag { display: block; font-family: "JetBrains Mono", monospace; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: #2b4bff; margin-bottom: 6px; }

.quote__req { background: var(--m-soft); border-radius: 14px; padding: 14px; font-size: 14px; font-style: italic; color: #3a3b40; margin-bottom: 14px; }
.quote__label { display: block; font-style: normal; font-family: "JetBrains Mono", monospace; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--m-muted); margin-bottom: 6px; }
.quote__lines div { display: flex; justify-content: space-between; padding: 10px 2px; border-bottom: 1px solid var(--m-line); font-size: 14px; }
.quote__lines span { color: #3a3b40; }
.quote__tot { border-bottom: 0 !important; padding-top: 14px !important; }
.quote__tot span { font-weight: 600; color: #111214 !important; }
.quote__tot b { font-family: "Inter Tight", sans-serif; font-size: 22px; color: #2b4bff; }

.app--chat { display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 82%; padding: 11px 14px; border-radius: 16px; font-size: 14px; line-height: 1.45; }
.msg--me { align-self: flex-end; background: #2b4bff; color: #fff; border-bottom-right-radius: 4px; }
.msg--ai { align-self: flex-start; background: var(--m-soft); color: #23243a; border-bottom-left-radius: 4px; }
.msg--typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.msg--typing i { width: 6px; height: 6px; border-radius: 50%; background: #9a9ba1; animation: typing 1.2s infinite; }
.msg--typing i:nth-child(2) { animation-delay: .15s; } .msg--typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.is-active .app--chat .msg { opacity: 0; animation: tl .45s ease forwards; }
.is-active .app--chat .msg:nth-of-type(1) { animation-delay: .1s; }
.is-active .app--chat .msg:nth-of-type(2) { animation-delay: .7s; }
.is-active .app--chat .msg:nth-of-type(3) { animation-delay: 1.4s; }
.is-active .app--chat .msg:nth-of-type(4) { animation-delay: 1.9s; }

/* Area clienti (mock) */
.portal__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--m-line); }
.portal__row > div { display: flex; flex-direction: column; line-height: 1.3; }
.portal__row small { font-size: 12.5px; color: var(--m-muted); }
.portal__buy { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #eef0ff; border-radius: 14px; padding: 12px 14px; font-size: 13.5px; line-height: 1.45; color: #23243a; }
.portal__buy b { color: #2b4bff; }
.portal__check { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #1f9d55; color: #fff; font-size: 13px; }
.is-active .portal__row, .is-active .portal__buy { opacity: 0; animation: tl .45s ease forwards; }
.is-active .portal__row:nth-child(1) { animation-delay: .15s; }
.is-active .portal__row:nth-child(2) { animation-delay: .45s; }
.is-active .portal__row:nth-child(3) { animation-delay: .75s; }
.is-active .portal__buy { animation-delay: 1.2s; }

/* Caso reale dentro la sezione software */
.tcase { margin-top: clamp(48px, 6vw, 72px); padding-top: clamp(36px, 5vw, 56px); border-top: 1px solid var(--tools-line); display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
.tcase h3 { font-family: "Inter Tight", sans-serif; font-weight: 600; font-size: clamp(24px, 2.4vw, 32px); line-height: 1.15; letter-spacing: -0.02em; margin: 10px 0 16px; }
.tcase__intro p:not(.eyebrow) { color: var(--tools-muted); font-size: 16.5px; line-height: 1.6; margin-top: 12px; }
.tcase__list { list-style: none; margin: 0; padding: 0; }
.tcase__list li { display: flex; flex-direction: column; gap: 2px; padding: 16px 0; border-bottom: 1px solid var(--tools-line); }
.tcase__list li:first-child { padding-top: 0; }
.tcase__list li:last-child { border-bottom: 0; }
.tcase__list b { font-family: "Inter Tight", sans-serif; font-weight: 600; font-size: 20px; color: var(--tools-ink); }
.tcase__list span { color: var(--tools-muted); font-size: 15px; }
@media (max-width: 900px) { .tcase { grid-template-columns: 1fr; } }

/* ---------- Risultati ---------- */
.cases { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.case {
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px;
  padding: 28px; display: flex; flex-direction: column; gap: 12px;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.case:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-2); }
.case__tags { display: flex; gap: 6px; flex-wrap: wrap; }
.case__tags span { font-size: 10.5px; padding: 4px 9px; border-radius: 999px; background: var(--bg-2); color: var(--muted); }
.case h3 { font-size: 24px; font-weight: 600; margin-top: 6px; }
.case > p { color: var(--ink-2); font-size: 15.5px; line-height: 1.55; }
.case__metrics { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); display: flex; gap: 28px; flex-wrap: wrap; }
.case__metrics div { display: flex; flex-direction: column; }
.case__metrics b { font-family: "Inter Tight", sans-serif; font-weight: 600; font-size: 34px; letter-spacing: -0.035em; line-height: 1.1; }
.case__metrics span { font-size: 13px; color: var(--muted); }

.case--feature {
  grid-column: span 2; grid-row: span 1;
  background: var(--accent); color: var(--accent-ink); border-color: transparent;
}
.case--feature h3 { font-size: 34px; }
.case--feature > p { color: inherit; opacity: .85; max-width: 520px; font-size: 17px; }
.case--feature .case__tags span { background: rgba(255,255,255,.16); color: inherit; }
.case--feature .case__metrics { border-color: color-mix(in srgb, currentColor 22%, transparent); gap: 56px; flex-wrap: nowrap; }
.case--feature .case__metrics b { font-size: clamp(36px, 4vw, 56px); white-space: nowrap; }
.case--feature .case__metrics span { color: inherit; opacity: .75; }

.results__foot { margin-top: 30px; color: var(--muted); font-size: 15.5px; text-align: center; }
.results__foot a { color: var(--ink); text-underline-offset: 3px; }

/* ---------- Chi sono ---------- */
.about__grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(40px, 7vw, 110px); align-items: start; }
.about__copy { display: flex; flex-direction: column; gap: 24px; }
.about__copy > p { color: var(--ink-2); font-size: 18px; }

.badge-wrap { position: sticky; top: 110px; display: flex; flex-direction: column; align-items: center; padding-top: 0; }
.lanyard { width: 22px; height: 110px; background: repeating-linear-gradient(180deg, var(--ink) 0 10px, color-mix(in srgb, var(--ink) 85%, var(--bg)) 10px 20px); border-radius: 0 0 4px 4px; position: relative; }
.lanyard::after { content: ""; position: absolute; left: 50%; bottom: -14px; translate: -50% 0; width: 30px; height: 18px; border: 3px solid var(--muted); border-radius: 6px; }
.about { overflow-x: clip; }
.badge3d { display: none; position: absolute; top: -70px; left: 50%; translate: -50% 0; width: 230%; height: calc(100% + 70px); pointer-events: none; z-index: 2; }
.badge3d canvas { display: block; width: 100%; height: 100%; pointer-events: none; -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 110px); mask-image: linear-gradient(to bottom, transparent 0, #000 110px); }
.badge-wrap.is-3d { top: 70px; height: clamp(520px, 74vh, 700px); }
.badge-wrap.is-3d .badge3d { display: block; }
.badge-wrap.is-3d .lanyard, .badge-wrap.is-3d .badge { display: none; }
@media (max-width: 900px) { .badge-wrap.is-3d { position: relative; height: 480px; } }
.badge {
  margin-top: 10px; width: min(330px, 100%);
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px;
  overflow: hidden; box-shadow: var(--shadow-lg);
  transform-origin: 50% -120px; animation: swing 6s ease-in-out infinite;
}
@keyframes swing { 0%, 100% { transform: rotate(-1.6deg); } 50% { transform: rotate(1.6deg); } }
.badge__photo { aspect-ratio: 1 / 0.9; overflow: hidden; background: var(--bg-2); }
.badge__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; filter: grayscale(1) contrast(1.05); }
.badge__body { padding: 20px 22px 18px; display: flex; flex-direction: column; gap: 4px; }
.badge__name { font-family: "Inter Tight", sans-serif; font-weight: 600; font-size: 22px; }
.badge__role { font-family: "JetBrains Mono", monospace; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.badge__line { font-size: 14px; color: var(--ink-2); margin-top: 8px; line-height: 1.45; }
.badge__foot { display: flex; justify-content: space-between; margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--line-2); font-size: 12px; color: var(--muted); }

.roles { list-style: none; margin: 8px 0 0; padding: 0; border-top: 1px solid var(--line); }
.roles li { display: grid; grid-template-columns: 130px 1fr; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.roles__when { color: var(--muted); padding-top: 3px; }
.roles b { font-family: "Inter Tight", sans-serif; font-weight: 600; font-size: 17px; display: block; }
.roles span:not(.roles__when) { font-size: 15px; color: var(--ink-2); }

.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 8px; }
.gallery img { aspect-ratio: 1; object-fit: cover; border-radius: 14px; width: 100%; height: auto; filter: saturate(.9); transition: transform .3s ease; }
.gallery img:hover { transform: scale(1.03); }

/* ---------- Fit ---------- */
.fit__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.fit__card { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.fit__card h3 { font-size: 21px; font-weight: 600; line-height: 1.2; }
.fit__card p { color: var(--ink-2); font-size: 15.5px; line-height: 1.55; }
.fit__x { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--warn-soft); color: var(--warn); font-size: 20px; font-weight: 600; }
.fit__card--ok { background: var(--ok-soft); border-color: transparent; }
.fit__card--ok .fit__x { background: var(--ok); color: #fff; font-size: 16px; }

/* ---------- Prossimi passi ---------- */
.next__steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; counter-reset: s; }
.next__steps li { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px 20px; display: flex; flex-direction: column; gap: 14px; }
.next__steps span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--bg); font-family: "Inter Tight", sans-serif; font-weight: 600; font-size: 14px; }
.next__steps p { font-size: 15px; color: var(--ink-2); line-height: 1.5; }

/* ---------- CTA finale ---------- */
.final { padding-top: 0; }
.final__card {
  text-align: center; display: flex; flex-direction: column; align-items: center; gap: 22px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 36px;
  padding: clamp(48px, 8vw, 100px) clamp(24px, 6vw, 90px);
  box-shadow: var(--shadow);
}
.final__avatar { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; border: 3px solid var(--bg); box-shadow: var(--shadow); }
.final__card .h2 { max-width: 900px; }
.final__card > p { color: var(--muted); font-size: 18px; max-width: 560px; }

/* ---------- Footer ---------- */
.footer { padding: 40px 0 50px; border-top: 1px solid var(--line); }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer__links { display: flex; gap: 22px; }
.footer__links a { text-decoration: none; color: var(--ink-2); font-size: 15px; }
.footer__links a:hover { color: var(--ink); }
.footer__copy { color: var(--muted); font-size: 14px; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1); }
.reveal.is-in { opacity: 1; transform: none; }
.desk__item.reveal.is-in { transform: var(--rot, none); }
.desk__item--wa.reveal.is-in { transform: rotate(-1.5deg); }
.desk__item--mail.reveal.is-in { transform: rotate(1deg); }
.desk__item--sheet.reveal.is-in { transform: rotate(-0.8deg); }
.desk__item--note.reveal.is-in { transform: rotate(2deg); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .nav__links { display: none; }
  .desk { grid-template-columns: repeat(2, 1fr); gap: 34px 22px; }
  .desk__item { margin-top: 0 !important; }
  .next__steps { grid-template-columns: repeat(2, 1fr); }
  .next__steps li:last-child { grid-column: span 2; }
}

@media (max-width: 900px) {
  body { font-size: 16px; }
  .hero { padding-top: 120px; }
  .hero__grid, .story__grid, .about__grid, .tabs { grid-template-columns: 1fr; }
  .hero__visual { padding: 10px 10px 30px; max-width: 460px; margin-inline: auto; width: 100%; }
  .float--lead { left: -6px; top: auto; bottom: 0; width: 230px; }
  .float--chart { right: -6px; width: 215px; }
  .story__side, .badge-wrap { position: static; }
  .steps, .cases, .fit__grid { grid-template-columns: 1fr; }
  .case--feature { grid-column: auto; }
  .stats { gap: 24px; }
  .stats dt { font-size: 24px; }
}

@media (max-width: 560px) {
  .wrap { width: calc(100% - 32px); }
  .hero { padding-top: 100px; }
  .hero__visual { order: -1; padding: 0 0 18px; }
  .portrait { aspect-ratio: 5 / 4; border-radius: 22px; }
  .portrait img { object-position: 50% 22%; }
  .float--chart { display: none; }
  .float--lead { left: auto; right: 10px; bottom: 0; width: 210px; padding: 10px 12px; }
  .float--lead .float__body span { display: none; }
  .h-display { font-size: 40px; }
  .case--feature .case__metrics { flex-wrap: wrap; gap: 20px; }
  .case--feature .case__metrics b { font-size: 34px; white-space: normal; }
  .case__metrics b { font-size: 28px; }
  .tools__panel { border-radius: 24px; padding: 28px 18px; }
  .nav__inner { padding-left: 12px; }
  .brand__name small { display: none; }
  .nav .btn--sm { padding: 10px 12px; }
  .nav .btn--sm span { display: none; }
  .desk { grid-template-columns: 1fr; }
  .next__steps { grid-template-columns: 1fr; }
  .next__steps li:last-child { grid-column: auto; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .roles li { grid-template-columns: 1fr; gap: 4px; }
  .kpis--4 { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .stats dt { font-size: 21px; }
  .stats dd { font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .scrub .w { color: var(--ink); }
}
