/* Trama Contractor — palette e font dal sito originale */
:root {
  --bg: #F1E5CF;
  --surface: #F7EDD9;
  --ink: #2F2D2B;
  --ink-soft: #5C5852;
  --line: #E2D2B6;
  --silver: #A3A09A;
  --clay: #a77b5e;
  --font-display: "Questrial", "Century Gothic", "Futura", sans-serif;
  --font-body: "Manrope", "Segoe UI", system-ui, sans-serif;
  --wrap: 1120px;
  --hh: 68px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.55 var(--font-body); }
a { color: inherit; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }
.eyebrow { font: 600 12px/1 var(--font-body); letter-spacing: .18em; text-transform: uppercase; color: var(--clay); margin: 0 0 18px; }
.h2 { font: 400 clamp(34px, 4.6vw, 58px)/1.05 var(--font-display); letter-spacing: -.01em; margin: 0 0 22px; }
.intro { max-width: 560px; color: var(--ink-soft); font-size: 18px; margin: 0 0 48px; }
.btn { display: inline-flex; gap: 10px; align-items: center; background: var(--ink); color: #F7EEDB; text-decoration: none;
  font: 600 15px/1 var(--font-body); padding: 16px 22px; border: 0; border-radius: 2px; cursor: pointer; transition: transform .2s, background .2s; }
.btn:hover { background: #000; transform: translateY(-1px); }
.btn--sm { padding: 10px 14px; font-size: 13px; }

/* ---------- header */
.hdr { position: fixed; inset: 0 0 auto; height: var(--hh); z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: 0 max(28px, calc((100vw - var(--wrap)) / 2 + 28px)); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent; transition: border-color .3s; }
.hdr.is-scrolled { border-color: var(--line); }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.mark { width: 32px; height: 32px; }
.wm { display: flex; flex-direction: column; line-height: 1; }
.wm b { font: 400 23px/1 var(--font-display); letter-spacing: -.02em; }
.wm i { font: 600 7.5px/1 var(--font-body); letter-spacing: .42em; font-style: normal; margin-top: 3px; }
.nav { display: flex; gap: 28px; align-items: center; font: 500 14px/1 var(--font-body); }
.nav a:not(.btn) { text-decoration: none; color: var(--ink-soft); }
.nav a:not(.btn):hover { color: var(--ink); }

/* ---------- hero: sezione lunga, scena sticky */
.house-sketch {
  --hs-paper: #F1E5CF; --hs-ink: #2F2D2B; --hs-graphite: #8f877b; --hs-accent: #a77b5e;
  --hs-pad-l: .32; --hs-pad-r: .04; --hs-pad-t: .08; --hs-pad-b: .22;
  position: relative; height: 640vh;
}
.house-sketch__stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.house-sketch__stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .4 0 0 0 0 .33 0 0 0 .1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.house-sketch canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.house-sketch.is-static { height: auto; }
.house-sketch.is-static .house-sketch__stage { position: relative; }

.hero__copy { position: absolute; z-index: 2; left: max(28px, calc((100vw - var(--wrap)) / 2 + 28px)); top: calc(var(--hh) + 6vh);
  width: min(30vw, 400px); height: calc(80vh - var(--hh) - 6vh); }
.hero__copy [data-show] { position: absolute; inset: 0 auto auto 0; width: 100%; opacity: 0; transform: translateY(14px);
  transition: opacity .45s ease, transform .45s ease; pointer-events: none; }
.hero__copy [data-show].on { opacity: 1; transform: none; pointer-events: auto; }
.hero h1 { font: 400 clamp(44px, 5.6vw, 82px)/.98 var(--font-display); letter-spacing: -.02em; margin: 0 0 22px; }
.lead { font-size: clamp(17px, 1.4vw, 19px); color: var(--ink-soft); margin: 0 0 34px; max-width: 340px; }
.scrollhint { display: flex; align-items: center; gap: 12px; font: 600 12px/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.scrollhint span { width: 1px; height: 38px; background: var(--ink); transform-origin: top; animation: drip 1.8s ease-in-out infinite; }
@keyframes drip { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }
.hero__phases { list-style: none; margin: 0; padding: 0; }
.hero__phases .n { display: block; font: 400 15px/1 var(--font-display); color: var(--clay); margin-bottom: 14px; letter-spacing: .08em; }
.hero__phases h2 { font: 400 clamp(36px, 4.2vw, 60px)/1 var(--font-display); letter-spacing: -.015em; margin: 0 0 16px; }
.hero__phases p { font-size: clamp(16px, 1.3vw, 18px); color: var(--ink-soft); margin: 0; max-width: 330px; }
.hero__outro h2 { font: 400 clamp(36px, 4.2vw, 60px)/1.02 var(--font-display); margin: 0 0 28px; letter-spacing: -.015em; }

/* cronoprogramma */
.gantt { position: absolute; z-index: 2; left: max(28px, calc((100vw - var(--wrap)) / 2 + 28px)); right: max(28px, calc((100vw - var(--wrap)) / 2 + 28px)); bottom: 4vh;
  height: 15vh; min-height: 118px; font: 500 12px/1 var(--font-body); color: var(--ink-soft); }
.gantt::before { content: "Cronoprogramma"; position: absolute; top: -26px; left: 0; font: 600 10.5px/1 var(--font-body); letter-spacing: .16em; text-transform: uppercase; color: var(--clay); }
.gantt__rows { position: absolute; inset: 0 0 16px 0; display: flex; flex-direction: column; justify-content: space-between; }
.gantt .row { position: relative; display: flex; align-items: center; height: 11px; }
.gantt .row span { color: #6f6a62; width: 150px; flex: none; letter-spacing: .02em; white-space: nowrap; transition: color .3s; }
.gantt .row::before { content: ""; position: absolute; left: 150px; right: 0; top: 50%; border-top: 1px dashed var(--line); }
.gantt .row i { position: absolute; top: 2px; height: 7px; left: calc(150px + (100% - 150px) * var(--a)); width: calc((100% - 150px) * (var(--b) - var(--a)));
  border: 1px solid var(--ink); border-radius: 1px; background: linear-gradient(90deg, var(--ink) var(--fill, 0%), transparent var(--fill, 0%)); }
.gantt .row.live span { color: var(--ink); }
.gantt .row.done i { background: var(--ink); }
.gantt__head { position: absolute; top: -6px; bottom: 10px; left: calc(150px + (100% - 150px) * var(--p, 0)); width: 1px; background: var(--clay); }
.gantt__head b { position: absolute; top: -4px; left: -3px; width: 7px; height: 7px; border-radius: 50%; background: var(--clay); }
.gantt__weeks { position: absolute; left: 150px; right: 0; bottom: 0; height: 6px;
  background: repeating-linear-gradient(90deg, var(--ink-soft) 0 1px, transparent 1px calc(100% / 24)); opacity: .55; }

/* ---------- sezioni */
.sec { padding: clamp(80px, 12vw, 150px) 0; }
.who { background: var(--surface); border-top: 1px solid var(--line); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.card { background: var(--bg); border: 1px solid var(--line); padding: 36px; }
.tag { font: 600 12px/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--clay); margin: 0 0 18px; }
.card h3 { font: 400 28px/1.15 var(--font-display); margin: 0 0 22px; }
.ticks { list-style: none; padding: 0; margin: 0; }
.ticks li { position: relative; padding: 12px 0 12px 28px; border-top: 1px solid var(--line); color: var(--ink-soft); }
.ticks li::before { content: ""; position: absolute; left: 2px; top: 19px; width: 10px; height: 5px; border-left: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); transform: rotate(-45deg); }

.steps { list-style: none; padding: 0; margin: 56px 0 0; display: grid; grid-template-columns: repeat(6, 1fr); border-top: 1px solid var(--ink); }
.steps li { padding: 22px 18px 0 0; position: relative; }
.steps li::before { content: ""; position: absolute; top: -4px; left: 0; width: 7px; height: 7px; background: var(--bg); border: 1px solid var(--ink); border-radius: 50%; }
.steps .n { font: 400 14px/1 var(--font-display); color: var(--clay); letter-spacing: .08em; }
.steps h3 { font: 400 21px/1.15 var(--font-display); margin: 14px 0 10px; }
.steps p { margin: 0; font-size: 15px; color: var(--ink-soft); }

.rules { background: var(--ink); color: #F7EEDB; padding: 70px 0; }
.rules__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.rule b { display: block; font: 400 clamp(54px, 6vw, 84px)/1 var(--font-display); margin-bottom: 10px; }
.rule span { color: #C9C5BD; font-size: 15px; }

.grid6 { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); margin-top: 28px; }
.w { padding: 34px 30px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.w svg { width: 44px; height: 44px; fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 18px;
  stroke-dasharray: 220; stroke-dashoffset: 220; transition: stroke-dashoffset 1.6s ease; }
.w.in svg { stroke-dashoffset: 0; }
.w h3 { font: 400 22px/1.2 var(--font-display); margin: 0 0 8px; }
.w p { margin: 0; color: var(--ink-soft); font-size: 15px; }

.docs { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.docs__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.folder { list-style: none; margin: 0; padding: 32px; background: var(--bg); border: 1px solid var(--line); box-shadow: 10px 10px 0 -1px var(--line); }
.folder li { display: flex; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px dashed var(--line); color: var(--ink-soft); transition: color .4s; }
.folder li:last-child { border: 0; }
.folder i { flex: none; width: 20px; height: 20px; border: 1.3px solid var(--ink); position: relative; }
.folder i::after { content: ""; position: absolute; left: 5px; top: 2px; width: 6px; height: 11px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink);
  transform: rotate(45deg) scale(0); transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); }
.folder li.ok { color: var(--ink); }
.folder li.ok i::after { transform: rotate(45deg) scale(1); }

.faq__grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 60px; }
.acc details { border-top: 1px solid var(--line); }
.acc details:last-child { border-bottom: 1px solid var(--line); }
.acc summary { list-style: none; cursor: pointer; padding: 20px 40px 20px 0; position: relative; font: 400 20px/1.3 var(--font-display); }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: "+"; position: absolute; right: 4px; top: 16px; font: 300 26px/1 var(--font-body); transition: transform .3s; }
.acc details[open] summary::after { transform: rotate(45deg); }
.acc p { margin: 0 0 22px; color: var(--ink-soft); max-width: 560px; }

.contact { background: var(--ink); color: #F7EEDB; }
.contact .intro, .contact dt { color: #C9C5BD; }
.contact__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; }
.ref { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.ref dt { font: 600 11px/1 var(--font-body); letter-spacing: .16em; text-transform: uppercase; margin-bottom: 8px; }
.ref dd { margin: 0; font: 400 19px/1.3 var(--font-display); }
.ref a { text-decoration: none; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; align-content: start; }
.form label { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 8px; }
.form label.half { grid-column: auto; }
.form span { font: 600 11px/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: #C9C5BD; }
.form input, .form select, .form textarea { font: 400 16px/1.4 var(--font-body); color: #F7EEDB; background: transparent; border: 0; border-bottom: 1px solid rgba(255,255,255,.3);
  padding: 8px 0; border-radius: 0; outline: none; }
.form select option { color: var(--ink); }
.form input:focus, .form select:focus, .form textarea:focus { border-color: #F7EEDB; }
.form .btn { grid-column: 1 / -1; justify-self: start; background: #F7EEDB; color: var(--ink); margin-top: 10px; }
.ftr { background: var(--ink); color: #A3A09A; font-size: 13px; padding: 24px 0 36px; border-top: 1px solid rgba(255,255,255,.12); }
.ftr .wrap { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
.steps li.reveal:nth-child(2) { transition-delay: .08s } .steps li.reveal:nth-child(3) { transition-delay: .16s }
.steps li.reveal:nth-child(4) { transition-delay: .24s } .steps li.reveal:nth-child(5) { transition-delay: .32s } .steps li.reveal:nth-child(6) { transition-delay: .4s }

/* ---------- tablet / mobile */
@media (max-width: 980px) {
  .steps { grid-template-columns: repeat(3, 1fr); row-gap: 36px; }
  .grid6 { grid-template-columns: 1fr 1fr; }
  .rules__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px), (orientation: portrait) and (max-width: 1024px) {
  .house-sketch { --hs-pad-l: 0; --hs-pad-t: .36; --hs-pad-b: .16; height: 560vh; }
  .hero__copy { left: 22px; right: 22px; width: auto; top: calc(var(--hh) + 2.5vh); height: 30vh; }
  .hero h1 { font-size: clamp(38px, 11vw, 60px); margin-bottom: 14px; }
  .lead { margin-bottom: 18px; font-size: 16px; }
  .scrollhint span { height: 26px; }
  .hero__phases .n { margin-bottom: 8px; }
  .hero__phases h2, .hero__outro h2 { font-size: clamp(32px, 9vw, 48px); margin-bottom: 10px; }
  .hero__outro h2 { margin-bottom: 18px; }
  .hero__phases p { font-size: 16px; }
  .gantt { left: 22px; right: 22px; bottom: 2.5vh; height: 11vh; min-height: 84px; font-size: 9.5px; }
  .gantt .row span { width: 104px; }
  .gantt .row::before, .gantt__weeks { left: 104px; }
  .gantt .row i { left: calc(104px + (100% - 104px) * var(--a)); width: calc((100% - 104px) * (var(--b) - var(--a))); height: 5px; top: 3px; }
  .gantt__head { left: calc(104px + (100% - 104px) * var(--p, 0)); }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav a:not(.btn) { display: none; }
  .hdr { padding: 0 18px; }
  .wrap { padding: 0 22px; }
  .cols, .docs__grid, .faq__grid, .contact__grid { grid-template-columns: 1fr; gap: 36px; }
  .card { padding: 26px; }
  .steps { grid-template-columns: 1fr; border-top: 0; border-left: 1px solid var(--ink); margin-left: 4px; row-gap: 28px; }
  .steps li { padding: 0 0 0 26px; }
  .steps li::before { top: 4px; left: -4px; }
  .grid6 { grid-template-columns: 1fr; }
  .ref { grid-template-columns: 1fr; }
  .contact__grid > * { min-width: 0; }
  .form { grid-template-columns: 1fr; }
  .form label.half { grid-column: 1 / -1; }
  .form input, .form select, .form textarea { width: 100%; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .w svg { stroke-dashoffset: 0; transition: none; }
  .house-sketch:not(.is-static) .hero__copy [data-show] { transition: none; }
}

/* ---------- selettore versioni (bozza) */
.vsw { position: fixed; z-index: 30; left: 50%; top: 15px; transform: translateX(-50%); display: flex; gap: 2px; padding: 3px; background: var(--ink); border-radius: 999px;
  font: 600 12px/1 var(--font-body); box-shadow: 0 6px 20px rgba(0,0,0,.15); }
.vsw a { color: #C9C5BD; text-decoration: none; padding: 9px 14px; border-radius: 999px; }
.vsw a[aria-current] { background: #F7EEDB; color: var(--ink); }

/* ---------- versione lana */
.wool .house-sketch { --hs-ink: #6b4532; --hs-graphite: #b39c87; --hs-accent: #b0603f; }
.wool .gantt .row i { border-radius: 4px; border-width: 1.5px; border-color: #6b4532;
  background: repeating-linear-gradient(115deg, #6b4532 0 3px, #8a5d45 3px 5px) 0 0 / var(--fill, 0%) 100% no-repeat; }
.wool .gantt .row.done i { background: repeating-linear-gradient(115deg, #6b4532 0 3px, #8a5d45 3px 5px); }
.wool .gantt .row::before { border-top: 1.5px dotted #c9b49c; }
.wool .gantt__head, .wool .gantt__head b { background: #b0603f; }
.wool .eyebrow, .wool .tag, .wool .hero__phases .n, .wool .steps .n { color: #b0603f; }
.wool .steps { border-top: 0; background: repeating-linear-gradient(115deg, #6b4532 0 3px, #8a5d45 3px 5px) top / 100% 2px no-repeat; }
.wool .w svg { stroke: #6b4532; stroke-width: 2.2; }
.wool .card, .wool .folder { border-style: dashed; border-color: #c9b49c; border-width: 1.5px; }
.wool .rules, .wool .contact, .wool .ftr { background: #3b2c24; }
@media (max-width: 760px) { .vsw { left: auto; right: 112px; transform: none; top: 17px; font-size: 10.5px; } .vsw a { padding: 7px 9px; } }
@media (max-width: 380px) { .wm i { letter-spacing: .3em; } .vsw { right: 104px; } .vsw a { padding: 7px 8px; } }
