/* Layout: one reading column with wide figure bands; before/after always side by side, stacked on phones */
:root {
  --paper: #fffdf9;
  --surface: #ffffff;
  --ink: #121212;
  --ink-soft: #4f4b57;
  --line: #ece8e1;
  --accent: #6c47ff;
  --accent-soft: #e9e3ff;
  --before: #8a8478;
  --before-soft: #ffe8dc;
  --font-display: "Fredoka", "Segoe UI", system-ui, sans-serif;
  --font-body: "Nunito", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Nunito", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
}
.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.prose { max-width: 680px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.05; font-weight: 600; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(36px, 6vw, 64px); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: clamp(26px, 3.6vw, 38px); font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 21px; font-weight: 700; }
p { margin: 0; }
a { color: var(--accent); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.mono { font-family: var(--font-mono); font-size: 0.88em; }
section { padding-block: 56px; border-top: 1px solid var(--line); }
section:first-of-type { border-top: 0; }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 48px;
  align-items: center;
  padding-block: 48px 56px;
}
.hero-text { display: grid; gap: 20px; min-width: 0; }
.lead { font-size: 20px; color: var(--ink-soft); max-width: 560px; }
.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 24px;
  margin: 8px 0 0;
  padding: 0;
}
.facts div { display: grid; gap: 2px; }
.facts dt { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.facts dd { margin: 0; font-weight: 500; }

/* Before/after slider on the phone screenshot */
.compare {
  position: relative;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  aspect-ratio: 750 / 1624;
  border-radius: 34px;
  overflow: hidden;
  border: 8px solid var(--ink);
  background: var(--surface);
  box-shadow: 0 30px 60px -30px rgba(10, 30, 20, 0.45);
  touch-action: pan-y;
}
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.compare .after-layer { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--pos, 50%)); }
.compare .handle {
  position: absolute; top: 0; bottom: 0; left: var(--pos, 50%);
  width: 2px; margin-left: -1px; background: var(--surface);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.15);
  pointer-events: none;
}
.compare .handle::after {
  content: "⇆";
  position: absolute; top: 50%; left: 50%;
  width: 40px; height: 40px; margin: -20px 0 0 -20px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface); color: var(--ink);
  font-size: 18px; box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.compare input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  margin: 0; opacity: 0; cursor: ew-resize;
}
.compare input:focus-visible + .handle::after { outline: 3px solid var(--accent); outline-offset: 2px; }
.tag {
  position: absolute; top: 14px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  padding: 3px 10px; border-radius: 999px;
  pointer-events: none;
}
.tag.before { left: 14px; background: var(--before-soft); color: var(--before); }
.tag.after { right: 14px; background: var(--accent-soft); color: var(--accent); }
.compare-hint { text-align: center; font-size: 14px; color: var(--ink-soft); margin-top: 12px; }

/* ---------- Results ---------- */
.results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}
.result {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  display: grid;
  gap: 6px;
  align-content: start;
}
.result .from-to {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.result .from { color: var(--before); text-decoration: line-through; text-decoration-thickness: 2px; font-size: 24px; }
.result .to { color: var(--accent); }
.result p { color: var(--ink-soft); font-size: 15px; }

/* ---------- Problems ---------- */
.problems {
  list-style: none; margin: 24px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 32px;
}
.problems li { padding: 14px 0; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.problems strong { font-weight: 600; }
.problems span { color: var(--ink-soft); font-size: 15px; }

/* ---------- Before / after pairs ---------- */
.pair-head { display: grid; gap: 8px; margin-bottom: 24px; }
.pair-head p { color: var(--ink-soft); max-width: 680px; }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.pair.phones { max-width: 760px; }
.pair figure { margin: 0; display: grid; gap: 10px; min-width: 0; }
.pair img {
  width: 100%; height: auto; display: block;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.pair.phones img { border-radius: 22px; }
.pair figcaption { display: flex; gap: 10px; align-items: baseline; font-size: 15px; color: var(--ink-soft); }
.pill { font-family: var(--font-mono); font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: 999px; flex: none; }
.pill.before { background: var(--before-soft); color: var(--before); }
.pill.after { background: var(--accent-soft); color: var(--accent); }
.changes { margin: 20px 0 0; padding-left: 20px; display: grid; gap: 6px; max-width: 760px; }

/* ---------- Process ---------- */
.steps { list-style: none; counter-reset: step; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.steps li { counter-increment: step; display: grid; gap: 6px; align-content: start; padding-top: 14px; border-top: 2px solid var(--accent); }
.steps li::before { content: counter(step, decimal-leading-zero); font-family: var(--font-mono); font-size: 13px; color: var(--accent); }
.steps strong { font-family: var(--font-display); font-size: 18px; }
.steps span { font-size: 15px; color: var(--ink-soft); }

/* ---------- Code notes ---------- */
.code-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; margin-top: 24px; }
.files {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px 20px; overflow-x: auto;
  font-family: var(--font-mono); font-size: 14px; line-height: 1.8;
}
.files .add { color: var(--accent); }
.files .del { color: var(--before); }
.notes { display: grid; gap: 14px; }
.notes p { color: var(--ink-soft); }
.notes strong { color: var(--ink); }

/* ---------- Call to action ---------- */
.cta {
  background: var(--ink);
  color: var(--paper);
  border-radius: 24px;
  padding: 40px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 32px;
  align-items: center;
}
.cta h2 { color: var(--paper); }
.cta p { color: var(--paper); opacity: 0.8; margin-top: 12px; }
.offer { background: var(--paper); color: var(--ink); border-radius: 16px; padding: 22px; display: grid; gap: 10px; }
.offer .price { font-family: var(--font-display); font-size: 40px; font-weight: 800; line-height: 1; }
.offer .price small { font-family: var(--font-body); font-size: 15px; font-weight: 500; color: var(--ink-soft); }
.contact { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.contact code { font-family: var(--font-mono); font-size: 15px; user-select: all; overflow-wrap: anywhere; }
.copy {
  font: inherit; font-size: 14px; font-weight: 600;
  padding: 8px 14px; border-radius: 10px; border: 0;
  background: var(--accent); color: var(--surface); cursor: pointer;
}
.copy:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.fineprint { font-size: 13px; color: var(--ink-soft); padding-block: 32px 48px; display: grid; gap: 6px; }

@media (max-width: 860px) {
  .hero, .cta, .code-grid { grid-template-columns: minmax(0, 1fr); }
  .hero { gap: 36px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cta { padding: 28px 22px; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  section { padding-block: 40px; }
  .results, .problems { grid-template-columns: minmax(0, 1fr); }
  .pair:not(.phones) { grid-template-columns: minmax(0, 1fr); }
  .pair.phones { gap: 12px; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* ---------- Site top bar (same as the home) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 800; font-size: 20px;
  color: var(--ink); text-decoration: none; letter-spacing: -0.01em;
}
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--accent); color: var(--surface);
  display: grid; place-items: center; font-size: 17px;
}
.wordmark span { color: var(--accent); }
.back { margin-left: auto; color: var(--ink-soft); text-decoration: none; font-size: 15px; font-weight: 500; }
.back:hover { color: var(--ink); }

.eyebrow { font-family: var(--font-body); font-weight: 800; letter-spacing: 0.02em; text-transform: none; font-size: 15px; }
.topbar { background: color-mix(in srgb, var(--paper) 90%, transparent); }
.brand { font-family: var(--font-display); font-weight: 700; font-size: 24px; }
.brand-mark { border-radius: 12px; background: var(--accent); transform: rotate(-8deg); }
.result, .files { border: 2px solid var(--ink); border-radius: 24px; }
.cta { border-radius: 36px; }

/* ===== Playful layer: pastel blocks, thick outlines, hard shadows (same language as the home) ===== */
:root {
  --lilac: #e9e3ff;
  --mint: #dff7ec;
  --peach: #ffe8dc;
  --sun: #fff3c4;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}
body { background: var(--paper); }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: clamp(40px, 6vw, 72px); }

/* Eyebrow becomes an outlined chip */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; justify-self: start;
  padding: 5px 14px; border-radius: 999px;
  background: #fff; border: 2px solid var(--ink); color: var(--ink);
  font-family: var(--font-body); font-weight: 800; font-size: 14px; letter-spacing: 0; text-transform: none;
}
.prose .eyebrow, .pair-head .eyebrow { margin-bottom: 4px; }

/* Sections become rounded colour blocks */
main > section { border-top: 0; padding-block: 0; margin-block: 22px; }
main > section.hero { margin-block: 0; padding-block: 36px 40px; }
main > section[aria-labelledby="risultati"],
main > section[aria-labelledby="problemi"],
main > section[aria-labelledby="metodo"],
main > section[aria-labelledby="codice"],
main > section:has(> .pair-head) {
  border-radius: 40px;
  padding: clamp(28px, 5vw, 60px);
}
main > section[aria-labelledby="risultati"] { background: var(--sun); }
main > section[aria-labelledby="problemi"] { background: var(--peach); }
main > section[aria-labelledby="metodo"] { background: var(--sun); }
main > section[aria-labelledby="codice"] { background: var(--mint); }
main > section:has(> .pair-head):nth-of-type(3n+1) { background: var(--lilac); }
main > section:has(> .pair-head):nth-of-type(3n+2) { background: var(--mint); }
main > section:has(> .pair-head):nth-of-type(3n) { background: var(--peach); }

/* Hero: a blob behind the phone */
.hero > div:last-child { position: relative; isolation: isolate; }
.hero > div:last-child::before {
  content: ""; position: absolute; z-index: -1; inset: 6% -4% 8% -4%;
  background: var(--lilac); border-radius: 48% 52% 44% 56% / 55% 45% 55% 45%;
}
.facts div { background: #fff; border: 2px solid var(--ink); border-radius: 18px; padding: 10px 14px; }
.facts dt { font-family: var(--font-body); font-weight: 700; text-transform: none; letter-spacing: 0; font-size: 13px; }
.facts dd { font-weight: 800; }
.lead { color: var(--ink-soft); }

/* Phone frame and slider */
.compare { border-color: var(--ink); box-shadow: 0 30px 50px -24px rgba(18,18,18,.5); }
.compare .handle { background: #fff; }
.compare .handle::after {
  content: ""; background-color: var(--accent); border: 3px solid #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l-6 6 6 6M15 6l6 6-6 6'/%3E%3C/svg%3E");
  background-size: 20px; background-position: center; background-repeat: no-repeat;
}
.tag { font-family: var(--font-body); font-weight: 800; }
.tag.before { background: #fff; color: var(--ink); }
.tag.after { background: var(--accent); color: #fff; }
.compare-hint { font-weight: 600; }

/* Result cards */
.result { background: #fff; border: 2px solid var(--ink); border-radius: 28px; box-shadow: 0 6px 0 var(--ink); }
.result .from-to { font-family: var(--font-display); font-weight: 600; }
.result .from { color: var(--ink-soft); opacity: .6; }
.result .to { color: var(--accent); }
.result p { color: var(--ink-soft); font-weight: 600; }

/* Problems as cards */
.problems { gap: 14px; }
.problems li { background: #fff; border: 2px solid var(--ink); border-radius: 24px; padding: 18px 20px; box-shadow: 0 5px 0 var(--ink); }
.problems strong { font-family: var(--font-display); font-weight: 600; font-size: 19px; }
.problems span { color: var(--ink-soft); font-weight: 600; }

/* Before / after pairs */
.pair-head p { color: var(--ink-soft); font-weight: 600; }
.pair.phones img { border: 8px solid var(--ink); border-radius: 34px; background: var(--ink); box-shadow: 0 24px 40px -22px rgba(18,18,18,.5); }
.pair:not(.phones) img { border: 3px solid var(--ink); border-radius: 18px; box-shadow: 0 6px 0 var(--ink); }
.pair figcaption { font-weight: 700; color: var(--ink); }
.pill { font-family: var(--font-body); font-weight: 800; font-size: 12px; padding: 3px 10px; }
.pill.before { background: #fff; color: var(--ink); border: 2px solid var(--ink); }
.pill.after { background: var(--accent); color: #fff; border: 2px solid var(--accent); }

/* Steps */
.steps li { background: #fff; border: 0; border-radius: 24px; padding: 22px; gap: 8px; }
.steps li::before {
  content: counter(step); width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: #fff;
  font-family: var(--font-display); font-weight: 600; font-size: 20px;
}
.steps strong { font-family: var(--font-display); font-weight: 600; }
.steps span { font-weight: 600; }

/* Code */
.files { background: #fff; border: 2px solid var(--ink); border-radius: 24px; font-family: ui-monospace, Consolas, monospace; font-size: 13.5px; }
.files .add { color: #127a4a; font-weight: 700; }
.files .del { color: #b2481b; font-weight: 700; }
.notes p { color: var(--ink-soft); font-weight: 600; }
.notes strong { font-weight: 800; }

/* Call to action */
.cta { background: var(--ink); border-radius: 40px; }
.cta h2 { color: #fff; }
.cta p { color: #cfcbd8; opacity: 1; }
.offer { background: #fff; border-radius: 28px; transform: rotate(1.5deg); }
.offer .price { font-family: var(--font-display); font-weight: 600; }
.copy { background: var(--ink); color: #fff; border-radius: 999px; padding: 10px 18px; font-weight: 800; box-shadow: 0 4px 0 var(--accent); transition: transform .3s var(--spring); }
.copy:hover { transform: translateY(-2px); }
.contact code { font-family: var(--font-display); font-size: 17px; }

.fineprint { font-weight: 600; }
.back { font-weight: 800; color: var(--ink); }
.back:hover { color: var(--accent); }

@media (max-width: 600px) {
  main > section[aria-labelledby="risultati"],
  main > section[aria-labelledby="problemi"],
  main > section[aria-labelledby="metodo"],
  main > section[aria-labelledby="codice"],
  main > section:has(> .pair-head) { border-radius: 28px; padding: 24px 18px; }
  .offer { transform: none; }
  .pair.phones img { border-width: 6px; border-radius: 24px; }
}

/* ===== Plain "what was wrong / what I fixed" cards ===== */
.fixes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }
.fix { background: #fff; border: 2px solid var(--ink); border-radius: 28px; padding: 24px 26px; box-shadow: 0 6px 0 var(--ink); }
.fix h3 { font-family: var(--font-display); font-weight: 600; font-size: 21px; margin-bottom: 14px; }
.fix ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.fix li { display: grid; grid-template-columns: 26px 1fr; gap: 12px; align-items: start; font-weight: 600; color: var(--ink-soft); }
.fix li::before { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; margin-top: 1px; }
.fix.bad li::before { content: "✕"; background: var(--peach); color: #b2481b; }
.fix.good li::before { content: "✓"; background: var(--mint); color: #127a4a; }
.fix.bad h3 { color: #b2481b; }
.fix.good h3 { color: #127a4a; }
.reassure { margin-top: 22px; background: #fff; border: 2px dashed var(--ink); border-radius: 24px; padding: 18px 22px; font-weight: 700; display: flex; gap: 14px; align-items: center; }
.reassure span { font-size: 26px; }
.home-fixes { margin-top: 8px; }
@media (max-width: 760px) { .fixes { grid-template-columns: minmax(0, 1fr); } }
