/* Modello dei casi studio (`build_casi_nuovi.py`). Caricato SOLO da quelle pagine.

   ⚠️ Ogni classe porta il prefisso `cs-` e ogni regola su un elemento sta sotto
   `.cs`: site.css usa gli stessi nomi brevi (`.sec`, `.hero`, `.btn`, `.wrap`…)
   e senza prefisso i due fogli si sarebbero pestati i piedi in entrambe le
   direzioni. Nato dal prototipo approvato il 2026-10-30 (sessione «Creazione
   pagina Caso Studio WebGas»), convertito con le stesse regole. I colori del
   cliente arrivano dal file di dati come `--client` e `--client-soft` sullo
   stile di `.cs`. */
.cs {
  --ground: #FFFFFF;
  --ground-alt: #F6F6F4;
  --ink: #0D0D0D;
  --ink-soft: #3A3A3A;
  --ink-faint: #6E6E6E;
  --rule: #E0E0E0;
  --yellow: #FFD501;
  --on-yellow: #0D0D0D;
  --band: #0D0D0D;
  --band-ink: #F2F2F0;
  --band-faint: #8F8F8A;
  --client: #3D6488;
  --client-soft: #E9EFF5;
  --display: "Montserrat", system-ui, sans-serif;
  --body: "Open Sans", system-ui, sans-serif;
  --fs-micro: 14px; --fs-small: 16px; --fs-base: 18px; --fs-lead: 22px; --fs-title: 26px;
  --fs-section: clamp(32px, 4vw, 48px);
  --fs-display: clamp(40px, 6vw, 72px);
  --fs-cover: clamp(56px, 11vw, 160px);
}

:where(.cs) * { box-sizing: border-box; }

.cs { background: var(--ground); color: var(--ink); font-family: var(--body); font-size: var(--fs-base); line-height: 1.6; overflow-x: clip; }

/* line-height: inherit perche' site.css ne da' una propria ai titoli: nel prototipo
   i titoli senza regola ereditano quella del testo */
:where(.cs) h1, :where(.cs) h2, :where(.cs) h3 { font-family: var(--display); margin: 0; letter-spacing: -0.02em; text-wrap: balance; line-height: inherit; }

:where(.cs) p { margin: 0; }

:where(.cs) img { display: block; max-width: 100%; }

:where(.cs) a { color: inherit; }

:where(.cs) a:focus-visible, :where(.cs) button:focus-visible, :where(.cs) input:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }

.cs-wrap { max-width: 1200px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

.cs-eyebrow { font-family: var(--display); font-size: var(--fs-micro); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }
/* Barra di lettura */
.cs-progress { position: fixed; top: 0; left: 0; right: 0; height: 4px; padding-top: env(safe-area-inset-top, 0px); z-index: 50; pointer-events: none; }

.cs-progress i { display: block; height: 4px; background: var(--yellow); transform-origin: 0 50%; transform: scaleX(0); }
/* 1. Apertura */
.cs-hero .cs-wrap { padding-block: 64px 0; display: grid; gap: 32px; justify-items: start; }

.cs-hero-top { display: grid; gap: 24px; justify-items: start; }

.cs-hero-logo { height: 48px; width: auto; }

.cs-hero-serv { display: grid; gap: 8px; width: max-content; max-width: 100%; }

.cs-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }

.cs-chips li { font-family: var(--display); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 4px 12px; border: 1px dashed var(--yellow); border-radius: 999px; white-space: nowrap; }

.cs-hero-p { font-size: var(--fs-base); line-height: 1.6; color: var(--ink-soft); max-width: 62ch; }

.cs-hero h1 { font-size: var(--fs-cover); line-height: 0.95; font-weight: 800; letter-spacing: -0.04em; }

.cs-hero h1 .cs-w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.3em; margin-bottom: -0.24em; }

.cs-hero h1 .cs-wi { display: inline-block; }

.cs-hero h1 em { font-style: normal; }

.cs-hero h1 em .cs-wi, .cs-hero h1 em:not(:has(.cs-wi)) { box-shadow: inset 0 -0.18em 0 var(--yellow); }

.cs-frame { will-change: transform; margin-top: 32px; background: var(--client); border-radius: 16px; padding: clamp(24px, 6vw, 80px) clamp(16px, 6vw, 80px) 0; overflow: hidden; }

.cs-frame { position: relative; isolation: isolate; }
/* Palco: il mockup parte piccolo e si allarga, dietro scorre il nome del cliente (data-allarga + data-nastro) */
.cs-stage { position: relative; height: 100vh; min-height: 560px; display: grid; align-items: center; overflow: hidden; margin-top: 32px; }

.cs-stage-text { position: absolute; inset: 0; display: flex; align-items: center; pointer-events: none; z-index: 0; }

.cs-stage-track { display: flex; white-space: nowrap; will-change: transform; }

.cs-stage-track span { font-family: var(--display); font-weight: 800; font-size: clamp(96px, 22vw, 360px); letter-spacing: -0.05em; line-height: 1; color: var(--ink); padding-right: 0.3em; }

.cs-stage-in { position: relative; z-index: 1; width: 100%; }

.cs-stage .cs-frame { margin: 0 auto; width: min(100%, calc((100vh - 96px) * 1.3)); }
/* Variante con una foto a tutta cornice: niente fondo colorato né acqua, la foto ha già la sua scena */
.cs-frame--foto { padding: 0; background: #0B1A4A; }

.cs-frame--foto img { display: block; width: 100%; height: auto; transform-origin: 50% 50%; }

.cs-stage .cs-frame--foto { width: min(100%, calc((100vh - 96px) * 1.78)); }
/* Titoli scoperti da barre gialle, riga per riga */
.cs-bl { display: block; position: relative; width: fit-content; }

.cs-bl-bar { position: absolute; top: 0.04em; bottom: 0.04em; left: -0.06em; right: -0.06em; background: var(--yellow); transform: scaleX(0); transform-origin: 0 50%; z-index: 1; }

.cs-frame-in { position: relative; z-index: 1; border-radius: 8px 8px 0 0; overflow: hidden; background: #FFFFFF; }

.cs-frame img { width: 100%; height: auto; will-change: transform; }
/* 2. Numeri */
.cs-kpis { background: var(--band); color: var(--band-ink); margin-top: 176px; margin-bottom: 96px; }

.cs-kpis .cs-wrap { padding-block: 80px; display: grid; gap: 40px; }

.cs-kpis-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }

.cs-kpis-head .cs-eyebrow { color: var(--band-faint); }

.cs-kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px; }

.cs-kpi { border-top: 1px solid #2B2B2B; padding-top: 16px; display: grid; gap: 8px; }

.cs-kpi-n { font-family: var(--display); font-weight: 800; font-size: var(--fs-display); line-height: 1; color: var(--yellow); font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }

.cs-kpi p { font-size: var(--fs-base); color: var(--band-ink); line-height: 1.45; }

.cs-kpi small { font-size: var(--fs-micro); color: var(--band-faint); }
/* Sezioni */
.cs-sec { padding-block: 216px 96px; }

.cs-sec-head { display: grid; gap: 16px; max-width: 760px; margin-bottom: 56px; }

.cs-sec-head h2 { font-size: var(--fs-section); line-height: 1.1; font-weight: 800; }

.cs-sec-head p { font-size: var(--fs-lead); color: var(--ink-soft); line-height: 1.45; }
/* 3. Punto di partenza: titolo a sinistra, voci con numeri giganti a destra */
.cs-start2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: start; }

.cs-start-head { margin-bottom: 0; }

.cs-facts-list { list-style: none; margin: 0; padding: 0; display: grid; }

.cs-facts-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; padding-block: 24px; border-bottom: 1px solid var(--rule); overflow: hidden; }

.cs-facts-list .cs-k { display: block; margin-bottom: 8px; font-family: var(--display); font-size: var(--fs-small); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

.cs-facts-list p { font-size: var(--fs-base); line-height: 1.5; color: var(--ink-soft); max-width: 36ch; }

.cs-big-n { font-family: var(--display); font-weight: 800; font-size: clamp(72px, 9vw, 128px); line-height: 0.8; letter-spacing: -0.04em; color: var(--ink); opacity: 0.14; }
/* 3b. Il problema: frase con la parola barrata, poi quattro card problema → soluzione */
.cs-pb-statement { font-family: var(--display); font-weight: 800; font-size: clamp(32px, 4.6vw, 64px); line-height: 1.1; letter-spacing: -0.03em; max-width: 20ch; margin: 16px 0 56px; text-wrap: balance; }

.cs-strike { position: relative; white-space: nowrap; }

.cs-strike-bar { position: absolute; left: -0.04em; right: -0.04em; top: 50%; height: 0.14em; margin-top: -0.07em; background: var(--yellow); border-radius: 999px; transform: scaleX(0); transform-origin: 0 50%; }

.cs-pb-grid { display: grid; border-top: 1px solid var(--rule); }

.cs-pb-row { display: grid; grid-template-columns: 80px minmax(0, 1fr) minmax(0, 1.2fr); gap: 32px; align-items: baseline; padding-block: 32px; border-bottom: 1px solid var(--rule); }

.cs-pb-n { font-family: var(--display); font-weight: 800; font-size: var(--fs-section); line-height: 1; letter-spacing: -0.03em; color: var(--yellow); font-variant-numeric: tabular-nums; }

.cs-pb-row h3 { font-size: var(--fs-title); line-height: 1.2; }

.cs-pb-row p { font-size: var(--fs-base); line-height: 1.5; color: var(--ink-soft); }

.cs-pb-ref { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-size: var(--fs-micro); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); white-space: nowrap; }

.cs-pb-ref i { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 999px; background: var(--yellow); color: var(--on-yellow); font-style: normal; font-size: 12px; }
/* 4. Capitoli */
.cs-chapters { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 64px; align-items: start; }

.cs-ch-visual { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 80px); aspect-ratio: 941 / 560; border-radius: 16px; background: var(--client-soft); overflow: hidden; }

.cs-vis { position: absolute; inset: 24px; display: grid; place-items: center; opacity: 0; transform: scale(0.96); transition: opacity .5s ease, transform .6s cubic-bezier(.2,.7,.2,1); }

.cs-vis.cs-on { opacity: 1; transform: none; }

.cs-vis img { width: 100%; height: auto; border-radius: 8px; box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 16px 40px rgba(13,13,13,.12); }

.cs-ch-texts { display: grid; }

.cs-ch { min-height: 72vh; display: grid; align-content: center; gap: 16px; padding-block: 40px; }

.cs-ch .cs-num { font-family: var(--display); font-weight: 800; font-size: var(--fs-small); color: var(--ink-faint); display: flex; align-items: center; gap: 16px; }

.cs-ch .cs-num::after { content: ""; height: 1px; flex: 1; background: var(--rule); }

.cs-ch h3 { font-size: clamp(28px, 3vw, 40px); line-height: 1.1; font-weight: 800; }

.cs-ch p { font-size: var(--fs-lead); line-height: 1.45; color: var(--ink-soft); }

.cs-ch .cs-tags { display: flex; flex-wrap: wrap; gap: 8px; }

.cs-ch .cs-tags span { font-family: var(--display); font-size: var(--fs-micro); font-weight: 600; padding: 4px 12px; border: 1px solid var(--rule); border-radius: 999px; }
/* Immagini che hanno già gli angoli arrotondati e trasparenti: ombra che segue la forma */
.cs-vis img.cs-vis-png { border-radius: 0; box-shadow: none; filter: drop-shadow(0 16px 32px rgba(13,13,13,.18)); }
/* Vittoria sulla soglia del carrello: pallino con spunta, onda gialla, coriandoli, etichetta evidenziata */
.cs-stop { transition: background .25s ease, transform .25s ease; }

.cs-bar .cs-stop.cs-won { background: var(--client); transform: scale(1.25); }

.cs-stop.cs-won::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: #FFFFFF; font-size: 9px; font-weight: 800; line-height: 1; }

.cs-stop.cs-won::before { content: ""; position: absolute; inset: -2px; border-radius: 999px; animation: cs-winpulse .9s ease-out 2; }

@keyframes cs-winpulse { 0% { box-shadow: 0 0 0 0 rgba(255,213,1,.85); } 100% { box-shadow: 0 0 0 18px rgba(255,213,1,0); } }

.cs-lab-ship { transition: background .25s ease, color .25s ease, padding .25s ease; border-radius: 999px; }

.cs-lab-ship.cs-won { background: var(--yellow); color: #0D0D0D; padding: 0 8px; font-weight: 700; }

.cs-gift { display: inline-block; transition: opacity .3s ease, transform .3s ease; }

.cs-gift.cs-off { opacity: 0; transform: translateY(4px); }

.cs-confetto { position: absolute; top: 50%; width: 6px; height: 10px; margin: -5px 0 0 -3px; border-radius: 2px; pointer-events: none; z-index: 2; }
/* Carrello ricostruito */
.cs-cart { width: min(440px, 100%); background: #FFFFFF; color: #0D0D0D; border-radius: 12px; padding: 24px; display: grid; gap: 16px; box-shadow: 0 16px 40px rgba(13,13,13,.14); font-size: 14px; }

.cs-cart-h { display: flex; justify-content: space-between; font-family: var(--display); font-weight: 700; }

.cs-cart-msg { font-weight: 600; }

.cs-cart-msg b { color: var(--client); }

.cs-bar { position: relative; height: 8px; border-radius: 999px; background: #E4E9EE; }

.cs-bar i { position: absolute; inset: 0 auto 0 0; width: 86%; border-radius: 999px; background: var(--client); }

.cs-bar .cs-stop { position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 999px; background: #FFFFFF; border: 2px solid var(--client); }

.cs-stops { display: flex; justify-content: space-between; font-size: var(--fs-micro); color: #5F5F5F; }

.cs-line { display: grid; grid-template-columns: 48px 1fr auto; gap: 16px; align-items: center; padding-top: 16px; border-top: 1px solid #EEEEEE; }

.cs-line .cs-ph { width: 48px; height: 48px; border-radius: 8px; background: #EEF3E6; }

.cs-line .cs-ph.cs-b { background: #E6EEF5; }

.cs-line .cs-gift { font-family: var(--display); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--client); }
/* Interfacce minimal dei capitoli, stesso linguaggio del carrello */
.cs-ui-pdp { width: min(560px, 100%); }

.cs-pdp { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr); gap: 24px; align-items: start; }

.cs-pdp-media { display: grid; gap: 8px; }

.cs-pdp-media img { width: 100%; height: auto; border-radius: 8px; box-shadow: none; }

.cs-pdp-thumbs { display: flex; gap: 8px; justify-content: center; }

.cs-pdp-thumbs i { width: 8px; height: 8px; border-radius: 999px; background: #E4E4E4; }

.cs-pdp-thumbs i.cs-on { background: var(--client); }

.cs-pdp-info { display: grid; gap: 8px; }

.cs-pdp-crumb { font-size: 12px; color: #8A8A8A; }

.cs-pdp-title { font-family: var(--display); font-size: 16px; line-height: 1.3; }

.cs-pdp-buy { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.cs-pdp-price { font-family: var(--display); font-size: 20px; }

.cs-pdp .cs-ui-box { padding: 8px 12px; font-size: 12px; }

.cs-pdp .cs-ui-box b { font-size: 14px; }

.cs-ui-stars { color: #E8A33B; letter-spacing: .04em; }

.cs-ui-stars small { color: #5F5F5F; font-family: var(--body); font-weight: 600; }

.cs-ui-box { display: grid; gap: 4px; padding: 12px 16px; border-radius: 8px; background: #F4F6F8; border-left: 4px solid #E4E4E4; color: #5F5F5F; transition: background .4s ease, border-color .4s ease, color .4s ease; }

.cs-ui-box b { font-family: var(--display); color: #0D0D0D; }

.cs-ui-box.cs-on { background: #E6EEF5; border-left-color: var(--yellow); color: #1C1C1C; }

.cs-ui-btn { display: block; text-align: center; padding: 12px 16px; border-radius: 8px; background: var(--client); color: #FFFFFF; font-family: var(--display); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; transition: background .3s ease; }

.cs-ui-btn.cs-off { background: #C9D3DC; }

.cs-ui-q { font-family: var(--display); font-size: 16px; line-height: 1.3; }

.cs-ui-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

.cs-ui-opt, .cs-ui-chip, .cs-ui-field { border: 1px solid #E4E4E4; border-radius: 8px; padding: 8px 12px; transition: background .3s ease, border-color .3s ease, color .3s ease; }

.cs-ui-opt.cs-on { border-color: var(--client); background: #E6EEF5; font-weight: 600; }

.cs-ui-opt.cs-on::before { content: "✓ "; color: var(--client); }

.cs-ui-help { font-size: 12px; color: #5F5F5F; }

.cs-ui-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.cs-ui-chip { border-radius: 999px; padding: 4px 12px; }

.cs-ui-chip.cs-on { background: var(--client); border-color: var(--client); color: #FFFFFF; }

.cs-ui-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

.cs-ui-field { color: #8A8A8A; }
/* 5. Prima e dopo */
.cs-ba { position: relative; aspect-ratio: 1600 / 760; border-radius: 16px; overflow: hidden; --pos: 50%; user-select: none; touch-action: pan-y; background: var(--ground-alt); }

.cs-ba img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }

.cs-ba .cs-before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }

.cs-ba .cs-handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: var(--yellow); }

.cs-ba .cs-handle::after { content: "⟷"; position: absolute; top: 50%; left: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 999px; background: var(--yellow); color: var(--on-yellow); display: grid; place-items: center; font-weight: 800; font-size: 20px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }

.cs-ba .cs-tag { position: absolute; top: 16px; font-family: var(--display); font-size: var(--fs-micro); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 8px 16px; border-radius: 8px; background: rgba(13,13,13,.8); color: #FFFFFF; }

.cs-ba .cs-tag.cs-l { left: 16px; }

.cs-ba .cs-tag.cs-r { right: 16px; background: var(--yellow); color: var(--on-yellow); }

.cs-ba input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }

.cs-ba-notes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 32px; }

.cs-ba-notes div { display: grid; gap: 8px; }

.cs-ba-notes b { font-family: var(--display); font-size: var(--fs-base); }

.cs-ba-notes p { font-size: var(--fs-base); color: var(--ink-soft); line-height: 1.45; }
/* 6. Schema tecnico */
.cs-stack { background: var(--ground-alt); border-radius: 16px; padding: 24px; overflow-x: auto; }

.cs-stack svg { width: 100%; min-width: 720px; height: auto; display: block; }

.cs-stack .cs-wire { fill: none; stroke: var(--ink-faint); stroke-width: 1.5; }

.cs-stack .cs-node rect { fill: var(--ground); stroke: var(--rule); }

.cs-stack .cs-node.cs-core rect { fill: var(--band); stroke: var(--band); }

.cs-stack .cs-node text { font-family: var(--display); fill: var(--ink); }

.cs-stack .cs-node.cs-core text { fill: var(--yellow); }

.cs-stack .cs-node .cs-s { font-family: var(--body); fill: var(--ink-faint); }

.cs-stack .cs-dot { fill: var(--yellow); stroke: var(--ink); stroke-width: 1; }
/* 7. Citazione */
.cs-quote { padding-block: 216px; }

.cs-quote blockquote { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(28px, 4.2vw, 56px); line-height: 1.15; letter-spacing: -0.02em; max-width: none; }

.cs-quote cite { display: flex; gap: 16px; align-items: center; margin-top: 32px; font-style: normal; font-size: var(--fs-small); color: var(--ink-soft); }

.cs-quote cite b { font-family: var(--display); color: var(--ink); }
/* 8. Chiusura */
.cs-close { background: var(--band); color: var(--band-ink); }

.cs-close .cs-wrap { padding-block: 120px 80px; display: grid; gap: 32px; justify-items: start; }

.cs-close h2 { font-size: var(--fs-display); line-height: 1.05; font-weight: 800; max-width: 16ch; }

.cs-btn { display: inline-flex; align-items: center; gap: 16px; font-family: var(--display); font-weight: 700; font-size: var(--fs-base); padding: 16px 32px; border-radius: 999px; background: var(--yellow); color: var(--on-yellow); text-decoration: none; }

.cs-btn span { transition: transform .3s ease; }

.cs-btn:hover span { transform: translateX(4px); }

.cs-next { border-top: 1px solid #2B2B2B; overflow: hidden; text-decoration: none; display: block; color: var(--band-ink); }

.cs-next .cs-eyebrow { color: var(--band-faint); display: block; padding: 24px max(16px, env(safe-area-inset-left, 0px)) 0; max-width: 1200px; margin: 0 auto; }

.cs-track { display: flex; width: max-content; padding-block: 16px 40px; }

.cs-track span { font-family: var(--display); font-weight: 800; font-size: clamp(48px, 9vw, 128px); letter-spacing: -0.04em; white-space: nowrap; padding-right: 0.5em; }

.cs-track span i { font-style: normal; color: var(--yellow); }
/* Passi allo scroll: puntini di avanzamento, riusabili su ogni sezione con data-steps */
.cs-step-dots { display: flex; gap: 8px; align-items: center; }

.cs-step-dots i { width: 24px; height: 4px; border-radius: 999px; background: rgba(255,255,255,.18); overflow: hidden; display: block; }

.cs-step-dots i b { display: block; height: 100%; background: var(--yellow); transform-origin: 0 50%; transform: scaleX(0); }

.cs-step-dots span { font-family: var(--display); font-size: var(--fs-micro); font-weight: 700; color: var(--band-faint); font-variant-numeric: tabular-nums; margin-left: 8px; }
/* Indice flottante */
.cs-toc { position: fixed; left: max(30px, env(safe-area-inset-left, 0px)); bottom: calc(30px + env(safe-area-inset-bottom, 0px)); z-index: 45; transform: translateY(24px); opacity: 0; pointer-events: none; transition: transform .5s cubic-bezier(.2,.8,.2,1), opacity .4s ease; width: max-content; max-width: calc(100vw - 112px); }

.cs-toc.cs-show { transform: none; opacity: 1; pointer-events: auto; }

.cs-toc-pill, .cs-toc-list { background: rgba(13,13,13,.86); -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4); color: #F2F2F0; border: 1px solid rgba(255,255,255,.12); box-shadow: 0 16px 40px rgba(0,0,0,.28); }

.cs-toc-pill { display: flex; align-items: center; gap: 0; padding: 8px 8px 8px 20px; border-radius: 999px; font: inherit; cursor: pointer; min-height: 56px; }

.cs-toc-n { font-family: var(--display); font-weight: 800; font-size: var(--fs-small); color: var(--yellow); font-variant-numeric: tabular-nums; margin-right: 12px; }
/* Compatta: nome e segmenti chiusi; si aprono con hover, tastiera o elenco aperto */
.cs-toc-t, .cs-toc-seg { max-width: 0; opacity: 0; overflow: hidden; margin-right: 0; transition: max-width .5s cubic-bezier(.2,.8,.2,1), opacity .25s ease, margin-right .5s cubic-bezier(.2,.8,.2,1); }

.cs-toc-t { font-family: var(--display); font-weight: 600; font-size: 14px; text-align: left; white-space: nowrap; }

.cs-toc-t span { display: inline-block; }

.cs-toc-seg { display: flex; gap: 4px; }

.cs-toc:has(:focus-visible) .cs-toc-t, .cs-toc.cs-open .cs-toc-t { max-width: 220px; opacity: 1; margin-right: 16px; transition-delay: 0s, .1s, 0s; }

.cs-toc:has(:focus-visible) .cs-toc-seg, .cs-toc.cs-open .cs-toc-seg { max-width: 160px; opacity: 1; margin-right: 16px; transition-delay: 0s, .15s, 0s; }

@media (hover: hover) {
.cs-toc:hover .cs-toc-t { max-width: 220px; opacity: 1; margin-right: 16px; transition-delay: 0s, .1s, 0s; }

.cs-toc:hover .cs-toc-seg { max-width: 160px; opacity: 1; margin-right: 16px; transition-delay: 0s, .15s, 0s; }
}

.cs-toc-seg i { width: 16px; height: 4px; border-radius: 999px; background: rgba(255,255,255,.18); overflow: hidden; display: block; }

.cs-toc-seg i b { display: block; height: 100%; background: var(--yellow); transform-origin: 0 50%; transform: scaleX(0); }

.cs-toc-ico { width: 40px; height: 40px; border-radius: 999px; background: var(--yellow); color: var(--on-yellow); display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 20px; transition: transform .4s cubic-bezier(.2,.8,.2,1); }

.cs-toc.cs-open .cs-toc-ico { transform: rotate(45deg); }

.cs-toc-list { position: absolute; left: 0; width: max(100%, 300px); max-width: calc(100vw - 32px); bottom: calc(100% + 8px); margin: 0; padding: 8px; list-style: none; border-radius: 24px; display: grid; gap: 0; transform-origin: 0 100%; transform: translateY(8px) scale(.96); opacity: 0; pointer-events: none; transition: transform .35s cubic-bezier(.2,.8,.2,1), opacity .25s ease; }

.cs-toc.cs-open .cs-toc-list { transform: none; opacity: 1; pointer-events: auto; }

.cs-toc-list a { display: grid; grid-template-columns: 32px 1fr auto; gap: 8px; align-items: center; padding: 8px 16px; border-radius: 16px; text-decoration: none; font-family: var(--display); font-size: 14px; font-weight: 600; color: #C4C4C0; transition: background .2s ease, color .2s ease; }

.cs-toc-list a:hover, .cs-toc-list a:focus-visible { background: rgba(255,255,255,.08); color: #FFFFFF; }

.cs-toc-list a .cs-ln { font-weight: 800; color: #8F8F8A; font-variant-numeric: tabular-nums; }

.cs-toc-list a .cs-lt { white-space: nowrap; }

.cs-toc-list a .cs-lp { width: 24px; height: 2px; border-radius: 999px; background: rgba(255,255,255,.18); overflow: hidden; }

.cs-toc-list a .cs-lp b { display: block; height: 100%; background: var(--yellow); transform-origin: 0 50%; transform: scaleX(0); }

.cs-toc-list a[aria-current="true"] { color: #FFFFFF; background: rgba(255,213,1,.12); }

.cs-toc-list a[aria-current="true"] .cs-ln { color: var(--yellow); }

@media (max-width: 900px) {
.cs-start2 { grid-template-columns: 1fr; gap: 32px; }

.cs-pb-row { grid-template-columns: 64px minmax(0, 1fr); gap: 8px 24px; }

.cs-pb-row p, .cs-pb-row .cs-pb-ref { grid-column: 2; }

.cs-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.cs-chapters { grid-template-columns: 1fr; gap: 0; }

.cs-ch-visual { top: calc(env(safe-area-inset-top, 0px) + 8px); z-index: 2; aspect-ratio: 941 / 600; }

.cs-vis { inset: 16px; }

.cs-ch { min-height: 60vh; }

.cs-ba-notes { grid-template-columns: 1fr; }

.cs-sec { padding-block: 128px 48px; }

.cs-kpis { margin-top: 128px; margin-bottom: 48px; }
}
/* Schema tecnico su telefono: lista verticale collegata da una linea gialla, al posto del disegno largo */
.cs-stack-m { display: none; list-style: none; margin: 0; padding: 0; }

@media (max-width: 700px) {
#cs-stack { display: none; }

.cs-stack-m { display: grid; gap: 0; position: relative; }

.cs-stack-m::before { content: ""; position: absolute; left: 15px; top: 24px; bottom: 24px; width: 2px; background: var(--yellow); }

.cs-stack-m li { position: relative; display: grid; gap: 2px; padding: 16px 16px 16px 48px; }

.cs-stack-m li::before { content: ""; position: absolute; left: 10px; top: 22px; width: 12px; height: 12px; border-radius: 999px; background: var(--ground); border: 2px solid var(--yellow); }

.cs-stack-m li b { font-family: var(--display); font-size: var(--fs-base); }

.cs-stack-m li small { font-size: var(--fs-small); color: var(--ink-faint); }

.cs-stack-m li.cs-core { background: var(--band); border-radius: 12px; margin-bottom: 8px; }

.cs-stack-m li.cs-core b { color: var(--yellow); }

.cs-stack-m li.cs-core::before { background: var(--yellow); }
}

@media (max-width: 520px) {
.cs-stage { height: 72vh; min-height: 420px; }

.cs-stage-track span { font-size: 30vw; }
/* Telefono: titolo che entra nello schermo, pillole dei servizi che vanno a capo, etichetta lontana dal logo */
.cs { --fs-cover: 12vw; }

.cs-hero .cs-wrap { padding-block: 40px 0; gap: 24px; }

.cs-hero h1, .cs-hero-p { max-width: 100%; }

.cs-hero-logo { height: 36px; }

.cs-hero-serv { width: 100%; }

.cs-pb-row { grid-template-columns: 48px minmax(0, 1fr); padding-block: 24px; }

.cs-toc { left: max(16px, env(safe-area-inset-left, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }

.cs-toc-seg, .cs-toc-t { display: none; }

.cs-toc-pill { padding-left: 16px; }

.cs-cart { padding: 16px; gap: 8px; }

.cs-line { display: none; }

.cs-ba { aspect-ratio: 4 / 3; }

.cs-quote { padding-block: 128px; }
}

@media (prefers-reduced-motion: reduce) {
.cs-vis { transition: none; }
}
/* Telefono: ogni interfaccia sta dentro il suo capitolo, sopra il testo, invece che nel riquadro fisso */
.cs-ch-inline { display: none; }

@media (max-width: 900px) {
.cs-ch-visual { display: none; }

.cs-ch { min-height: 0; padding-block: 48px; }

.cs-ch:first-child { padding-top: 0; }

.cs-ch-inline { display: grid; place-items: center; margin-bottom: 32px; padding: 24px 16px; border-radius: 16px; background: var(--client-soft); }

.cs-ch-inline .cs-vis { position: static; inset: auto; opacity: 1; transform: none; width: 100%; display: grid; place-items: center; }

.cs-ch-inline .cs-line { display: grid; }

.cs-ch-inline .cs-cart { width: 100%; }

.cs-ch .cs-ch-inline .cs-cart-msg { font-size: 14px; line-height: 1.4; color: #0D0D0D; max-width: none; margin: 0; }
}

@media (max-width: 520px) {/* Apertura: la home riempie il palco in verticale invece di restare una striscia */
.cs-stage .cs-frame--foto { width: min(100%, calc((72vh - 48px) * 390 / 700)); aspect-ratio: 390 / 700; border-radius: 24px; }

.cs-stage .cs-frame--foto img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
/* Scheda prodotto più stretta: foto piccola a sinistra, informazioni a destra */
.cs-pdp { grid-template-columns: 112px minmax(0, 1fr); gap: 16px; }

.cs-pdp-price { font-size: 16px; }

.cs-pdp .cs-ui-box span { display: none; }

.cs-ch-inline .cs-cart { padding: 16px; gap: 12px; }

.cs-pdp .cs-ui-btn { padding: 8px; letter-spacing: .02em; }

.cs-stops { font-size: 12px; gap: 8px; }

.cs-stops span { white-space: nowrap; }

.cs-ui-row { grid-template-columns: 1fr; }
/* Citazione: nome e ruolo uno sotto l'altro */
.cs-quote cite { display: grid; gap: 4px; }
/* Prima e dopo: etichette più discrete */
.cs-ba .cs-tag { font-size: 12px; padding: 4px 8px; top: 8px; }

.cs-ba .cs-tag.cs-l { left: 8px; }

.cs-ba .cs-tag.cs-r { right: 8px; }
}
/* Testi ristretti: 70% della larghezza del contenuto su desktop */
@media (min-width: 901px) {
.cs-hero-p, .cs-sec-head, .cs-pb-statement, .cs-close h2 { max-width: 70%; }

.cs-start2 .cs-sec-head { max-width: none; }
/* Righe piene fino al 70%, senza il bilanciamento che le accorcia */
.cs-sec-head h2, .cs-pb-statement, .cs-quote blockquote, .cs-close h2 { text-wrap: pretty; }
}

/* Testo solo per chi usa un lettore di schermo */
.cs-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Sul sito ─────────────────────────────────────────────────────────────── */
/* ⚠️ Il «torna su» del sito (galleria.js) sta in basso a SINISTRA, dove qui
   c'è l'indice flottante: su queste pagine passa a destra, come nel prototipo. */
body.cs-page .scroll-top { left: auto; right: max(30px, env(safe-area-inset-right, 0px)); }
@media (max-width: 520px) {
  body.cs-page .scroll-top { right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
}
