/* Margini — sito. Colori e caratteri presi dall'app; i frammenti d'interfaccia (data-ui) usano gli stili dell'app. */
:root {
  --ground: #f2f2f0;
  --sheet: #ffffff;
  --paper: #faf8f3;
  --field: #e6e8eb;
  --field-2: #dde1e7;
  --night: #1f2125;
  --ink: #1b1f24;
  --ink-2: #3c424a;
  --muted: #5b626b;
  --accent: #2f6fde;
  --accent-ink: #1f5bc4;
  --accent-deep: #1a4ea8;
  --accent-soft: rgba(47, 111, 222, 0.1);
  --pen: #2152c4;
  --hl: #ffe14d;
  --line-ui: rgba(16, 24, 40, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Helvetica, Arial, sans-serif;
  --hand: "Caveat", "Bradley Hand", "Segoe Print", cursive;

  --m: clamp(16px, 2.2vw, 32px);
  --r: 20px;
  --gap: 12px;
  --sec: clamp(96px, 12vw, 200px);

  /* cinque misure */
  --t-display: clamp(44px, 5.6vw, 96px);
  --t-h2: clamp(32px, 3.4vw, 56px);
  --t-state: clamp(22px, 2.3vw, 34px);
  --t-body: 18px;
  --t-lead: 20px;
  --t-small: 15px;

  --raise: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 0 0 1px rgba(16, 24, 40, 0.07), 0 1px 2px rgba(16, 24, 40, 0.06), 0 3px 8px -3px rgba(16, 24, 40, 0.08);
  --raise-hover: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 0 0 1px rgba(16, 24, 40, 0.09), 0 2px 4px rgba(16, 24, 40, 0.07), 0 8px 18px -6px rgba(16, 24, 40, 0.14);
  --raise-lg: 0 0 0 1px rgba(16, 24, 40, 0.05), 0 1px 2px rgba(16, 24, 40, 0.04), 0 10px 28px -8px rgba(16, 24, 40, 0.1), 0 28px 56px -20px rgba(16, 24, 40, 0.1);
  --float: 0 0 0 1px rgba(16, 24, 40, 0.06), 0 4px 10px rgba(16, 24, 40, 0.06), 0 20px 44px -10px rgba(16, 24, 40, 0.2);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { background: var(--ground); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font-family: var(--font); font-size: var(--t-body); line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: clip;
}
h1, h2, h3, h4, p { margin: 0; }
h1, h2 { font-weight: 650; letter-spacing: -0.035em; line-height: 1; text-wrap: balance; }
h2 { font-size: var(--t-h2); }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
img, svg { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: rgba(255, 225, 77, 0.7); color: var(--ink); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hand { font-family: var(--hand); font-weight: 600; color: var(--pen); line-height: 1.05; }
.skip { position: absolute; left: var(--m); top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; text-decoration: none; }
.skip:focus { top: 12px; }
[data-split] .ln { display: block; overflow: clip; padding-bottom: 0.08em; margin-bottom: -0.08em; }
[data-split] .ln > span { display: block; }

/* ───── pulsanti: luce in alto e profondità, come nell'app ───── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 11px; border: 0;
  background: linear-gradient(#ffffff, #f8f8f7); box-shadow: var(--raise); color: var(--ink);
  font-weight: 600; font-size: var(--t-small); text-decoration: none; white-space: nowrap; touch-action: manipulation;
  transition: box-shadow .15s, transform .08s, filter .15s;
} /* taste-skill-ignore: pulsanti dell'app, richiesti dal brand */
.btn:hover { box-shadow: var(--raise-hover); }
.btn:active { transform: translateY(1px); box-shadow: inset 0 1px 2px rgba(16, 24, 40, .12), 0 0 0 1px rgba(16, 24, 40, .08); }
.btn.primary {
  color: #fff; background: linear-gradient(#3d7df0, #2a64d4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 0 0 1px #2256bb, 0 1px 2px rgba(34, 86, 187, .35), 0 6px 14px -4px rgba(47, 111, 222, .45);
} /* taste-skill-ignore: pulsante primario dell'app */
.btn.primary:hover { filter: brightness(1.06); }
.btn.primary:active { box-shadow: inset 0 2px 3px rgba(0, 0, 0, .2), 0 0 0 1px #2256bb; }
.btn.big { height: 52px; padding: 0 24px; font-size: 17px; border-radius: 13px; }

/* ───── barra ───── */
.nav {
  position: sticky; top: 0; z-index: 50; height: 68px;
  display: flex; align-items: center; gap: 24px; padding: 0 var(--m);
  background: var(--ground);
}
.nav-mark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 650; font-size: 18px; letter-spacing: -0.01em; margin-right: auto; }
.nav-mark img { width: 34px; height: 34px; border-radius: 9px; }
.nav-links { display: flex; gap: 4px; }
.nav-links a { padding: 8px 12px; border-radius: 10px; text-decoration: none; font-size: var(--t-small); font-weight: 500; color: var(--ink); transition: background-color .18s ease; }
.nav-links a:hover { background: var(--field); }

/* ───── hero ───── */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap);
  padding: 0 var(--m) var(--m); height: calc(100svh - 68px); min-height: 680px; max-height: 1040px;
}
.hero-card {
  background: var(--sheet); border-radius: var(--r);
  padding: clamp(28px, 3.6vw, 64px); display: flex; flex-direction: column; justify-content: space-between; gap: 48px; min-width: 0;
}
.hero-logo { width: min(400px, 74%); }
.hero-logo svg, .foot-mark svg { width: 100%; height: auto; overflow: visible; }
.hero-logo path, .foot-mark path { fill: var(--ink); stroke: var(--ink); stroke-width: 0; stroke-linecap: round; stroke-linejoin: round; }
.hero-copy { display: grid; gap: 40px; }
.hero h1 { font-size: var(--t-display); max-width: 11.5em; }
.lead { font-size: var(--t-lead); line-height: 1.45; max-width: 34em; color: var(--ink); }
.hero .lead { margin-top: -6px; }
.hero-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hero-stage { position: relative; min-width: 0; }

/* ───── frammenti d'interfaccia: stile dell'app ───── */
[data-ui] { font-family: var(--font); }
[data-ui] svg use, [data-ui] .ib svg, [data-ui] .tool svg, .nav-item svg, .card svg, .btn-app svg, .view-seg svg, .search svg {
  fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.ib { width: 38px; height: 38px; flex: none; display: inline-grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); transition: background .15s, box-shadow .15s; }
.ib svg { width: 21px; height: 21px; }
button.ib:hover { background: rgba(255, 255, 255, .8); box-shadow: var(--raise); }
button.ib:active { background: #f4f4f4; box-shadow: inset 0 1px 2px rgba(16, 24, 40, .1); }
.ib:disabled { opacity: .3; pointer-events: none; }

/* editor */
.ed {
  position: absolute; inset: 0; border-radius: var(--r); overflow: hidden; background: #f8f8f7;
  display: flex; flex-direction: column; isolation: isolate;
}
.ed-bar {
  position: relative; z-index: 3; margin: 10px 10px 0; height: 54px; padding: 0 8px; flex: none;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
  border-radius: 17px; background: #fff;
  box-shadow: 0 0 0 1px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .05), 0 6px 14px -8px rgba(16, 24, 40, .14);
}
.ed-left, .ed-right { display: flex; align-items: center; gap: 2px; min-width: 0; }
.ed-right { justify-content: flex-end; }
.ed-title { display: flex; flex-direction: column; min-width: 0; margin-left: 4px; line-height: 1.2; }
.ed-title b { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-title span { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.ed-title span[data-state="unsaved"] { color: var(--accent-ink); }
.tools { display: flex; gap: 2px; padding: 3px; border-radius: 13px; background: rgba(16, 24, 40, .055); box-shadow: inset 0 1px 2px rgba(16, 24, 40, .07); }
.tool { width: 46px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); touch-action: manipulation; transition: background .15s, color .15s, box-shadow .15s; }
.tool svg { width: 22px; height: 22px; }
.tool:hover { color: var(--ink); }
.tool[aria-pressed="true"] { background: #fff; color: var(--accent); box-shadow: var(--raise); }
.optbar {
  position: relative; z-index: 3; align-self: center; margin-top: 8px; display: flex; align-items: center; gap: 2px; padding: 4px 8px; flex: none;
  border-radius: 15px; background: #fff; box-shadow: 0 0 0 1px rgba(16, 24, 40, .06), 0 2px 4px -2px rgba(16, 24, 40, .08), 0 10px 22px -12px rgba(16, 24, 40, .2);
}
.optbar .hint { font-size: 13.5px; color: var(--muted); padding: 0 8px; white-space: nowrap; }
.optbar .sep { width: 1px; height: 22px; background: rgba(16, 24, 40, .13); margin: 0 4px; }
.sw-c { width: 34px; height: 34px; flex: none; border: 0; border-radius: 50%; background: transparent; display: grid; place-items: center; position: relative; touch-action: manipulation; }
.sw-c::before { content: ""; width: 22px; height: 22px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); transition: transform .15s var(--ease-out); }
.sw-c:hover::before { transform: scale(1.1); }
.sw-c.on::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; box-shadow: 0 0 0 2px var(--accent); }
.sz { width: 34px; height: 34px; flex: none; border: 0; border-radius: 10px; background: transparent; display: grid; place-items: center; color: var(--ink); }
.sz i { display: block; border-radius: 50%; background: currentColor; }
.sz.on { background: var(--accent-soft); color: var(--accent); }

.ed-scroller { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.ed-page {
  position: absolute; left: 0; top: 0; width: 860px; height: 820px; transform-origin: 0 0;
  touch-action: none; cursor: crosshair; -webkit-user-select: none; user-select: none;
}
.ed[data-tool="eraser"] .ed-page { cursor: cell; }
.ed-doc {
  position: absolute; left: 0; top: 0; width: 500px; height: 100%;
  background: #fff; padding: 48px 44px; color: #1d1f23;
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif; font-size: 17.5px; line-height: 1.62;
  box-shadow: 0 0 0 1px rgba(16, 24, 40, .06), 0 2px 10px -2px rgba(16, 24, 40, .1);
}
.ed-doc h3 { font-family: var(--font); font-size: 23px; letter-spacing: -.02em; margin: 0 0 18px; font-weight: 700; line-height: 1.15; }
.ed-doc p { margin: 0 0 16px; }
.ed-doc .w { border-radius: 2px; }
.ed-margin {
  position: absolute; left: 560px; top: 0; width: 300px; height: 100%; background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%278%27%20height%3D%2732%27%3E%3Crect%20y%3D%2731%27%20width%3D%278%27%20height%3D%271%27%20fill%3D%27%232f6fde%27%20fill-opacity%3D%270.16%27%2F%3E%3C%2Fsvg%3E");
  background-position: 0 14px;
  box-shadow: 0 0 0 1px rgba(16, 24, 40, .06);
}
.ed-ink { position: absolute; left: 0; top: 0; width: 860px; height: 820px; overflow: visible; pointer-events: none; }
#ed-hl { mix-blend-mode: multiply; }
.ed-note { position: absolute; left: 596px; top: 258px; font-size: 23px; width: 240px; pointer-events: none; }
.ed-hint {
  position: absolute; z-index: 3; left: 50%; bottom: 16px; transform: translateX(-50%);
  font-size: 13.5px; color: #fff; background: #1d2127; padding: 9px 14px; border-radius: 11px; white-space: nowrap;
  transition: opacity .3s ease, transform .3s var(--ease-out); pointer-events: none;
}
.ed-hint.gone { opacity: 0; transform: translate(-50%, 8px); }

/* ───── storia ───── */
figure { margin: 0; }
.pic { overflow: hidden; border-radius: var(--r); background: #d9d4c7; }
.pic img { width: 100%; height: auto; display: block; }
figcaption { margin-top: 12px; font-size: var(--t-small); color: var(--ink-2); max-width: 44em; }
.statement { font-size: var(--t-state); line-height: 1.3; letter-spacing: -0.01em; }
.story {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(64px, 8vw, 128px) var(--gap); padding: var(--sec) var(--m) 0; align-items: start;
}
.story-intro { grid-column: 1 / span 5; display: grid; gap: 32px; }
.story-big { grid-column: 6 / -1; }
.chapter { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: center; }
.chapter figure { grid-column: 1 / span 7; }
.chapter .ch-text { grid-column: 9 / -1; display: grid; gap: 20px; }
.chapter.flip figure { grid-column: 6 / -1; grid-row: 1; }
.chapter.flip .ch-text { grid-column: 1 / span 4; grid-row: 1; }
.ch-text h3 { font-size: var(--t-h2); font-weight: 650; letter-spacing: -0.035em; line-height: 1; }
.ch-text p { font-size: var(--t-lead); line-height: 1.5; max-width: 30em; }
.credits { margin-top: 48px; font-size: var(--t-small); color: var(--ink-2); max-width: 70em; }
.credits a { color: var(--ink-2); }

/* ───── scena dei margini ───── */
.mscene { margin-top: clamp(64px, 8vw, 128px); }
.mscene-pin {
  height: 100svh; min-height: 640px; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 0 var(--gap);
  padding: 92px var(--m) var(--m);
}
.mscene-text { display: flex; flex-direction: column; gap: 28px; padding-right: 16px; }

.pop {
  width: min(320px, 100%); padding: 14px; border-radius: 15px; background: #fcfcfb; margin-top: auto;
  box-shadow: 0 0 0 1px rgba(16, 24, 40, .06), 0 2px 6px rgba(0, 0, 0, .06), 0 16px 40px rgba(0, 0, 0, .12);
}
.pop h4 { margin: 2px 0 10px; font-size: 13px; color: var(--muted); font-weight: 600; }
.pop h4:not(:first-child) { margin-top: 16px; }
.range { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 8px; margin-bottom: 8px; font-size: 14px; }
.range output { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.range input { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); height: 26px; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border: 0; background: linear-gradient(#fff, #f8f8f7); box-shadow: var(--raise); border-radius: 9px; padding: 6px 12px; font-size: 13px; transition: background .15s; }
.chips button:hover { box-shadow: var(--raise-hover); }
.chips button:active { transform: translateY(1px); }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: rgba(16, 24, 40, .055); box-shadow: inset 0 1px 2px rgba(16, 24, 40, .07); }
.seg button { border: 0; background: transparent; border-radius: 9px; padding: 6px 12px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); transition: background .15s, box-shadow .15s; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: var(--raise); }
.seg.full { display: flex; }
.seg.full button { flex: 1; }
.mscene-stage { position: relative; border-radius: var(--r); background: #f8f8f7; overflow: hidden; display: grid; place-items: center; }
.msheet { position: relative; width: 420px; height: 560px; transform-origin: 50% 50%; }
.mpage {
  position: absolute; inset: 0; background: #fff; padding: 40px 38px; color: #1d1f23;
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif; font-size: 15.5px; line-height: 1.6;
  box-shadow: 0 0 0 1px rgba(16, 24, 40, .06), 0 2px 10px -2px rgba(16, 24, 40, .1);
}
.mpage h3 { font-family: var(--font); font-size: 23px; margin: 0 0 14px; letter-spacing: -.02em; }
.mpage p { margin: 0 0 13px; }
.mm { position: absolute; top: 0; height: 100%; width: 300px; overflow: hidden; }
.mm.l { right: 100%; clip-path: inset(0 0 0 100%); }
.mm.r { left: 100%; clip-path: inset(0 100% 0 0); }
.mm-in { position: absolute; inset: 0; background-color: var(--mc, var(--paper)); box-shadow: inset 0 0 0 1px rgba(16, 24, 40, .06); }
.msheet[data-pat="lines"] .mm-in { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%278%27%20height%3D%2726%27%3E%3Crect%20y%3D%2725%27%20width%3D%278%27%20height%3D%271%27%20fill%3D%27%232f6fde%27%20fill-opacity%3D%270.18%27%2F%3E%3C%2Fsvg%3E"); background-position: 0 10px; }
.msheet[data-pat="grid"] .mm-in { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2720%27%20height%3D%2720%27%3E%3Cpath%20d%3D%27M19.5%200V20M0%2019.5H20%27%20stroke%3D%27%232f6fde%27%20stroke-opacity%3D%270.15%27%2F%3E%3C%2Fsvg%3E"); }
.mnote { position: absolute; left: 22px; font-size: 25px; white-space: nowrap; }
.mnote.n1 { top: 74px; }
.mnote.n2 { top: 176px; }
.mnote.n3 { top: 330px; color: #c42f2f; }

/* ───── formati ───── */
.formats { padding: var(--sec) var(--m) 0; }
.fm-head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px var(--gap); align-items: end; margin-bottom: 56px; }
.fm-head .lead { max-width: 32em; }
.fm-body { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 32px clamp(24px, 3vw, 48px); align-items: start; }
.fm-list { display: grid; gap: 4px; position: sticky; top: 96px; }
.fm-list button {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px; width: 100%; text-align: left;
  border: 0; background: transparent; border-radius: 14px; padding: 12px 16px; color: var(--muted);
  transition: background-color .2s ease, color .2s ease;
}
.fm-list button:hover { color: var(--ink); background: rgba(255, 255, 255, .6); }
.fm-list button[aria-selected="true"] { color: var(--ink); background: var(--sheet); }
.fm-name { font-size: var(--t-h2); font-weight: 650; letter-spacing: -0.035em; line-height: 1.05; }
.fm-tag { font-size: var(--t-small); font-weight: 500; white-space: nowrap; }
.fm-list button[aria-selected="true"] .fm-tag { color: var(--accent-ink); }
.fm-panel { display: grid; gap: 28px; }
.fm-why { font-size: var(--t-lead); line-height: 1.5; max-width: 40em; }
.fm-demo { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--gap); border-radius: var(--r); background: #e9eaec; padding: var(--gap); min-height: 420px; }
.fm-src { background: #1d2127; color: #e8eaed; border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.fm-file { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: #c9ccd1; }
.fm-file b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fm-ext { font-size: 11px; font-weight: 700; letter-spacing: .02em; padding: 3px 6px; border-radius: 6px; background: #3a4049; color: #fff; }
.fm-src pre { margin: 0; overflow-x: auto; font: 13px/1.6 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: #e8eaed; white-space: pre; }
.fm-slide { flex: 1; background: #fff; color: #1d1f23; border-radius: 6px; padding: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; line-height: 1.4; }
.fm-slide b { font-size: 17px; letter-spacing: -.01em; margin-bottom: 4px; }
.fm-slide em { margin-top: auto; font-style: normal; color: var(--muted); font-size: 12.5px; }
.fm-slide.share { background: #2a2f36; color: #e8eaed; }
.fm-out { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 30%; background: #fff; border-radius: 6px; overflow: hidden; box-shadow: 0 0 0 1px rgba(16, 24, 40, .06), 0 2px 10px -2px rgba(16, 24, 40, .1); }
.fm-page { padding: 22px 22px 26px; font-family: Georgia, "Iowan Old Style", "Times New Roman", serif; font-size: 15px; line-height: 1.6; color: #1d1f23; }
.fm-page h5 { font-family: var(--font); font-size: 19px; letter-spacing: -.02em; margin: 0 0 10px; }
.fm-page p { margin: 0 0 10px; }
.fm-page ul { margin: 0; padding-left: 20px; }
.fm-page math { font-size: 1.15em; margin: 12px 0 14px; }
.fm-page.slide { font-family: var(--font); }
.fm-page.slide p { font-size: 16px; }
.fm-page .caret { border-right: 2px solid var(--accent); padding-right: 1px; animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { border-color: transparent; } }
.fm-page mark, .mini mark { background: rgba(255, 225, 77, .55); color: inherit; border-radius: 2px; padding: 0 1px; }
.fm-page mark.g, .mini mark.g { background: rgba(127, 224, 143, .5); }
.fm-page mark.p { background: rgba(255, 158, 194, .5); }
.fm-margin {
  background-color: var(--paper); padding: 26px 12px; box-shadow: inset 1px 0 0 rgba(16, 24, 40, .06);
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%278%27%20height%3D%2726%27%3E%3Crect%20y%3D%2725%27%20width%3D%278%27%20height%3D%271%27%20fill%3D%27%232f6fde%27%20fill-opacity%3D%270.18%27%2F%3E%3C%2Fsvg%3E");
}
.fm-margin .hand { font-size: 23px; margin-top: 40px; }
.fm-margin .red { color: #c42f2f; }

/* ───── libreria ───── */
.lib { margin-top: var(--sec); background: var(--field); padding: clamp(72px, 8vw, 128px) var(--m) var(--m); }
.lib-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px 48px; align-items: end; margin-bottom: 48px; }
.lib-head p { font-size: var(--t-lead); max-width: 32em; }
.try { border: 0; background: rgba(255, 225, 77, .7); padding: 0 4px; border-radius: 3px; font-weight: 600; transition: background-color .15s ease; }
.try:hover { background: var(--hl); }
.win {
  position: relative; min-height: 760px; border-radius: var(--r); overflow: hidden;
  display: grid; grid-template-columns: 250px minmax(0, 1fr); padding: 10px 10px 10px 0; font-size: 15px;
  background: var(--ground);
}
.sidebar { padding: 12px 10px 4px 12px; display: flex; flex-direction: column; min-height: 0; }
.sb-logo { height: 32px; width: auto; margin: 4px 0 20px 10px; align-self: flex-start; }
.sb-group { display: grid; gap: 2px; margin-bottom: 16px; }
.nav-item { display: flex; align-items: center; gap: 11px; width: 100%; height: 38px; padding: 0 10px; border: 0; border-radius: 11px; background: transparent; text-align: left; font-size: 15px; color: var(--ink); transition: background .15s, box-shadow .15s; }
.nav-item > svg { width: 19px; height: 19px; color: var(--muted); flex: none; }
.nav-item span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item em { font-style: normal; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.nav-item:hover { background: rgba(255, 255, 255, .6); }
.nav-item.on { background: #fff; box-shadow: var(--raise); }
svg.star { color: #f5a623 !important; fill: #f5a623 !important; stroke: #f5a623 !important; }
.sb-label { font-size: 13px; color: var(--muted); margin: 4px 10px 6px; }
.nav-item .cat-ic { flex: none; }
.cat-ic { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; flex: none; background: var(--c); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 1px 2px rgba(16, 24, 40, .18); }
.cat-ic svg { width: 14px; height: 14px; color: #fff; stroke-width: 2 !important; }
.sb-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 14px; background: #fff; box-shadow: var(--raise); }
.avatar { width: 32px; height: 32px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 14px; flex: none; background: #45525f; }
.who { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.who b { font-weight: 600; font-size: 14px; }
.who small { font-size: 12.5px; color: var(--muted); }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: #34a853; flex: none; margin-right: 4px; box-shadow: 0 0 0 3px rgba(52, 168, 83, .15); display: inline-block; }
.sync-dot.busy { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.wmain { background: #fff; border-radius: 20px; box-shadow: var(--raise-lg); display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.main-head { display: flex; align-items: center; gap: 10px; height: 64px; padding: 0 18px 0 30px; flex: none; }
.main-head h3 { font-size: 19px; font-weight: 600; margin: 0; letter-spacing: -.01em; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-app { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 11px; font-weight: 500; font-size: 15px; white-space: nowrap; }
.btn-app svg { width: 18px; height: 18px; }
.btn-app.primary { color: #fff; background: #3370e2; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 0 0 1px #2256bb, 0 1px 2px rgba(34, 86, 187, .35), 0 6px 14px -4px rgba(47, 111, 222, .45); }
.view-seg button { width: 42px; height: 32px; padding: 0; display: grid; place-items: center; }
.view-seg svg { width: 18px; height: 18px; }
.main-scroll { flex: 1; padding: 2px 30px 32px; }
.greeting { margin: 0 0 12px; color: var(--ink-2); font-size: 15.5px; }
.search { position: relative; display: block; margin-bottom: 26px; }
.search input {
  width: 100%; height: 54px; padding: 0 52px 0 20px; border-radius: 15px; border: 0; background: #fff; font: inherit; font-size: 18px; outline: none; -webkit-appearance: none; appearance: none;
  box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgba(16, 24, 40, .07), 0 2px 4px rgba(16, 24, 40, .04), 0 10px 24px -10px rgba(16, 24, 40, .12);
  transition: box-shadow .15s;
}
.search input::placeholder { color: #6e747c; }
.search input:focus { box-shadow: 0 0 0 1px rgba(47, 111, 222, .55), 0 0 0 5px var(--accent-soft), 0 10px 24px -10px rgba(16, 24, 40, .12); }
.search svg { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); width: 21px; height: 21px; color: var(--muted); pointer-events: none; }
.section { margin-bottom: 30px; }
.sec-head { display: flex; align-items: center; gap: 12px; height: 44px; border-bottom: 1px solid var(--line-ui); margin-bottom: 16px; }
.sec-ring { width: 20px; height: 20px; border-radius: 50%; border: 2.2px solid var(--c); flex: none; }
.sec-head h4 { font-size: 16.5px; font-weight: 500; margin: 0; }
.sec-head h4 small { color: var(--muted); font-weight: 400; font-size: 14px; margin-left: 6px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.card {
  position: relative; height: 250px; display: flex; flex-direction: column; background: #fff; border-radius: 13px; border: 0; overflow: hidden; text-align: left; padding: 0; width: 100%;
  box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgba(16, 24, 40, .07), 0 1px 2px rgba(16, 24, 40, .05), 0 6px 16px -8px rgba(16, 24, 40, .12);
  transition: transform .18s ease, box-shadow .18s ease;
}
.card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--c, #c7ccd3); z-index: 1; }
button.card:hover { transform: translateY(-3px); box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgba(16, 24, 40, .08), 0 4px 8px rgba(16, 24, 40, .05), 0 18px 34px -14px rgba(16, 24, 40, .22); }
button.card:active { transform: scale(.99); }
.card-body { flex: 1; min-height: 0; padding: 22px 20px 0; position: relative; overflow: hidden; }
.card-body::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 48px; background: linear-gradient(rgba(255, 255, 255, 0), #fff); } /* taste-skill-ignore: dissolvenza dell'anteprima, come nell'app */
.card h4, .card h5 { margin: 0 0 10px; font-size: 16.5px; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; display: flex; gap: 8px; align-items: flex-start; color: var(--ink); }
.card h4 svg.star, .card h5 svg.star { width: 16px; height: 16px; flex: none; margin-top: 3px; }
.pv { font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.pv p { margin: 0 0 9px; }
.pv mark { background: rgba(255, 225, 77, .6); color: inherit; border-radius: 2px; padding: 0 1px; }
.pv-note { font-family: var(--hand); font-size: 19px; color: var(--pen); line-height: 1.1; }
.pv .hit { display: block; padding: 6px 8px; border-radius: 8px; background: #fbf7df; color: var(--ink); margin-bottom: 8px; font-size: 12.5px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; height: 46px; padding: 0 16px 0 20px; color: var(--muted); font-size: 13.5px; flex: none; background: #f9f9f8; box-shadow: inset 0 1px 0 rgba(16, 24, 40, .05); }
.card-foot .kind { display: inline-flex; align-items: center; gap: 6px; }
.card-foot .kind svg { width: 15px; height: 15px; }
.rows { display: grid; gap: 2px; }
.row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto 90px; align-items: center; gap: 12px; height: 50px; padding: 0 12px; border-radius: 11px; border: 0; background: transparent; text-align: left; width: 100%; font-size: 15px; transition: background .15s, box-shadow .15s; }
.row:hover { background: #fff; box-shadow: var(--raise); }
.row > svg { width: 19px; height: 19px; color: var(--muted); }
.row .r-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 8px; }
.row .r-name svg.star { width: 14px; height: 14px; flex: none; }
.row .r-cat { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--ink-2); }
.row .r-cat i { width: 9px; height: 9px; border-radius: 3px; background: var(--c); }
.row .r-when { font-size: 13.5px; color: var(--muted); text-align: right; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 18px; margin-bottom: 6px; }
.toast {
  position: absolute; left: 50%; bottom: 26px; transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  background: #1d2127; color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 14.5px; white-space: nowrap;
  transition: opacity .25s ease, transform .3s var(--ease-out);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ───── come funziona ───── */
.flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field { position: relative; min-height: 84svh; padding: 28px clamp(16px, 1.8vw, 28px); display: flex; flex-direction: column; }
.field.f1 { background: #e2e5e9; }
.field.f2 { background: #fff; }
.field.f3 { background: #c9d6ea; }
.field.f4 { background: var(--night); color: #fff; }
.flow h2 { font-size: var(--t-state); font-weight: 750; letter-spacing: -0.02em; position: absolute; top: 28px; left: clamp(16px, 1.8vw, 28px); right: 16px; line-height: 1.1; }
.mini-wrap { position: absolute; top: 44%; left: 50%; transform: translate(-50%, -50%); display: grid; gap: 8px; justify-items: center; width: calc(100% - 32px); }
.mini {
  display: grid; grid-template-columns: 200px; height: 360px; overflow: hidden; color: #1d1f23; background: #fff; border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(16, 24, 40, .06), 0 2px 4px rgba(16, 24, 40, .06), 0 18px 34px -16px rgba(16, 24, 40, .3);
  transition: transform .25s var(--ease-out);
}
.mini.wide { grid-template-columns: 200px 110px; }
.field:hover .mini { transform: translateY(-6px); }
.mini-doc { padding: 20px 18px; font-family: Georgia, "Iowan Old Style", "Times New Roman", serif; font-size: 11px; line-height: 1.55; }
.mini-doc h4 { font-family: var(--font); font-size: 14px; letter-spacing: -.01em; margin: 0 0 8px; }
.mini-doc p { margin: 0 0 8px; }
.mini-margin {
  position: relative; background-color: var(--paper); box-shadow: inset 1px 0 0 rgba(16, 24, 40, .06);
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%278%27%20height%3D%2718%27%3E%3Crect%20y%3D%2717%27%20width%3D%278%27%20height%3D%271%27%20fill%3D%27%232f6fde%27%20fill-opacity%3D%270.18%27%2F%3E%3C%2Fsvg%3E");
}
.mini-margin .hand { position: absolute; left: 9px; font-size: 16px; line-height: 1; }
.mn1 { top: 52px; }
.mn2 { top: 128px; color: #1d8a4a !important; }
.mn3 { top: 196px; }
.mini-sync { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 11px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 600; box-shadow: var(--raise); }
.mini-sync .devs { font-weight: 400; color: var(--muted); margin-left: 4px; }
.clause { margin-top: auto; font-size: var(--t-state); line-height: 1.12; letter-spacing: -0.02em; font-weight: 600; max-width: 13em; }

/* ───── prezzo ───── */
.price { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 48px clamp(32px, 6vw, 120px); padding: var(--sec) var(--m) 0; align-items: center; }
.price-text { display: grid; gap: 24px; justify-items: start; grid-column: 1; grid-row: 1; align-self: end; }
.price-go { grid-column: 1; grid-row: 2; justify-self: start; align-self: start; }
.price-figs { grid-column: 2; grid-row: 1 / span 2; }
.price-text h2 { font-size: var(--t-h2); }
.price-text p { max-width: 26em; }
.price-figs { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: end; }
.pf { display: grid; gap: 16px; }
.figure-wrap { position: relative; width: fit-content; }
.figure { display: flex; align-items: flex-start; font-weight: 700; line-height: .85; letter-spacing: -0.06em; font-size: clamp(120px, 15vw, 250px); font-variant-numeric: tabular-nums; }
.figure .cur { font-size: .5em; margin: .02em 0 0 .06em; }
.figure.sm { font-size: clamp(64px, 7.5vw, 124px); }
.pf-label { font-size: var(--t-lead); color: var(--ink-2); line-height: 1.3; max-width: 12em; }
.price-ring { position: absolute; left: -14%; top: -20%; width: 110%; height: auto; overflow: visible; pointer-events: none; }
.price-note { position: absolute; left: 70%; top: -26%; font-size: clamp(28px, 2.4vw, 40px); transform: rotate(-6deg); white-space: nowrap; }

/* ───── domande ───── */
.faq { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 32px clamp(32px, 6vw, 120px); padding: var(--sec) var(--m) 0; align-items: start; }
.faq-side { position: sticky; top: 100px; display: grid; gap: 40px; }
.faq h2 { font-size: var(--t-state); letter-spacing: -0.025em; line-height: 1.1; }
.faq-list { display: grid; gap: 8px; }
.faq details { background: var(--sheet); border-radius: 16px; transition: background-color .25s ease, color .25s ease; }
.faq summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 76px; padding: 18px 24px; font-size: var(--t-lead); font-weight: 550; cursor: pointer; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary i { position: relative; width: 16px; height: 16px; flex: none; }
.faq summary i::before, .faq summary i::after { content: ""; position: absolute; left: 0; top: 6.5px; width: 16px; height: 3px; border-radius: 2px; background: currentColor; transition: transform .25s var(--ease-out); }
.faq summary i::after { transform: rotate(90deg); }
.faq details[open] { background: var(--accent); color: #fff; }
.faq details[open] summary i::after { transform: rotate(0); }
.faq details p { padding: 0 24px 26px; max-width: 52ch; font-size: var(--t-body); line-height: 1.55; }
.faq summary:hover { color: var(--accent-ink); }
.faq details[open] summary:hover { color: #fff; }

/* ───── chiusura ───── */
.cta {
  position: relative; display: block; margin-top: var(--sec); min-height: max(62svh, 33vw); padding: 28px var(--m) 0;
  background: var(--accent); color: #fff; text-decoration: none; overflow: hidden;
  transition: background-color .2s ease, color .2s ease;
}
.cta:hover, .cta:focus-visible { background: var(--hl); color: var(--ink); }
.cta-say { display: block; font-size: var(--t-lead); max-width: 30em; line-height: 1.4; }
.cta-arrow { position: absolute; right: var(--m); top: 24px; width: 52px; height: 52px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; transition: transform .3s var(--ease-out); }
.cta:hover .cta-arrow { transform: translate(6px, -6px); }
.cta-word { position: absolute; left: calc(var(--m) - 0.03em); right: var(--m); bottom: 24px; font-size: clamp(110px, 41vw, 760px); font-weight: 800; letter-spacing: -0.06em; line-height: .76; white-space: nowrap; }

/* ───── piede ───── */
.foot { padding: 72px var(--m) 28px; }
.foot-mark { width: 100%; }
.foot-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 2fr)) minmax(0, 3fr); gap: 32px; margin-top: 56px; font-size: var(--t-small); }
.foot-cols nav { display: grid; gap: 8px; align-content: start; }
.foot-cols h3 { font-size: var(--t-small); font-weight: 650; margin-bottom: 4px; }
.foot-cols a { text-decoration: none; color: var(--ink-2); width: fit-content; transition: color .15s ease; }
.foot-cols a:hover { color: var(--accent-ink); }
.foot-by { display: grid; gap: 10px; align-content: start; color: var(--ink-2); }
.made-by { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); }
.made-by img { height: 13px; width: auto; }
.foot-last { display: flex; align-items: center; justify-content: space-between; margin-top: 64px; font-size: var(--t-small); color: var(--ink-2); }

/* ───── finestre più strette ───── */
@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; height: auto; max-height: none; }
  .hero-card { gap: 56px; }
  .hero-logo { width: min(340px, 60%); }
  .hero-stage { height: min(86svh, 780px); }
  .win { grid-template-columns: 210px minmax(0, 1fr); }
  .flow { grid-template-columns: 1fr 1fr; }
  .fm-body { grid-template-columns: 1fr; }
  .fm-list { position: static; display: flex; flex-wrap: wrap; gap: 6px; }
  .fm-list button { width: auto; }
  .fm-list button { flex-direction: column; gap: 2px; padding: 10px 14px; }
  .fm-name { font-size: clamp(24px, 3.4vw, 34px); }
}
@media (max-width: 900px) {
  .nav-links { display: none; }
  .story { grid-template-columns: 1fr; gap: 56px; }
  .story > * { grid-column: 1 / -1 !important; }
  .chapter, .chapter.flip { grid-template-columns: 1fr; gap: 20px; }
  .chapter figure, .chapter .ch-text, .chapter.flip figure, .chapter.flip .ch-text { grid-column: 1 / -1; grid-row: auto; }
  .fm-head { grid-template-columns: 1fr; }
  .fm-demo { grid-template-columns: 1fr; min-height: 0; }
  .mscene-pin { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); gap: 20px; padding-top: 84px; }
  .mscene-text { gap: 14px; padding: 0; }
  .mscene-text .lead { font-size: 16px; }
  .pop { display: none; }
  .lib-head { grid-template-columns: 1fr; }
  .win { grid-template-columns: 1fr; padding: 6px; }
  .sidebar { display: none; }
  .price, .faq { grid-template-columns: 1fr; }
  .price-text, .faq-side { position: static; }
  .faq-side figure { display: none; }
  .price-figs { grid-template-columns: 1fr 1fr; grid-column: 1; grid-row: 2; }
  .price-go { grid-row: 3; }
  .pf-main { grid-column: 1 / -1; }
  .foot-cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  :root { --t-body: 17px; --r: 16px; }
  .hero { padding: 0 12px 12px; }
  .hero-card { min-height: auto; padding: 28px 20px; gap: 36px; }
  .hero h1 { font-size: clamp(38px, 10.4vw, 56px); }
  .lead { font-size: 18px; }
  .hero-copy { gap: 26px; }
  .hero-stage { height: 76svh; min-height: 520px; }
  .ed-title { display: none; }
  .hide-sm { display: none; }
  .ed-bar { grid-template-columns: auto 1fr auto; margin: 6px 6px 0; }
  .ed-bar .tools { justify-self: center; }
  .tool { width: 42px; }
  .optbar { max-width: calc(100% - 12px); overflow-x: auto; scrollbar-width: none; }
  .optbar .hint { display: none; }
  .ed-hint { white-space: normal; width: calc(100% - 32px); text-align: center; }
  .ch-text p { font-size: 18px; }
  .fm-src pre { font-size: 12px; }
  .fm-out { grid-template-columns: minmax(0, 1fr) 34%; }
  .fm-margin .hand { font-size: 19px; }
  .lib { padding: 72px 16px 16px; }
  .lib-head { margin-bottom: 28px; }
  .main-head { padding: 0 12px 0 16px; }
  .main-head .btn-app span { display: none; }
  .main-scroll { padding: 2px 14px 32px; }
  .cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card { height: 230px; }
  .card-body { padding: 18px 14px 0; }
  .card-foot { padding: 0 12px 0 14px; }
  .row { grid-template-columns: 20px minmax(0, 1fr) 70px; }
  .row .r-cat { display: none; }
  .flow { grid-template-columns: 1fr; }
  .field { min-height: 64svh; padding: 24px 20px; }
  .flow h2 { position: static; margin-bottom: 10px; font-size: 24px; }
  .clause { margin-top: 0; font-size: 24px; order: -1; }
  .flow h2 { order: -2; }
  .mini-wrap { position: relative; top: auto; left: auto; transform: none; margin-top: 28px; width: auto; justify-items: start; }
  .figure { font-size: 40vw; }
  .figure.sm { font-size: 22vw; }
  .price-note { left: 62%; top: -18%; font-size: 26px; }
  .price-go { width: 100%; }
  .faq summary { font-size: 18px; min-height: 64px; padding: 16px 20px; }
  .faq details p { font-size: 16px; padding: 0 20px 22px; }
  .cta { min-height: 46svh; }
  .cta-say { font-size: 17px; padding-right: 48px; }
  .cta-arrow { width: 34px; height: 34px; }
  .cta-word { font-size: 41vw; }
  .foot-last { gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
