/* Sezioni nuove di home e Blast (ottobre 2026). Valori dal DESIGN.md: blu #212080, rosso #ff003a, giallo #ffcb00,
   testo #262626, Sofia Pro 300/500/600, raggi 10/20 px. */

:root {
  --sn-blu: #212080;
  --sn-rosso: #ff003a;
  --sn-giallo: #ffcb00;
  --sn-testo: #262626;
  --sn-testo-2: #5c5c66;
  --sn-blu-08: rgba(33, 32, 128, .08);
  --sn-blu-16: rgba(33, 32, 128, .16);
  --sn-r: 20px;
  --sn-ease: cubic-bezier(.16, 1, .3, 1);
}

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::selection { background: var(--sn-blu); color: #fff; }

.sn-section { padding: 160px 0; }
.sn-section + .sn-section { padding-top: 0; }
.sn-h2 { font-size: 50px; line-height: 60px; font-weight: 500; letter-spacing: -.01em; margin: 0 0 24px; text-wrap: balance; max-width: 18ch; }
.sn-p { font-size: 20px; line-height: 1.5; font-weight: 300; max-width: 60ch; margin: 0; }
.sn-blast:focus-visible, .sn-stars:focus-visible { outline: 2px solid var(--sn-blu); outline-offset: 4px; }

/* ── Card dei lavori: entrata a cascata e resistenza allo scroll (proprietà translate, non tocca le interazioni Webflow) ── */
.grid-job-thumbs > .job-thumb { translate: 0 calc(var(--sn-y, 0px) + var(--sn-lag, 0px)); }

/* card clone: anteprima del caso in loop al posto del telefono */
.job-thumb.sn-loop { position: relative; isolation: isolate; }
.sn-loop-media { position: absolute; inset: 0; z-index: -1; overflow: hidden; border-radius: inherit; }
.sn-loop-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(0, 0, 0, .55), rgba(0, 0, 0, 0) 45%); }
.sn-loop-media > * { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; opacity: 0; transform: scale(1.06); transition: opacity .3s ease, transform 4s linear; }
.sn-loop-media > .is-on { opacity: 1; transform: scale(1); z-index: 1; }
.sn-loop-media > .is-prev { opacity: 1; transform: scale(1); z-index: 0; transition: none; }
/* appena parte la sequenza la copertina e il colore della card spariscono: sotto gli asset c'è solo un fondo scuro */
.sn-loop.sn-loop-attiva { background: #111119 !important; }
.job-thumb.sn-loop .job-nameproject, .job-thumb.sn-loop .job-categorie { position: relative; color: #fff; }

/* ── Blast in una card: muro a sinistra, testo a destra ── */
.sn-blast { display: grid; grid-template-columns: 1.4fr 1fr; align-items: center; position: relative; border-radius: var(--sn-r); overflow: hidden; background-image: linear-gradient(#2b2d44, #111119); color: #fff; text-decoration: none; min-height: 680px; }
.sn-wall { position: absolute; inset: 0; overflow: hidden; cursor: grab; -webkit-mask-image: radial-gradient(52% 160% at 0% 50%, #000 25%, rgba(0, 0, 0, .55) 55%, rgba(0, 0, 0, .15) 80%, transparent 100%); mask-image: radial-gradient(52% 160% at 0% 50%, #000 25%, rgba(0, 0, 0, .55) 55%, rgba(0, 0, 0, .15) 80%, transparent 100%); touch-action: pan-y; }
.sn-wall.is-dragging { cursor: grabbing; }
.sn-bricks { position: absolute; left: 0; top: 0; display: grid; gap: 14px; will-change: transform; user-select: none; -webkit-user-select: none; }
.sn-row { display: flex; gap: 14px; height: 280px; width: max-content; will-change: transform; }
.sn-row > .sn-brick:last-child { margin-right: 14px; }
.sn-brick { flex: none; height: 100%; border-radius: 16px; overflow: hidden; background: #1c1d2c; }
.sn-brick { position: relative; }
.sn-brick img, .sn-brick video { height: 100%; width: auto; display: block; pointer-events: none; }
.sn-brick .sn-brick-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sn-blast-text { grid-column: 2; position: relative; z-index: 1; pointer-events: none; align-self: stretch; display: flex; flex-direction: column; justify-content: space-between; padding: 44px 48px 100px 8px; }
.sn-nums { list-style: none; padding: 0; margin: 40px 0 0; display: flex; justify-content: flex-start; gap: 48px; }
.sn-nums li { text-align: left; white-space: nowrap; }
.sn-nums b { display: block; font-size: 44px; line-height: 1; font-weight: 300; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.sn-nums span { display: block; margin-top: 10px; font-size: 15px; font-weight: 300; color: rgba(255, 255, 255, .78); }
.sn-blast-go { position: absolute; bottom: 30px; width: 44px; height: 44px; color: #fff; pointer-events: none; transition: transform .6s var(--sn-ease); }
.sn-blast-go svg { width: 100%; height: 100%; display: block; }
.sn-blast-go.is-dx { right: 30px; transform: rotate(-45deg); }
.sn-blast:hover .sn-blast-go.is-dx, .sn-blast:focus-visible .sn-blast-go.is-dx { transform: translate(14px, 14px) rotate(-45deg) scale(1.5); }
.sn-lead { color: inherit; font-size: 40px; line-height: 1.18; font-weight: 300; letter-spacing: -.015em; margin: 0; text-wrap: balance; }

/* ── Recensioni in orbita ───────────────────── */
.sn-orbit { position: relative; height: 900px; margin-top: 24px; touch-action: pan-y; cursor: grab; overflow-x: clip; }
.sn-orbit.is-dragging { cursor: grabbing; }
.sn-core { position: absolute; left: 50%; top: 36%; transform: translate(-50%, -50%); text-align: center; z-index: 20; width: min(90%, 760px); }
.sn-core .sn-big-stars { width: 280px; height: 52px; display: block; margin: 0 auto 26px; }
.sn-core .sn-h2 { margin: 0 auto; max-width: 20ch; text-align: center; }
.sn-stars { display: inline-flex; align-items: center; gap: 8px; margin-top: 22px; color: var(--sn-blu); font-size: 18px; font-weight: 600; text-decoration: none; border-radius: 6px; }
.sn-stars svg { width: 18px; height: 18px; }
.sn-stars:hover span { text-decoration: underline; text-underline-offset: 5px; }
.sn-g { position: absolute; left: 50%; top: 50%; width: 340px; margin: -100px 0 0 -170px; background: #fff; border-radius: 14px; padding: 18px 18px 16px; box-shadow: 0 1px 3px rgba(38, 38, 38, .12), 0 14px 34px -18px rgba(33, 32, 128, .35); font-family: sofia-pro, sans-serif; will-change: transform, opacity, filter; user-select: none; -webkit-user-select: none; }
.sn-g-head { display: flex; align-items: flex-start; gap: 12px; }
.sn-g-head > div { flex: 1; min-width: 0; }
.sn-g-av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 16px; font-weight: 500; flex: none; }
.sn-g-name { font-size: 15px; font-weight: 500; line-height: 1.2; overflow-wrap: anywhere; }
.sn-g-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; font-size: 13px; font-weight: 300; color: var(--sn-testo-2); }
.sn-g-meta svg { width: 70px; height: 13px; }
.sn-g p { margin: 12px 0 0; font-size: 14.5px; line-height: 1.45; font-weight: 300; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.sn-g.aperta p { display: block; -webkit-line-clamp: unset; overflow: visible; }
.sn-g.aperta { z-index: 100 !important; box-shadow: 0 1px 3px rgba(38, 38, 38, .12), 0 30px 60px -20px rgba(33, 32, 128, .45); }
.sn-g-piu { margin-top: 10px; padding: 0; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--sn-blu); cursor: pointer; }
.sn-g-piu:hover { text-decoration: underline; text-underline-offset: 4px; }
.sn-g-tag { flex: none; margin-left: auto; font-size: 11.5px; font-weight: 500; color: var(--sn-blu); background: var(--sn-blu-08); padding: 3px 9px; border-radius: 100px; }


/* ── Blast: timeline (pagina del caso) ──────── */
.sn-tl { position: relative; padding: 40px 0 120px; }
.sn-tl::before { content: ""; position: absolute; left: 6px; top: 0; bottom: 0; width: 1px; background: var(--sn-blu-16); }
.sn-tl-item { position: relative; display: grid; grid-template-columns: minmax(220px, 1fr) 2.2fr; gap: 56px; padding: 72px 0 72px 48px; transform-origin: 0 50%; will-change: transform, opacity; }
.sn-tl-item::before { content: ""; position: absolute; left: 0; top: 84px; width: 13px; height: 13px; border-radius: 50%; background: #fff; border: 2px solid var(--sn-blu); }
.sn-tl-item.is-current::before { background: var(--sn-blu); }
.sn-bento { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 150px; grid-auto-flow: dense; gap: 14px; }
.sn-bento > * { position: relative; margin: 0; border-radius: var(--sn-r); overflow: hidden; background: #111119; }
.sn-bento img, .sn-bento video { width: 100%; height: 100%; object-fit: cover; display: block; }
.b-big { grid-column: span 2; grid-row: span 2; }
.b-wide { grid-column: span 2; }
.b-tall { grid-row: span 2; }

/* ── Responsive ─────────────────────────────── */
@media (max-width: 991px) {
  .sn-section { padding: 110px 0; }
  .sn-h2 { font-size: 38px; line-height: 1.15; }
  .sn-blast { grid-template-columns: 1fr; min-height: 0; }
  .sn-blast-text { grid-column: 1; }
  .sn-wall { position: relative; inset: auto; height: 420px; -webkit-mask-image: linear-gradient(#000 30%, rgba(0, 0, 0, .55) 60%, transparent 92%); mask-image: linear-gradient(#000 30%, rgba(0, 0, 0, .55) 60%, transparent 92%); }
  .sn-row { height: 180px; }
  .sn-blast-text { padding: 36px 28px 112px; margin-top: 0; }
  .sn-blast .sn-lead { font-size: 30px; }
  .sn-blast-go { width: 36px; height: 36px; bottom: 22px; }
  .sn-nums { gap: 20px 32px; flex-wrap: wrap; }
  .sn-nums b { font-size: 36px; }
  .sn-orbit { height: 640px; }
  .sn-core .sn-big-stars { width: 200px; height: 38px; }
  .sn-g { width: 290px; margin: -95px 0 0 -145px; }
  .sn-tl-item { grid-template-columns: 1fr; gap: 28px; padding: 48px 0 48px 36px; }
  .sn-bento { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 130px; }
}
@media (max-width: 479px) {
  .sn-h2 { font-size: 32px; }
  .sn-nums { gap: 18px 28px; }
  .sn-nums b { font-size: 32px; }
  .sn-orbit { height: 480px; }
  .sn-core { top: 34%; }
  .sn-g { width: 264px; margin: -92px 0 0 -132px; padding: 16px; }
  .sn-g p { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .sn-orbit { height: auto; cursor: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
  .sn-core { position: static; transform: none; grid-column: 1 / -1; margin-bottom: 24px; }
  .sn-g { position: static; width: auto; margin: 0; }
  .sn-tl-item { transform: none !important; opacity: 1 !important; }
}

/* versione leggera (rete lenta o computer che non regge): stesso aspetto, niente movimento */
.sn-leggero .sn-loop-media > * { transition: none; transform: none; }
.sn-leggero .sn-blast-go { transition: none; }

/* asset «intero»: si vede senza tagli; dietro, i bordi allungati (immagini) o la copertina sfocata (video) */
.sn-loop-media > canvas.sn-fondo-vivo { transform: scale(1.1); filter: blur(12px); transition: opacity .3s ease; }
.sn-leggero .sn-loop-media > canvas.sn-fondo-vivo { display: none; }
.sn-loop-media > .sn-intero { object-fit: contain; background-position: center; background-repeat: no-repeat; background-size: cover; }

/* ── Pagina Blast unita (portfolio/blast): testi con le classi del sito (.h2, .h3, .p), qui solo spazi e numeri ── */
.bp-campaign .div-topbot-200, .bp-intro { padding-top: 100px; }
.bp-nums { justify-content: flex-start; gap: 72px; margin-top: 60px; color: var(--sn-testo); }
.bp-nums span { font-size: 15px; font-weight: 500; color: var(--sn-testo); }
.bp-credit { margin-top: 20px; }
.bp-side time { display: block; font-size: 15px; font-weight: 500; color: var(--sn-blu); }
.bp-h { margin: 8px 0 0; text-wrap: balance; }
.bp-side .p { margin-top: 14px; }
.bp-play { position: absolute; inset: 0; border: 0; padding: 0; background: none; cursor: pointer; }
.bp-tag { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 100px; background: rgba(33, 32, 128, .72); color: #fff; display: grid; place-items: center; transition: transform .25s cubic-bezier(.16,1,.3,1); }
.bp-tag svg { width: 26px; height: 26px; margin-left: 3px; }
.bp-play:hover .bp-tag { transform: scale(1.1); }
.bp-play:focus-visible { outline: 2px solid var(--sn-blu); outline-offset: -4px; border-radius: var(--sn-r); }
.bp-viewer { border: 0; padding: 0; background: transparent; max-width: none; max-height: none; width: 100vw; height: 100vh; }
.bp-viewer::backdrop { background: rgba(38, 38, 38, .94); }
.bp-viewer video { width: 100%; height: 100%; object-fit: contain; }
.bp-close { position: fixed; top: 16px; right: 16px; width: 44px; height: 44px; border-radius: 99px; border: 0; background: #fff; color: var(--sn-testo); cursor: pointer; display: grid; place-items: center; z-index: 2; }
.bp-close svg { width: 20px; height: 20px; }
@media (max-width: 767px) {
  .bp-nums { gap: 24px 32px; margin-top: 40px; }
}
