/* ============================================================
   Clarivio — Sistema visivo
   Precisione · Chiarezza · Calore misurato
   ============================================================ */

:root {
  /* Accento brand — Viola Clarivio (max 10% superficie) */
  --viola: #6556f6;
  --viola-hover: #5244e0;
  --viola-soft: #ece9ff;

  /* Superfici */
  --white: #ffffff;
  --nebbia: #f5f7fc;
  --nebbia-chiara: #f8faff;
  --nebbia-media: #f1f5f9;

  /* Testo */
  --slate: #0f172a;
  --slate-medio: #475569;
  --slate-chiaro: #64748b;

  /* Bordo */
  --bordo: #dde5f0;

  /* Semantici (solo feedback) */
  --danger-bg: #feeceb;
  --danger-text: #b42318;
  --danger-border: #fecdd3;
  --warning-bg: #fef9c3;
  --warning-text: #854d0e;
  --success-bg: #e7f8ef;
  --success-text: #0e8a4f;

  /* Motion — lineare, funzionale */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --container: 1100px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--nebbia);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: 'Geist', system-ui, sans-serif;
  background: transparent;
  color: var(--slate);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

/* Mai overflow orizzontale: media fluidi e celle griglia comprimibili */
img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
}

canvas#webgl-bg {
  height: 100%;
}

*,
*::before,
*::after {
  min-width: 0;
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: rgba(101, 86, 246, 0.18);
}

button,
input,
select,
textarea {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

button {
  -webkit-appearance: none;
  appearance: none;
}

em {
  font-style: italic;
  color: var(--viola);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ---------- Tipografia ---------- */
.eyebrow {
  margin: 0;
  font-family: 'Geist', sans-serif;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  color: var(--viola);
}

.display {
  margin: 0;
  font-family: 'DM Serif Display', serif;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.08;
}

.section-title {
  margin: 0;
  font-family: 'DM Serif Display', serif;
  font-weight: 400;
  font-size: clamp(2rem, 4.4vw, 3.2rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.lede {
  margin: 0;
  color: var(--slate-medio);
  font-size: 1.15rem;
  line-height: 1.55;
  max-width: 60ch;
}

/* ---------- Layout ---------- */
.section {
  position: relative;
  padding: 120px 0;
}

.section--white {
  background: var(--white);
}

.section--nebbia {
  background: var(--nebbia);
}

/* ---------- Sfondo WebGL globale ---------- */
#webgl-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  z-index: -2;
  display: block;
  pointer-events: none;
}

/* Hero trasparente: lascia trasparire l'animazione WebGL */
.hero.hero {
  background: transparent;
}

/* Alcune sezioni con gradiente translucido: il WebGL filtra sotto */
.section--glassbg {
  background: linear-gradient(180deg, rgba(245, 247, 252, 0.72) 0%, rgba(255, 255, 255, 0.88) 100%);
  backdrop-filter: blur(8px) saturate(115%);
  -webkit-backdrop-filter: blur(8px) saturate(115%);
}

.section--gradient {
  background: linear-gradient(165deg, #ffffff 0%, #eef0ff 55%, #e7ecff 100%);
}

/* ---------- Sezioni-pannello che si sovrappongono nello scroll ---------- */
.section--panel {
  margin: 0 clamp(14px, 3vw, 40px);
  border-radius: clamp(26px, 3vw, 40px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 40px 80px -55px rgba(15, 23, 42, 0.3);
  will-change: transform, opacity;
}

/* Sovrapposizione: ogni pannello sale sopra il precedente */
.section--panel,
.section--framed {
  position: relative;
  z-index: 1;
  margin-top: clamp(-72px, -6vw, -40px);
  transform-origin: center top;
}

.hero {
  z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
  .section--panel,
  .section--framed {
    transform: none !important;
    opacity: 1 !important;
  }
}


.shell {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 40px;
}

.section-head {
  max-width: 680px;
  display: grid;
  gap: 20px;
  margin-bottom: 72px;
}

.section-head--wide {
  max-width: none;
}

.title-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-right: 18px;
  border-radius: 16px;
  background: linear-gradient(150deg, #8678ff 0%, #6556f6 52%, #4d3ddb 100%);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.55) inset,
    0 -8px 16px -8px rgba(40, 28, 130, 0.7) inset,
    0 18px 30px -12px rgba(74, 58, 196, 0.55),
    0 6px 12px -8px rgba(15, 23, 42, 0.4);
  vertical-align: middle;
  transform: translateY(-4px);
}

.title-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.55), transparent 50%);
  mix-blend-mode: screen;
  opacity: 0.85;
  pointer-events: none;
}

.title-icon svg {
  position: relative;
  width: 26px;
  height: 26px;
  stroke: #fff;
  stroke-width: 1.85;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(40, 28, 130, 0.5));
}

/* ---------- Header ---------- */
.site-shell {
  position: fixed;
  top: clamp(12px, 1.6vw, 22px);
  left: 0;
  right: 0;
  z-index: 80;
  display: flex;
  justify-content: center;
  padding: 0 clamp(14px, 3vw, 32px);
  pointer-events: none;
}

.floating-nav {
  pointer-events: auto;
  height: 64px;
  width: 100%;
  max-width: 980px;
  padding: 0 14px 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-radius: 999px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0.28) 100%
  );
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow:
    0 8px 32px -12px rgba(15, 23, 42, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 -1px 0 rgba(15, 23, 42, 0.04);
  transition: box-shadow 300ms var(--ease), background 300ms var(--ease);
}

.floating-nav:hover {
  box-shadow:
    0 14px 40px -14px rgba(15, 23, 42, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    inset 0 -1px 0 rgba(15, 23, 42, 0.04);
}

.brand {
  display: inline-flex;
  align-items: center;
}

.brand img {
  height: 26px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  font-size: 15px;
  font-weight: 500;
  color: var(--slate-medio);
  transition: color 200ms var(--ease);
}

.nav-links a:hover {
  color: var(--slate);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Hamburger — nascosto su desktop, visibile da tablet in giù */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 12px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--slate);
  transition: transform 260ms var(--ease), opacity 200ms var(--ease);
}

.nav-toggle.is-active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Bottoni ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 10px;
  font-family: 'Geist', sans-serif;
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 200ms var(--ease), color 200ms var(--ease),
    border-color 200ms var(--ease), transform 200ms var(--ease);
}

.btn--primary {
  background: var(--viola);
  color: #fff;
}

.btn--primary:hover {
  background: var(--viola-hover);
}

.btn--outline {
  background: transparent;
  color: var(--slate);
  border-color: var(--bordo);
}

.btn--outline:hover {
  border-color: var(--slate);
}

.btn--ghost {
  background: transparent;
  color: var(--viola);
  padding: 0;
}

.btn--ghost svg {
  transition: transform 200ms var(--ease);
}

.btn--ghost:hover svg {
  transform: translateX(5px);
}

.btn-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.75;
  fill: none;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 168px 0 110px;
  background: var(--nebbia);
  overflow: hidden;
}

/* Velo di luce sul lato sinistro: tiene leggibile il titolo,
   mentre il sfondo WebGL resta visibile sulla destra (mockup). */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    100deg,
    rgba(245, 247, 252, 0.95) 0%,
    rgba(245, 247, 252, 0.82) 34%,
    rgba(245, 247, 252, 0.4) 56%,
    transparent 74%
  );
}

.hero .shell {
  position: relative;
  z-index: 2;
  max-width: none;
  padding-left: clamp(40px, 4.5vw, 104px);
  padding-right: clamp(40px, 4.5vw, 104px);
}

/* ---------- Hero · icone 3D + parallasse ---------- */
.hero-decor {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
}

.hero-orb--1 {
  width: 460px;
  height: 460px;
  top: -120px;
  right: -80px;
  background: radial-gradient(circle at 30% 30%, rgba(101, 86, 246, 0.38), transparent 70%);
}

.hero-orb--2 {
  width: 380px;
  height: 380px;
  bottom: -140px;
  left: -100px;
  background: radial-gradient(circle at 50% 50%, rgba(101, 86, 246, 0.22), transparent 70%);
}

.hero-grid-dots {
  position: absolute;
  top: 12%;
  right: 3%;
  width: clamp(320px, 36vw, 560px);
  height: clamp(320px, 36vw, 560px);
  background-image: radial-gradient(rgba(101, 86, 246, 0.16) 1.4px, transparent 1.4px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(circle at 70% 35%, #000 0%, transparent 68%);
  mask-image: radial-gradient(circle at 70% 35%, #000 0%, transparent 68%);
  opacity: 0.9;
}

.hero-ring {
  position: absolute;
  top: 8%;
  right: 8%;
  width: clamp(280px, 30vw, 460px);
  height: clamp(280px, 30vw, 460px);
  border-radius: 50%;
  border: 1px solid rgba(101, 86, 246, 0.18);
  box-shadow: inset 0 0 0 24px rgba(101, 86, 246, 0.04);
}

.hero-ring--2 {
  top: 30%;
  right: 26%;
  width: clamp(160px, 18vw, 260px);
  height: clamp(160px, 18vw, 260px);
  border-color: rgba(101, 86, 246, 0.12);
  box-shadow: none;
  animation: heroRingPulse 7s var(--ease) infinite;
}

@keyframes heroRingPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-ring--2 {
    animation: none;
  }
}

@media (max-width: 940px) {
  .hero-grid-dots,
  .hero-ring {
    display: none;
  }
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.08fr;
  align-items: center;
  gap: clamp(48px, 5vw, 96px);
}

.hero-copy {
  display: grid;
  gap: 28px;
  justify-items: start;
  max-width: 660px;
}

.hero-title {
  font-size: clamp(2.8rem, 5vw, 4.4rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 4px;
}

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 8px;
}

.trust-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--slate-chiaro);
}

.trust-item svg {
  width: 16px;
  height: 16px;
  stroke: var(--viola);
  stroke-width: 1.75;
  fill: none;
}

/* ---------- Hero mockup SaaS Clarivio ---------- */
.hero-doc {
  position: relative;
  background: var(--white);
  border: 1px solid var(--bordo);
  border-radius: 18px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 18px 50px -28px rgba(15, 23, 42, 0.28);
}

.app-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 22px;
  background: var(--nebbia-chiara);
  border-bottom: 1px solid var(--bordo);
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 600;
  color: var(--slate);
}

.app-logo {
  display: block;
  height: 18px;
  width: auto;
}

.doc-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--viola);
  box-shadow: 0 0 0 4px var(--viola-soft);
}

.app-tabs {
  display: flex;
  align-items: center;
  gap: 20px;
}

.app-tab {
  font-size: 13px;
  font-weight: 500;
  color: var(--slate-chiaro);
}

.app-tab.is-active {
  color: var(--viola-hover);
  font-weight: 600;
}

.doc-mode {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--viola-soft);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--viola-hover);
}

.doc-mode svg {
  width: 13px;
  height: 13px;
  stroke: var(--viola-hover);
  stroke-width: 1.9;
  fill: none;
}

.app-body {
  display: grid;
  grid-template-columns: 210px 1fr;
}

.app-side {
  padding: 20px 16px;
  border-right: 1px solid var(--bordo);
  background: var(--nebbia-chiara);
}

.app-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--slate-chiaro);
}

.app-side-count {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--viola-soft);
  color: var(--viola-hover);
  letter-spacing: 0;
}

.app-files {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.app-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--slate-medio);
}

.app-file svg {
  width: 14px;
  height: 14px;
  stroke: var(--slate-chiaro);
  stroke-width: 1.75;
  fill: none;
  flex-shrink: 0;
}

.app-file.is-active {
  background: var(--white);
  border: 1px solid var(--bordo);
  color: var(--slate);
}

.app-file.is-active svg {
  stroke: var(--viola);
}

.app-file-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-left: auto;
  flex-shrink: 0;
}

.app-file-dot.ok {
  background: var(--success-text);
}

.app-file-dot.run {
  background: var(--warning-text);
}

.app-main {
  padding: 24px 24px 20px;
  display: grid;
  gap: 18px;
  align-content: start;
}

.app-main-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-main-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--slate);
}

.doc-bracket {
  font-family: 'Geist', sans-serif;
  font-size: 10px;
  font-weight: 600;
  color: var(--viola);
  letter-spacing: 0.05em;
  text-transform: none;
}

.app-gen {
  display: grid;
  gap: 10px;
  padding: 18px 18px;
  border-radius: 12px;
  background: var(--nebbia-chiara);
  border: 1px solid var(--bordo);
}

.app-gen-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--slate-chiaro);
}

.app-gen-line {
  margin: 0;
  font-size: 13.5px;
  color: var(--slate);
}

.app-gen-text {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--slate-medio);
}

.doc-pii {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--slate);
  color: var(--slate);
  font-size: 12px;
  letter-spacing: 1px;
  vertical-align: middle;
  user-select: none;
}

.doc-pii--sm {
  font-size: 11px;
}

.doc-rag {
  font-size: 12px;
  font-weight: 500;
  color: var(--viola-hover);
}

.app-actions {
  display: flex;
  gap: 10px;
  margin-top: 2px;
}

.app-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: 9px;
  border: 1px solid var(--bordo);
  background: var(--white);
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-medio);
}

.app-btn svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  stroke-width: 1.75;
  fill: none;
}

.app-btn--primary {
  background: var(--viola);
  border-color: var(--viola);
  color: #fff;
}

.hero-doc-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 13px 18px;
  border-top: 1px solid var(--bordo);
  background: var(--nebbia-chiara);
  font-size: 12px;
  font-weight: 500;
  color: var(--success-text);
}

.hero-doc-foot svg {
  width: 15px;
  height: 15px;
  stroke: var(--success-text);
  stroke-width: 2;
  fill: none;
}

/* ---------- Steps editoriali (Come funziona) ---------- */
.steps {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--bordo);
}

.step {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  align-items: baseline;
  gap: 32px;
  padding: 40px 0;
  border-bottom: 1px solid var(--bordo);
}

.step-num {
  font-family: 'DM Serif Display', serif;
  font-size: 3rem;
  line-height: 1;
  color: var(--slate);
}

.step-body h3 {
  margin: 0 0 10px;
  font-family: 'Geist', sans-serif;
  font-weight: 600;
  font-size: 1.4rem;
  color: var(--slate);
}

.step-body p {
  margin: 0;
  color: var(--slate-medio);
  font-size: 1.05rem;
  line-height: 1.5;
  max-width: 52ch;
}

.step-tag {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--slate-chiaro);
  white-space: nowrap;
}

/* ---------- Sezione scura (Rischio) ---------- */
.section--slate {
  background: var(--slate);
  color: var(--nebbia);
}

.section--slate .section-title {
  color: #fff;
}

.section--slate .lede {
  color: #e2e8f0;
}

.section--slate .eyebrow {
  color: #a5b4fc;
}

.risk-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.risk-card {
  padding: 34px 32px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 24px 40px -28px rgba(0, 0, 0, 0.6);
  transition: border-color 300ms var(--ease), background 300ms var(--ease), transform 300ms var(--ease);
}

.risk-card:hover {
  border-color: rgba(101, 86, 246, 0.55);
  background: linear-gradient(160deg, rgba(101, 86, 246, 0.14), rgba(255, 255, 255, 0.03));
  transform: translateY(-4px);
}

.risk-reg {
  margin: 0 0 16px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #a5b4fc;
}

.risk-card h3 {
  margin: 0 0 12px;
  font-family: 'DM Serif Display', serif;
  font-weight: 400;
  font-size: 1.6rem;
  line-height: 1.12;
  color: #fff;
}

.risk-card p {
  margin: 0;
  color: #e2e8f0;
  font-size: 1rem;
  line-height: 1.5;
}

.risk-fine {
  display: inline-block;
  margin-top: 22px;
  padding: 7px 14px;
  border-radius: 8px;
  background: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid var(--danger-border);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* ---------- Efficienza · Scroll story (sticky) ---------- */
.scroll-story {
  padding: 120px 0;
}

.story-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 72px;
  align-items: start;
}

.story-sticky {
  position: sticky;
  top: 120px;
  display: grid;
  gap: 24px;
  align-content: start;
}

.scroll-story .section-title {
  color: #fff;
}

.scroll-story .title-icon {
  background: rgba(101, 86, 246, 0.16);
}

.scroll-story .title-icon svg {
  stroke: #a5b4fc;
}

.story-scene {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 22px 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(101, 86, 246, 0.06);
}

.story-scene-num {
  font-family: 'DM Serif Display', serif;
  font-size: 2.6rem;
  line-height: 1;
  color: #fff;
}

.story-scene-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #a5b4fc;
}

.story-progress {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.story-progress-bar {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--viola);
  transition: width 200ms var(--ease);
}

.story-track {
  display: grid;
  gap: 80px;
  padding-bottom: 10px;
}

.story-act {
  display: grid;
  gap: 16px;
  align-content: start;
  min-height: 60vh;
  padding-top: 8px;
  opacity: 0.5;
  transition: opacity 450ms var(--ease);
}

.story-act.is-active {
  opacity: 1;
}

.story-act-tag {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #a5b4fc;
}

.story-act h3 {
  margin: 0;
  font-family: 'DM Serif Display', serif;
  font-weight: 400;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  line-height: 1.14;
  color: #fff;
}

.story-act > p {
  margin: 0;
  color: #e2e8f0;
  font-size: 1.05rem;
  line-height: 1.55;
  max-width: 50ch;
}

.story-lead {
  color: #cbd5e1 !important;
  font-size: 1.2rem !important;
}

.story-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.story-line {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 1rem;
  font-weight: 500;
  color: #e2e8f0;
  transition: border-color 300ms var(--ease), background 300ms var(--ease);
}

.story-line:hover {
  border-color: rgba(101, 86, 246, 0.5);
  background: rgba(101, 86, 246, 0.07);
}

.story-line svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke: #a5b4fc;
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.story-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 10px;
}

.story-metric {
  display: grid;
  gap: 8px;
  padding: 22px 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.story-metric-num {
  font-family: 'DM Serif Display', serif;
  font-size: 2.2rem;
  line-height: 1;
  color: #fff;
}

.story-metric-label {
  font-size: 12.5px;
  line-height: 1.4;
  color: #e2e8f0;
}

.story-checks {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.story-check {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 1rem;
  font-weight: 500;
  color: #e2e8f0;
}

.story-check svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: var(--success-text);
  stroke-width: 2.4;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Sezioni incorniciate (pannelli arrotondati) ---------- */
.section--framed {
  margin-inline: clamp(14px, 3vw, 40px);
  margin-bottom: clamp(22px, 3vw, 44px);
  border-radius: clamp(26px, 3vw, 40px);
}

.section--slate.section--framed,
.section--aurora {
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 50px 90px -55px rgba(10, 14, 31, 0.85);
}

.section--white.section--framed {
  border: 1px solid var(--bordo);
  box-shadow: 0 40px 80px -55px rgba(15, 23, 42, 0.18);
}

/* Sfondo dinamico "aurora" — Efficienza */
.section--aurora {
  background:
    radial-gradient(110% 80% at 100% 0%, rgba(101, 86, 246, 0.3), transparent 55%),
    radial-gradient(100% 95% at 0% 100%, rgba(76, 61, 219, 0.26), transparent 55%),
    linear-gradient(155deg, #0a0e1f 0%, #141833 50%, #1b1547 100%);
}

.section-decor {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}

.section-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
}

.section-glow--1 {
  top: -130px;
  right: -90px;
  width: 440px;
  height: 440px;
  background: radial-gradient(circle, rgba(101, 86, 246, 0.55), transparent 70%);
  animation: sectionGlowFloat 15s var(--ease) infinite;
}

.section-glow--2 {
  bottom: -150px;
  left: -110px;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(56, 48, 150, 0.5), transparent 70%);
  animation: sectionGlowFloat 19s var(--ease) infinite reverse;
}

.section-grid-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(165, 180, 252, 0.16) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(75% 70% at 50% 30%, #000 0%, transparent 80%);
  mask-image: radial-gradient(75% 70% at 50% 30%, #000 0%, transparent 80%);
}

@keyframes sectionGlowFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(20px, 34px, 0) scale(1.1);
  }
}

.section--aurora .shell {
  position: relative;
  z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
  .section-glow {
    animation: none;
  }
}

/* ---------- Problemi · Gestione documenti (manifatturiero) ---------- */
.eyebrow--alert {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--danger-text);
}

.eyebrow--alert::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--danger-text);
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.14);
}

.problem-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.problem-card {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 36px 34px 32px;
  border-radius: 22px;
  background: linear-gradient(165deg, #ffffff 0%, #f7f9ff 100%);
  border: 1px solid var(--bordo);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 26px 50px -34px rgba(15, 23, 42, 0.28);
  overflow: hidden;
  transition: transform 320ms var(--ease), box-shadow 320ms var(--ease), border-color 320ms var(--ease);
}

.problem-card::after {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.12), transparent 70%);
  pointer-events: none;
}

.problem-card:hover {
  border-color: rgba(249, 115, 22, 0.35);
  transform: translateY(-6px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 36px 60px -32px rgba(180, 35, 24, 0.28);
}

.problem-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 17px;
  background: linear-gradient(150deg, #ff8a5c 0%, #f4502f 52%, #c81e1e 100%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 -8px 16px -8px rgba(120, 18, 18, 0.7) inset,
    0 18px 30px -12px rgba(200, 30, 30, 0.5),
    0 6px 12px -8px rgba(15, 23, 42, 0.4);
  transform: translateY(-2px);
  transition: transform 320ms var(--ease), box-shadow 320ms var(--ease);
}

.problem-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.55), transparent 45%);
  mix-blend-mode: screen;
  pointer-events: none;
}

.problem-card:hover .problem-icon {
  transform: translateY(-5px) rotate(-4deg);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 -8px 16px -8px rgba(120, 18, 18, 0.7) inset,
    0 24px 38px -12px rgba(200, 30, 30, 0.6),
    0 8px 16px -8px rgba(15, 23, 42, 0.45);
}

.problem-icon svg {
  position: relative;
  width: 28px;
  height: 28px;
  stroke: #fff;
  stroke-width: 1.9;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(120, 18, 18, 0.5));
}

.problem-card h3 {
  margin: 0;
  font-family: 'Geist', sans-serif;
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--slate);
}

.problem-card p {
  margin: 0;
  color: var(--slate-medio);
  font-size: 1rem;
  line-height: 1.55;
}

.problem-impact {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  width: fit-content;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--danger-text);
}

.problem-impact::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--danger-text);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.16);
}

@media (max-width: 720px) {
  .problem-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Soluzione (4 pilastri editoriali) ---------- */
.solution-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.solution-card {
  position: relative;
  padding: 36px 34px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.55));
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 24px 44px -28px rgba(15, 23, 42, 0.4);
  transition: border-color 300ms var(--ease), transform 300ms var(--ease), box-shadow 300ms var(--ease);
}

.solution-card:hover {
  border-color: var(--viola);
  transform: translateY(-4px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 30px 50px -26px rgba(74, 58, 196, 0.5);
}

.solution-num {
  font-family: 'DM Serif Display', serif;
  font-size: 2.4rem;
  line-height: 1;
  color: var(--viola);
}

.solution-card h3 {
  margin: 18px 0 12px;
  font-family: 'Geist', sans-serif;
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--slate);
}

.solution-card p {
  margin: 0;
  color: var(--slate-medio);
  font-size: 1rem;
  line-height: 1.5;
}

.solution-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--viola);
}

.solution-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--viola);
}

/* ---------- Deployment / On-premise ---------- */
.deploy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.deploy-card {
  display: flex;
  flex-direction: column;
  padding: 38px 34px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.55));
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 24px 44px -28px rgba(15, 23, 42, 0.4);
  transition: border-color 300ms var(--ease), transform 300ms var(--ease), box-shadow 300ms var(--ease);
}

.deploy-card:hover {
  border-color: var(--viola);
  transform: translateY(-4px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 30px 50px -26px rgba(74, 58, 196, 0.5);
}

.deploy-card--accent {
  border-color: var(--viola);
  box-shadow: 0 0 0 1px var(--viola) inset;
}

.deploy-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--viola);
}

.deploy-card h3 {
  margin: 16px 0 12px;
  font-family: 'Geist', sans-serif;
  font-weight: 600;
  font-size: 1.4rem;
  color: var(--slate);
}

.deploy-card > p {
  margin: 0 0 22px;
  color: var(--slate-medio);
  font-size: 1rem;
  line-height: 1.55;
}

.deploy-list {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: grid;
  gap: 12px;
}

.deploy-list li {
  position: relative;
  padding-left: 28px;
  color: var(--slate);
  font-size: 0.95rem;
  line-height: 1.45;
}

.deploy-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--viola-soft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236556f6' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.deploy-tag {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--viola);
}

.deploy-tag::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--viola);
}

/* ---------- Piattaforma / FAQ accordion ---------- */
.split-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 64px;
  align-items: start;
}

.split-aside {
  position: sticky;
  top: 110px;
  display: grid;
  gap: 22px;
}

.accordion {
  border-top: 1px solid var(--bordo);
}

.acc-item {
  border-bottom: 1px solid var(--bordo);
}

.acc-trigger {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 26px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  text-align: left;
  cursor: pointer;
  color: var(--slate);
  font-family: 'Geist', sans-serif;
  font-weight: 600;
  font-size: 1.2rem;
  transition: color 200ms var(--ease);
}

.acc-trigger:hover {
  color: var(--viola);
}

.acc-icon {
  position: relative;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 300ms var(--ease);
}

.acc-icon::before,
.acc-icon::after {
  content: '';
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  background: currentColor;
  border-radius: 1px;
}

.acc-icon::before {
  width: 16px;
  height: 1.5px;
}

.acc-icon::after {
  width: 1.5px;
  height: 16px;
}

.acc-item.is-open .acc-icon {
  transform: rotate(45deg);
}

/* ---------- FAQ full-width glass ---------- */
#faq .shell {
  max-width: none;
  padding-left: clamp(40px, 4.5vw, 104px);
  padding-right: clamp(40px, 4.5vw, 104px);
}

.accordion--grid {
  border-top: 0;
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.accordion--grid .acc-item {
  border-bottom: 0;
  border-radius: 18px;
  padding: 4px 26px;
  background: linear-gradient(160deg, rgba(101, 86, 246, 0.07), rgba(255, 255, 255, 0.55));
  border: 1px solid rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 22px 40px -28px rgba(74, 58, 196, 0.45);
  transition: border-color 300ms var(--ease), transform 300ms var(--ease), box-shadow 300ms var(--ease);
}

.accordion--grid .acc-item:hover {
  border-color: rgba(101, 86, 246, 0.45);
  transform: translateY(-3px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 28px 46px -26px rgba(74, 58, 196, 0.5);
}

.accordion--grid .acc-item.is-open {
  border-color: rgba(101, 86, 246, 0.6);
}

@media (max-width: 720px) {
  .accordion--grid {
    grid-template-columns: 1fr;
  }
}

.acc-panel {
  height: 0;
  overflow: hidden;
  transition: height 400ms var(--ease);
}

.acc-panel-inner {
  padding: 0 4px 28px;
  max-width: 56ch;
  color: var(--slate-medio);
  font-size: 1.05rem;
  line-height: 1.55;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.tag {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--nebbia-media);
  border: 1px solid var(--bordo);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate-medio);
}

/* ---------- Citazioni clienti ---------- */
.quotes-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
}

.quote {
  padding-left: 28px;
  border-left: 2px solid var(--viola);
}

.quote p {
  margin: 0;
  font-family: 'DM Serif Display', serif;
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  line-height: 1.28;
  color: var(--slate);
}

.quote-by {
  margin-top: 20px;
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--slate-chiaro);
}

.quote-author {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
}

.quote-author .quote-by {
  margin-top: 0;
}

.quote-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  border: 1px solid var(--bordo);
}

/* ---------- CTA finale + Footer (Slate) ---------- */
.footer {
  background: var(--slate);
  color: var(--nebbia);
  padding: 120px 0 48px;
}

.footer-cta {
  display: grid;
  gap: 26px;
  max-width: 980px;
  justify-items: start;
  padding-bottom: 80px;
  margin-bottom: 64px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-cta .section-title {
  color: #fff;
}

.footer-cta .lede {
  color: #94a3b8;
  max-width: 640px;
}

.funnel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  width: 100%;
  margin-top: 14px;
}

.funnel-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 32px 30px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.funnel-card--calendar {
  background: rgba(101, 86, 246, 0.1);
  border-color: rgba(101, 86, 246, 0.4);
}

.funnel-step {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--viola);
}

.funnel-card h3 {
  margin: 0;
  font-family: 'Geist', sans-serif;
  font-weight: 600;
  font-size: 1.3rem;
  color: #fff;
}

.funnel-card > p {
  margin: 0;
  color: #94a3b8;
  font-size: 0.95rem;
  line-height: 1.5;
}

.funnel-cal {
  margin-top: auto;
  align-self: flex-start;
}

.funnel-note {
  font-size: 12px;
  color: var(--slate-chiaro);
}

.funnel-form {
  display: grid;
  gap: 12px;
  margin-top: auto;
}

.funnel-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.funnel-field {
  display: grid;
}

.funnel-form input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-family: 'Geist', sans-serif;
  font-size: 0.95rem;
}

.funnel-form input::placeholder {
  color: #64748b;
}

.funnel-form input:focus {
  outline: none;
  border-color: var(--viola);
}

.funnel-form .btn {
  width: 100%;
  justify-content: center;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
}

.footer-brand img {
  height: 30px;
  width: auto;
  margin-bottom: 16px;
}

.footer-brand p {
  margin: 0;
  max-width: 36ch;
  color: #94a3b8;
  font-size: 14px;
  line-height: 1.5;
}

.footer-social {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.75);
  transition: color 200ms var(--ease), border-color 200ms var(--ease), background 200ms var(--ease);
}

.footer-social a:hover {
  color: #fff;
  border-color: var(--viola);
  background: rgba(101, 86, 246, 0.18);
}

.footer-social svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.6;
}

.footer-social svg[fill="none"] {
  fill: none;
}

.footer-meta {
  display: flex;
  gap: 56px;
}

.footer-col p:first-child {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--slate-chiaro);
}

.footer-col a,
.footer-col p:not(:first-child) {
  margin: 0 0 8px;
  display: block;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
  transition: color 200ms var(--ease);
}

.footer-col a:hover {
  color: #fff;
}

.footer-legal {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.footer-copy {
  margin: 0;
  font-size: 12px;
  color: var(--slate-chiaro);
}

.footer-tagline {
  margin: 0;
  font-size: 12px;
  color: var(--slate-chiaro);
}

/* ---------- Reveal motion (story scroll, focus-in) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(38px) scale(0.975);
  filter: blur(6px);
  transition: opacity 820ms var(--ease), transform 820ms var(--ease),
    filter 820ms var(--ease);
  transition-delay: var(--delay, 0ms);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

/* Variante laterale per sezioni alternate */
.reveal--left {
  transform: translateX(-46px) scale(0.985);
}

.reveal--right {
  transform: translateX(46px) scale(0.985);
}

.reveal--left.is-visible,
.reveal--right.is-visible {
  transform: translateX(0) scale(1);
}

/* L'icona del titolo entra con un piccolo "pop" */
.reveal .title-icon {
  transform: scale(0.4) rotate(-12deg);
  opacity: 0;
  transition: transform 700ms var(--ease) 120ms, opacity 700ms var(--ease) 120ms;
}

.reveal.is-visible .title-icon {
  transform: scale(1) rotate(0);
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    transition: none;
    opacity: 1;
    transform: none;
    filter: none;
  }

  .reveal--left,
  .reveal--right {
    transform: none;
  }

  .reveal .title-icon {
    transition: none;
    transform: none;
    opacity: 1;
  }

  .story-act {
    opacity: 1;
    transition: none;
  }
}

/* ---------- CTA demo fluttuante ---------- */
.demo-dock {
  position: fixed;
  right: clamp(16px, 3vw, 32px);
  bottom: clamp(16px, 3vw, 32px);
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px;
  border-radius: 999px;
  background: var(--viola);
  color: #fff;
  font-family: 'Geist', sans-serif;
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  box-shadow:
    0 18px 40px -14px rgba(74, 58, 196, 0.6),
    0 6px 16px -8px rgba(15, 23, 42, 0.4);
  opacity: 0;
  transform: translateY(24px) scale(0.92);
  pointer-events: none;
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease),
    background 0.2s var(--ease);
}

.demo-dock.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.demo-dock:hover {
  background: var(--viola-hover);
  transform: translateY(-2px) scale(1.02);
}

.demo-dock-icon {
  position: relative;
  width: 18px;
  height: 18px;
  stroke: #fff;
  stroke-width: 1.9;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.demo-dock-arrow {
  width: 17px;
  height: 17px;
  stroke: #fff;
  stroke-width: 1.9;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s var(--ease);
}

.demo-dock:hover .demo-dock-arrow {
  transform: translateX(4px);
}

.demo-dock-pulse {
  position: absolute;
  left: 16px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  animation: dockPulse 2.4s var(--ease) infinite;
  pointer-events: none;
}

@keyframes dockPulse {
  0% {
    transform: scale(0.6);
    opacity: 0.7;
  }
  70%,
  100% {
    transform: scale(2.6);
    opacity: 0;
  }
}

@media (max-width: 560px) {
  .demo-dock-text {
    display: none;
  }
  .demo-dock {
    padding: 14px;
  }
  .demo-dock-arrow {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .demo-dock-pulse {
    animation: none;
    display: none;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 940px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .hero-doc {
    max-width: 560px;
  }

  .split-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .split-aside {
    position: static;
  }

  .story-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .story-sticky {
    position: static;
    top: auto;
  }

  .story-track {
    gap: 56px;
  }

  .story-act {
    min-height: 0;
  }

  .risk-grid,
  .solution-grid {
    grid-template-columns: 1fr;
  }

  .deploy-grid,
  .funnel-grid {
    grid-template-columns: 1fr;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .floating-nav {
    position: relative;
  }

  .nav-links {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 10px;
    border-radius: 22px;
    background: linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.85) 0%,
      rgba(255, 255, 255, 0.7) 100%
    );
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 18px 44px -18px rgba(15, 23, 42, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 240ms var(--ease), transform 240ms var(--ease),
      visibility 240ms var(--ease);
  }

  .nav-links.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav-links a {
    padding: 13px 16px;
    border-radius: 14px;
    font-size: 16px;
    transition: background 180ms var(--ease), color 180ms var(--ease);
  }

  .nav-links a:hover,
  .nav-links a:active {
    background: var(--viola-soft);
    color: var(--viola);
  }
}

@media (max-width: 720px) {
  .section {
    padding: 80px 0;
  }

  .shell {
    padding: 0 24px;
  }

  .floating-nav {
    padding: 0 12px 0 18px;
  }

  .hero {
    padding: 130px 0 80px;
  }

  .step {
    grid-template-columns: 64px 1fr;
    gap: 20px;
    row-gap: 8px;
  }

  .step-num {
    font-size: 2.2rem;
  }

  .step-tag {
    grid-column: 2;
  }

  .funnel-row {
    grid-template-columns: 1fr;
  }

  .story-metrics {
    grid-template-columns: 1fr;
  }

  .footer-meta {
    gap: 36px;
  }
}

/* ---------- Mockup SaaS: layout mobile ---------- */
@media (max-width: 640px) {
  /* Allinea tutte le schede: pannelli a tutta larghezza, stesso gutter
     delle sezioni full-bleed (hero, footer). Il contenuto interno parte
     così dallo stesso bordo in ogni sezione. */
  .section--panel,
  .section--framed {
    margin-inline: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  /* La barra app va a capo invece di schiacciarsi */
  .app-bar {
    flex-wrap: wrap;
    gap: 10px 12px;
    padding: 12px 14px;
  }

  .app-tabs {
    gap: 14px;
    order: 3;
    width: 100%;
  }

  .doc-mode {
    margin-left: auto;
  }

  /* Da due colonne a una: la lista file va sopra, il documento sotto */
  .app-body {
    grid-template-columns: 1fr;
  }

  .app-side {
    border-right: none;
    border-bottom: 1px solid var(--bordo);
    padding: 14px 14px;
  }

  /* I file scorrono orizzontalmente per non occupare troppa altezza */
  .app-files {
    grid-auto-flow: column;
    grid-auto-columns: minmax(170px, 1fr);
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .app-files::-webkit-scrollbar {
    display: none;
  }

  .app-file {
    white-space: nowrap;
  }

  .app-main {
    padding: 18px 16px 16px;
    gap: 14px;
  }

  .app-actions {
    flex-wrap: wrap;
  }

  .hero-doc-foot {
    padding: 12px 14px;
    font-size: 11px;
  }
}

/* ---------- Telefoni piccoli (≤480px) ---------- */
@media (max-width: 480px) {
  body {
    font-size: 17px;
  }

  .hero {
    padding: 116px 0 64px;
  }

  .hero-title {
    font-size: clamp(2.1rem, 8.5vw, 2.8rem);
  }

  .lede {
    font-size: 1.02rem;
  }

  .section-title {
    font-size: clamp(1.7rem, 7vw, 2.3rem);
  }

  .section {
    padding: 64px 0;
  }

  .shell {
    padding: 0 18px;
  }

  /* CTA navbar più compatta per non sforare con logo + hamburger */
  .floating-nav {
    height: 58px;
    gap: 10px;
    padding: 0 10px 0 14px;
  }

  .floating-nav .btn--primary {
    padding: 11px 16px;
    font-size: 14px;
  }

  .brand img {
    height: 22px;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .btn {
    padding: 13px 22px;
  }
}

/* ---------- Telefoni molto piccoli (≤360px) ---------- */
@media (max-width: 360px) {
  .floating-nav .btn--primary {
    padding: 10px 13px;
    font-size: 13px;
  }
}

/* ---------- Safe-area (notch / barre di sistema) ---------- */
@supports (padding: max(0px)) {
  .site-shell {
    padding-left: max(clamp(14px, 3vw, 32px), env(safe-area-inset-left));
    padding-right: max(clamp(14px, 3vw, 32px), env(safe-area-inset-right));
    top: max(clamp(12px, 1.6vw, 22px), env(safe-area-inset-top));
  }
}

/* ---------- Fallback backdrop-filter non supportato ---------- */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .floating-nav {
    background: rgba(255, 255, 255, 0.92);
  }

  .nav-links.is-open {
    background: rgba(255, 255, 255, 0.97);
  }

  .section--glassbg {
    background: rgba(255, 255, 255, 0.96);
  }
}

/* ---------- Schermi bassi in orizzontale ---------- */
@media (max-height: 480px) and (orientation: landscape) {
  .hero {
    padding-top: 96px;
  }
}

/* ============================================================
   Animazioni & micro-interazioni
   ============================================================ */

/* ---------- Bottoni: lift + shine sweep ---------- */
.btn--primary {
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 22px -12px rgba(101, 86, 246, 0.55);
  transition: background 200ms var(--ease), color 200ms var(--ease),
    border-color 200ms var(--ease), transform 200ms var(--ease),
    box-shadow 200ms var(--ease);
}

.btn--primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -80%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 100%
  );
  transform: skewX(-20deg);
  pointer-events: none;
  transition: left 600ms var(--ease);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px -12px rgba(101, 86, 246, 0.65);
}

.btn--primary:hover::after {
  left: 130%;
}

.btn--primary:active {
  transform: translateY(0) scale(0.98);
}

.btn--outline:hover {
  transform: translateY(-2px);
}

/* ---------- Navbar: underline animata (solo desktop) ---------- */
@media (min-width: 941px) {
  .nav-links a {
    position: relative;
  }

  .nav-links a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: var(--viola);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 260ms var(--ease);
  }

  .nav-links a:hover::after {
    transform: scaleX(1);
  }
}

/* ---------- Titoli: evidenziazione soft sul corsivo ---------- */
.section-title em,
.hero-title em {
  background: linear-gradient(transparent 64%, var(--viola-soft) 64%);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  padding: 0 2px;
}

.section--slate .section-title em,
.section--aurora .section-title em,
.footer .section-title em {
  background: linear-gradient(transparent 64%, rgba(101, 86, 246, 0.32) 64%);
}

/* ---------- Eyebrow alert: dot pulse ---------- */
.eyebrow--alert::before {
  animation: alertPing 2.4s var(--ease) infinite;
}

@keyframes alertPing {
  0% {
    box-shadow: 0 0 0 0 rgba(180, 35, 24, 0.32);
  }
  70%,
  100% {
    box-shadow: 0 0 0 9px rgba(180, 35, 24, 0);
  }
}

/* ---------- Card: spotlight che segue il mouse ---------- */
.risk-card,
.deploy-card,
.funnel-card,
.acc-item {
  position: relative;
}

.problem-card::before,
.solution-card::before,
.deploy-card::before,
.risk-card::before,
.funnel-card::before,
.accordion--grid .acc-item::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    240px circle at var(--mx, 50%) var(--my, 50%),
    rgba(101, 86, 246, 0.1),
    transparent 65%
  );
  opacity: 0;
  transition: opacity 350ms var(--ease);
  pointer-events: none;
}

.risk-card::before,
.funnel-card::before {
  background: radial-gradient(
    240px circle at var(--mx, 50%) var(--my, 50%),
    rgba(165, 180, 252, 0.14),
    transparent 65%
  );
}

.problem-card:hover::before,
.solution-card:hover::before,
.deploy-card:hover::before,
.risk-card:hover::before,
.funnel-card:hover::before,
.accordion--grid .acc-item:hover::before {
  opacity: 1;
}

/* ---------- Steps: numero che si accende ---------- */
.step {
  transition: background 250ms var(--ease);
}

.step-num {
  transition: color 250ms var(--ease), transform 250ms var(--ease);
}

.step:hover .step-num {
  color: var(--viola);
  transform: translateX(4px);
}

/* ---------- Mockup hero: bozza "viva" ---------- */
/* Le righe della bozza entrano in sequenza quando il mockup appare */
.hero-doc.is-visible .app-gen > * {
  animation: genLineIn 560ms var(--ease) both;
}

.hero-doc.is-visible .app-gen > :nth-child(1) { animation-delay: 500ms; }
.hero-doc.is-visible .app-gen > :nth-child(2) { animation-delay: 700ms; }
.hero-doc.is-visible .app-gen > :nth-child(3) { animation-delay: 900ms; }
.hero-doc.is-visible .app-gen > :nth-child(4) { animation-delay: 1100ms; }
.hero-doc.is-visible .app-gen > :nth-child(5) { animation-delay: 1400ms; }

@keyframes genLineIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Caret lampeggiante in coda al testo generato */
.app-gen-text::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 0.95em;
  margin-left: 3px;
  vertical-align: -0.12em;
  background: var(--viola);
  animation: caretBlink 1.1s steps(2, start) infinite;
}

@keyframes caretBlink {
  to {
    visibility: hidden;
  }
}

/* Scan luminoso sui dati mascherati (PII) */
.doc-pii {
  background-image: linear-gradient(
    110deg,
    transparent 35%,
    rgba(165, 180, 252, 0.35) 50%,
    transparent 65%
  );
  background-size: 250% 100%;
  background-repeat: no-repeat;
  background-position: -150% 0;
  animation: piiScan 4.2s var(--ease) infinite;
}

@keyframes piiScan {
  0%,
  55% {
    background-position: -150% 0;
  }
  85%,
  100% {
    background-position: 150% 0;
  }
}

/* Pulse sul bottone "Genera bozza" */
.app-btn--primary {
  animation: genPulse 3.2s var(--ease) infinite;
}

@keyframes genPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(101, 86, 246, 0.4);
  }
  45%,
  100% {
    box-shadow: 0 0 0 11px rgba(101, 86, 246, 0);
  }
}

/* Badge "Privata": respiro soft ---------- */
.doc-mode {
  animation: privateBreath 3.8s var(--ease) infinite;
}

@keyframes privateBreath {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(101, 86, 246, 0.22);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(101, 86, 246, 0);
  }
}

/* ---------- Form funnel: focus ring ---------- */
.funnel-form input:focus {
  box-shadow: 0 0 0 3px rgba(101, 86, 246, 0.28);
  transition: box-shadow 180ms var(--ease), border-color 180ms var(--ease);
}

/* ---------- Reduced motion: tutto spento ---------- */
@media (prefers-reduced-motion: reduce) {
  .btn--primary::after,
  .doc-pii,
  .app-btn--primary,
  .doc-mode,
  .app-gen-text::after,
  .eyebrow--alert::before {
    animation: none;
    transition: none;
  }

  .hero-doc.is-visible .app-gen > * {
    animation: none;
  }

  .btn--primary:hover,
  .btn--outline:hover,
  .step:hover .step-num {
    transform: none;
  }
}
