:root {
  --bg: #f6f1e7; --bg-2: #efe7d8; --fg: #1d2520; --muted: #66695f; --card: #fffdf8;
  --line: #e0d6c4; --accent: #d9622b; --accent-fg: #ffffff; --ink: #1e3a2f; --ink-fg: #f6f1e7;
  --blue: #2f5d8a; --pencil: #4a4a46; --ok: #2f7d4f; --ko: #b3361f;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --hand: "Segoe Print", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", cursive;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #151816; --bg-2: #1c201d; --fg: #ece7df; --muted: #a39d92; --card: #1f2420;
    --line: #333a35; --accent: #f08a50; --accent-fg: #1a1714; --ink: #2c5444; --ink-fg: #f6f1e7;
    --blue: #7fb0e0; --pencil: #c9c4ba; --ok: #6cc28f; --ko: #f08070; }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { margin: 0; background: var(--bg); color: var(--fg);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px 64px; }
.home .wrap { max-width: 1120px; }

/* Testata */
header.top { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent);
  position: sticky; top: 0; z-index: 10; backdrop-filter: blur(8px); }
header.top .wrap { display: flex; gap: 20px; align-items: center; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
header.top .logo { font: 700 1.15rem var(--serif); color: var(--fg); text-decoration: none; margin-right: auto;
  display: inline-flex; align-items: center; gap: 10px; }
.logo-img { height: 40px; width: auto; display: block; }
header.top nav a { color: var(--muted); text-decoration: none; margin-left: 16px; }
header.top nav a:hover { color: var(--fg); }
header.top nav a.nav-cta { color: var(--fg); border: 1px solid var(--line); padding: 6px 14px; border-radius: 999px; }
header.top nav a.nav-cta:hover { border-color: var(--accent); }

/* Tipografia */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; }
h1 em, h2 em { color: var(--accent); }
h1 { font-size: 2.3rem; line-height: 1.15; margin: 40px 0 12px; }
h2 { font-size: 1.6rem; line-height: 1.2; margin: 40px 0 10px; }
h3 { font-size: 1.15rem; margin: 22px 0 6px; }
p.lead { font-size: 1.15rem; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.eyebrow, .sec-num { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 600; color: var(--muted); margin: 0; }
a { color: var(--accent); }

.btn { display: inline-block; background: var(--accent); color: var(--accent-fg); padding: 12px 22px;
  border-radius: 8px; text-decoration: none; font-weight: 600; border: 0; font-size: 1rem; cursor: pointer;
  transition: transform .15s, box-shadow .15s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px -8px var(--accent); }
.btn.secondary { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.btn.secondary:hover { box-shadow: none; border-color: var(--fg); }
.btn.light { background: var(--ink-fg); color: var(--ink); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 24px 0 10px; }

/* Hero */
.hero { background: radial-gradient(1200px 500px at 80% 0%, var(--bg-2), transparent 70%); }
.hero .wrap { padding-bottom: 24px; }
.hero-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); margin-top: 14px; }
@media (max-width: 820px) { .hero-grid { grid-template-columns: 1fr; gap: 8px; } }

.stage { margin: 32px 0; background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 12px 12px 0; box-shadow: 0 30px 60px -40px rgba(30, 40, 30, .45); }
.stage svg { display: block; width: 100%; height: auto; color: var(--line); }
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 10px 4px 14px; margin: 0;
  border-top: 1px dashed var(--line); counter-reset: s; }
.steps li { font-size: .82rem; color: var(--muted); position: relative; padding-top: 10px; counter-increment: s; transition: color .3s; }
.steps li::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; border-radius: 3px; background: var(--line); transition: background .4s; }
.steps li.done::before, .steps li.on::before { background: var(--accent); }
.steps li.on { color: var(--fg); font-weight: 600; }

/* Strati dell'animazione */
.paper, .bed, .sketch, .wire, .solid, .nozzle { transition: opacity .6s; }
.sketch path { fill: none; stroke: var(--pencil); stroke-width: 1.5; stroke-linecap: round; }
.sketch path.p2 { stroke-width: .8; opacity: .55; }
.sketch .dims path { stroke-width: 1; stroke-dasharray: 1; }
.hand text { font: 15px var(--hand); fill: var(--pencil); }
.wire path { fill: none; stroke: var(--blue); stroke-width: 1.6; stroke-linejoin: round; }
.draw path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .9s ease-out; }
.bed { fill: var(--bg-2); stroke: var(--line); }
.nozzle rect { fill: var(--ink); }
.nozzle path { fill: #8a8f8a; }
.stage .paper, .stage .bed, .stage .sketch, .stage .wire, .stage .solid, .stage .nozzle, .stage .hand { opacity: 0; }
.stage .lines { transition: opacity 1.2s; }
.stage.s0 .paper, .stage.s1 .paper { opacity: 1; }
.stage.s0 .sketch, .stage.s1 .sketch { opacity: 1; }
.stage.s1 .sketch { opacity: .35; }
.stage.s0 .hand, .stage.s1 .hand { opacity: 1; transition: opacity .6s 2s; }
.stage.s0 .sketch path, .stage.s1 .sketch path, .stage.s1 .wire path { stroke-dashoffset: 0; }
.stage.s1 .wire { opacity: 1; }
.stage.s2 .wire { opacity: .25; }
.stage.s2 .wire path { stroke-dashoffset: 0; transition: none; }
.stage.s2 .bed, .stage.s3 .bed, .stage.s2 .solid, .stage.s3 .solid, .stage.s2 .nozzle { opacity: 1; }
.stage.s3 .lines { opacity: .35; }
.stage.fade .solid, .stage.fade .bed { opacity: 0; }

/* Colori dei pezzi pieni */
.solid path { stroke: rgba(0, 0, 0, .25); stroke-width: .6; stroke-linejoin: round; }
.mat-petg { --t: #f2a06b; --r: #d9622b; --f: #b44a1a; --h: #4a210c; --side: url(#g-petg); }
.mat-pla  { --t: #6fa395; --r: #3f7466; --f: #2b5248; --h: #12221d; --side: url(#g-pla); }
.mat-tpu  { --t: #5c5c63; --r: #3a3a40; --f: #2a2a2e; --h: #0c0c0e; --side: url(#g-tpu); }
.s-top { fill: var(--t); } .s-right { fill: var(--r); } .s-front { fill: var(--f); }
.s-side { fill: var(--side); } .s-end { fill: var(--t); }
.s-rib { fill: none; stroke: rgba(0, 0, 0, .5) !important; stroke-width: 1.4 !important; } .s-hole { fill: var(--h); } .s-mark { fill: none; stroke: #f6f1e7 !important; stroke-width: 2.5 !important; stroke-linecap: round; }

/* Sezioni */
.sec { padding-top: 24px; padding-bottom: 24px; }
.sec h2 { margin-top: 6px; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 20px 0; }
.grid.four { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.card, article { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin: 12px 0; }
.grid .card { margin: 0; }
.card h3 { margin-top: 0; }
.card.step { position: relative; padding-top: 18px; }
.big-num { display: block; font: 600 2.6rem/1 var(--serif); color: var(--accent); margin-bottom: 10px; }
.card.who { border-top: 3px solid var(--ink); }
.swatch { display: block; width: 36px; height: 36px; border-radius: 50%; margin-bottom: 10px;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.55), transparent 45%), var(--c);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }

/* Esempi prima/dopo */
.card.ex { padding: 10px; }
.card.ex figcaption { padding: 8px 6px 2px; }
.card.ex figcaption p { margin: 0; color: var(--muted); font-size: .92rem; }
.ba { position: relative; border-radius: 8px; overflow: hidden; background: var(--bg); --pos: 50%; }
.ba svg { display: block; width: 100%; height: auto; color: var(--line); }
.ba .ex-solid { position: absolute; inset: 0; background: var(--bg-2); clip-path: inset(0 0 0 var(--pos)); }
.ba::after { content: ""; position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px;
  background: var(--accent); pointer-events: none; }
.ba input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.ba input:focus-visible + * , .ba:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

.cta-band { background: var(--ink); color: var(--ink-fg); border-radius: 18px; padding: 36px 28px; text-align: center; margin-top: 24px;
  background-image: linear-gradient(var(--ink), var(--ink)), repeating-linear-gradient(0deg, transparent 0 13px, rgba(255,255,255,.06) 13px 14px); }
.cta-band h2 { margin: 0 0 8px; color: var(--ink-fg); }
.cta-band p { opacity: .85; margin: 0 0 20px; }

/* Liste, tabelle, moduli (guida e ordine) */
.do, .dont { border-left: 4px solid var(--ok); }
.dont { border-left-color: var(--ko); }
ul.check { list-style: none; padding-left: 0; }
ul.check li::before { content: "✓ "; color: var(--ok); font-weight: 700; }
ul.cross { list-style: none; padding-left: 0; }
ul.cross li::before { content: "✗ "; color: var(--ko); font-weight: 700; }
table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: .95rem; }
th, td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; vertical-align: top; }
form label { display: block; font-weight: 600; margin: 18px 0 6px; }
form .hint { font-weight: 400; color: var(--muted); font-size: .9rem; }
input[type=text], input[type=email], input[type=tel], input[type=number], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--fg); font: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { min-height: 110px; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 8px 16px 16px; margin: 20px 0; background: var(--card); }
fieldset label.inline { font-weight: 400; display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; }
.error { color: var(--ko); font-weight: 600; }
.ok { color: var(--ok); font-weight: 600; }
footer { color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 48px; }
footer.site { margin-top: 24px; }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; padding-bottom: 28px; }
footer.site span:first-child { font-family: var(--serif); font-weight: 600; color: var(--fg); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
.swatch.cf { background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.35), transparent 45%),
  repeating-linear-gradient(45deg, rgba(255,255,255,.08) 0 2px, transparent 2px 4px), var(--c); }

/* Sezione con foto (inserti filettati) */
.feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 36px; align-items: center; margin-top: 12px; }
.feature img { width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--line); background: #fff; }
.feature h2 { margin-top: 0; }
@media (max-width: 720px) { .feature { grid-template-columns: 1fr; gap: 16px; } }
