/* =========================================================
   FLAG Software — foglio di stile
   ========================================================= */

/* Caratteri ospitati sul sito (nessuna connessione a Google) */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Sora"; font-style: normal; font-weight: 100 800; font-display: swap; src: url("../fonts/sora-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Sora"; font-style: normal; font-weight: 100 800; font-display: swap; src: url("../fonts/sora-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #070b18;
  --bg-2: #0b1124;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --border-2: rgba(255, 255, 255, 0.16);
  --text: #e8ecf7;
  --muted: #9aa5c4;
  --dim: #6b7696;
  --cyan: #38bdf8;
  --violet: #a78bfa;
  --indigo: #6366f1;
  --amber: #fbbf24;
  --ok: #34d399;
  --grad: linear-gradient(100deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);
  --radius: 22px;
  --shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--border);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Sora", var(--font);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.65 var(--font);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0; letter-spacing: -0.02em; }
p { margin: 0 0 1em; }
::selection { background: rgba(129, 140, 248, .45); }

svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Sfondo: aurora + grana ---------- */
.aurora { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .45; will-change: transform; }
.orb-1 { width: 55vw; height: 55vw; left: -15vw; top: -10vw; background: radial-gradient(circle, #1d4ed8 0%, transparent 65%); animation: drift1 26s ease-in-out infinite alternate; }
.orb-2 { width: 50vw; height: 50vw; right: -15vw; top: 30vh; background: radial-gradient(circle, #7c3aed 0%, transparent 65%); animation: drift2 32s ease-in-out infinite alternate; }
.orb-3 { width: 40vw; height: 40vw; left: 25vw; bottom: -20vw; background: radial-gradient(circle, #0891b2 0%, transparent 65%); animation: drift3 28s ease-in-out infinite alternate; opacity: .3; }
@keyframes drift1 { to { transform: translate(18vw, 22vh) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-20vw, -15vh) scale(.9); } }
@keyframes drift3 { to { transform: translate(-15vw, -30vh) scale(1.2); } }
.grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Bottoni ---------- */
.btn {
  --h: 54px;
  display: inline-flex; align-items: center; gap: .6em; height: var(--h); padding: 0 26px;
  border-radius: 999px; border: 1px solid transparent; text-decoration: none; cursor: pointer;
  font: 600 16px/1 var(--font); color: var(--text); white-space: nowrap;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), background .3s, border-color .3s;
}
.btn svg { width: 18px; height: 18px; transition: transform .35s var(--ease); }
.btn:hover svg { transform: translateX(4px); }
.btn-small { --h: 40px; padding: 0 18px; font-size: 14.5px; background: var(--surface-2); border-color: var(--border-2); }
.btn-small:hover { background: rgba(255,255,255,.12); }
.btn-primary {
  position: relative; isolation: isolate; color: #fff;
  background: linear-gradient(100deg, #0ea5e9, #6366f1 55%, #a855f7);
  box-shadow: 0 10px 30px -8px rgba(99, 102, 241, .7), inset 0 1px 0 rgba(255,255,255,.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 45px -10px rgba(129, 140, 248, .9), inset 0 1px 0 rgba(255,255,255,.35); }
.btn-glow::before {
  content: ""; position: absolute; inset: -2px; z-index: -1; border-radius: inherit;
  background: var(--grad); filter: blur(14px); opacity: .55; animation: pulseGlow 3.2s ease-in-out infinite;
}
@keyframes pulseGlow { 50% { opacity: .9; filter: blur(20px); } }
.btn-ghost { background: var(--surface); border-color: var(--border-2); backdrop-filter: blur(10px); }
.btn-ghost:hover { background: var(--surface-2); transform: translateY(-2px); }

/* ---------- Navigazione ---------- */
.nav {
  position: fixed; top: 14px; left: 50%; z-index: 50; transform: translateX(-50%);
  width: min(1180px, 100% - 24px); height: 64px; padding: 0 12px 0 20px;
  display: flex; align-items: center; justify-content: space-between;
  border-radius: 999px; border: 1px solid transparent;
  transition: background .4s, border-color .4s, box-shadow .4s, top .4s;
}
.nav.scrolled {
  top: 10px; background: rgba(10, 15, 32, .72); border-color: var(--border);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 20px 50px -20px rgba(0,0,0,.8);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-logo {
  width: 40px; height: 40px; flex: none;
  filter: drop-shadow(0 0 10px rgba(250, 204, 21, .35)) drop-shadow(0 2px 4px rgba(0, 0, 0, .6));
  transition: transform .5s var(--ease), filter .5s var(--ease);
}
.brand:hover .brand-logo { transform: rotate(-8deg) scale(1.08); filter: drop-shadow(0 0 14px rgba(250, 204, 21, .6)) drop-shadow(0 2px 4px rgba(0, 0, 0, .6)); }
.brand-text { font: 800 19px/1 var(--display); letter-spacing: .02em; }
.brand-text b { font-weight: 500; color: var(--muted); margin-left: 5px; }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a:not(.btn) { padding: 10px 14px; border-radius: 999px; text-decoration: none; font-size: 15px; color: var(--muted); transition: color .25s, background .25s; }
.nav-links a:not(.btn):hover { color: var(--text); background: var(--surface); }
.nav-toggle { display: none; width: 44px; height: 44px; border: 0; background: var(--surface-2); border-radius: 50%; cursor: pointer; position: relative; }
.nav-toggle span { position: absolute; left: 13px; right: 13px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .35s var(--ease), top .35s var(--ease); }
.nav-toggle span:first-child { top: 17px; } .nav-toggle span:last-child { top: 25px; }
.nav-toggle[aria-expanded="true"] span:first-child { top: 21px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { top: 21px; transform: rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100svh; display: grid; align-items: center; padding: 120px 0 80px; overflow: hidden; }
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero-fallback { display: none; }
.no-webgl .hero-fallback {
  display: block; position: absolute; right: 5vw; top: 50%; width: 46vmin; height: 46vmin; transform: translateY(-50%);
  border-radius: 50%; background: radial-gradient(circle at 35% 30%, #a5b4fc, #6366f1 35%, #1e1b4b 70%);
  box-shadow: 0 0 120px 20px rgba(99,102,241,.5);
}
.hero::after { /* sfuma il basso */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 180px; z-index: 1; pointer-events: none;
  background: linear-gradient(transparent, var(--bg));
}
.hero-inner { position: relative; z-index: 2; width: min(1180px, 100% - 32px); margin-inline: auto; pointer-events: none; }
.hero-inner > * { pointer-events: auto; max-width: 680px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 12px; margin-bottom: 26px;
  border-radius: 999px; background: rgba(255,255,255,.05); border: 1px solid var(--border-2);
  font-size: 14px; font-weight: 500; color: #c7d2fe; backdrop-filter: blur(8px);
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(52,211,153,.7); animation: ping 2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 10px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }
.hero h1 { font-size: clamp(40px, 6.6vw, 82px); font-weight: 700; margin-bottom: 26px; text-shadow: 0 4px 40px rgba(7, 11, 24, .8); }
/* la frase che cambia resta sempre su UNA riga: niente salti del testo sotto */
.rotator { display: block; position: relative; perspective: 600px; white-space: nowrap; }
.rotator-word .art { color: var(--text); -webkit-text-fill-color: var(--text); filter: none; }
.rotator-word {
  display: inline-block; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 24px rgba(129, 140, 248, .55));
  transition: opacity .45s var(--ease), transform .45s var(--ease), filter .45s;
}
.rotator-word.out { opacity: 0; transform: translateY(-0.45em) rotateX(70deg); filter: blur(6px); }
.rotator-word.in { opacity: 0; transform: translateY(0.45em) rotateX(-70deg); filter: blur(6px); transition: none; }
.lead { font-size: clamp(18px, 2vw, 21px); color: #c3cbe3; max-width: 600px; margin-bottom: 34px; }
.lead strong { color: #fff; font-weight: 600; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 36px; }
.hero-points { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px 26px; color: var(--muted); font-size: 15px; }
.hero-points li { display: flex; align-items: center; gap: 8px; }
.hero-points svg { width: 18px; height: 18px; color: var(--ok); stroke-width: 2.4; }
.scroll-hint { position: absolute; left: 50%; bottom: 28px; z-index: 3; width: 26px; height: 42px; margin-left: -13px; border: 2px solid var(--border-2); border-radius: 14px; }
.scroll-hint span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--text); animation: wheel 1.8s var(--ease) infinite; }
@keyframes wheel { 0% { opacity: 0; transform: translateY(-4px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- Sezioni ---------- */
.section { position: relative; padding: 120px 0; }
.section-compact { padding: 40px 0; }
.section-head { text-align: center; max-width: 760px; margin: 0 auto 64px; }
.section-head.left { text-align: left; margin: 0; }
.kicker { display: inline-block; margin-bottom: 16px; font: 600 13px/1 var(--font); letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); }
.section h2 { font-size: clamp(32px, 4.6vw, 54px); font-weight: 700; margin-bottom: 22px; }
.sub { color: var(--muted); font-size: 18px; }

/* ---------- Carte girevoli (3D flip) ---------- */
.flip-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; perspective: 1400px; }
.flip { all: unset; display: block; cursor: pointer; height: 300px; }
.flip:focus-visible .flip-inner { outline: 2px solid var(--cyan); outline-offset: 4px; }
.flip-inner { position: relative; display: block; height: 100%; border-radius: var(--radius); transform-style: preserve-3d; transition: transform .9s var(--ease); }
.flip.is-flipped .flip-inner { transform: rotateY(180deg); }
@media (hover: hover) { .flip:hover .flip-inner { transform: rotateY(180deg); } }
.flip-face {
  position: absolute; inset: 0; display: flex; flex-direction: column; padding: 28px; border-radius: var(--radius);
  backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: var(--shadow); overflow: hidden;
}
.flip-front { background: linear-gradient(160deg, rgba(255,255,255,.07), rgba(255,255,255,.02)); justify-content: space-between; }
.flip-front::after { content: "?"; position: absolute; right: -10px; bottom: -50px; font: 800 220px/1 var(--display); color: rgba(255,255,255,.035); }
.flip-back {
  transform: rotateY(180deg);
  background: linear-gradient(160deg, rgba(56,189,248,.22), rgba(129,140,248,.18) 50%, rgba(192,132,252,.2));
  box-shadow: var(--shadow), inset 0 0 60px rgba(129,140,248,.25);
}
.flip-tag { font-size: 12.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.flip-tag.ok { color: var(--ok); }
.flip-title { font: 600 23px/1.25 var(--display); margin: 14px 0; }
.flip-front .flip-title { color: #fff; font-style: italic; }
.flip-text { color: #d6dcf0; font-size: 15.5px; line-height: 1.6; }
.flip-hint { font-size: 13.5px; color: var(--violet); }

/* ---------- Demo chat ---------- */
.demo-wrap { display: grid; grid-template-columns: 1fr 1.15fr; gap: 64px; align-items: center; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 30px; max-width: 420px; }
.tab {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 14px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted); font: 500 15.5px var(--font);
  transition: all .3s var(--ease);
}
.tab svg { width: 20px; height: 20px; }
.tab:hover { color: var(--text); border-color: var(--border-2); }
.tab.active { color: #fff; background: linear-gradient(120deg, rgba(56,189,248,.18), rgba(167,139,250,.18)); border-color: rgba(129,140,248,.6); box-shadow: 0 0 30px -8px rgba(129,140,248,.7); }
.note { margin-top: 18px; font-size: 13.5px; color: var(--dim); }

.device {
  position: relative; border-radius: 26px; overflow: hidden;
  background: linear-gradient(180deg, rgba(20, 27, 52, .92), rgba(12, 17, 36, .95));
  box-shadow: 0 60px 120px -30px rgba(0,0,0,.9), 0 0 0 1px var(--border-2), 0 0 80px -20px rgba(99,102,241,.5);
  transform-style: preserve-3d;
}
.device::before { /* riflesso */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 3;
  background: radial-gradient(600px circle at var(--mx, 70%) var(--my, 0%), rgba(255,255,255,.08), transparent 45%);
}
.device-bar { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.03); }
.lights { display: flex; gap: 7px; } .lights i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; } .lights i:nth-child(2) { background: #febc2e; } .lights i:nth-child(3) { background: #28c840; }
.device-title { font-size: 13.5px; color: var(--muted); } .device-title b { color: var(--text); font-weight: 600; }
.chat { height: 440px; padding: 24px 22px; display: flex; flex-direction: column; gap: 16px; overflow: hidden; }
.msg { max-width: 88%; padding: 14px 18px; border-radius: 18px; font-size: 15.5px; line-height: 1.55; animation: msgIn .5s var(--ease) both; }
@keyframes msgIn { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.msg.user { align-self: flex-end; background: linear-gradient(120deg, #2563eb, #7c3aed); color: #fff; border-bottom-right-radius: 6px; box-shadow: 0 10px 30px -10px rgba(99,102,241,.8); }
.msg.ai { align-self: flex-start; background: rgba(255,255,255,.06); border: 1px solid var(--border); border-bottom-left-radius: 6px; }
.msg.ai b { color: #fff; }
.typing { display: inline-flex; gap: 5px; padding: 18px 20px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 30% { opacity: 1; transform: translateY(-3px); } 0%, 60%, 100% { opacity: .3; } }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 92px; margin: 14px 0 8px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; font-size: 11.5px; color: var(--muted); }
.bar span { width: 100%; height: 0; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--cyan), var(--indigo)); box-shadow: 0 0 18px -4px rgba(56,189,248,.7); transition: height 1.1s var(--ease); }
.bar.low span { background: linear-gradient(180deg, #fb7185, #e11d48); box-shadow: 0 0 18px -4px rgba(251,113,133,.8); }
.file { display: inline-flex; align-items: center; gap: 10px; margin-top: 10px; padding: 9px 14px; border-radius: 12px; background: rgba(52,211,153,.1); border: 1px solid rgba(52,211,153,.35); font-size: 14px; color: #a7f3d0; }
.file svg { width: 18px; height: 18px; }
.chat-input { display: flex; align-items: center; justify-content: space-between; margin: 0 16px 16px; padding: 12px 12px 12px 18px; border-radius: 16px; background: rgba(255,255,255,.05); border: 1px solid var(--border); color: var(--dim); font-size: 15px; }
.chat-input .send { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: linear-gradient(120deg, #0ea5e9, #8b5cf6); color: #fff; }
.chat-input .send svg { width: 17px; height: 17px; }
#chat-typing.active { color: var(--text); }
#chat-typing.active::after { content: ""; display: inline-block; width: 2px; height: 1.1em; margin-left: 2px; vertical-align: -3px; background: var(--cyan); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

/* ---------- Card servizi ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; perspective: 1200px; }
.card {
  position: relative; padding: 34px 30px 32px; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(165deg, rgba(255,255,255,.065), rgba(255,255,255,.015));
  box-shadow: var(--shadow); transform-style: preserve-3d;
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
.card::before { /* luce che segue il mouse */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(129,140,248,.18), transparent 50%);
}
.card::after { /* bordo luminoso */
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 50%), rgba(56,189,248,.9), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.card:hover::before, .card:hover::after { opacity: 1; }
.card:hover { box-shadow: 0 40px 90px -25px rgba(0,0,0,.85), 0 0 0 1px var(--border-2), 0 0 60px -20px rgba(99,102,241,.6); }
.card > * { transform: translateZ(30px); }
.card-icon {
  width: 56px; height: 56px; display: grid; place-items: center; margin-bottom: 24px; border-radius: 16px;
  background: linear-gradient(140deg, rgba(56,189,248,.25), rgba(167,139,250,.25)); border: 1px solid rgba(165,180,252,.35);
  box-shadow: 0 12px 30px -10px rgba(99,102,241,.8), inset 0 1px 0 rgba(255,255,255,.2); color: #e0e7ff;
}
.card-icon svg { width: 26px; height: 26px; }
.card h3 { font-size: 21px; margin-bottom: 12px; }
.card p { color: var(--muted); font-size: 15.5px; margin: 0; }
.card-feature { background: linear-gradient(165deg, rgba(99,102,241,.2), rgba(56,189,248,.06)); }
.badge { position: absolute; top: 22px; right: 22px; padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #1e1b4b; background: linear-gradient(120deg, #fde68a, var(--amber)); box-shadow: 0 6px 20px -6px rgba(251,191,36,.8); }

/* ---------- Caso reale ---------- */
.case {
  position: relative; display: grid; grid-template-columns: 1.4fr 1fr; gap: 56px; align-items: center;
  padding: 64px; border-radius: 32px; overflow: hidden; isolation: isolate;
  background: linear-gradient(135deg, rgba(30, 41, 90, .65), rgba(15, 20, 45, .8));
  box-shadow: 0 50px 120px -40px rgba(0,0,0,.9), 0 0 0 1px var(--border-2);
}
.case-glow { position: absolute; z-index: -1; width: 500px; height: 500px; right: -120px; top: -160px; border-radius: 50%; background: radial-gradient(circle, rgba(139,92,246,.55), transparent 65%); filter: blur(30px); animation: drift2 18s ease-in-out infinite alternate; }
.case .case-title { font-size: clamp(30px, 3.6vw, 44px); }
.case-text p { color: #c3cbe3; }
.case-text strong { color: #fff; }
.case-stats { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.case-stats li { padding: 22px 26px; border-radius: 18px; background: rgba(255,255,255,.05); border: 1px solid var(--border); backdrop-filter: blur(10px); }
.case-stats b { display: block; font: 700 26px/1.2 var(--display); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.case-stats span { color: var(--muted); font-size: 15px; }

/* ---------- Passi ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; position: relative; }
.steps::before { content: ""; position: absolute; top: 34px; left: 6%; right: 6%; height: 2px; background: linear-gradient(90deg, transparent, rgba(129,140,248,.6), transparent); }
.step { position: relative; padding: 0 8px; text-align: center; }
.step-num {
  position: relative; display: grid; place-items: center; width: 68px; height: 68px; margin: 0 auto 24px; border-radius: 50%;
  font: 700 20px var(--display); color: #fff; background: radial-gradient(circle at 30% 30%, #4f46e5, #1e1b4b);
  box-shadow: 0 0 0 6px var(--bg), 0 0 0 7px rgba(129,140,248,.5), 0 0 40px rgba(99,102,241,.7);
}
.step h3 { font-size: 21px; margin-bottom: 10px; }
.step p { color: var(--muted); font-size: 15.5px; }

/* ---------- Perché io ---------- */
.why { position: relative; display: grid; grid-template-columns: 1fr 1.3fr; gap: 56px; align-items: center; }
.why-year {
  font: 800 clamp(90px, 15vw, 200px)/1 var(--display); letter-spacing: -0.05em; text-align: center;
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(129,140,248,.25) 70%, transparent);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 20px 50px rgba(99,102,241,.45));
}
.why-text p { color: #c3cbe3; } .why-text strong { color: #fff; }

/* ---------- Gestionali ---------- */
.legacy { border-radius: 20px; background: var(--surface); border: 1px solid var(--border); }
.legacy summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 28px; font: 600 18px var(--display); }
.legacy summary::-webkit-details-marker { display: none; }
.legacy summary .kicker { display: block; margin-bottom: 6px; color: var(--dim); }
.legacy summary svg { width: 22px; height: 22px; flex: none; color: var(--muted); transition: transform .4s var(--ease); }
.legacy[open] summary svg { transform: rotate(180deg); }
.legacy-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 0 28px; }
.legacy-grid div { padding: 20px; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid var(--border); }
.legacy-grid h3 { font-size: 17px; margin-bottom: 8px; }
.legacy-grid p { color: var(--muted); font-size: 14.5px; margin: 0; }
.legacy-note { padding: 18px 28px 24px; margin: 0; color: var(--muted); font-size: 15px; }
.legacy-note a { color: var(--cyan); }

/* ---------- Contatti ---------- */
.contact { display: grid; grid-template-columns: 1fr 1.1fr; gap: 64px; align-items: start; }
.contact-text p { color: #c3cbe3; }
.contact-list { list-style: none; padding: 0; margin: 30px 0 0; display: grid; gap: 14px; }
.contact-list li { display: flex; align-items: center; gap: 14px; color: var(--muted); }
.contact-list svg { width: 22px; height: 22px; flex: none; color: var(--cyan); }
.contact-list a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border-2); }
.contact-list a:hover { border-color: var(--cyan); }
.mail-card {
  position: relative; display: grid; gap: 18px; padding: 40px; border-radius: 28px; overflow: hidden;
  background: linear-gradient(165deg, rgba(255,255,255,.07), rgba(255,255,255,.02));
  box-shadow: var(--shadow), 0 0 80px -30px rgba(99,102,241,.6); backdrop-filter: blur(12px);
  transition: transform .5s var(--ease);
}
.mail-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 80%) var(--my, 0%), rgba(129,140,248,.16), transparent 55%);
}
.mail-icon {
  width: 64px; height: 64px; display: grid; place-items: center; border-radius: 18px; color: #e0e7ff;
  background: linear-gradient(140deg, rgba(56,189,248,.3), rgba(167,139,250,.3)); border: 1px solid rgba(165,180,252,.4);
  box-shadow: 0 14px 34px -10px rgba(99,102,241,.9), inset 0 1px 0 rgba(255,255,255,.2);
  animation: floaty 5s ease-in-out infinite;
}
.mail-icon svg { width: 30px; height: 30px; }
@keyframes floaty { 50% { transform: translateY(-6px) rotate(-3deg); } }
.mail-card h3 { font-size: 26px; }
.mail-card p { margin: 0; color: #c3cbe3; }
.mail-tips { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.mail-tips li { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); }
.mail-tips svg { width: 20px; height: 20px; flex: none; margin-top: 2px; color: var(--ok); stroke-width: 2.4; }
.mail-btn { justify-self: start; margin-top: 6px; }
.mail-alt { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; color: var(--muted); font-size: 15px; }
.mail-alt a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border-2); }
.mail-alt a:hover { border-color: var(--cyan); }
.mail-alt .btn svg { width: 16px; height: 16px; }
.mail-alt .btn:hover svg { transform: none; }
.mail-alt .btn.copied { border-color: rgba(52,211,153,.6); color: #a7f3d0; }
.mail-note { font-size: 13.5px; color: var(--dim) !important; }
.mail-note a { color: var(--cyan); }

/* ---------- Pagine legali ---------- */
.legal { padding: 150px 0 90px; }
.legal .container { width: min(820px, 100% - 32px); }
.legal h1 { font-size: clamp(34px, 5vw, 52px); margin-bottom: 14px; }
.legal .updated { color: var(--dim); font-size: 14.5px; margin-bottom: 44px; }
.legal-card {
  padding: 44px; border-radius: 26px;
  background: linear-gradient(165deg, rgba(255,255,255,.06), rgba(255,255,255,.015));
  box-shadow: var(--shadow);
}
.legal h2 { font-size: 22px; margin: 40px 0 14px; color: #fff; }
.legal h2:first-child { margin-top: 0; }
.legal p, .legal li { color: #c3cbe3; font-size: 16px; }
.legal ul { padding-left: 22px; margin: 0 0 1em; }
.legal li { margin-bottom: 8px; }
.legal a { color: var(--cyan); }
.legal strong { color: #fff; }
.legal table { width: 100%; border-collapse: collapse; margin: 8px 0 20px; font-size: 15px; }
.legal th, .legal td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); color: #c3cbe3; vertical-align: top; }
.legal th { color: #fff; font-weight: 600; background: rgba(255,255,255,.04); }
.back-link { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 26px; color: var(--muted); text-decoration: none; font-size: 15px; }
.back-link:hover { color: var(--text); }
.back-link svg { width: 18px; height: 18px; }
@media (max-width: 760px) { .legal-card { padding: 26px 20px; } .legal table { font-size: 14px; } .legal th, .legal td { padding: 10px 8px; } }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 44px 0; color: var(--dim); font-size: 14px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.footer p { margin: 8px 0 0; }
.footer nav { display: flex; gap: 22px; }
.footer nav a { text-decoration: none; } .footer nav a:hover { color: var(--text); }
.footer .copy { margin: 0; }
.todo { color: var(--amber); }

/* ---------- Animazioni di comparsa ---------- */
.reveal { opacity: 0; transform: translateY(36px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0s); }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .flip-grid { grid-template-columns: repeat(2, 1fr); }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .demo-wrap, .contact, .why, .case { grid-template-columns: 1fr; gap: 44px; }
  .case { padding: 44px 32px; }
  .steps { grid-template-columns: repeat(2, 1fr); row-gap: 50px; }
  .steps::before { display: none; }
  .why-year { text-align: left; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 74px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 4px; padding: 14px;
    border-radius: 24px; background: rgba(10, 15, 32, .96); border: 1px solid var(--border-2); backdrop-filter: blur(18px);
    opacity: 0; transform: translateY(-10px) scale(.98); pointer-events: none; transition: opacity .3s, transform .3s var(--ease);
  }
  .nav-links.open { opacity: 1; transform: none; pointer-events: auto; }
  .nav-links a:not(.btn) { padding: 14px 16px; font-size: 17px; }
  .nav-links .btn { justify-content: center; margin-top: 6px; --h: 50px; }
  .nav.menu-open { background: rgba(10, 15, 32, .9); border-color: var(--border); }
  .hero { padding-top: 110px; align-items: end; }
  #hero-canvas { opacity: .6; }
  .hero h1 { font-size: clamp(26px, 7.8vw, 44px); }
  .hero-inner { padding-bottom: 30px; }
  .section { padding: 84px 0; }
  .section-head { margin-bottom: 44px; }
  .flip-grid, .cards, .legacy-grid, .steps { grid-template-columns: 1fr; }
  .flip { height: 250px; }
  .chat { height: 470px; padding: 18px 14px; }
  .msg { font-size: 14.5px; max-width: 94%; }
  .mail-card { padding: 28px 22px; }
  .mail-btn { justify-self: stretch; justify-content: center; white-space: normal; text-align: center; }
  .btn { --h: 52px; padding: 0 22px; }
  .hero-cta .btn { flex: 1 1 auto; justify-content: center; }
  .legacy summary { padding: 18px 20px; } .legacy-grid { padding: 0 20px; } .legacy-note { padding: 16px 20px 20px; }
  .scroll-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
