:root {
  --cream: #F4EFE6;
  --paper: #FFFDF8;
  --ink: #17151F;
  --muted: #5E5A6B;
  --violet: #6B3BFF;
  --violet-dark: #4E22D9;
  --sun: #FFD23F;
  --line: #E2DACB;
  --radius: 22px;
  --font: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.08; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; border-radius: 6px; }

.top, main, footer { width: min(1080px, 100% - 40px); margin-inline: auto; }

/* ---------- header ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 0; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 19px; letter-spacing: -0.01em; }
.top nav { display: flex; gap: 22px; font-size: 15px; font-weight: 600; }
.top nav a { text-decoration: none; color: var(--muted); }
.top nav a:hover { color: var(--ink); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 0 26px; margin: 0;
  border-radius: 999px; border: 2px solid var(--ink);
  font-family: inherit; font-weight: 800; font-size: 17px; line-height: 1;
  text-decoration: none; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-primary { background: var(--violet); color: #fff; box-shadow: 0 5px 0 var(--ink); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--ink); }
.btn-primary:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--paper); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { transform: translateY(-2px); }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; padding: 40px 0 72px; }
.eyebrow { font-size: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--violet-dark); margin-bottom: 18px; }
h1 { font-size: clamp(44px, 7.2vw, 84px); font-weight: 900; letter-spacing: -0.04em; }
.mark { background: var(--sun); padding: 0 .12em; border-radius: .18em; display: inline-block; transform: rotate(-2deg); }
.lead { font-size: 20px; color: var(--muted); max-width: 34em; margin: 24px 0 30px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; }
.meta { margin-top: 20px; font-size: 14px; color: var(--muted); }

.hero-art { position: relative; display: grid; place-items: center; min-height: 480px; }
.phone {
  width: min(310px, 100%); background: var(--paper);
  border: 2px solid var(--ink); border-radius: 36px;
  box-shadow: 10px 12px 0 var(--ink);
  overflow: hidden; transform: rotate(3deg);
}
.chat-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 2px solid var(--ink); font-weight: 700; font-size: 15px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--sun); border: 2px solid var(--ink); }
.chat { display: flex; flex-direction: column; gap: 12px; padding: 18px 16px 26px; background: repeating-linear-gradient(135deg, #F7F2E8 0 14px, #F2ECDF 14px 28px); }
.bubble { max-width: 80%; padding: 9px 13px; border-radius: 16px; font-size: 14px; border: 1.5px solid var(--ink); }
.bubble.in { background: #fff; align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble.out { background: #E4DAFF; align-self: flex-end; border-bottom-right-radius: 4px; }

.sticker { position: relative; width: 112px; height: 112px; display: grid; place-items: center; align-self: flex-start; }
.sticker.right { align-self: flex-end; }
.emoji {
  font-size: 78px; line-height: 1;
  filter: drop-shadow(3px 0 0 #fff) drop-shadow(-3px 0 0 #fff) drop-shadow(0 3px 0 #fff) drop-shadow(0 -3px 0 #fff) drop-shadow(0 4px 5px rgba(23,21,31,.3));
}
.sticker:has(img) { width: 120px; height: 120px; }
.sticker img {
  display: block; width: 120px; height: 120px; object-fit: cover;
  border: 4px solid #fff; border-radius: 22px;
  box-shadow: 0 4px 8px rgba(23,21,31,.3);
  rotate: -4deg;
}
.sticker.right img { rotate: 4deg; }
.s1 .emoji { transform: rotate(-8deg); }
.s2 .emoji { transform: rotate(7deg); }
.sound {
  position: absolute; right: -6px; bottom: 0;
  display: flex; align-items: center; gap: 3px;
  height: 30px; padding: 0 9px;
  background: var(--violet); border: 2px solid var(--ink); border-radius: 999px;
}
.sound i { width: 3px; height: 14px; border-radius: 2px; background: #fff; animation: eq 0.9s ease-in-out infinite; }
.sound i:nth-child(2) { animation-delay: -.3s; }
.sound i:nth-child(3) { animation-delay: -.6s; }
.sound i:nth-child(4) { animation-delay: -.15s; }
@keyframes eq { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }

.float {
  position: absolute; font-size: 54px;
  filter: drop-shadow(3px 0 0 #fff) drop-shadow(-3px 0 0 #fff) drop-shadow(0 3px 0 #fff) drop-shadow(0 -3px 0 #fff) drop-shadow(0 5px 6px rgba(23,21,31,.25));
  animation: bob 5s ease-in-out infinite;
}
.f1 { top: 4%; left: 2%; rotate: -14deg; }
.f2 { bottom: 6%; left: 0; rotate: 10deg; animation-delay: -1.6s; }
.f3 { top: 12%; right: 0; rotate: 12deg; animation-delay: -3s; }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }

/* ---------- blocks ---------- */
.block { padding: 56px 0; border-top: 2px solid var(--line); }
h2 { font-size: clamp(28px, 4vw, 42px); font-weight: 850; margin-bottom: 30px; }
h3 { font-size: 21px; font-weight: 800; margin-bottom: 8px; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.steps li { background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius); padding: 26px 24px 28px; }
.steps li:nth-child(2) { transform: rotate(-1deg); }
.steps p { color: var(--muted); font-size: 16px; }
.num {
  display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 18px;
  border-radius: 50%; background: var(--sun); border: 2px solid var(--ink);
  font-weight: 900; font-size: 20px;
}

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.card { background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius); padding: 32px; }
.card h2 { font-size: 28px; margin-bottom: 18px; }
.card-accent { background: var(--sun); box-shadow: 8px 8px 0 var(--ink); }
.card-accent p { margin-bottom: 24px; }
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 34px; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--violet) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
}

.install { margin: 0; padding-left: 1.3em; display: grid; gap: 14px; max-width: 46em; }
.install li::marker { font-weight: 900; color: var(--violet-dark); }
.note { margin-top: 26px; padding: 16px 20px; max-width: 46em; background: var(--paper); border-left: 5px solid var(--violet); border-radius: 0 12px 12px 0; font-size: 16px; color: var(--muted); }

details { border-bottom: 2px solid var(--line); max-width: 46em; }
summary { cursor: pointer; padding: 18px 34px 18px 0; font-weight: 750; font-size: 18px; list-style: none; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font-size: 26px; font-weight: 500; color: var(--violet-dark); transition: rotate .2s; }
details[open] summary::after { rotate: 45deg; }
details p { padding: 0 0 20px; color: var(--muted); }

.final { margin: 20px 0 64px; padding: 56px 24px; text-align: center; background: var(--ink); color: #fff; border-radius: 32px; }
.final h2 { margin-bottom: 26px; }
.final .btn-primary { border-color: #fff; box-shadow: 0 5px 0 var(--sun); }

footer { padding: 0 0 40px; font-size: 13px; color: var(--muted); max-width: 60em; }

/* ---------- share gate ---------- */
.sg-overlay[hidden] { display: none; }
.sg-overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; padding: 20px;
  /* overlay scrollabile: su iPhone, quando la modale (col pannello iOS) supera
     l'altezza dello schermo, si può scorrere per vederla tutta. */
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: rgba(23, 21, 31, .55);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.sg-modal {
  position: relative; width: min(440px, 100%);
  /* margin:auto centra quando ci sta, e NON taglia il top quando è più alta
     della viewport (bug noto di flex/grid align-center + overflow). */
  margin: auto;
  background: var(--paper); color: var(--ink);
  border: 2px solid var(--ink); border-radius: var(--radius);
  box-shadow: 10px 12px 0 var(--ink);
  padding: 30px 26px 26px;
}
.sg-close {
  position: absolute; top: 8px; right: 12px;
  width: 38px; height: 38px; display: grid; place-items: center;
  background: transparent; border: none; cursor: pointer;
  font-size: 30px; line-height: 1; color: var(--muted);
}
.sg-close:hover { color: var(--ink); }
.sg-modal h2 { font-size: 26px; margin-bottom: 10px; padding-right: 30px; }
.sg-body { color: var(--muted); font-size: 16px; margin-bottom: 16px; }
.sg-msg {
  background: var(--cream); border: 2px dashed var(--line); border-radius: 14px;
  padding: 12px 14px; font-size: 15px; font-weight: 650; margin-bottom: 18px;
}
.sg-share { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
/* `.sg-share { display: grid }` batte [hidden]: serve questa per nascondere davvero
   il menu di condivisione dopo lo sblocco. */
.sg-share[hidden] { display: none; }
.sg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 14px;
  border-radius: 12px; border: 2px solid var(--ink);
  font-weight: 800; font-size: 15px; text-decoration: none; cursor: pointer;
  background: #fff; color: var(--ink);
  transition: transform .12s ease;
}
.sg-btn:hover { transform: translateY(-2px); }
.sg-btn svg { width: 18px; height: 18px; }
.sg-btn b { font-weight: 900; }
.sg-wa { background: #25D366; color: #06331b; }
.sg-tg { background: #2AABEE; color: #063; }
.sg-x  { background: #111; color: #fff; }
/* Copia link e Condividi (nativa) ben distinti: copia bianco con icona catena,
   condividi giallo a tutta larghezza con icona nodi. */
.sg-copy { background: #fff; color: var(--ink); }
.sg-native { background: var(--sun); color: var(--ink); grid-column: 1 / -1; }
.sg-dl { width: 100%; }
/* `.btn { display: inline-flex }` batte l'attributo [hidden] (UA display:none):
   serve una regola più specifica per poter davvero nascondere il download su iOS. */
.sg-dl[hidden] { display: none; }
.sg-dl[aria-disabled="true"] { opacity: .5; pointer-events: none; filter: grayscale(.4); }
.sg-ios[hidden] { display: none; }
.sg-ios { text-align: center; }
.sg-ios h3 { font-size: 20px; font-weight: 850; margin-bottom: 8px; }
.sg-ios p { color: var(--muted); font-size: 15px; margin-bottom: 16px; }
.sg-chan { width: 100%; }
.sg-chan svg { width: 18px; height: 18px; }
.sg-chan[disabled] { opacity: .6; cursor: not-allowed; }
.sg-chan[disabled]:hover { transform: none; }
@media (max-width: 480px) {
  .sg-share { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .sg-btn { transition: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 24px; padding-top: 16px; }
  .hero-art { min-height: 440px; }
  .steps, .split { grid-template-columns: 1fr; }
  .steps li:nth-child(2) { transform: none; }
  .top nav { display: none; }
  .cta-row .btn { flex: 1 1 100%; }
  .card { padding: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sound i, .float { animation: none; }
  .btn { transition: none; }
}
