/* ==========================================================================
   MP Design System v3 · Experiences
   Layout dei set piece della showcase e della pagina docs.
   ========================================================================== */

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-6);
  padding-top: calc(var(--nav-h) + var(--space-7));
  padding-bottom: var(--space-6);
  overflow-x: clip;
}
.hero__field { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; }
.hero__top { display: flex; justify-content: space-between; gap: var(--space-4); }
.hero__meta { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--fg-mute); white-space: nowrap; }
.hero__title {
  font-family: var(--font-display);
  font-size: 10vw;
  font-weight: 800;
  line-height: 0.84;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  opacity: calc(1 - clamp(0, (var(--p, 0.5) - 0.62) * 3, 1));
}
.hero__line { position: relative; display: block; width: max-content; white-space: nowrap; letter-spacing: -0.03em; }
.hero__line .t-accent { font-size: 1.12em; line-height: 0; margin-left: 0.02em; }
@media (max-width: 700px) { .hero__title { font-stretch: 62%; } .hero__meta { display: none; } }

.pill {
  position: relative;
  display: inline-block;
  width: 1.45em;
  height: 0.68em;
  margin-inline: 0.02em 0.06em;
  border-radius: 999px;
  background: var(--navy-700);
  box-shadow: inset 0 0 0 0.025em var(--line-strong);
  overflow: hidden;
}
.pill__bar {
  position: absolute;
  inset: 0.08em;
  border-radius: inherit;
  background: var(--grad-signal);
  transform-origin: 0 50%;
  animation: pill-run 3.4s var(--ease-out-expo) infinite;
}
.pill::after {
  content: "LCP 1,2 s";
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.11em;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--navy-950);
  text-transform: none;
}
@media (max-width: 700px) { .pill::after { display: none; } }

.hero__bottom { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: var(--space-6) var(--space-8); }
.hero__bottom--prompt { grid-template-columns: minmax(0, 1fr) minmax(0, 560px); }
.hero__copy { display: grid; justify-items: start; gap: var(--space-5); }
.hero__prompt { justify-self: end; width: 100%; }
.hero__bottom--prompt .hero__actions { align-items: center; gap: var(--space-3) var(--space-6); }
.hero__call { display: grid; gap: 2px; font-size: var(--text-sm); line-height: 1.35; color: var(--fg-soft); }
.hero__call b { font-family: var(--font-mono); font-weight: 500; color: var(--fg); transition: color var(--dur-fast); }
.hero__call:hover b { color: var(--accent); }
.hero__call small { font-family: var(--font-mono); font-size: var(--text-2xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-mute); }
.hero__bottom .t-lead { max-width: 46ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
@media (max-width: 860px) {
  .hero__bottom, .hero__bottom--prompt { grid-template-columns: 1fr; }
  .hero__bottom--prompt .hero__copy { display: contents; }
  .hero__bottom--prompt .hero__actions { order: 2; }
  .hero__prompt { justify-self: stretch; }
  .hero__actions .btn--lg { height: 56px; padding-inline: var(--space-5); }
}

/* ---------- Banda marquee ---------- */
.band { padding-block: var(--space-7); display: grid; gap: var(--space-2); overflow: clip; }

/* ---------- Flood ---------- */
.flood .t-eyebrow { color: var(--navy-800); }
.flood .t-eyebrow::before { background: var(--navy-950); box-shadow: none; }
.flood .t-eyebrow b { color: var(--navy-950); }
.flood__meta span:first-child { max-width: 44ch; text-transform: none; letter-spacing: 0.02em; font-size: var(--text-sm); }

/* ---------- Servizi: mini anteprime ---------- */
.svc-section .section-head { margin-bottom: var(--space-7); }
.pv { position: relative; display: grid; align-content: start; gap: 10px; padding: 16px; overflow: hidden; background: radial-gradient(90% 80% at 100% 0%, rgb(0 126 167 / 0.55), transparent 60%), var(--navy-800); font-family: var(--font-mono); font-size: 10px; color: var(--fg-soft); }
.pv i { display: block; }
.pv__bar { display: flex; align-items: center; gap: 5px; color: var(--fg-mute); }
.pv__bar i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.pv__bar span { margin-left: 8px; }
.pv__wp { display: grid; grid-template-columns: 26% 1fr; gap: 10px; height: 100%; }
.pv__side { display: grid; align-content: start; gap: 8px; padding: 10px; border-radius: 10px; background: rgb(255 255 255 / 0.04); }
.pv__side i { height: 8px; border-radius: 4px; background: rgb(255 255 255 / 0.12); }
.pv__canvas { display: grid; align-content: start; gap: 8px; padding: 10px; border-radius: 10px; background: #f6f7fb; }
.pv__blk { height: 22px; border-radius: 6px; background: #dfe2ec; }
.pv__blk--hero { height: 56px; background: linear-gradient(120deg, var(--yellow-300), var(--cyan-400)); }
.pv__blk--sel { outline: 2px solid var(--cyan-500); outline-offset: 2px; }
.pv--app { background: radial-gradient(80% 70% at 0% 100%, rgb(248 192 0 / 0.3), transparent 60%), var(--navy-800); }
.pv__kpi b { display: block; font-family: var(--font-display); font-size: 44px; font-weight: 800; letter-spacing: -0.04em; color: var(--fg); line-height: 1; }
.pv__bars { display: flex; align-items: flex-end; gap: 8px; height: 120px; margin-top: 8px; }
.pv__bars i { flex: 1; height: calc(var(--h) * 100%); border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--accent), rgb(248 192 0 / 0.25)); }
.pv--seo { background: #f6f7fb; color: #3a3f66; }
.pv__search { padding: 9px 12px; border-radius: 999px; background: #fff; box-shadow: 0 2px 10px rgb(7 11 34 / 0.08); color: #62668a; }
.pv__res { display: grid; gap: 5px; padding: 8px 10px; border-radius: 10px; }
.pv__res i { height: 6px; border-radius: 3px; background: #dfe2ec; }
.pv__res i + i { width: 70%; }
.pv__res--top { background: #fff; box-shadow: 0 6px 18px rgb(7 11 34 / 0.1); }
.pv__res--top b { font-family: var(--font-sans); font-size: 12px; font-weight: 600; color: #1a0dab; }
.pv__rank { justify-self: start; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--navy-950); font-weight: 500; }
.pv__q { justify-self: end; width: 62%; height: 26px; border-radius: 14px 14px 4px 14px; background: var(--surface-3); }
.pv__ans { position: relative; display: grid; gap: 7px; padding: 12px; border-radius: 12px; background: rgb(255 255 255 / 0.05); }
.pv__ans i { height: 7px; border-radius: 4px; background: rgb(255 255 255 / 0.18); }
.pv__ans .pv__short { width: 55%; }
.pv__cite { position: absolute; right: 14px; bottom: 9px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: var(--navy-950); }
.pv__src { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-accent); box-shadow: var(--glow-accent); color: var(--fg); }
.pv__src span { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: var(--navy-950); }
.pv--auto svg { width: 100%; height: 100%; }
.pv--auto circle { fill: var(--navy-600); stroke: var(--line-strong); stroke-width: 2; }
.pv--auto .pv__hub { fill: var(--accent); stroke: none; }
.pv__flow { fill: none; stroke: var(--cyan-400); stroke-width: 2; stroke-dasharray: 6 8; animation: flow 1.2s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -28; } }

/* ---------- GEO + chat ---------- */
.geo__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: var(--space-8); align-items: center; }
.geo__copy { display: grid; gap: var(--space-5); }
.geo__copy .t-h1 { font-size: var(--text-3xl); }
.geo__list { list-style: none; margin: var(--space-3) 0 0; padding: 0; border-top: 1px solid var(--line); }
.geo__list li { display: flex; gap: var(--space-4); padding: var(--space-4) 0; border-bottom: 1px solid var(--line); }
.geo__list .t-mono { color: var(--accent); }
@media (max-width: 960px) { .geo__grid { grid-template-columns: 1fr; } }

.chat {
  display: grid;
  gap: var(--space-5);
  padding: var(--space-5);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgb(255 255 255 / 0.06), rgb(255 255 255 / 0.02));
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(var(--blur-md));
}
.chat__head { display: flex; align-items: center; gap: var(--space-3); font-size: var(--text-sm); color: var(--fg-soft); }
.chat__brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--fg); }
.chat__brand i { width: 10px; height: 10px; border-radius: 50%; background: var(--grad-signal); }
.chat__replay { margin-left: auto; font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-mute); }
.chat__replay:hover { color: var(--accent); }
.chat__q { justify-self: end; max-width: 86%; padding: var(--space-3) var(--space-4); border-radius: 18px 18px 4px 18px; background: var(--surface-3); font-size: var(--text-sm); }
.chat__a { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: var(--space-3); }
.chat__avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); border: 1px solid var(--line-accent); color: var(--accent); }
.chat__body { position: relative; }
.chat__body p { font-size: var(--text-md); line-height: 1.7; }
.chat mark { padding: 0 0.2em; border-radius: 4px; background: var(--accent-soft); color: var(--accent); }
.chat cite { display: inline-grid; place-items: center; width: 1.4em; height: 1.4em; border-radius: 50%; font-family: var(--font-mono); font-size: 0.68em; font-style: normal; background: var(--accent); color: var(--fg-on-accent); vertical-align: 0.2em; }
.js .chat .tok { opacity: 0; transition: opacity 0.35s var(--ease-standard); }
.js .chat .tok.is-on { opacity: 1; }
.js .chat cite.tok { scale: 0; transition: scale 0.6s var(--ease-out-back), opacity 0.2s; }
.js .chat cite.tok.is-on { scale: 1; }
.chat .tok.is-current { position: relative; }
.chat .tok.is-current::after { content: ""; position: absolute; top: 0.2em; right: -0.55em; width: 0.45em; height: 1.1em; border-radius: 2px; background: var(--accent); animation: blink 0.8s steps(1) infinite; }
.chat__thinking { position: absolute; left: 0; top: 0.6em; display: flex; gap: 5px; opacity: 0; transition: opacity var(--dur-fast); }
.chat.is-thinking .chat__thinking { opacity: 1; }
.chat__thinking i { width: 6px; height: 6px; border-radius: 50%; background: var(--fg-mute); animation: think 1s var(--ease-in-out) infinite; }
.chat__thinking i:nth-child(2) { animation-delay: 0.15s; }
.chat__thinking i:nth-child(3) { animation-delay: 0.3s; }
@keyframes think { 0%, 100% { translate: 0 0; opacity: 0.4; } 50% { translate: 0 -4px; opacity: 1; } }
.chat__sources { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.source { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--space-3); align-items: center; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); border: 1px solid var(--line); background: var(--surface-1); transition: border-color 0.4s, box-shadow 0.4s, translate 0.6s var(--ease-out-back); }
.source__n { grid-row: span 2; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-family: var(--font-mono); font-size: var(--text-xs); background: var(--surface-3); transition: background-color 0.4s, color 0.4s; }
.source__t { font-size: var(--text-sm); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source__d { font-size: var(--text-xs); color: var(--fg-mute); }
.source.is-cited { border-color: var(--line-accent); box-shadow: var(--glow-accent); translate: 0 -3px; }
.source.is-cited .source__n { background: var(--accent); color: var(--fg-on-accent); }
@media (max-width: 520px) { .chat__sources { grid-template-columns: 1fr; } }

/* ---------- Build: codice → UI ---------- */
.build { position: relative; height: 320vh; }
.build__sticky { position: sticky; top: 0; height: 100vh; display: grid; align-content: center; gap: var(--space-6); padding-top: calc(var(--nav-h) * 0.6); }
.build__head { display: grid; gap: var(--space-4); }
.build__head .t-h1 { font-size: var(--text-3xl); }
.build__grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--space-5); align-items: stretch; }
.build__code { display: flex; flex-direction: column; }
.build__status { display: grid; gap: 6px; margin-top: auto; padding: var(--space-4) var(--space-5); border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: var(--text-xs); color: var(--fg-mute); }
.build__ok { color: var(--success); opacity: 0; translate: -8px 0; transition: opacity var(--dur-base), translate var(--dur-slow) var(--ease-out-expo); }
.build__ok.is-on { opacity: 1; translate: 0 0; }
.build__ok + .build__ok { transition-delay: 150ms; }
.build__lines { position: relative; padding-block: var(--space-4); font-size: clamp(0.7rem, 0.55rem + 0.35vw, 0.88rem); overflow: clip; }
.code-line { position: relative; z-index: 1; display: block; height: 2.2em; padding-inline: var(--space-5); font-family: var(--font-mono); font-size: 1em; line-height: 2.2em; white-space: pre; color: var(--fg-mute); opacity: 0.3; transition: opacity var(--dur-base), color var(--dur-base); }
.code-line.is-on { opacity: 1; color: var(--fg-soft); }
.code-line.is-active { color: var(--fg); }
.build__hl { position: absolute; left: 0; right: 0; top: var(--space-4); height: 2.2em; border-left: 2px solid var(--accent); background: linear-gradient(90deg, var(--accent-soft), transparent 85%); translate: 0 calc(var(--step, 0) * 2.2em); transition: translate var(--dur-slow) var(--ease-out-expo); }

.browser { display: grid; grid-template-rows: auto 1fr; min-height: 380px; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line-strong); background: #f4f5fa; box-shadow: var(--shadow-lg); }
.browser__bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: #e6e8f1; }
.browser__bar i { width: 9px; height: 9px; border-radius: 50%; background: #c7cad8; }
.browser__url { flex: 1; margin-left: 10px; padding: 4px 12px; border-radius: 999px; background: #fff; font-family: var(--font-mono); font-size: 11px; color: #5b6080; }
.browser__view { position: relative; display: grid; align-content: start; gap: var(--space-4); padding: var(--space-5); color: var(--navy-900); }
.build__loading { position: absolute; inset: var(--space-5); border-radius: 14px; background: linear-gradient(90deg, #e6e8f1 25%, #f4f5fa 50%, #e6e8f1 75%) 0 0 / 200% 100%; animation: shimmer 1.2s linear infinite; opacity: 0; transition: opacity var(--dur-base); }
.build__loading.is-active { opacity: 1; }
.bcard { display: grid; grid-template-columns: 1fr; gap: var(--space-4); padding: var(--space-4); border-radius: 16px; background: #fff; box-shadow: 0 18px 40px -20px rgb(7 11 34 / 0.35); }
.bcard__img { aspect-ratio: 16 / 7; border-radius: 12px; background: radial-gradient(80% 90% at 80% 10%, var(--cyan-400), transparent 60%), radial-gradient(60% 70% at 10% 100%, var(--yellow-300), transparent 60%), var(--navy-800); clip-path: inset(0 100% 0 0 round 12px); transition: clip-path 0.9s var(--ease-out-expo); }
.bcard__img.is-on { clip-path: inset(0 0 0 0 round 12px); }
.bcard__body { display: grid; justify-items: start; gap: var(--space-3); }
.bcard__title { font-family: var(--font-display); font-size: clamp(1.1rem, 0.9rem + 0.6vw, 1.5rem); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.bcard__kpi { padding: 4px 10px; border-radius: 999px; background: #dcfce7; color: #15803d; font-family: var(--font-mono); font-size: 12px; font-weight: 500; }
.bcard__btn { padding: 8px 14px; border-radius: 999px; background: var(--navy-900); color: #fff; font-size: 13px; font-weight: 500; }
:is(.bcard, .bcard__title, .bcard__kpi, .bcard__btn, .bschema, .bscore) { opacity: 0; translate: 0 14px; transition: opacity var(--dur-base), translate var(--dur-slow) var(--ease-out-back); }
:is(.bcard, .bcard__title, .bcard__kpi, .bcard__btn, .bschema, .bscore).is-on { opacity: 1; translate: 0 0; }
.build__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.bschema { padding: 6px 12px; border-radius: 999px; background: #e0f2fe; color: var(--cyan-600); font-family: var(--font-mono); font-size: 12px; }
.bscore { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12px; color: #15803d; }
.bscore b { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 3px solid #22c55e; font-size: 14px; }
@media (max-width: 900px) {
  .build__grid { grid-template-columns: 1fr; }
  .build__status { display: none; }
  .build__hl { display: none; }
  .code-line:not(.is-active) { display: none; }
  .code-line.is-active { opacity: 1; }
  .browser { min-height: 0; }
  .bcard__img { aspect-ratio: 16 / 6; }
}

/* ---------- Race: Core Web Vitals prima/dopo ---------- */
.race { position: relative; height: 340vh; }
.race__sticky { position: sticky; top: 0; height: 100vh; display: grid; align-content: center; gap: var(--space-5); padding-top: calc(var(--nav-h) * 0.6); }
.race__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-5); }
.race__intro { display: grid; gap: var(--space-4); max-width: 820px; }
.race__intro .t-h1 { font-size: var(--text-3xl); }
.race__timer { display: flex; align-items: baseline; gap: 0.3em; font-family: var(--font-mono); font-size: var(--text-sm); color: var(--fg-mute); }
.race__timer b { font-family: var(--font-display); font-size: clamp(2.5rem, 1rem + 4vw, 5rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.race__grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); }
.frame { display: grid; gap: var(--space-3); }
.frame__screen { position: relative; aspect-ratio: 16 / 10; overflow: clip; border-radius: var(--radius-md); border: 1px solid var(--line-strong); background: #f4f5fa; }
.frame__spin { position: absolute; inset: 0; z-index: 3; margin: auto; width: 32px; height: 32px; border-radius: 50%; border: 3px solid #d7dae6; border-top-color: var(--cyan-500); animation: spin 0.8s linear infinite; transition: opacity var(--dur-fast); }
.frame__spin.is-on { opacity: 0; }
.frame__banner { position: absolute; left: 0; right: 0; top: 0; z-index: 2; height: 16%; display: grid; place-items: center; background: var(--navy-900); color: #fff; font-family: var(--font-mono); font-size: clamp(9px, 0.7vw, 12px); translate: 0 -101%; transition: translate var(--dur-base) var(--ease-out-expo); }
.frame__banner.is-on { translate: 0 0; }
.frame__slot { position: absolute; left: 6px; right: 6px; top: 6px; height: calc(16% - 12px); display: grid; place-items: center; border: 1px dashed #b8bccd; border-radius: 6px; font-family: var(--font-mono); font-size: clamp(8px, 0.6vw, 11px); color: #5d6283; }
.frame__page { position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr; gap: 6%; padding: 6%; transition: translate var(--dur-slow) var(--ease-out-back); }
.frame--after .frame__page { top: 16%; }
.frame--before .frame__banner.is-on ~ .frame__page { translate: 0 16%; }
.fp-skel, .fp-content { grid-area: 1 / 1; display: grid; gap: 8px; }
.fp-skel { opacity: 0; }
.fp-skel.is-on { opacity: 1; }
.fp-skel i { height: 12px; border-radius: 6px; background: linear-gradient(90deg, #e2e5ef 25%, #eef0f6 50%, #e2e5ef 75%) 0 0 / 200% 100%; animation: shimmer 1.2s linear infinite; }
.fp-skel i:first-child { height: 18px; width: 60%; }
.fp-content { background: #f4f5fa; opacity: 0; transition: opacity var(--dur-fast); }
.fp-content.is-on { opacity: 1; }
.fp-content i { height: 10px; border-radius: 5px; background: #c9cddc; }
.fp-content .fp-nav { height: 8px; width: 40%; background: #dfe2ec; }
.fp-content .fp-h { height: 20px; width: 82%; background: var(--navy-900); }
.fp-content .fp-t--s { width: 58%; }
.fp-hero { position: relative; border-radius: 10px; background: #e2e5ef; overflow: hidden; }
.fp-hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(80% 90% at 80% 10%, var(--cyan-400), transparent 60%), radial-gradient(60% 70% at 10% 100%, var(--yellow-300), transparent 60%), var(--navy-800); opacity: 0; transition: opacity var(--dur-base); }
.fp-hero.is-on::after { opacity: 1; }
.fp-hero::before { content: "LCP"; position: absolute; z-index: 1; top: 8px; right: 8px; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--navy-950); font-family: var(--font-mono); font-size: 10px; scale: 0; transition: scale var(--dur-slow) var(--ease-out-back); }
.fp-hero.is-on::before { scale: 1; }
.frame__metrics { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.metric { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-1); font-family: var(--font-mono); font-size: var(--text-xs); transition: border-color var(--dur-base), color var(--dur-base); }
.metric__k { color: var(--fg-mute); }
.metric__v { display: inline-grid; text-align: right; }
.metric__v > span { grid-area: 1 / 1; transition: opacity var(--dur-fast), translate var(--dur-slow) var(--ease-out-back); }
.metric__v > span + span { opacity: 0; translate: 0 6px; }
.metric.is-on .metric__v > span:first-child { opacity: 0; }
.metric.is-on .metric__v > span + span { opacity: 1; translate: 0 0; }
.metric--good.is-on { border-color: rgb(74 222 154 / 0.5); color: var(--success); }
.metric--ni.is-on { border-color: rgb(255 169 77 / 0.5); color: var(--warning); }
.metric--bad.is-on { border-color: rgb(255 107 107 / 0.5); color: var(--danger); }
.race__track { position: relative; height: 2px; margin-top: var(--space-3); background: var(--line-strong); }
.race__fill { position: absolute; inset: 0; background: var(--grad-signal); transform-origin: 0 50%; transform: scaleX(var(--t, 0)); }
.race__ticks { position: absolute; left: 0; right: 0; top: 10px; display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 10px; font-style: normal; color: var(--fg-mute); }
.race__ticks i { font-style: normal; }
.race__note { text-align: right; margin-top: var(--space-5); font-family: var(--font-mono); font-size: var(--text-2xs); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--fg-mute); }
@media (max-width: 760px) {
  .race__grid { gap: var(--space-3); }
  .frame__screen { aspect-ratio: 3 / 4; }
  .metric { padding: 4px 8px; font-size: 10px; }
}

/* ---------- Metodo ---------- */
.hscroll__head { display: grid; gap: var(--space-4); margin-bottom: var(--space-4); }
.hscroll__head .t-h1 { font-size: var(--text-3xl); }

/* ---------- Numeri ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-6) var(--space-5); }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Case study impilati ---------- */
.scase {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  grid-template-rows: auto 1fr;
  gap: var(--space-5) var(--space-7);
  min-height: min(68vh, 560px);
  padding: var(--space-6);
  border-radius: var(--radius-xl);
  border: 1px solid var(--line-strong);
  background: var(--navy-850);
  box-shadow: var(--shadow-lg);
}
.scase__info { display: grid; justify-items: start; align-content: start; gap: var(--space-4); }
.scase__kpi { align-self: end; display: grid; gap: var(--space-2); }
.scase__media { grid-column: 2; grid-row: 1 / span 2; min-height: 240px; }
@media (max-width: 860px) {
  .scase { grid-template-columns: 1fr; min-height: 0; }
  .scase__media { grid-column: auto; grid-row: auto; min-height: 180px; }
}
.mock { position: absolute; inset: 0; background: radial-gradient(80% 90% at 80% 10%, rgb(0 126 167 / 0.6), transparent 60%), radial-gradient(60% 60% at 10% 100%, rgb(248 192 0 / 0.4), transparent 60%), var(--navy-800); }
.mock::before { content: ""; position: absolute; inset: 12% 10% auto; height: 62%; border-radius: var(--radius-md); background: rgb(255 255 255 / 0.05); border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg); }
.mock::after { content: ""; position: absolute; left: 16%; top: 22%; width: 40%; height: 10px; border-radius: 6px; background: var(--fg-soft); opacity: 0.5; box-shadow: 0 24px 0 -2px rgb(255 255 255 / 0.2), 0 48px 0 -2px rgb(255 255 255 / 0.2), 0 90px 0 6px var(--accent); }
.mock--b { filter: hue-rotate(35deg); }
.mock--c { filter: hue-rotate(-40deg) saturate(1.2); }

/* ---------- CTA ---------- */
.cta-giant .t-eyebrow { justify-self: center; }
.cta-giant .aurora { inset: 0; height: 100%; mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); }

/* ---------- Footer ---------- */
.footer { padding-bottom: 72px; }
.footer__mark { overflow: clip; }

/* ==========================================================================
   Pagina docs
   ========================================================================== */
.doc-hero { padding-top: calc(var(--nav-h) + var(--space-9)); padding-bottom: var(--space-8); }
.doc-hero__title { margin-top: var(--space-5); }
.doc-code { display: inline-block; font-family: var(--font-mono); font-size: var(--text-xs); color: var(--cyan-300); background: var(--accent-2-soft); border: 1px solid rgb(34 181 226 / 0.25); padding: 2px 8px; border-radius: var(--radius-xs); white-space: nowrap; }
.doc-divider { height: 1px; margin: 0; border: 0; background: linear-gradient(90deg, transparent, var(--line-strong), transparent); }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-3); }
.swatch { overflow: hidden; border-radius: var(--radius-md); border: 1px solid var(--line); background: var(--surface-1); }
.swatch__chip { height: 96px; }
.swatch__meta { display: grid; gap: 2px; padding: var(--space-3); font-size: var(--text-xs); }
.swatch__meta b { font-size: var(--text-sm); font-weight: 500; }
.swatch__meta span { font-family: var(--font-mono); color: var(--fg-mute); }
.ramp { display: grid; grid-template-columns: repeat(auto-fit, minmax(28px, 1fr)); height: 56px; margin-top: var(--space-3); overflow: hidden; border-radius: var(--radius-md); }
.type-row { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: var(--space-5); align-items: baseline; padding-block: var(--space-5); border-bottom: 1px solid var(--line); overflow: hidden; }
.type-row > span:first-child { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--fg-mute); }
@media (max-width: 700px) { .type-row { grid-template-columns: 1fr; gap: var(--space-2); } }
.ease-list { display: grid; gap: var(--space-3); }
.ease-row { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: var(--space-4); align-items: center; }
.ease-row code { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--fg-soft); }
.ease-lane { container-type: inline-size; position: relative; height: 36px; border-radius: var(--radius-pill); background: var(--surface-1); border: 1px solid var(--line); }
.ease-dot { position: absolute; top: 5px; left: 5px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 16px var(--accent-glow); transition: translate var(--dur-epic) var(--e); }
.ease-list.is-playing .ease-dot { translate: calc(100cqw - 34px) 0; }
@media (max-width: 700px) { .ease-row { grid-template-columns: 1fr; } }
.tokens-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.tokens-table td, .tokens-table th { padding: var(--space-3) var(--space-2); border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tokens-table th { font-family: var(--font-mono); font-size: var(--text-2xs); font-weight: 500; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--fg-mute); }
.tokens-table td:first-child { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--cyan-300); white-space: nowrap; }
.tokens-table td:last-child { color: var(--fg-soft); }
.demo-box { display: grid; align-content: start; gap: var(--space-5); padding: var(--space-6); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-6); }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.table-wrap { overflow-x: auto; }

/* ==========================================================================
   Sito v3 · set piece della home
   ========================================================================== */

/* ---------- Pill vocale nel titolo: onda che parla (solo transform) ---------- */
.pill--voice { width: 1.6em; background: var(--navy-800); }
.pill--voice::after { content: none; }
.pill--media { width: 1.9em; background: var(--navy-800); }
.pill--media::after { content: none; }
.pill--media::before { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; box-shadow: inset 0 0 0 0.025em var(--line-strong); pointer-events: none; }
.pill--media :is(picture, img) { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border-radius: inherit; }
.pill--media img { object-fit: cover; }
.pill__wave { position: absolute; inset: 0.15em 0.2em; display: flex; align-items: center; justify-content: space-between; }
.pill__wave i { width: 0.065em; height: 100%; border-radius: 1em; background: var(--grad-signal); transform: scaleY(0.3); animation: wave 1.2s var(--ease-in-out) infinite; }
.pill__wave i:nth-child(2) { transform: scaleY(0.6); animation-delay: -0.35s; animation-duration: 1s; }
.pill__wave i:nth-child(3) { transform: scaleY(0.9); animation-delay: -0.7s; animation-duration: 1.3s; }
.pill__wave i:nth-child(4) { transform: scaleY(0.5); animation-delay: -0.2s; animation-duration: 0.9s; }
.pill__wave i:nth-child(5) { transform: scaleY(1); animation-delay: -0.55s; animation-duration: 1.15s; }
.pill__wave i:nth-child(6) { transform: scaleY(0.7); animation-delay: -0.9s; }
.pill__wave i:nth-child(7) { transform: scaleY(0.45); animation-delay: -0.15s; animation-duration: 1.05s; }
.pill__wave i:nth-child(8) { transform: scaleY(0.8); animation-delay: -0.45s; animation-duration: 1.25s; }
.pill__wave i:nth-child(9) { transform: scaleY(0.35); animation-delay: -0.8s; animation-duration: 0.95s; }

/* ---------- Showcase agente: scene legate allo scroll (pin da 900px) ---------- */
.showcase { position: relative; height: 380vh; }
.showcase__sticky { position: sticky; top: 0; height: 100vh; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: var(--space-6); padding: calc(var(--nav-h) + var(--space-6)) 0 var(--space-7); overflow: clip; }
.showcase__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: var(--space-5) var(--space-7); }
.showcase__intro { display: grid; gap: var(--space-4); }
.showcase__intro .t-h1 { font-size: var(--text-3xl); max-width: 22ch; }
.showcase__tabs { display: flex; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.showcase__tab {
  --t: clamp(0, (var(--p, 0) - var(--a)) / (var(--b) - var(--a)), 1);
  position: relative;
  display: grid;
  gap: 2px;
  min-width: 152px;
  padding: var(--space-3) var(--space-4) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-1);
  text-align: left;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-mute);
  overflow: clip;
  transition: color var(--dur-base), border-color var(--dur-base);
}
.showcase__tab b { font-weight: 500; color: var(--accent); }
.showcase__tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--grad-signal); transform-origin: 0 50%; transform: scaleX(var(--t)); }
.showcase__tab[aria-current="true"] { color: var(--fg); border-color: var(--line-strong); }
.showcase__stage { position: relative; min-height: 0; }
.scene {
  --on: calc(max(var(--first, 0), clamp(0, (var(--p, 0) - var(--a)) * 16, 1)) * max(var(--last, 0), clamp(0, (var(--b) - var(--p, 0)) * 16, 1)));
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.25fr);
  align-items: center;
  gap: var(--space-8);
  opacity: var(--on);
}
.scene__copy { display: grid; justify-items: start; gap: var(--space-5); translate: 0 calc((1 - var(--on)) * 28px); }
.scene__num { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--accent); }
.scene__title { font-family: var(--font-display); font-size: clamp(2.4rem, 1rem + 3.6vw, 4.75rem); font-weight: 800; line-height: 0.92; letter-spacing: -0.04em; text-transform: uppercase; text-wrap: balance; }
.scene__cta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); }
.scene__visual { position: relative; height: 100%; max-height: 600px; align-self: center; }
.scene__media { height: 100%; aspect-ratio: auto; scale: calc(1.06 - var(--on) * 0.06); }
.scene__conv { position: absolute; left: calc(-1 * var(--space-7)); bottom: var(--space-6); width: min(80%, 380px); }
@media (max-width: 899px) {
  .showcase { height: auto; }
  .showcase__sticky { position: static; height: auto; padding: var(--section-y) 0; overflow: visible; }
  .showcase__tabs { display: none; }
  .showcase__stage { display: grid; gap: var(--space-9); }
  .scene { --on: 1; position: relative; inset: auto; grid-template-columns: 1fr; gap: var(--space-6); }
  .scene__visual { height: auto; }
  .scene__media { aspect-ratio: 4 / 3; }
  .scene__conv { position: relative; left: auto; bottom: auto; width: auto; margin-top: calc(-1 * var(--space-8)); padding-inline: var(--space-4); }
  .scene .conv__msg { --b: 1; }
}

/* ---------- Automation flow: il segnale attraversa i nodi con lo scroll ---------- */
.flow { position: relative; height: 260vh; }
.flow__sticky { position: sticky; top: 0; height: 100vh; isolation: isolate; overflow: clip; display: grid; align-content: center; gap: var(--space-7); padding: calc(var(--nav-h) + var(--space-5)) 0 var(--space-7); }
.flow__bg { position: absolute; inset: 0; z-index: -1; }
.flow__bg :is(picture, img) { display: block; width: 100%; height: 100%; }
.flow__bg img { object-fit: cover; opacity: 0.42; scale: calc(1.14 - var(--p, 0) * 0.1); }
.flow__bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, var(--bg) 2%, color-mix(in oklab, var(--bg) 35%, transparent) 38%, color-mix(in oklab, var(--bg) 55%, transparent) 70%, var(--bg) 98%); }
.flow__head { display: grid; gap: var(--space-4); max-width: 900px; }
.flow__head .t-h1 { font-size: var(--text-3xl); }
.flow__track { position: relative; container-type: inline-size; padding-top: var(--space-8); }
.flow__nodes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-4); margin: 0; padding: 0; list-style: none; }
.flow__line { position: absolute; left: 0; right: 0; top: calc(var(--space-8) / 2); height: 2px; background: var(--line-strong); }
.flow__line::before { content: ""; position: absolute; inset: 0; background: var(--grad-signal); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); box-shadow: 0 0 12px var(--accent-glow); }
.flow__packet { position: absolute; left: 0; top: calc(var(--space-8) / 2 - 7px); width: 16px; height: 16px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 6px var(--accent-soft), 0 0 24px var(--accent-glow); translate: calc(var(--p, 0) * (100cqw - 16px)) 0; }
.flow__node {
  --on: clamp(0, (var(--p, 0) - var(--at, 0)) * 14, 1);
  position: relative;
  display: grid;
  align-content: start;
  gap: var(--space-2);
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid color-mix(in oklab, var(--accent) calc(var(--on) * 45%), var(--line));
  background: color-mix(in oklab, var(--navy-900) 82%, transparent);
  backdrop-filter: blur(var(--blur-md));
  -webkit-backdrop-filter: blur(var(--blur-md));
  opacity: calc(0.35 + var(--on) * 0.65);
  translate: 0 calc((1 - var(--on)) * 18px);
}
.flow__node::before { content: ""; position: absolute; left: var(--space-5); top: calc(var(--space-8) / -2 - 7px); width: 14px; height: 14px; border-radius: 50%; background: color-mix(in oklab, var(--accent) calc(var(--on) * 100%), var(--navy-600)); box-shadow: 0 0 calc(var(--on) * 22px) var(--accent-glow); }
.flow__sys { justify-self: start; padding: 2px 8px; border-radius: var(--radius-pill); border: 1px solid var(--line); font-family: var(--font-mono); font-size: var(--text-2xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--cyan-300); }
.flow__node h3 { font-size: var(--text-lg); font-weight: 600; line-height: 1.2; letter-spacing: var(--tracking-tight); }
.flow__node p { font-size: var(--text-sm); line-height: 1.55; color: var(--fg-soft); }
.flow__result { margin-top: var(--space-6); display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-3) var(--space-6); opacity: clamp(0, (var(--p, 0) - 0.86) * 12, 1); }
.flow__result b { font-family: var(--font-display); font-size: var(--text-3xl); font-weight: 800; letter-spacing: -0.04em; line-height: 1; color: var(--accent); }
.flow__result span { font-family: var(--font-mono); font-size: var(--text-2xs); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--fg-mute); }
@media (max-width: 899px) {
  .flow { height: auto; }
  .flow__sticky { position: relative; height: auto; padding: var(--section-y) 0; }
  .flow__track { padding: 0 0 0 var(--space-7); }
  .flow__nodes { grid-template-columns: 1fr; }
  .flow__line { left: 7px; right: auto; top: 0; bottom: 0; width: 2px; height: auto; }
  .flow__line::before { transform: none; }
  .flow__packet { display: none; }
  .flow__node { --on: 1; }
  .flow__node::before { left: calc(-1 * var(--space-7) + 1px); top: var(--space-5); }
  .flow__result { opacity: 1; }
}

/* ---------- Anteprime servizi AI e sviluppo ---------- */
.pv--voice { align-content: space-between; background: radial-gradient(80% 70% at 50% 110%, rgb(248 192 0 / 0.32), transparent 60%), var(--navy-800); }
.pv__call { display: flex; align-items: center; justify-content: space-between; color: var(--fg); }
.pv__call b { font-family: var(--font-sans); font-size: 13px; font-weight: 600; }
.pv__live { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); }
.pv__live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pv__wave { display: flex; align-items: center; justify-content: center; gap: 5px; height: 110px; }
.pv__wave i { width: 6px; height: 100%; border-radius: 4px; background: var(--grad-signal); transform: scaleY(var(--h, 0.4)); }
.pv__cap { justify-self: center; padding: 6px 12px; border-radius: 999px; background: rgb(255 255 255 / 0.06); border: 1px solid var(--line); }
.pv--chat { align-content: end; background: radial-gradient(80% 70% at 100% 0%, rgb(34 181 226 / 0.35), transparent 60%), var(--navy-800); }
.pv__msg { max-width: 78%; padding: 8px 11px; border-radius: 12px 12px 12px 3px; background: rgb(255 255 255 / 0.07); font-family: var(--font-sans); font-size: 11px; line-height: 1.45; color: var(--fg); }
.pv__msg--me { justify-self: end; border-radius: 12px 12px 3px 12px; background: var(--accent); color: var(--navy-950); }
.pv__ok { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-accent); background: var(--accent-soft); color: var(--accent); }
.pv--ai { background: radial-gradient(70% 60% at 0% 0%, rgb(0 126 167 / 0.5), transparent 60%), var(--navy-800); }
.pv__doc { display: grid; gap: 7px; padding: 14px; border-radius: 10px; background: #f6f7fb; }
.pv__doc i { height: 6px; border-radius: 3px; background: #dfe2ec; }
.pv__doc i:nth-child(3n) { width: 72%; }
.pv__doc .pv__hl { background: var(--yellow-300); box-shadow: 0 0 0 3px rgb(248 192 0 / 0.25); }
.pv--ai .pv__cite { position: static; width: auto; height: auto; justify-self: start; padding: 6px 10px; border-radius: 999px; }
.pv--web { padding: 0; background: #f6f7fb; }
.pv__site { position: relative; display: grid; align-content: start; gap: 9px; padding: 14px; height: 100%; }
.pv__site .pv__nav { display: flex; justify-content: space-between; }
.pv__site .pv__nav i { width: 36px; height: 6px; border-radius: 3px; background: #c9cddc; }
.pv__site .pv__nav i:first-child { width: 60px; background: var(--navy-900); }
.pv__site .pv__h { height: 26px; width: 88%; border-radius: 5px; background: var(--navy-900); }
.pv__site .pv__h + .pv__h { width: 64%; }
.pv__site .pv__img { height: 70px; border-radius: 8px; background: radial-gradient(80% 90% at 80% 10%, var(--cyan-400), transparent 60%), radial-gradient(60% 70% at 10% 100%, var(--yellow-300), transparent 60%), var(--navy-800); }
.pv__bubble { position: absolute; right: 12px; bottom: 12px; display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 8px; border-radius: 999px; background: var(--navy-900); color: #fff; font-family: var(--font-sans); font-size: 11px; box-shadow: 0 10px 24px -8px rgb(7 11 34 / 0.6); }
.pv__bubble::before { content: ""; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }

/* ---------- Progetti con immagine, CTA con sfondo ---------- */
.case__media > :is(picture, img) { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.case__media img { width: 100%; height: 100%; object-fit: cover; }
.cta-giant__bg { position: absolute; inset: 0; z-index: -2; mask-image: radial-gradient(ellipse 75% 70% at 50% 50%, #000 30%, transparent 85%); }
.cta-giant__bg :is(picture, img) { display: block; width: 100%; height: 100%; }
.cta-giant__bg img { object-fit: cover; opacity: 0.4; }
.cta-giant__alt { position: relative; z-index: 1; font-size: var(--text-sm); color: var(--fg-soft); }
.cta-giant__alt button { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.cta-giant__alt button:hover { color: var(--accent); }

/* ---------- Reduced motion: scene e flusso statici ---------- */
@media (prefers-reduced-motion: reduce) {
  .showcase, .flow { height: auto; }
  .showcase__sticky, .flow__sticky { position: relative; height: auto; overflow: visible; padding-block: var(--section-y); }
  .showcase__tabs, .flow__packet { display: none; }
  .showcase__stage { display: grid; gap: var(--space-9); }
  .scene { --on: 1; position: relative; inset: auto; }
  .scene__visual { height: auto; }
  .scene__media { aspect-ratio: 4 / 3; scale: 1; }
  .conv__msg { --b: 1; }
  .flow__node { --on: 1; }
  .flow__line::before { transform: none; }
  .flow__result { opacity: 1; }
  .flow__bg img { scale: 1; }
}
