/* =========================================================
   AI Process Engineering — v2
   Sito "a schermate": ogni pagina è una vista in stile app iOS.
   Grigio di sistema, card bianche e grafite, un solo accento.
   ========================================================= */

:root {
  --bg: #e9e9ec;
  --bg-2: #f4f4f6;
  --card: #ffffff;
  --ink: #111113;
  --ink-2: #3a3a3f;
  --muted: #5c5c63;
  --line: rgba(17, 17, 19, 0.08);
  --line-strong: rgba(17, 17, 19, 0.14);
  --dark: #151517;
  --on-dark: #f3f3f5;
  --on-dark-muted: #a3a3ab;
  --accent: #ff5b1f;
  --accent-deep: #c93d08; /* bottoni con testo bianco: contrasto AA */

  --r-xl: 30px;
  --r-lg: 24px;
  --r-md: 18px;
  --gap: 12px;
  --pad: 12px;
  --bar: 60px;
  --shadow: 0 1px 1px rgba(0,0,0,.03), 0 10px 28px -14px rgba(0,0,0,.2);
  --shadow-lg: 0 30px 60px -30px rgba(0,0,0,.38);
  --font: "Geist", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --maxw: 1480px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden;
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, p, figure, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 200; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; transition: top .2s; }
.skip-link:focus { top: 12px; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Tipografia ---------- */
.eyebrow { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.dark .eyebrow, .eyebrow.light { color: var(--on-dark-muted); }
.title-xl { font-size: clamp(2.6rem, 6vw, 5.6rem); line-height: .95; letter-spacing: -.048em; font-weight: 600; }
.title-l { font-size: clamp(2rem, 3.8vw, 3.4rem); line-height: 1; letter-spacing: -.04em; font-weight: 600; }
.title-m { font-size: clamp(1.25rem, 1.7vw, 1.6rem); line-height: 1.12; letter-spacing: -.025em; font-weight: 600; }
.lead { font-size: clamp(1.05rem, 1.3vw, 1.22rem); line-height: 1.5; color: var(--ink-2); max-width: 46ch; }
.dark .lead { color: var(--on-dark-muted); }
.muted { color: var(--muted); }
.dark .muted { color: var(--on-dark-muted); }
.accent { color: var(--accent); }

/* ---------- Bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; padding: 0 22px; border-radius: 999px; white-space: nowrap;
  font-weight: 550; font-size: 15px; letter-spacing: -.01em;
  transition: transform .35s var(--ease), background .25s, box-shadow .25s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: scale(.97); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-accent { background: var(--accent-deep); color: #fff; }
.btn-accent:hover { box-shadow: 0 14px 28px -12px rgba(201, 61, 8, .7); }
.btn-light { background: rgba(255,255,255,.92); color: var(--ink); }
.btn-glass { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.25); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.btn-outline { border: 1px solid var(--line-strong); background: rgba(255,255,255,.5); }
.btn .ar { width: 30px; height: 30px; margin-right: -12px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.18); }
.btn-light .ar, .btn-outline .ar { background: var(--ink); color: #fff; }
.link-arrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 550; font-size: 15px; }
.link-arrow .icon { transition: transform .35s var(--ease); }
a:hover .link-arrow .icon, .link-arrow:hover .icon { transform: translateX(4px); }

.circle-btn { width: 52px; height: 52px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--ink); color: #fff; transition: transform .35s var(--ease); }
.circle-btn:hover { transform: scale(1.06); }
.circle-btn.light { background: rgba(255,255,255,.85); color: var(--ink); border: 1px solid var(--line); }

.tag { display: inline-flex; padding: 5px 11px; border-radius: 999px; font-family: var(--mono); font-size: 11.5px; background: var(--bg-2); border: 1px solid var(--line); color: var(--ink-2); }
.dark .tag { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.12); color: var(--on-dark); }

.glass { background: rgba(255,255,255,.6); -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%); border: 1px solid rgba(255,255,255,.6); }
.glass-dark { background: rgba(20,20,22,.5); -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%); border: 1px solid rgba(255,255,255,.14); color: #fff; }

/* ---------- Card ---------- */
.card { background: var(--card); border-radius: var(--r-xl); padding: clamp(22px, 2.4vw, 34px); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.card.dark { background: var(--dark); color: var(--on-dark); }

/* =========================================================
   Shell dell'app: barra in alto uguale su tutte le pagine
   ========================================================= */
.app { max-width: var(--maxw); margin: 0 auto; padding: var(--pad); display: flex; flex-direction: column; gap: var(--gap); min-height: 100svh; }
.appbar { display: flex; align-items: center; gap: 8px; height: var(--bar); view-transition-name: appbar; position: relative; z-index: 20; }
.brand-pill { display: flex; align-items: center; gap: 12px; height: var(--bar); padding: 0 22px 0 12px; border-radius: 999px; background: var(--dark); color: #fff; flex: none; }
.brand-pill svg { width: 38px; height: 38px; }
.brand-name { line-height: 1; }
.brand-name strong { display: block; font-size: 17px; font-weight: 650; letter-spacing: -.02em; }
.brand-name span { display: block; margin-top: 4px; font-size: 9px; letter-spacing: .32em; font-weight: 500; opacity: .6; }
.nav { display: flex; gap: 6px; flex: 1; min-width: 0; }
.pill {
  height: var(--bar); padding: 0 22px; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px;
  font-size: 14.5px; font-weight: 500; white-space: nowrap; border: 1px solid var(--line-strong); background: rgba(255,255,255,.4);
  transition: background .25s, color .25s;
}
.pill:hover { background: #fff; }
.pill[aria-current="page"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.pill.cta { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }
.pill.cta:hover { background: #b53606; }
.menu-btn { display: none; }

/* Menu a schermo intero (mobile) */
.sheet {
  position: fixed; inset: 0; z-index: 100; padding: var(--pad); display: flex; flex-direction: column; gap: 8px;
  background: rgba(233,233,236,.78); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%);
  opacity: 0; visibility: hidden; transition: opacity .4s var(--ease), visibility .4s;
}
.sheet.open { opacity: 1; visibility: visible; }
.sheet-top { display: flex; justify-content: space-between; align-items: center; padding-bottom: 8px; }
.sheet nav { display: grid; gap: 8px; }
.sheet nav a {
  display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-radius: var(--r-lg);
  background: rgba(255,255,255,.8); font-size: clamp(1.5rem, 6vw, 2.2rem); font-weight: 600; letter-spacing: -.035em;
  transform: translateY(18px); opacity: 0; transition: transform .6s var(--ease), opacity .6s var(--ease);
}
.sheet nav a[aria-current="page"] { background: var(--ink); color: #fff; }
.sheet nav a small { font-family: var(--mono); font-size: 12px; font-weight: 400; letter-spacing: 0; opacity: .6; }
.sheet.open nav a { transform: none; opacity: 1; }
.sheet.open nav a:nth-child(2) { transition-delay: .04s; } .sheet.open nav a:nth-child(3) { transition-delay: .08s; }
.sheet.open nav a:nth-child(4) { transition-delay: .12s; } .sheet.open nav a:nth-child(5) { transition-delay: .16s; }
.sheet.open nav a:nth-child(6) { transition-delay: .2s; }
.sheet .sheet-cta { margin-top: auto; display: grid; gap: 8px; }
.sheet .sheet-cta .btn { height: 58px; }

/* Transizioni tra pagine (Chrome/Edge/Safari recenti; altrove navigazione normale) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .28s var(--ease) both; }
::view-transition-new(root) { animation: vt-in .55s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-10px) scale(.985); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(18px) scale(.985); } }

/* Entrata degli elementi al caricamento / allo scroll */
.rise { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
.rise.in { opacity: 1; transform: none; }

/* =========================================================
   HOME — una sola schermata
   ========================================================= */
.home { flex: 1 0 auto; display: grid; grid-template-columns: 272px 1fr; gap: var(--gap); min-height: 0; height: calc(100svh - var(--bar) - var(--pad) * 2 - var(--gap)); min-height: 600px; max-height: 1000px; }
.rail { display: grid; grid-template-rows: auto 1fr auto; gap: var(--gap); min-height: 0; }
.tile { border-radius: var(--r-lg); padding: 20px; position: relative; overflow: hidden; display: flex; flex-direction: column; transition: transform .45s var(--ease); }
a.tile:hover { transform: translateY(-3px); }
.tile.dark { background: var(--dark); color: var(--on-dark); }
.tile .t-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--on-dark-muted); }
.tile .t-head .icon { width: 16px; height: 16px; }
.kpi { display: flex; align-items: center; gap: 14px; margin-top: 22px; }
.kpi-num { font-size: 52px; font-weight: 600; letter-spacing: -.05em; line-height: 1; }
.kpi-label { font-size: 12.5px; line-height: 1.3; color: var(--on-dark-muted); padding-left: 14px; border-left: 1px solid rgba(255,255,255,.18); }

.tile-gauge { align-items: center; justify-content: center; text-align: center; min-height: 0; background: radial-gradient(120% 90% at 20% 0%, rgba(255,255,255,.95), rgba(255,255,255,.4) 60%), linear-gradient(160deg, #f6f6f8, #d9d9de); border: 1px solid rgba(255,255,255,.8); }
.tile-gauge .g-label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.gauge { position: relative; width: min(100%, 190px); aspect-ratio: 1; margin: 8px 0 4px; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge .g-track { stroke: rgba(17,17,19,.16); stroke-dasharray: 1 5.2; }
.gauge .g-fill { stroke: var(--accent); }
.gauge-val { position: absolute; inset: 0; display: grid; place-items: center; font-size: 40px; letter-spacing: -.04em; }
.gauge-val small { font-size: 18px; }
.tile-gauge .g-foot { font-size: 12px; color: var(--muted); }
.tile .bar { height: 12px; border-radius: 4px; margin-top: 14px; background: rgba(255,255,255,.14); overflow: hidden; }
.tile .bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 4px; transition: width 1.6s var(--ease) .4s; }
.is-ready .tile .bar i { width: 100%; }

.stage { position: relative; border-radius: var(--r-xl); overflow: hidden; background: #1b1b1e; isolation: isolate; min-height: 0; box-shadow: inset 0 0 0 1px rgba(255,255,255,.3), var(--shadow-lg); }
.stage-media, .stage-media > * { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stage-media { z-index: -2; }
.stage-media video { opacity: 0; transition: opacity .9s var(--ease); }
.stage-media video.on { opacity: 1; }
.stage-media img.drift { animation: drift 24s ease-in-out infinite alternate; transform-origin: 55% 45%; }
@keyframes drift { from { transform: scale(1.02); } to { transform: scale(1.1) translate3d(-1%, -1%, 0); } }
.stage::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(0deg, rgba(10,10,12,.78) 0%, rgba(10,10,12,.3) 45%, rgba(10,10,12,0) 66%), linear-gradient(90deg, rgba(10,10,12,.5), rgba(10,10,12,0) 60%); }
.stage-copy { position: absolute; left: clamp(22px, 3.4vw, 52px); bottom: clamp(24px, 3.4vw, 48px); right: 40%; color: #fff; }
.stage-copy .eyebrow { color: rgba(255,255,255,.8); display: block; margin-bottom: 18px; }
.stage-copy h1 { font-size: clamp(2.8rem, 6vw, 6rem); line-height: .93; letter-spacing: -.05em; font-weight: 500; }
.stage-copy h1 .w { display: block; overflow: hidden; padding-bottom: .05em; }
.stage-copy h1 .w span { display: block; transform: translateY(105%); transition: transform 1.1s var(--ease); }
.is-ready .stage-copy h1 .w span { transform: none; }
.stage-copy p { margin-top: 18px; max-width: 44ch; color: rgba(255,255,255,.85); font-size: clamp(1rem, 1.15vw, 1.1rem); }
.stage-actions { display: flex; gap: 10px; margin-top: 26px; flex-wrap: wrap; }
.stage-note { position: absolute; right: clamp(18px, 2.4vw, 32px); bottom: clamp(24px, 3.4vw, 48px); width: 250px; border-radius: var(--r-lg); padding: 16px 18px; font-size: 13.5px; line-height: 1.4; }
.stage-note strong { display: block; font-size: 15px; margin-bottom: 4px; }
.stage-note span { color: rgba(255,255,255,.78); }

/* =========================================================
   Pagine interne
   ========================================================= */
.page { display: flex; flex-direction: column; gap: var(--gap); flex: 1; }
.page-head { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px 48px; align-items: end; padding: clamp(28px, 5vw, 64px) clamp(8px, 1.6vw, 22px) clamp(16px, 2.4vw, 28px); }
.page-head .eyebrow { grid-column: 1 / -1; }
.page-head .lead { justify-self: end; }
.crumbs { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.crumbs a:hover { color: var(--ink); }

.grid { display: grid; gap: var(--gap); grid-template-columns: repeat(12, 1fr); }
.s3 { grid-column: span 3; } .s4 { grid-column: span 4; } .s5 { grid-column: span 5; } .s6 { grid-column: span 6; }
.s7 { grid-column: span 7; } .s8 { grid-column: span 8; } .s12 { grid-column: span 12; }

/* Card con immagine */
.media-card { padding: 0; display: flex; flex-direction: column; }
.media-card .m-img { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #d9d9de; margin: 8px 8px 0; border-radius: calc(var(--r-xl) - 8px); }
.media-card .m-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
a.media-card:hover .m-img img { transform: scale(1.045); }
.media-card .m-body { padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.media-card .m-body p { color: var(--muted); font-size: 15px; }
.media-card.dark .m-body p { color: var(--on-dark-muted); }
.media-card .m-foot { margin-top: auto; padding-top: 10px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.media-card .num { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.media-card.dark .num { color: var(--on-dark-muted); }

/* Card grande con immagine di sfondo */
.feature { min-height: 520px; padding: clamp(24px, 3vw, 40px); display: flex; flex-direction: column; justify-content: flex-end; color: #fff; }
.feature > img, .feature > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; transition: transform 1.4s var(--ease); }
a.feature:hover > img { transform: scale(1.035); }
.feature::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(0deg, rgba(10,10,12,.82), rgba(10,10,12,.2) 55%, rgba(10,10,12,0)); }
.feature > * { position: relative; z-index: 2; }
.feature .badge { position: absolute; top: clamp(20px, 2.4vw, 30px); left: clamp(20px, 2.4vw, 30px); z-index: 2; padding: 8px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 500; }
.feature .title-l { max-width: 14ch; margin: 10px 0 12px; }
.feature p { color: rgba(255,255,255,.84); max-width: 46ch; }
.feature .link-arrow { margin-top: 20px; }

/* Passi del metodo */
.step .m-body .step-n { font-size: 44px; font-weight: 600; letter-spacing: -.06em; line-height: 1; color: var(--accent); }

/* Blocco scuro con elenco + numeri */
.why { padding: clamp(28px, 4vw, 56px); }
.why-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.why-list li { display: grid; grid-template-columns: 44px 1fr; gap: 14px; padding: 18px 0; border-top: 1px solid rgba(255,255,255,.1); }
.why-list li:last-child { border-bottom: 1px solid rgba(255,255,255,.1); }
.why-list .n { font-family: var(--mono); font-size: 12px; color: var(--accent); padding-top: 4px; }
.why-list h3 { font-size: 1.12rem; font-weight: 600; letter-spacing: -.015em; margin-bottom: 4px; }
.why-list p { color: var(--on-dark-muted); font-size: 15px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); margin-top: clamp(28px, 4vw, 48px); }
.stat { padding: 22px; border-radius: var(--r-lg); background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09); }
.stat-num { font-size: clamp(2.4rem, 4vw, 3.8rem); font-weight: 600; letter-spacing: -.05em; line-height: 1; }
.stat-num .suf { font-size: .5em; color: var(--accent); margin-left: 2px; }
.stat p { margin-top: 10px; font-size: 13.5px; color: var(--on-dark-muted); }

/* Casi d'uso */
.case .metric { font-size: clamp(2.4rem, 3.6vw, 3.4rem); font-weight: 600; letter-spacing: -.055em; line-height: 1; }
.case .metric small { display: block; font-size: 14px; letter-spacing: -.01em; color: var(--muted); font-weight: 500; margin-top: 6px; }
.case .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* Testo lungo in card */
.prose p + p { margin-top: 14px; }
.prose strong { font-weight: 600; }
.dark.prose strong, .dark .prose strong { color: #fff; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.hero-split { display: grid; grid-template-columns: 1fr 1.15fr; gap: var(--gap); min-height: min(76svh, 760px); }
.hero-split .copy { display: flex; flex-direction: column; justify-content: space-between; gap: 28px; }
.hero-split .copy h1 { font-size: clamp(2.6rem, 5vw, 5rem); line-height: .95; letter-spacing: -.048em; font-weight: 600; }
.hero-split .media { padding: 0; min-height: 420px; }
.hero-split .media > img, .hero-split .media > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.fact { padding: 22px; }
.fact strong { display: block; font-size: clamp(1.6rem, 2.4vw, 2.2rem); letter-spacing: -.045em; font-weight: 600; line-height: 1.05; }
.fact span { display: block; margin-top: 8px; font-size: 14px; color: var(--muted); }

.checks { display: grid; gap: 12px; margin-top: 22px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; font-size: 15.5px; }
.checks .icon { color: var(--accent); margin-top: 3px; }
.checks code { font-family: var(--mono); font-size: .9em; padding: 1px 6px; border-radius: 6px; background: rgba(255,91,31,.14); }

.cta-strip { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cta-strip h2 { font-size: clamp(1.5rem, 2.4vw, 2.2rem); letter-spacing: -.035em; line-height: 1.08; font-weight: 600; max-width: 24ch; }
.cta-strip p { margin-top: 8px; color: var(--on-dark-muted); max-width: 56ch; }
.cta-strip .actions { display: flex; gap: 10px; flex-wrap: wrap; }

.quote { font-size: clamp(1.4rem, 2.4vw, 2.2rem); line-height: 1.12; letter-spacing: -.03em; font-weight: 500; }
.quote em { font-style: normal; color: var(--accent); }

/* Demo "risposta AI" (pagina Siti web) */
.ai-answer { border-radius: var(--r-lg); padding: 18px; background: #0c0c0e; border: 1px solid rgba(255,255,255,.08); font-size: 14px; }
.ai-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.ai-tabs button { font-family: var(--mono); font-size: 11.5px; padding: 6px 11px; border-radius: 999px; background: #1c1c20; color: #b4b4bc; transition: .3s; }
.ai-tabs button:hover { color: #fff; }
.ai-tabs button[aria-selected="true"] { background: #fff; color: #111; }
.ai-q { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.ai-q span { background: #2a2a2f; padding: 10px 14px; border-radius: 18px 18px 4px 18px; max-width: 85%; color: #fff; }
.ai-a .txt { color: #d8d8de; min-height: 8.5em; }
.ai-a .txt b { background: rgba(255,91,31,.18); padding: 1px 6px; border-radius: 6px; }
.ai-a .txt b { color: #fff; font-weight: 600; }
.ai-a .caret { display: inline-block; width: 7px; height: 1.05em; vertical-align: -2px; background: var(--accent); margin-left: 2px; }
.ai-sources { display: flex; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); flex-wrap: wrap; opacity: 0; transition: .6s var(--ease); }
.ai-sources.show { opacity: 1; }
.ai-src { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border-radius: 12px; background: #1c1c20; font-size: 12.5px; color: #eee; }
.ai-src img, .ai-src i { width: 20px; height: 20px; border-radius: 6px; background: #2a2a30; }
.ai-src.hit { background: rgba(255,91,31,.14); box-shadow: inset 0 0 0 1px rgba(255,91,31,.5); }

/* FAQ */
.faq { display: grid; gap: 8px; }
.faq details { background: var(--card); border-radius: var(--r-lg); padding: 0 24px; box-shadow: var(--shadow); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 0; font-size: 1.05rem; font-weight: 550; letter-spacing: -.01em; }
.faq summary::-webkit-details-marker { display: none; }
.faq .plus { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--bg-2); transition: transform .4s var(--ease), background .3s, color .3s; }
.faq details[open] .plus { transform: rotate(45deg); background: var(--ink); color: #fff; }
.faq details p { padding: 0 0 22px; color: var(--ink-2); max-width: 75ch; }

/* Form */
.form { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; align-content: start; }
.form .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field .lbl { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field input, .field textarea { width: 100%; border-radius: 16px; border: 1px solid var(--line-strong); background: var(--bg-2); padding: 15px 16px; font-size: 16px; outline: none; transition: border .2s, background .2s, box-shadow .2s; }
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--ink); background: #fff; box-shadow: 0 0 0 4px rgba(17,17,19,.06); }
.topics { display: flex; flex-wrap: wrap; gap: 8px; }
.topics label { cursor: pointer; }
.topics input { position: absolute; opacity: 0; pointer-events: none; }
.topics span { display: inline-flex; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 14px; transition: .2s; }
.topics input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.topics input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.form-foot small { color: var(--muted); font-size: 12.5px; max-width: 40ch; }
.form-status { font-size: 14px; font-weight: 500; }
.form-status.ok { color: #1c7a42; } .form-status.err { color: #b8321b; }
.hp { position: absolute; left: -9999px; }
.c-points { display: grid; gap: 10px; }
.c-point { padding: 16px 18px; border-radius: var(--r-md); background: rgba(255,255,255,.06); }
.c-point strong { display: block; font-weight: 600; }
.c-point span { font-size: 14px; color: var(--on-dark-muted); }

/* Footer compatto */
.foot { margin-top: clamp(24px, 4vw, 48px); border-radius: var(--r-xl); background: var(--dark); color: var(--on-dark-muted); padding: 22px clamp(22px, 2.4vw, 32px); display: flex; justify-content: space-between; align-items: center; gap: 16px 28px; flex-wrap: wrap; font-size: 13.5px; }
.foot .f-brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.foot .f-brand svg { width: 30px; height: 30px; }
.foot nav { display: flex; gap: 18px; flex-wrap: wrap; }
.foot a:hover { color: #fff; }
.page-home .foot { margin-top: 0; }

/* Pagine legali */
.legal { max-width: 820px; width: 100%; margin: 0 auto; display: grid; gap: var(--gap); }
.legal h1 { font-size: clamp(2.4rem, 5vw, 4rem); letter-spacing: -.045em; line-height: 1; font-weight: 600; padding: clamp(28px, 5vw, 56px) 8px 0; }
.legal .upd { font-family: var(--mono); font-size: 12.5px; color: var(--muted); padding: 0 8px 12px; }
.legal h2 { font-size: 1.25rem; letter-spacing: -.02em; font-weight: 600; margin-bottom: 10px; }
.legal p, .legal li { color: var(--ink-2); }
.legal ul { list-style: disc; padding-left: 20px; display: grid; gap: 6px; }
.legal a { color: var(--accent-deep); text-decoration: underline; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1240px) {
  .nav .pill { padding: 0 16px; }
  .brand-pill .brand-name span { display: none; }
  .home { grid-template-columns: 236px 1fr; }
  .kpi-num { font-size: 44px; }
}
@media (max-width: 1080px) {
  .nav { display: none; }
  .menu-btn { display: grid; margin-left: auto; }
  .home { grid-template-columns: 1fr; height: auto; max-height: none; min-height: 0; }
  .stage { order: 1; height: calc(100svh - var(--bar) - var(--pad) * 2 - var(--gap) - 12px); min-height: 540px; max-height: 900px; }
  .rail { order: 2; grid-template-rows: none; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 calc(var(--pad) * -1); padding: 0 var(--pad); }
  .rail::-webkit-scrollbar { display: none; }
  .rail > .tile { scroll-snap-align: start; }
  .rail .gauge { width: 130px; }
  .rail .gauge-val { font-size: 30px; }
  .stage-copy { right: 22px; bottom: 28px; }
  .stage-note { display: none; }
  .page-head { grid-template-columns: 1fr; }
  .page-head .lead { justify-self: start; }
  .grid > * { grid-column: span 12; }
  .grid > .s4, .grid > .s3 { grid-column: span 6; }
  .why-grid, .split, .hero-split { grid-template-columns: 1fr; }
  .hero-split .media { min-height: 56svh; }
  .stats, .facts { grid-template-columns: repeat(2, 1fr); }
  .feature { min-height: 440px; }
}
@media (max-width: 640px) {
  :root { --gap: 10px; --pad: 10px; --r-xl: 26px; --bar: 54px; }
  .brand-pill { padding: 0 16px 0 10px; }
  .brand-pill svg { width: 32px; height: 32px; }
  .appbar .pill.cta { display: none; }
  .stage { min-height: 520px; }
  .stage-copy h1 { font-size: clamp(2.7rem, 13vw, 3.8rem); }
  .rail { grid-auto-columns: 78%; }
  .grid > .s4, .grid > .s3 { grid-column: span 12; }
  .form { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { padding: 16px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .fact { padding: 16px; }
  .feature { min-height: 400px; }
  .faq details { padding: 0 18px; }
  .foot { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .rise { opacity: 1; transform: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* Liste numerate in card chiare */
.card:not(.dark) .why-list li { border-color: var(--line); }
.card:not(.dark) .why-list p { color: var(--muted); }
.card.dark .facts > div { padding-top: 16px; border-top: 1px solid rgba(255,255,255,.12); }
figure.feature { justify-content: flex-end; }
@media (max-width: 1080px) { .card.dark .facts { gap: 20px; } }
.cta-strip:not(.dark) p { color: var(--muted); }
@media (max-width: 1080px) {
  .rail > .tile { min-height: 0; padding: 18px; }
  .rail .kpi { margin-top: 14px; }
  .rail .tile-gauge { flex-direction: row; gap: 14px; justify-content: flex-start; text-align: left; }
  .rail .tile-gauge .gauge { width: 96px; margin: 0; order: -1; flex: none; }
  .rail .tile-gauge .gauge-val { font-size: 22px; }
  .rail .tile-gauge .gauge-val small { font-size: 12px; }
  .rail .tile-gauge .g-label { display: block; font-size: 15px; }
}
.tile-gauge .g-foot { display: block; }
@media (min-width: 1081px) { .tile-gauge > div:last-child { order: -1; display: contents; } .tile-gauge .g-label { order: -2; } }
.case.dark .metric small { color: var(--on-dark-muted); }

/* =========================================================
   MOBILE — progettato come un'app a sé
   (barra sottile + "Menu" testuale, pillola d'azione in basso,
   hero verticale, pile di card compatte, un solo carosello per pagina)
   ========================================================= */
.menu-btn { display: none; align-items: center; gap: 8px; height: 44px; padding: 0 16px 0 18px; border-radius: 999px;
  background: rgba(255,255,255,.85); border: 1px solid var(--line); font-weight: 550; font-size: 15px; }
.m-dock, .m-explore { display: none; }

@media (max-width: 1080px) {
  .menu-btn { display: inline-flex; margin-left: auto; }
  .appbar { position: sticky; top: 0; height: auto; padding: 8px 0; margin: -8px 0 0; z-index: 50;
    background: linear-gradient(var(--bg) 70%, rgba(233,233,236,0)); }
  .brand-pill { height: 48px; }

  .m-dock { display: flex; gap: 8px; position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 60;
    padding: 6px; border-radius: 999px; background: rgba(21,21,23,.72); -webkit-backdrop-filter: blur(20px) saturate(170%); backdrop-filter: blur(20px) saturate(170%);
    border: 1px solid rgba(255,255,255,.14); box-shadow: 0 18px 40px -16px rgba(0,0,0,.5);
    transition: transform .5s var(--ease), opacity .4s, left .5s var(--ease); }
  .m-dock-main { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 52px; padding: 0 18px 0 20px; border-radius: 999px;
    background: var(--accent-deep); color: #fff; font-weight: 600; font-size: 15.5px; white-space: nowrap; overflow: hidden; transition: padding .5s var(--ease); }
  .m-dock-icon { width: 52px; height: 52px; flex: none; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.12); color: #fff; }
  .m-dock.mini { left: auto; }
  .m-dock.mini .m-label { display: none; }
  .m-dock.mini .m-dock-main { flex: none; width: 52px; padding: 0; justify-content: center; }
  .m-dock.hide, .m-dock.off { transform: translateY(140%); opacity: 0; pointer-events: none; }
  body { padding-bottom: 84px; }
}

@media (max-width: 760px) {
  :root { --gap: 10px; --pad: 10px; --r-xl: 26px; }
  .title-xl { font-size: clamp(2.5rem, 11.5vw, 3.4rem); }
  .title-l { font-size: clamp(1.9rem, 8.4vw, 2.4rem); }
  .lead { font-size: 1.05rem; }
  .page-head { padding: 22px 6px 8px; gap: 12px; }
  .foot { margin-top: 18px; }

  /* HOME: video verticale a tutto schermo + accessi rapidi */
  .home { display: flex; flex-direction: column; height: auto; min-height: 0; max-height: none; }
  .home .rail { display: none; }
  .stage { height: calc(100svh - 76px); min-height: 560px; max-height: 900px; border-radius: 28px; }
  .stage::after { background: linear-gradient(0deg, rgba(10,10,12,.86) 0%, rgba(10,10,12,.42) 38%, rgba(10,10,12,0) 60%); }
  .stage-copy { left: 20px; right: 20px; bottom: 24px; }
  .stage-copy .eyebrow { margin-bottom: 12px; }
  .stage-copy h1 { font-size: clamp(2.9rem, 14vw, 4rem); }
  .stage-copy p { font-size: 1rem; margin-top: 12px; }
  .stage-actions { flex-direction: column; align-items: stretch; margin-top: 20px; }
  .stage-actions .btn { width: 100%; height: 54px; justify-content: space-between; }
  .stage-actions .btn-glass { justify-content: center; }
  .m-explore { display: grid; gap: 10px; margin-top: 10px; }
  .m-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .m-kpis div { background: var(--dark); color: #fff; border-radius: 20px; padding: 16px 12px; }
  .m-kpis strong { display: block; font-size: 1.7rem; letter-spacing: -.05em; line-height: 1; font-weight: 600; }
  .m-kpis span { display: block; margin-top: 6px; font-size: 12px; color: var(--on-dark-muted); line-height: 1.25; }
  .m-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .m-tile { position: relative; aspect-ratio: 1 / 1.08; border-radius: 24px; overflow: hidden; background: #1b1b1e; color: #fff; isolation: isolate; }
  .m-tile-wide { grid-column: 1 / -1; aspect-ratio: 16 / 10; }
  .m-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform 1s var(--ease); }
  .m-tile::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(10,10,12,.82), rgba(10,10,12,0) 60%); }
  .m-tile span { position: absolute; left: 16px; right: 16px; bottom: 14px; font-size: 1.2rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
  .m-tile small { display: block; font-family: var(--mono); font-size: 11px; font-weight: 400; opacity: .7; margin-bottom: 4px; letter-spacing: .04em; }
  .m-tile em { display: block; font-style: normal; font-weight: 400; font-size: 13.5px; opacity: .8; margin-top: 4px; letter-spacing: 0; }
  .m-tile:active img { transform: scale(1.05); }

  /* Card con immagine → righe compatte (immagine a sinistra), come le liste delle app */
  .grid > .media-card.s4, .grid > .media-card.s3 { flex-direction: row; align-items: stretch; min-height: 0; }
  .media-card .m-img { flex: 0 0 38%; aspect-ratio: auto; min-height: 132px; margin: 8px 0 8px 8px; border-radius: 18px; }
  .media-card .m-body { padding: 14px 16px 14px 14px; gap: 5px; }
  .media-card .m-body p { font-size: 14px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .media-card .title-m { font-size: 1.12rem; }
  .media-card .tags { display: none; }
  .case .metric { font-size: 1.7rem; }
  .case .metric small { font-size: 12px; margin-top: 2px; }
  /* i primi 3 casi d'uso restano grandi */
  .page-casi-uso .grid > .case:nth-child(-n+3) { flex-direction: column; }
  .page-casi-uso .grid > .case:nth-child(-n+3) .m-img { aspect-ratio: 16 / 10; margin: 8px 8px 0; flex: none; }
  .page-casi-uso .grid > .case:nth-child(-n+3) .m-body { padding: 18px 20px 20px; }
  .page-casi-uso .grid > .case:nth-child(-n+3) .metric { font-size: 2.3rem; }
  .page-casi-uso .grid > .case:nth-child(-n+3) p { -webkit-line-clamp: unset; }

  /* Servizi: i due servizi di punta come card alte, gli altri in lista */
  .feature { min-height: 440px; padding: 22px; }
  .feature .title-l { font-size: 2rem; }

  /* Metodo: timeline verticale */
  .page-metodo ol.grid { position: relative; }
  .step .m-body .step-n { font-size: 30px; }
  .why { padding: 24px 20px; }
  .why-grid { gap: 20px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat { padding: 14px; } .stat-num { font-size: 2.3rem; }

  /* Pagine di dettaglio: prima l'immagine/video, poi il testo */
  .hero-split { min-height: 0; }
  .hero-split .media { order: -1; min-height: 0; aspect-ratio: 4 / 3.4; }
  .hero-split .copy { gap: 18px; }
  .hero-split .copy h1 { font-size: clamp(2.3rem, 10.5vw, 3rem); }
  .facts { gap: 8px; }
  .fact strong { font-size: 1.35rem; }

  /* Carosello: una sola sezione per pagina, con la card successiva che "sbuca" */
  .m-carousel { display: grid !important; grid-auto-flow: column; grid-auto-columns: 86%; grid-template-columns: none !important;
    overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 calc(var(--pad) * -1); padding: 2px var(--pad) 6px; }
  .m-carousel::-webkit-scrollbar { display: none; }
  .m-carousel > * { scroll-snap-align: start; grid-column: auto !important; }

  /* Contatti */
  .form .btn { width: 100%; height: 56px; }
  .field input, .field textarea { font-size: 16px; padding: 16px; }
  .c-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .faq summary { font-size: 1rem; padding: 18px 0; }

  /* Movimento legato allo scroll (dove supportato): immagini che si "posano" entrando */
  @supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
      .m-img img, .m-tile img, .feature > img { animation: settle linear both; animation-timeline: view(); animation-range: entry 0% cover 45%; }
      @keyframes settle { from { transform: scale(1.14); } to { transform: scale(1); } }
    }
  }
}
.c-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 760px) {
  .m-carousel > .media-card { flex-direction: column !important; }
  .m-carousel .m-img { aspect-ratio: 4 / 3 !important; margin: 8px 8px 0 !important; flex: none !important; min-height: 0 !important; }
  .m-carousel .m-body p { -webkit-line-clamp: unset; }
  .c-actions .btn { width: 100%; }
}
@media (max-width: 760px) { .home .stage { order: 1; } .m-explore { order: 2; } }
@media (max-width: 1080px) { .home .stage-actions .btn-glass { display: none; } }

@media (max-width: 1080px) { .home .stage { order: 1; } .home .rail { order: 2; } .m-explore { order: 3; } }
.page-head { padding-top: clamp(8px, 1.6vw, 22px); }

.hm-link { display: flex; flex-direction: column; gap: 10px; }
.hm-link .link-arrow { margin-top: auto; padding-top: 10px; }
