/* =========================================================================
   Home
   ========================================================================= */

/* ---------- Apertura: il video che diventa la casa del logo ---------- */
.opening { position: relative; margin-top: calc(-1 * var(--hdr)); }
.opening__stage { position: relative; overflow: hidden; }
.opening__media { position: absolute; left: 0; right: 0; top: 0; height: 100vh; height: 100svh; background: var(--petrolio-scuro); overflow: hidden; }
.opening__media img, .opening__media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* l'immagine sotto è il primo fotogramma del video: il passaggio è quasi istantaneo e non si nota */
.opening__media video { opacity: 0; transition: opacity .25s linear; }
.opening__media video.is-playing { opacity: 1; }
.opening__scrim { position: absolute; inset: 0; background: rgba(30, 38, 41, 0.46); }
.opening__copy { position: relative; z-index: 2; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; padding-block: calc(var(--hdr) + 64px) clamp(56px, 9vh, 112px); color: var(--carta); }
.opening__copy h1 { color: var(--carta); }
.opening__copy .t-lead { color: #E3ECF0; margin-top: 28px; max-width: 30em; }
.opening__copy .actions { margin-top: 40px; }
.opening__brief { padding-block: var(--section); }
.opening__brief-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 96px); align-items: center; }
.opening__brief .manifesto { margin-top: 20px; font-size: clamp(32px, 3.5vw, 52px); line-height: 1.1; }
.opening__brief .t-lead { margin-top: 32px; }
.opening__brief .link { margin-top: 36px; }
.opening__figure { margin: 0; aspect-ratio: 543 / 474; clip-path: var(--house); background: var(--cielo); }
.opening__figure img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 860px) { .opening__brief-grid { grid-template-columns: minmax(0, 1fr); } .opening__figure { max-width: 520px; } }

/* Versione animata: attiva solo con JavaScript e movimento consentito */
.opening.is-live { height: 260vh; }
.opening.is-live .opening__stage { position: sticky; top: 0; height: 100vh; height: 100svh; min-height: 0; }
.opening.is-live .opening__media {
  inset: auto;
  left: var(--m-l, 0px); top: var(--m-t, 0px); width: var(--m-w, 100%); height: var(--m-h, 100%);
  clip-path: var(--m-clip, none);
  will-change: left, top, width, height, clip-path;
}
.opening.is-live .opening__scrim { opacity: var(--scrim, 1); }
.opening.is-live .opening__copy { position: absolute; left: 0; right: 0; bottom: 0; min-height: 0; opacity: var(--copy-o, 1); transform: translateY(var(--copy-y, 0px)); will-change: opacity, transform; }
.opening.is-live .opening__brief { position: absolute; inset: 0; display: flex; align-items: center; padding-block: calc(var(--hdr) + 24px) 32px; pointer-events: none; }
.opening.is-live .opening__brief > .wrap { opacity: var(--brief-o, 0); transform: translateY(var(--brief-y, 32px)); }
.opening.is-live.is-brief .opening__brief { pointer-events: auto; }
.opening.is-live .opening__brief-text { max-width: min(560px, 48vw); }
.opening.is-live .opening__figure { display: none; }
@media (max-width: 860px) {
  .opening.is-live { height: 240vh; }
  .opening.is-live .opening__brief { align-items: flex-end; padding-bottom: 40px; }
  .opening.is-live .opening__brief-text { max-width: none; }
  .opening.is-live .opening__brief .manifesto { font-size: clamp(28px, 7.4vw, 40px); }
  .opening.is-live .opening__brief .t-lead { font-size: 17px; margin-top: 18px; }
  .opening.is-live .opening__brief .link { margin-top: 20px; }
}
.scroll-cue { position: absolute; z-index: 2; right: var(--gutter); top: calc(100svh - clamp(56px, 9vh, 112px) - 56px); display: flex; align-items: center; gap: 12px; color: #E3ECF0; font-size: 15px; opacity: var(--copy-o, 1); }
.scroll-cue::after { content: ""; width: 1px; height: 56px; background: linear-gradient(var(--carta), transparent); animation: cue 2.4s var(--ease) infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 60% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }
@media (max-width: 680px) { .scroll-cue { display: none; } }

/* ---------- Perché: azzurro del logo, emblemi disegnati con la grammatica del logo ---------- */
.why { background: var(--cielo); position: relative; overflow: hidden; }
.why::before {
  /* la casa del logo, enorme e appena accennata, come filigrana */
  content: ""; position: absolute; right: -6%; bottom: -18%; width: min(62vw, 820px); aspect-ratio: 543 / 474;
  clip-path: var(--house); background: rgba(255, 255, 255, 0.28); pointer-events: none;
}
.why .t-kicker { color: var(--petrolio); }
.why__head { position: relative; display: grid; gap: 20px; max-width: 40rem; margin-bottom: clamp(48px, 6vw, 88px); }
.why__list { position: relative; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.why__item { display: grid; align-content: start; gap: 28px; padding: 8px clamp(24px, 3vw, 48px) 8px; border-left: 1px solid rgba(30, 38, 41, 0.18); }
.why__item:first-child { padding-left: 0; border-left: 0; }
.why__text { display: grid; gap: 14px; }
.why__item h3 { font-weight: 300; font-size: clamp(34px, 3.4vw, 50px); line-height: 1; letter-spacing: -0.01em; }
.why__item p { font-size: 18px; color: var(--inchiostro); max-width: 24em; }
.emblem { width: clamp(120px, 11vw, 164px); height: auto; overflow: visible; }
/* Stessa grammatica del logo: tetti a 45°, linee aperte senza base, casa piena bianca, aste verticali, accenti acciaio */
.emblem__fill { fill: var(--bianco); transition: opacity .7s var(--ease), transform 1s var(--ease); }
.emblem__line { fill: none; stroke: var(--inchiostro); stroke-width: 1.6; stroke-dasharray: 1; stroke-dashoffset: 0; transition: stroke-dashoffset 1.3s var(--ease) .15s; }
.emblem__accent { fill: none; stroke: var(--acciaio-scuro); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: opacity .7s var(--ease) .7s, transform .9s var(--ease) .7s; }
.emblem__accent .thin { stroke-width: 1.2; }
.emblem__accent .dot { fill: var(--acciaio-scuro); stroke: none; }
.emblem__accent .coin { fill: var(--cielo); }
.js .why__item:not(.is-in) .emblem__fill { opacity: 0; transform: translateY(10px); }
.js .why__item:not(.is-in) .emblem__line { stroke-dashoffset: 1; }
.js .why__item:not(.is-in) .emblem__accent { opacity: 0; }
.js .why__item:not(.is-in) .emblem__accent { transform: translateY(-6px); }
@media (max-width: 900px) {
  .why__list { grid-template-columns: minmax(0, 1fr); }
  .why__item, .why__item:first-child { grid-template-columns: 96px minmax(0, 1fr); gap: 20px; align-items: start; padding: 28px 0; border-left: 0; border-top: 1px solid rgba(30, 38, 41, 0.18); }
  .emblem { width: 96px; }
  .why__item h3 { font-size: 34px; }
  .why__item p { font-size: 17px; }
  .why::before { width: 90vw; right: -30%; bottom: -8%; }
}
@media (prefers-reduced-motion: reduce) { .emblem__fill, .emblem__line, .emblem__accent { transition: none; } }

/* ---------- Come lavoro: la storia 3D ---------- */
.method-intro { padding-block: var(--section) clamp(32px, 4vw, 56px); }
.story { position: relative; height: 900vh; }
.story__stage { position: sticky; top: var(--hdr); height: calc(100vh - var(--hdr)); height: calc(100svh - var(--hdr)); overflow: hidden; }
.story__grid { position: absolute; inset: 0; opacity: var(--grid-o, .5) !important; background-image: linear-gradient(var(--linea) 1px, transparent 1px), linear-gradient(90deg, var(--linea) 1px, transparent 1px); background-size: 24px 24px; opacity: .5; -webkit-mask-image: radial-gradient(ellipse at 66% 50%, #000 25%, transparent 72%); mask-image: radial-gradient(ellipse at 66% 50%, #000 25%, transparent 72%); }
.story__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.story__labels { position: absolute; inset: 0; pointer-events: none; }
.story__fallback { display: none; position: absolute; right: 4%; top: 50%; transform: translateY(-50%); width: 50%; }
.no-webgl .story__fallback { display: block; }
.no-webgl .story__canvas { display: none; }
/* senza grafica 3D: la pianta statica resta nei primi capitoli, poi tavola, foto piatta nel visore e persona */
.story__pano { position: absolute; inset: 0; display: none; opacity: 0; pointer-events: none; background-color: #1B2226; background-repeat: repeat-x; }
.no-webgl .story__pano { display: block; }
.no-webgl .story__stage.past-plan .story__fallback, .no-webgl .tag--layer { display: none; }
.tag { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); white-space: nowrap; font-size: 14px; font-weight: 500; color: var(--inchiostro); text-align: center; line-height: 1.25; }
.tag small { display: block; font-family: var(--mono); font-size: 12px; font-weight: 400; color: var(--grafite); }
.tag--quota { font-family: var(--mono); font-size: 13px; font-weight: 400; color: var(--acciaio-scuro); background: var(--carta); padding: 2px 8px; }
.tag--layer { transform: translate(0, -50%); display: flex; align-items: center; gap: 12px; text-align: left; }
.tag--layer::before { content: ""; width: 44px; height: 1px; background: var(--inchiostro); }
.tag--point { font-family: var(--mono); font-size: 12px; font-weight: 400; color: var(--acciaio-scuro); }
.story__copy { position: absolute; left: var(--gutter); top: 50%; transform: translateY(-50%); width: min(500px, 36vw); height: 70%; }
.chapter { position: absolute; left: 0; right: 0; top: 50%; display: grid; gap: 22px; opacity: 0; visibility: hidden; transform: translateY(calc(-50% + 28px)); transition: opacity .55s var(--ease), transform .8s var(--ease), visibility 0s linear .55s; }
.chapter.is-active { opacity: 1; visibility: visible; transform: translateY(-50%); transition: opacity .7s var(--ease) .12s, transform .9s var(--ease) .12s, visibility 0s; }
.chapter.is-past { transform: translateY(calc(-50% - 28px)); }
.chapter__n { font-family: var(--mono); font-size: 14px; color: var(--acciaio-scuro); }
.chapter h3 { font-weight: 300; font-size: clamp(32px, 3.4vw, 50px); line-height: 1.06; letter-spacing: -0.01em; }
.chapter p { font-size: 18px; color: var(--testo); }
.chapter .t-small { font-size: 14px; }
.story__nav { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 24px; }
.story__rail { position: relative; margin: 0; padding: 14px 0 0; list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; border-top: 1px solid var(--linea); font-size: 14px; color: var(--grafite); }
.story__rail li { position: relative; transition: color .3s; }
.story__rail li::before { content: ""; position: absolute; left: 0; top: -19px; width: 9px; height: 9px; border-radius: 50%; background: var(--carta); box-shadow: inset 0 0 0 1.5px var(--grafite); transition: background .3s, box-shadow .3s; }
.story__rail li.is-active { color: var(--inchiostro); }
.story__rail li.is-active::before { background: var(--petrolio); box-shadow: inset 0 0 0 1.5px var(--petrolio); }
.story__rail button { display: block; width: 100%; margin: -6px 0; padding: 6px 0; font: inherit; color: inherit; text-align: left; background: none; border: 0; cursor: pointer; }
.story__rail button:hover { color: var(--petrolio); }
.story__rail button[aria-current] { font-weight: 500; }
.story__rail-fill { position: absolute; left: 0; top: -1px; height: 2px; width: 100%; background: var(--petrolio); transform-origin: left; transform: scaleX(0); pointer-events: none; }
@media (max-width: 860px) {
  .story { height: 840vh; }
  .story__copy { top: auto; bottom: 64px; transform: none; width: auto; right: var(--gutter); height: 44%; }
  .chapter { top: auto; bottom: 0; transform: translateY(24px); gap: 12px; }
  .chapter.is-active { transform: none; }
  .chapter.is-past { transform: translateY(-24px); }
  .chapter h3 { font-size: 30px; }
  .chapter p { font-size: 16px; }
  .story__grid { -webkit-mask-image: radial-gradient(ellipse at 50% 28%, #000 25%, transparent 70%); mask-image: radial-gradient(ellipse at 50% 28%, #000 25%, transparent 70%); }
  .story__nav { bottom: 12px; }
  .story__rail { font-size: 11px; padding-top: 10px; gap: 4px; }
  .story__rail li::before { top: -14.5px; width: 8px; height: 8px; }
  .tag { font-size: 11px; }
  .tag small { display: none; }
  .tag--layer::before { width: 18px; }
  .story__fallback { width: 92%; top: 6%; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .story { height: auto; }
  .story__stage { position: relative; top: 0; height: auto; overflow: visible; padding-bottom: 48px; }
  .story__canvas { position: relative; height: 64vh; }
  .story__labels { height: 64vh; }
  .story__copy { position: relative; left: 0; top: 0; transform: none; width: auto; height: auto; display: grid; gap: 40px; padding-inline: var(--gutter); max-width: var(--max); margin-inline: auto; }
  .chapter, .chapter.is-active, .chapter.is-past { position: relative; top: 0; bottom: auto; opacity: 1; visibility: visible; transform: none; }
  .story__nav { display: none; }
}


/* Visore: la sagoma attraverso cui si visita la casa */
.story__canvas { touch-action: pan-y; }
.story__visor {
  position: absolute; z-index: 2; pointer-events: none;
  left: var(--v-l, 40%); top: var(--v-t, 10%); width: var(--v-w, 56%); height: var(--v-h, 76%);
  border-radius: 34% 34% 42% 42% / 30% 30% 58% 58%;
  box-shadow: 0 0 0 200vmax rgba(24, 31, 34, 0.94), inset 0 0 70px rgba(10, 14, 16, 0.45);
  opacity: var(--visor-o, 0); visibility: hidden;
}
.story__visor::after { content: ""; position: absolute; left: 50%; bottom: -1px; width: 11%; height: 9%; transform: translateX(-50%); background: rgba(24, 31, 34, 0.94); clip-path: polygon(50% 0, 100% 100%, 0 100%); border-radius: 50% 50% 0 0; }
.is-visor .story__visor { visibility: visible; }
.visor__room { position: absolute; left: 50%; top: 9%; transform: translateX(-50%); font-size: 14px; color: var(--carta); background: rgba(24, 31, 34, 0.55); padding: 6px 14px; border-radius: 999px; white-space: nowrap; }
.visor__hint { position: absolute; left: 50%; bottom: 20%; transform: translateX(-50%); font-size: 13px; color: var(--carta); background: rgba(24, 31, 34, 0.55); padding: 6px 14px; border-radius: 999px; white-space: nowrap; transition: opacity .4s; }
.story__copy { z-index: 3; }
.story__nav { z-index: 3; }
.story__labels { z-index: 2; }
.is-dark .chapter h3, .is-dark .chapter p { color: var(--carta); }
.chapter h3, .chapter p, .chapter__n, .story__rail { transition: color .5s var(--ease); }
.is-dark .chapter .chapter__n { color: var(--cielo); }
.is-dark .story__rail { border-color: rgba(242, 246, 248, .2); color: #93A4AB; }
.is-dark .story__rail li.is-active { color: var(--carta); }
.is-dark .story__rail li::before { background: #131A21; box-shadow: inset 0 0 0 1.5px #93A4AB; }
.is-dark .story__rail li.is-active::before { background: var(--cielo); box-shadow: inset 0 0 0 1.5px var(--cielo); }
.is-dark .story__rail button:hover { color: var(--carta); }
.is-dark .story__rail-fill { background: var(--cielo); }
.is-visor .story__canvas { cursor: grab; }
.is-visor .story__canvas:active { cursor: grabbing; }
@media (max-width: 860px) {
  .story__visor { border-radius: 30% 30% 40% 40% / 24% 24% 50% 50%; }
  .visor__room { font-size: 12px; }
  .visor__hint { font-size: 12px; bottom: 18%; }
}
@media (prefers-reduced-motion: reduce) { .story__visor { display: none; } }


/* Tavola di progetto: dallo schizzo al rendering fotorealistico */
.story__board {
  position: absolute; z-index: 1; margin: 0; pointer-events: none;
  left: var(--b-l, 40%); top: var(--b-t, 8%); width: var(--b-w, 56%); height: var(--b-h, 80%);
  display: grid; place-items: center;
  opacity: var(--board-o, 0); visibility: hidden;
}
.has-board .story__board { visibility: visible; }
.board__frame {
  position: relative; width: 100%; max-height: 100%; aspect-ratio: 1 / 1;
  transform: scale(var(--zoom, 1)); transform-origin: var(--zx, 63%) var(--zy, 36%);
  will-change: transform;
}
@supports (aspect-ratio: 1) { .board__frame { width: min(100%, var(--b-h-px, 600px)); } }
.board__frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.board__photo { clip-path: polygon(0 0, calc(var(--reveal, 0) * 130%) 0, calc(var(--reveal, 0) * 130% - 30%) 100%, 0 100%); }
.board__blade {
  position: absolute; top: -8%; height: 116%; width: 3px; left: calc(var(--reveal, 0) * 130% - 15%);
  background: linear-gradient(transparent, var(--acciaio) 18%, #EAF4F8 50%, var(--acciaio) 82%, transparent);
  box-shadow: 0 0 24px 6px rgba(109, 163, 187, 0.45);
  transform: rotate(21.8deg); opacity: var(--blade-o, 0);
}
.board__pin {
  position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%);
  font-size: 13px; font-weight: 500; color: var(--inchiostro); background: rgba(255, 255, 255, 0.9);
  padding: 4px 10px 4px 22px; border-radius: 999px; white-space: nowrap; opacity: var(--pins-o, 0);
  box-shadow: 0 2px 10px rgba(30, 38, 41, 0.12);
}
.board__pin::before { content: ""; position: absolute; left: 9px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: var(--acciaio-scuro); }
.board__label { position: absolute; right: 0; bottom: 0; font-size: 13px; color: var(--cielo); padding: 4px 0; opacity: var(--pins-o, 0); }
@media (max-width: 860px) { .board__pin { font-size: 11px; padding: 3px 8px 3px 18px; } .board__pin::before { left: 7px; width: 6px; height: 6px; margin-top: -3px; } }
@media (prefers-reduced-motion: reduce) { .story__board { position: relative; left: 0; top: 0; width: 100%; height: auto; padding: 24px var(--gutter); } .board__label { color: var(--grafite); } .story__view { position: relative; } .story__person, .story__dark { display: none; } }

/* ---------- Servizi ---------- */
.services { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--linea-forte); border-left: 1px solid var(--linea-forte); }
.service { padding: clamp(28px, 3vw, 44px); border-right: 1px solid var(--linea-forte); border-bottom: 1px solid var(--linea-forte); display: grid; align-content: start; gap: 14px; background: var(--carta); transition: background-color .35s var(--ease); }
.service:hover { background: var(--bianco); }
.service svg { width: 100%; max-width: 240px; height: auto; margin-bottom: 18px; }
.service h3 { font-size: 24px; font-weight: 400; line-height: 1.2; }
.service p { font-size: 17px; color: var(--testo); }
.ill { fill: none; stroke: var(--inchiostro); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.ill .fill { fill: var(--cielo); stroke: none; }
.ill .accent { stroke: var(--acciaio-scuro); }
.ill .thin { stroke-width: 1; stroke: var(--grafite); }
@media (max-width: 980px) { .services { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .services { grid-template-columns: minmax(0, 1fr); } .service svg { max-width: 200px; } }

/* ---------- Confronto: una casa a metà. A sinistra lo schizzo tratteggiato, a destra la parte costruita ---------- */
.casa { position: relative; margin-top: clamp(8px, 2vw, 24px); }
.casa::after { content: ""; display: block; height: 2px; margin: 0 -2.5%; background: var(--inchiostro); }
.casa__tetto { position: relative; aspect-ratio: 1000 / 200; }
.casa__tetto svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.casa__falda { fill: var(--petrolio); transform-box: fill-box; transform-origin: 50% 100%; transition: transform .8s var(--ease) .78s; }
.casa__falda--narrow { display: none; }
.casa__linea { fill: none; stroke: var(--petrolio); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; transition: opacity .5s var(--ease) 1.1s; }
.casa__linea--trad { stroke: rgba(30, 38, 41, 0.5); stroke-width: 1.5; stroke-dasharray: 7 7; transition: none; }
.casa__chi { position: absolute; bottom: clamp(14px, 1.8vw, 24px); margin: 0; line-height: 1.2; }
.casa__chi--trad { right: calc(60% + 28px); font-size: clamp(17px, 1.5vw, 21px); color: var(--grafite); text-align: right; }
.casa__chi--tema { left: 40%; width: 20%; font-size: 15px; color: var(--grafite); text-align: center; }
.casa__chi--ours { left: calc(60% + 28px); font-size: clamp(20px, 1.8vw, 26px); font-weight: 500; color: var(--carta); transition: opacity .5s var(--ease) 1.2s; }
.casa__chi--ours small { display: block; margin-top: 4px; font-size: 15px; font-weight: 400; color: var(--cielo); }
.casa__piani { margin: 0; }
.casa__piano { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 2fr); }
.casa__piano > * { grid-row: 1; margin: 0; }
.casa__piano dt { grid-column: 2; display: flex; align-items: center; justify-content: center; padding: 24px 16px; text-align: center; font-size: clamp(18px, 1.6vw, 22px); line-height: 1.25; color: var(--inchiostro); border-left: 1.5px dashed var(--linea-forte); border-bottom: 1px solid var(--linea); }
.casa__trad { grid-column: 1; padding: 26px clamp(20px, 2.4vw, 32px); font-size: 17px; color: var(--grafite); border-left: 1.5px dashed var(--linea-forte); border-bottom: 1.5px dashed var(--linea-forte); }
.casa__ours { grid-column: 3; padding: 26px clamp(20px, 2.4vw, 32px); font-size: 17px; color: #DCE8ED; background: var(--petrolio); box-shadow: inset 0 -1px rgba(242, 246, 248, 0.14); clip-path: inset(0 0 0 0); transition: clip-path .85s var(--ease) calc(var(--d, 0) * 1ms); }
.casa__ours strong { display: block; margin-bottom: 6px; font-size: 19px; font-weight: 500; color: var(--carta); }
.casa__lab { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* in attesa di entrare in vista: la metà Domus Ars non è ancora costruita */
.is-waiting .casa__piano:not(.is-built) .casa__ours { clip-path: inset(100% 0 0 0); }
.is-waiting .casa__tetto:not(.is-built) .casa__falda { transform: scaleY(0); }
.is-waiting .casa__tetto:not(.is-built) .casa__chi--ours, .is-waiting .casa__tetto:not(.is-built) .casa__linea { opacity: 0; }
.is-waiting .casa__tetto:not(.is-built) .casa__linea--trad { opacity: 1; }
.compare__end { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 24px 48px; margin-top: 56px; }
.compare__end strong { display: block; font-weight: 300; font-size: clamp(26px, 2.6vw, 36px); line-height: 1.15; color: var(--inchiostro); }
@media (max-width: 860px) {
  .casa__tetto { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; aspect-ratio: auto; }
  .casa__tetto svg { position: relative; flex: 0 0 100%; height: auto; aspect-ratio: 1000 / 300; margin-bottom: 10px; }
  .casa__falda--wide { display: none; }
  .casa__falda--narrow { display: inline; transition-delay: 0s; }
  .casa__linea, .casa__chi--ours { transition-delay: .3s; }
  .casa__chi { position: static; font-size: 15px; }
  .casa__chi--trad { order: 1; text-align: left; font-size: 15px; }
  .casa__chi--tema { display: none; }
  .casa__chi--ours { order: 2; color: var(--petrolio); font-size: 16px; text-align: right; }
  .casa__chi--ours small { display: none; }
  .casa__piano { --d: 0 !important; grid-template-columns: minmax(0, 1fr); padding: 28px 0 22px; }
  .casa__piano > dt, .casa__piano > dd { grid-row: auto; grid-column: 1; }
  .casa__piano dt { justify-content: flex-start; padding: 0 0 12px; text-align: left; font-size: 23px; border: 0; }
  .casa__trad { margin-bottom: 10px; padding: 14px 16px; font-size: 16px; border: 1.5px dashed var(--linea-forte); }
  .casa__ours { padding: 18px; font-size: 16px; box-shadow: none; }
  .casa__lab { position: static; display: block; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; margin-bottom: 4px; font-size: 13px; font-weight: 500; }
  .casa__ours .casa__lab { color: var(--cielo); }
  .casa::after { margin: 0; }
}
@media (prefers-reduced-motion: reduce) { .casa__ours, .casa__falda, .casa__linea, .casa__chi--ours { transition: none; } }

/* ---------- Quanto costa ---------- */
.cost { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 96px); align-items: center; }
.cost__text .t-lead { margin-top: 28px; }
.cost__text .t-small { margin-top: 24px; max-width: 32em; }
.calc { background: var(--carta); color: var(--testo); padding: clamp(28px, 3.4vw, 48px); display: grid; gap: 28px; }
.calc__price { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.calc__price label { font-size: 17px; font-weight: 500; color: var(--inchiostro); }
.calc__price output { font-family: var(--mono); font-size: clamp(26px, 2.6vw, 34px); color: var(--inchiostro); }
.calc input[type="range"] { width: 100%; height: 44px; margin: -8px 0; background: transparent; appearance: none; -webkit-appearance: none; cursor: pointer; }
.calc input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(to right, var(--petrolio) var(--fill, 30%), var(--linea-forte) var(--fill, 30%)); }
.calc input[type="range"]::-moz-range-track { height: 2px; background: var(--linea-forte); }
.calc input[type="range"]::-moz-range-progress { height: 2px; background: var(--petrolio); }
.calc input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -12px; border-radius: 50%; background: var(--carta); border: 2px solid var(--petrolio); }
.calc input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--carta); border: 2px solid var(--petrolio); }
.calc__scale { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 13px; color: var(--grafite); }
.calc__rows { display: grid; border-top: 1px solid var(--linea-forte); }
.calc__row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-block: 18px; border-bottom: 1px solid var(--linea); }
.calc__k { font-size: 17px; }
.calc__k b { font-weight: 500; }
.calc__v { font-family: var(--mono); font-size: 20px; color: var(--inchiostro); white-space: nowrap; }
.calc__row--ours .calc__v { font-size: clamp(30px, 3vw, 40px); color: var(--petrolio); font-weight: 500; }
.calc__row--ref .calc__k, .calc__row--ref .calc__v { color: var(--grafite); }
.calc__row--ref .calc__v { text-decoration: line-through; text-decoration-thickness: 1px; }
.calc__row--save .calc__k { font-weight: 500; color: var(--inchiostro); }
.calc__note { font-size: 14px; color: var(--grafite); }
@media (max-width: 900px) { .cost { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Percorso ---------- */
.tabs { display: inline-flex; border: 1px solid var(--inchiostro); border-radius: 2px; padding: 3px; gap: 3px; }
.tabs button { min-height: 44px; padding: 0 24px; border: 0; background: transparent; font-size: 16px; color: var(--inchiostro); cursor: pointer; border-radius: 1px; transition: background-color .25s var(--ease), color .25s var(--ease); }
.tabs button[aria-selected="true"] { background: var(--inchiostro); color: var(--carta); }
.steps { list-style: none; margin: 56px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; position: relative; counter-reset: step; }
.steps::before { content: ""; position: absolute; left: 0; right: 0; top: 23px; height: 1px; background: var(--linea-forte); }
.step { position: relative; padding-right: 24px; }
.step__n { position: relative; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--carta); border: 1px solid var(--inchiostro); font-family: var(--mono); font-size: 15px; color: var(--inchiostro); }
.step--key .step__n { background: var(--petrolio); border-color: var(--petrolio); color: var(--carta); }
.step h3 { margin-top: 24px; font-size: 22px; font-weight: 400; }
.step p { margin-top: 10px; font-size: 16px; color: var(--testo); }
.step a { color: var(--acciaio-scuro); }
.steps[hidden] { display: none; }
@media (max-width: 900px) {
  .steps { grid-template-columns: minmax(0, 1fr); gap: 0; margin-top: 40px; }
  .steps::before { left: 23px; right: auto; top: 0; bottom: 0; width: 1px; height: auto; }
  .step { display: grid; grid-template-columns: 46px minmax(0, 1fr); column-gap: 20px; padding: 0 0 32px; }
  .step h3 { margin-top: 8px; grid-column: 2; }
  .step p { grid-column: 2; }
  .step__n { grid-row: span 2; }
}

/* ---------- Chi sono (anteprima) ---------- */
.me { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(40px, 6vw, 96px); align-items: center; }
.me .portrait { justify-self: center; }
.me__text { display: grid; gap: 24px; }
.me__text .link { justify-self: start; margin-top: 8px; }
.where { margin-top: clamp(64px, 8vw, 120px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); align-items: center; padding-top: clamp(48px, 6vw, 80px); border-top: 1px solid var(--linea-forte); }
.where img { width: 100%; max-width: 520px; height: auto; justify-self: end; }
@media (max-width: 860px) { .me, .where { grid-template-columns: minmax(0, 1fr); } .me .portrait { justify-self: start; max-width: 400px; } .where img { justify-self: start; } }



/* Palco scuro dalla scansione al visore; contenitore della vista che nel finale si stringe nel visore */
.story__dark { position: absolute; inset: 0; background: #131A21; opacity: var(--dark, 0); pointer-events: none; }
.story__view { position: absolute; inset: 0; transform-origin: 0 0; will-change: transform; }

/* Chi si toglie il visore */
.story__person { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.story__person img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
/* il visore sale e sparisce, la sua ombra sul viso si spegne subito */
.p-casco { transform-origin: 50% 26%; transform: translateY(calc(var(--lift, 0) * -21%)) rotate(calc(var(--lift, 0) * -3deg)); opacity: calc(1.7 - var(--lift, 0) * 1.7); }
.p-ombra { opacity: calc(1 - var(--lift, 0) * 4); }
@media (prefers-reduced-motion: reduce) {
  .story__view { position: relative; inset: auto; transform: none !important; }
  .story__person, .story__dark { display: none; }
}
