/* Whate: la bolla di chat e il gradiente dell'icona su una base neutra leggermente verde. */
@font-face { font-family: "Bricolage Grotesque"; src: url("/assets/bricolage.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
:root {
  --bg: #f1f6f4;
  --surface: #ffffff;
  --surface-2: #e3ece8;
  --ink: #10211c;
  --ink-2: #51635c;
  --line: rgba(16, 33, 28, .13);
  --accent: #08795c;
  --sea: #07708f;
  --send: linear-gradient(120deg, #2fdc8e, #13c7ad 58%, #17b4dc);
  --send-ink: #04261d;
  --press: #0c3b30;
  --press-ink: #ffffff;
  --error: #b3261e;
  --warn: #8a5300;
  --mark: rgba(23, 180, 220, .28);
  --shadow: 0 18px 50px rgba(12, 59, 48, .12);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Bricolage Grotesque", var(--sans);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --wide: 1120px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #07120f; --surface: #101f1a; --surface-2: #1b2f28; --ink: #e9f4ef; --ink-2: #9fb4ab;
    --line: rgba(233, 244, 239, .15); --accent: #4fdca6; --sea: #62cdec; --press: #e9f4ef; --press-ink: #07120f;
    --error: #ff8f86; --warn: #f0b95e; --mark: rgba(23, 180, 220, .35); --shadow: 0 18px 50px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #07120f; --surface: #101f1a; --surface-2: #1b2f28; --ink: #e9f4ef; --ink-2: #9fb4ab;
  --line: rgba(233, 244, 239, .15); --accent: #4fdca6; --sea: #62cdec; --press: #e9f4ef; --press-ink: #07120f;
  --error: #ff8f86; --warn: #f0b95e; --mark: rgba(23, 180, 220, .35); --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ol, ul, figure, table { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--sea); outline-offset: 2px; }
code, kbd { font-family: var(--mono); font-size: .88em; background: var(--surface-2); border-radius: 5px; padding: .08em .35em; overflow-wrap: anywhere; }
kbd { font-family: inherit; font-weight: 600; }
.wrap { width: 100%; max-width: calc(var(--wide) + 48px); margin-inline: auto; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); }

/* Barra */
.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.logo { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font: 700 22px/1 var(--display); }
.logo img { display: block; border-radius: 7px; }
.bar nav { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 0 18px; font-size: 15px; }
.bar nav a { text-decoration: none; color: var(--ink-2); padding-block: 10px; }
.bar nav a:hover, .bar nav a[aria-current="page"] { color: var(--ink); }

/* Pulsanti */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 22px; border: 0; border-radius: 999px; background: var(--surface-2); color: var(--ink); font: 600 16px/1.2 var(--sans); text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(.96); }
.btn svg { width: 18px; height: 18px; flex: none; fill: currentColor; }
.btn-primary { background: var(--press); color: var(--press-ink); }
.btn-send { background: var(--send); color: var(--send-ink); }
.btn[aria-disabled="true"] { opacity: .55; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.meta { margin-top: 14px; font-size: 14px; color: var(--ink-2); }

/* Apertura */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(28px, 5vw, 64px); align-items: center; padding-block: clamp(36px, 7vw, 76px) clamp(30px, 5vw, 56px); }
.hero h1, .page-head h1 { font: 700 clamp(38px, 5.6vw, 64px)/1.03 var(--display); letter-spacing: -.02em; }
.hero .lead, .page-head .lead { margin-top: 18px; font-size: clamp(18px, 2vw, 20px); color: var(--ink-2); max-width: 32em; }
.page-head { padding-block: clamp(32px, 6vw, 60px) 8px; }
.page-head h1 { font-size: clamp(34px, 4.8vw, 54px); max-width: 17em; }
.page-head.with-tool { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(28px, 5vw, 64px); align-items: center; }

/* Strumento: una bolla di chat con il codino */
.tool { position: relative; background: var(--surface); border-radius: 26px 26px 26px 6px; padding: clamp(20px, 3vw, 28px); box-shadow: var(--shadow); display: grid; gap: 14px; }
.tool-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tool-head h2 { font: 700 21px/1.2 var(--display); }
.typing { display: inline-flex; gap: 5px; padding: 8px 11px; border-radius: 999px; background: var(--send); flex: none; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: #ffffff; animation: typing 1.5s infinite; }
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes typing { 0%, 55%, 100% { transform: none; } 25% { transform: translateY(-3px); } }
.field { display: grid; gap: 5px; min-width: 0; }
.field label { font-size: 14px; font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink); padding: 11px 13px; font: 400 17px/1.35 var(--sans); }
.field textarea { resize: vertical; min-height: 92px; }
.numbers { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 9fr); gap: 10px; }
.tool[data-state="error"] [data-number] { border-color: var(--error); }
.tool-status { min-height: 1.45em; font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.tool-status[data-state="ok"] { color: var(--accent); }
.tool-status[data-state="hint"] { color: var(--warn); }
.tool-status[data-state="error"] { color: var(--error); }
.tool-status code { background: transparent; padding: 0; }
.tool-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tool-actions .btn-send { grid-column: 1 / -1; min-height: 52px; font-size: 17px; }
.tool-actions .btn { padding-inline: 12px; font-size: 15px; }
.tool-actions .btn-send { font-size: 17px; }
.tool-note { font-size: 13px; color: var(--ink-2); }
.linklike { border: 0; padding: 0; background: none; color: var(--accent); font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

/* Schermata e menu illustrato */
.stage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(18px, 3vw, 32px); align-items: stretch; }
.stage figure { min-width: 0; display: flex; flex-direction: column; }
.stage figcaption { margin-top: 10px; font-size: 14px; color: var(--ink-2); }
.stage-box { flex: 1; display: flex; align-items: center; justify-content: center; border-radius: 24px; padding: clamp(18px, 3vw, 32px); background: var(--surface-2); min-height: 340px; overflow: hidden; }
.window { width: min(100%, 340px); border-radius: 12px; overflow: hidden; background: #f5f5f7; box-shadow: 0 16px 40px rgba(0, 0, 0, .25); }
.window-bar { display: flex; align-items: center; gap: 6px; height: 28px; padding-inline: 11px; background: #e9e9ec; color: #333333; font: 600 12px var(--sans); }
.window-bar i { width: 10px; height: 10px; border-radius: 50%; }
.window-bar i:nth-child(1) { background: #ff5f57; }
.window-bar i:nth-child(2) { background: #febc2e; }
.window-bar i:nth-child(3) { background: #28c840; }
.window-bar span { flex: 1; text-align: center; margin-right: 42px; }
.window img { display: block; width: 100%; }
.demo { width: min(100%, 440px); position: relative; padding-bottom: 8px; }
.demo-text { background: var(--surface); border-radius: 14px; padding: 18px; font-size: 16px; }
.demo-text mark { background: var(--mark); color: inherit; padding: .05em .15em; border-radius: 3px; font-weight: 600; white-space: nowrap; }
.menu { list-style: none; padding: 5px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(0, 0, 0, .2); font-size: 14px; }
.menu li { padding: 3px 10px; border-radius: 5px; display: flex; justify-content: space-between; gap: 18px; white-space: nowrap; }
.menu .on { background: var(--press); color: var(--press-ink); }
.demo-menus { display: flex; align-items: flex-start; flex-wrap: wrap; margin: 10px 0 0 18px; }
.demo-menus .menu:first-child { min-width: 150px; }
.demo-menus .menu:last-child { margin: 66px 0 0 -8px; position: relative; }

/* Sezioni */
.block { margin-top: clamp(50px, 8vw, 88px); }
.title { font: 700 clamp(28px, 3.8vw, 40px)/1.1 var(--display); letter-spacing: -.015em; }
.intro { margin-top: 12px; color: var(--ink-2); max-width: 40em; font-size: 18px; }
.fineprint { margin-top: 12px; font-size: 14px; color: var(--ink-2); max-width: 46em; }
.table-box { margin-top: 22px; overflow-x: auto; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { padding: 11px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.table tr:last-child td { border-bottom: 0; }
.table th { font-size: 13px; color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.table.numbers-table td:nth-child(1) code { white-space: nowrap; }
.table.numbers-table td:nth-child(2), .table.numbers-table td:nth-child(3) { white-space: nowrap; font-variant-numeric: tabular-nums; }
.points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px 32px; margin-top: 34px; }
.points h3 { font: 700 19px/1.2 var(--display); }
.points p { margin-top: 6px; font-size: 16px; color: var(--ink-2); }
.get { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 26px; align-items: stretch; }
.panel { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: clamp(20px, 2.6vw, 28px); min-width: 0; }
.panel h3 { font: 700 23px/1.15 var(--display); }
.panel p { font-size: 16px; color: var(--ink-2); }
.panel ul { padding-left: 1.1em; font-size: 15px; color: var(--ink-2); display: grid; gap: 3px; }
.panel .btn { margin-top: auto; }
.panel-links { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; }
.panel .panel-foot { width: 100%; margin-top: auto; display: grid; gap: 10px; justify-items: start; padding-top: 6px; }
.panel .panel-foot .btn { margin-top: 0; }

/* Istruzioni */
.prose { max-width: 44em; }
.prose h2 { font: 700 clamp(25px, 3vw, 32px)/1.15 var(--display); letter-spacing: -.01em; margin-top: 44px; scroll-margin-top: 76px; }
.prose h3 { font: 700 20px/1.2 var(--display); margin-top: 26px; }
.prose p, .prose ul { margin-top: 12px; }
.prose ul { padding-left: 1.15em; display: grid; gap: 5px; }
.prose > :first-child { margin-top: 0; }
.steps { list-style: none; padding: 0; margin-top: 16px; display: grid; gap: 15px; counter-reset: s; }
.steps > li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 8px; counter-increment: s; }
.steps > li::before { content: counter(s); font: 700 24px/1.15 var(--display); color: var(--accent); }
.path { display: inline-flex; flex-wrap: wrap; gap: 3px 6px; align-items: center; }
.path span + span::before { content: "›"; color: var(--ink-2); margin-right: 6px; font-weight: 400; }
.path span { font-weight: 600; }
.copy { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.copy code { padding: 6px 10px; }
.copy button { min-height: 34px; padding: 4px 13px; border: 0; border-radius: 999px; background: var(--surface-2); color: var(--ink); font: 600 14px var(--sans); cursor: pointer; }
.note { margin-top: 18px; padding: 14px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 16px; }
.manual { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(24px, 4vw, 52px); align-items: start; margin-top: 18px; }
.toc { position: sticky; top: 76px; font-size: 15px; }
.toc ol { list-style: none; padding: 0; display: grid; gap: 1px; }
.toc a { display: block; padding: 5px 10px; margin-left: -10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; }
.toc a:hover { background: var(--surface-2); color: var(--ink); }
.band { margin-top: clamp(36px, 6vw, 56px); padding: clamp(22px, 3.5vw, 34px); border-radius: 20px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; justify-content: space-between; }
.band p { font-size: 18px; font-weight: 600; max-width: 28em; }
.band .cta { margin-top: 0; }

/* Domande */
.faq { margin-top: 20px; display: grid; gap: 8px; max-width: 48em; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 2px 18px; }
.faq summary { cursor: pointer; font-weight: 600; padding-block: 12px; }
.faq details p { padding-bottom: 14px; color: var(--ink-2); font-size: 16px; }

/* Dona */
.give { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 40px; align-items: center; padding: clamp(24px, 4vw, 42px); border-radius: 26px 26px 6px 26px; background: var(--send); color: var(--send-ink); margin-top: clamp(50px, 8vw, 88px); }
.give .title { color: inherit; }
.give p { margin-top: 10px; max-width: 36em; }
.give-side { display: grid; gap: 8px; justify-items: center; }
.give-note { font-size: 13px; text-align: center; max-width: 16em; }
.give .btn { background: #0c3b30; color: #ffffff; }

footer { margin-top: clamp(50px, 8vw, 80px); padding-block: 26px 40px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
footer .wrap { display: grid; gap: 10px; }
footer nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
footer a { color: var(--ink-2); }
footer details summary { cursor: pointer; }
footer ul { margin: 8px 0 0; padding-left: 1.15em; display: grid; gap: 3px; }

.toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 8px); max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 12px; background: var(--press); color: var(--press-ink); font-size: 15px; text-align: center; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 30; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .hero, .page-head.with-tool, .stage, .manual { grid-template-columns: minmax(0, 1fr); }
  /* Sul telefono lo strumento viene subito dopo il titolo */
  .hero { gap: 0; }
  .hero > div:first-child { display: contents; }
  .hero .tool { order: 3; margin-top: 24px; }
  .hero .cta { order: 4; }
  .hero .meta { order: 5; }
  .points { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .get { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; }
  .toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toc a { margin-left: 0; padding: 7px 4px; }
  .give { grid-template-columns: minmax(0, 1fr); }
  .give-side { justify-items: stretch; }
  .give-note { max-width: none; }
}
@media (max-width: 560px) {
  .wrap { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .bar nav a.only-wide { display: none; }
  .bar nav { gap: 0 14px; }
  .points { grid-template-columns: minmax(0, 1fr); }
  .cta .btn { flex: 1 1 100%; }
  .numbers { grid-template-columns: minmax(0, 1fr); }
  .stage-box { min-height: 0; }
  .demo-menus .menu:last-child { margin: 8px 0 0 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
