/* =============================================================================
   EXIBIZ — Immersive (stile "hubtown"): preloader, smooth scroll, hero animato,
   sezioni-capitolo, galleria orizzontale, cursore. Layer sopra styles.css.
   Richiede GSAP + ScrollTrigger + Lenis (via CDN).
   ============================================================================= */

/* --- Lenis (smooth scroll) --- */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* --- Helpers reveal (maschere) --- */
.mask { display: block; overflow: hidden; }
.word-mask { display: inline-block; overflow: hidden; vertical-align: top; line-height: 1; }
.word-mask > span { display: inline-block; will-change: transform; }

/* --- Cursore custom --- */
.cursor-dot, .cursor-ring { position: fixed; top: 0; left: 0; z-index: 9999; pointer-events: none; border-radius: 50%; }
.cursor-dot { width: 6px; height: 6px; background: var(--brass); transform: translate(-50%, -50%); }
.cursor-ring { width: 40px; height: 40px; border: 1px solid rgba(198,161,91,.6); transform: translate(-50%, -50%); transition: width .3s var(--ease), height .3s var(--ease), background .3s, border-color .3s; }
.cursor-ring.is-hover { width: 66px; height: 66px; background: rgba(198,161,91,.12); border-color: transparent; }
@media (hover: none), (pointer: coarse) { .cursor-dot, .cursor-ring { display: none; } }

/* --- Preloader --- */
.preloader { position: fixed; inset: 0; z-index: 1000; background: var(--ink); color: var(--ivory); }
.preloader__brand { position: absolute; top: clamp(1.5rem,4vw,3rem); left: clamp(1.25rem,4vw,3rem); font-family: var(--font-display); font-size: 1.5rem; letter-spacing: .04em; }
.preloader__brand span { display:block; font-family:var(--font-sans); font-size:.6rem; letter-spacing:.28em; text-transform:uppercase; color:var(--brass); margin-top:.3rem; }
.preloader__count { position: absolute; right: clamp(1.25rem,4vw,3.5rem); bottom: clamp(1rem,4vw,2.5rem); font-family: var(--font-display); font-size: clamp(4rem,20vw,15rem); line-height: .8; color: var(--brass); font-variant-numeric: tabular-nums; }
.preloader__label { position:absolute; left: clamp(1.25rem,4vw,3rem); bottom: clamp(2rem,5vw,3rem); font-size:.72rem; letter-spacing:.2em; text-transform:uppercase; color:var(--on-dark-muted); }
.preloader__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(245,242,234,.12); }
.preloader__bar i { position: absolute; inset: 0 100% 0 0; background: var(--brass); }

/* --- Header immersivo (minimale) --- */
.imm-header { position: fixed; inset: 0 0 auto 0; z-index: 200; padding: clamp(1rem,2.5vw,1.6rem) 0; }
.imm-header__in { display: flex; align-items: center; justify-content: space-between; }
.imm-header .brand { color: #fff; mix-blend-mode: difference; }
.imm-header .brand span { color: #fff; opacity: .8; }
.imm-header nav { display: flex; gap: clamp(1rem,2.5vw,2rem); align-items: center; }
.imm-header nav a { color: #fff; font-size: .85rem; font-weight: 500; }
.imm-header nav a.pill { border: 1px solid rgba(255,255,255,.5); padding: .5rem 1rem; border-radius: 100px; }

/* --- Hero immersivo --- */
.imm-hero { position: relative; height: 100svh; min-height: 620px; display: flex; align-items: flex-end; color: var(--on-dark); overflow: hidden; background: var(--ink); }
.imm-hero__bg { position: absolute; inset: -12% 0; z-index: 0; will-change: transform; }
.imm-hero__bg img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(35%) brightness(.6); }
.imm-hero__bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(18,18,19,.4), rgba(18,18,19,.15) 38%, rgba(18,18,19,.96)); }
.imm-hero__in { position: relative; z-index: 2; width: 100%; padding-bottom: clamp(2.5rem,9vh,6rem); }
.imm-hero .eyebrow { color: var(--brass); margin-bottom: 1.4rem; }
.imm-hero__claim { font-family: var(--font-display); font-weight: 400; font-size: clamp(3rem,10vw,9rem); line-height: .92; letter-spacing: -.02em; margin-bottom: 1.6rem; }
.imm-hero__claim em { font-style: italic; color: var(--brass); }
.imm-hero__sub { max-width: 44ch; color: rgba(245,242,234,.8); font-size: clamp(1.05rem,1.6vw,1.35rem); }
.imm-hero__cue { position: absolute; bottom: clamp(2rem,9vh,6rem); right: clamp(1.25rem,4vw,3rem); z-index: 2; font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: rgba(245,242,234,.7); writing-mode: vertical-rl; display: flex; align-items: center; gap: .8rem; }
.imm-hero__cue i { width: 1px; height: 50px; background: linear-gradient(var(--brass), transparent); }
@media (max-width: 640px){ .imm-hero__cue { display: none; } }

/* --- Sezioni-capitolo --- */
.chapter { position: relative; min-height: 100svh; display: flex; align-items: center; overflow: hidden; padding-block: clamp(4rem,10vh,7rem); }
.chapter--dark { background: var(--ink); color: var(--on-dark); }
.chapter--paper { background: var(--paper); }
/* Sfumatura morbida ai bordi dei capitoli chiari: si fondono nello scuro sopra/sotto (niente linea netta) */
.chapter--paper::before, .chapter--paper::after,
.chapter.clients::before, .chapter.clients::after { content: ""; position: absolute; left: 0; right: 0; height: clamp(38px, 6vh, 82px); z-index: 1; pointer-events: none; }
.chapter--paper::before, .chapter.clients::before { top: 0; background: linear-gradient(to bottom, var(--ink), transparent); }
.chapter--paper::after, .chapter.clients::after { bottom: 0; background: linear-gradient(to top, var(--ink), transparent); }
.chapter__bg { position: absolute; inset: -14% 0; z-index: 0; will-change: transform; opacity: .32; }
.chapter__bg img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(70%) brightness(.5); }
.chapter__in { position: relative; z-index: 2; width: 100%; }
.chapter__num { font-family: var(--font-display); color: var(--brass); font-size: clamp(1rem,2vw,1.4rem); margin-bottom: 1rem; display: inline-block; }
.chapter__lead { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.8rem,4.2vw,3.6rem); line-height: 1.15; letter-spacing: -.01em; max-width: 20ch; }
.chapter__lead .muted { color: var(--muted); }
.chapter--dark .chapter__lead .muted { color: var(--on-dark-muted); }
.chapter__text { max-width: 44ch; color: var(--muted); font-size: clamp(1.05rem,1.5vw,1.3rem); margin-top: 1.6rem; }
.chapter--dark .chapter__text { color: var(--on-dark-muted); }

.mega { font-family: var(--font-display); font-weight: 400; font-size: clamp(3.5rem,16vw,15rem); line-height: .82; letter-spacing: -.03em; }
.mega--outline { color: transparent; -webkit-text-stroke: 1.2px rgba(245,242,234,.55); text-stroke: 1.2px rgba(245,242,234,.55); }
.method-row { display: flex; align-items: baseline; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.method-row .chapter__text { margin-top: 0; align-self: center; }

/* --- Numeri immersivi --- */
.imm-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: clamp(1.5rem,3vw,3rem); border-top: 1px solid var(--line-dark); padding-top: clamp(2rem,4vw,3rem); }
.imm-stat .v { font-family: var(--font-display); font-size: clamp(3rem,7vw,6rem); line-height: 1; color: var(--brass); font-variant-numeric: tabular-nums; }
.imm-stat .l { color: var(--on-dark-muted); margin-top: .5rem; font-size: .95rem; }
@media (max-width: 760px){ .imm-stats { grid-template-columns: 1fr 1fr; gap: 2rem; } }

/* --- Galleria orizzontale (pinned) --- */
.h-section { position: relative; background: var(--ink); color: var(--on-dark); }
.h-panel { position: sticky; top: 0; height: 100svh; overflow: hidden; display: flex; align-items: center; }
.h-track { display: flex; gap: clamp(1.25rem,2.5vw,2.4rem); padding-inline: clamp(1.25rem,4vw,3rem); will-change: transform; }
.h-intro { flex: 0 0 auto; width: min(84vw,400px); display: flex; flex-direction: column; justify-content: center; }
.h-intro .eyebrow { color: var(--brass); margin-bottom: 1.2rem; }
.h-intro h2 { font-size: clamp(2rem,4vw,3.2rem); }
.h-card { flex: 0 0 auto; width: min(80vw,440px); }
.h-card__media { aspect-ratio: 3/4; overflow: hidden; border-radius: 6px; background: var(--ink-2); }
.h-card__media img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(100%) contrast(1.03); transition: filter .6s var(--ease), transform .9s var(--ease); }
.h-card:hover .h-card__media img { filter: none; transform: scale(1.05); }
.h-card__meta { display: flex; justify-content: space-between; align-items: baseline; margin-top: 1.1rem; gap: 1rem; }
.h-card__meta h3 { font-size: clamp(1.2rem,1.8vw,1.6rem); }
.h-card__meta .cat { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--brass); }
.h-card__sub { color: var(--on-dark-muted); font-size: .88rem; margin-top: .2rem; }
.h-hint { position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%); font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--on-dark-muted); }
@media (max-width: 760px){ .h-card, .h-intro { width: 82vw; } }

/* Lavori: titolo fisso, barra avanzamento, card valorizzate */
.h-head { position: absolute; top: clamp(6vh, 8vh, 10vh); left: clamp(1.5rem, 5vw, 4.5rem); z-index: 3; max-width: 440px; }
.h-head h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.05; margin: .8rem 0 .6rem; }
.h-head__hint { color: var(--on-dark-muted); font-size: .9rem; }
.h-progress { position: absolute; bottom: clamp(5vh, 7vh, 9vh); left: clamp(1.5rem, 5vw, 4.5rem); right: clamp(1.5rem, 5vw, 4.5rem); height: 2px; background: rgba(245,242,234,.14); z-index: 3; }
.h-progress__bar { display: block; height: 100%; width: 0; background: var(--brass); }
.h-card { width: min(78vw, 470px); }
.h-card__media { position: relative; }
.h-card__num { position: absolute; top: 1rem; left: 1rem; z-index: 2; font-family: var(--font-display); font-size: 1.3rem; color: #fff; mix-blend-mode: difference; }
.h-card__go { position: absolute; bottom: 1rem; left: 1rem; z-index: 2; background: var(--brass); color: var(--ink); font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: .5rem .9rem; border-radius: 100px; opacity: 0; transform: translateY(8px); transition: opacity .35s var(--ease), transform .35s var(--ease); }
.h-card:hover .h-card__go { opacity: 1; transform: translateY(0); }
.h-card__cat { display: block; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--brass); margin-bottom: .3rem; }
/* Indice nascosto mentre si è sui Lavori (niente sovrapposizioni) */
.section-index { transition: opacity .45s var(--ease), transform .45s var(--ease); }
body.hide-index .section-index { opacity: 0; transform: translateY(-50%) translateX(-24px); pointer-events: none; }
@media (max-width: 1024px){
  .h-head { position: static; max-width: none; margin-bottom: 1.4rem; padding: 0 clamp(1.25rem,5vw,2rem); }
  .h-progress { display: none; }
}

/* --- CTA immersiva --- */
.imm-cta { min-height: 86svh; display: flex; align-items: center; text-align: center; background: var(--ink); color: var(--on-dark); }
.imm-cta h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(3rem,12vw,11rem); line-height: .88; letter-spacing: -.03em; margin-bottom: 2rem; }
.imm-cta h2 em { font-style: italic; color: var(--brass); }

/* =============================================================================
   IMMERSIVE v2 — rifiniture stile "hubtown"
   ============================================================================= */

/* Transizione di pagina (curtain) */
.page-veil { position: fixed; inset: 0; z-index: 900; background: var(--ink); display: grid; place-items: center; opacity: 0; visibility: hidden; transform: scale(1.08); transition: opacity .55s var(--ease), visibility .55s, transform .7s var(--ease); }
.page-veil.show { opacity: 1; visibility: visible; transform: scale(1); }
.page-veil__brand { font-family: var(--font-display); color: var(--ivory); font-size: clamp(2rem,6vw,3.5rem); letter-spacing: .05em; opacity: 0; transform: translateY(12px); }
.page-veil.show .page-veil__brand { animation: veilBrand .7s var(--ease-out) forwards; }
@keyframes veilBrand { to { opacity: 1; transform: none; } }

/* Indice di sezione — SINISTRA, nomi sempre visibili; hover/attivo si accendono (stile hubtown) */
.section-index { position: fixed; left: clamp(1rem,2.5vw,2.4rem); top: 50%; transform: translateY(-50%); z-index: 180; display: flex; flex-direction: column; gap: 1.35rem; mix-blend-mode: difference; }
.section-index a { display: flex; align-items: center; gap: .85rem; color: #fff; font-size: 1.15rem; letter-spacing: .07em; text-transform: uppercase; font-weight: 500; opacity: .4; transition: opacity .35s var(--ease), transform .35s var(--ease); }
.section-index a .mk { width: 7px; height: 7px; background: #fff; flex-shrink: 0; opacity: 0; transform: scale(.4); transition: opacity .35s var(--ease), transform .35s var(--ease); }
.section-index a .lbl { white-space: nowrap; }
.section-index a:hover, .section-index a.active { opacity: 1; transform: translateX(5px); }
.section-index a:hover .mk, .section-index a.active .mk { opacity: 1; transform: scale(1); }
@media (max-width: 1199px){ .section-index { display: none; } }
/* Gutter a sinistra: il contenuto non finisce mai sotto l'indice */
@media (min-width: 1200px){
  .imm-hero__in, .chapter__in { padding-left: 180px; }
}

/* Ticker / marquee testuale */
.ticker { background: var(--ink); color: var(--on-dark); border-block: 1px solid var(--line-dark); overflow: hidden; padding-block: 1.4rem; }
.ticker__track { display: flex; gap: 3rem; width: max-content; animation: tickerX 30s linear infinite; }
.ticker:hover .ticker__track { animation-play-state: paused; }
.ticker__item { font-family: var(--font-display); font-size: clamp(1.4rem,3vw,2.4rem); white-space: nowrap; display: inline-flex; align-items: center; gap: 3rem; opacity: .92; }
.ticker__item::after { content: "✦"; color: var(--brass); font-size: .85rem; }
@keyframes tickerX { to { transform: translateX(-50%); } }

/* Immagini con reveal a maschera */
.reveal-img { position: relative; overflow: hidden; }
.reveal-img img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Sezione "Progetto in evidenza" */
.feature { position: relative; min-height: 100svh; display: flex; align-items: center; overflow: hidden; background: var(--ink); color: var(--on-dark); }
.feature__media { position: absolute; inset: 0; z-index: 0; }
.feature__media img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(30%) brightness(.5); }
.feature__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(18,18,19,.9), rgba(18,18,19,.35) 70%, rgba(18,18,19,.2)); }
.feature__in { position: relative; z-index: 2; max-width: 640px; }
.feature .eyebrow { color: var(--brass); }
.feature h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.6rem,7vw,6rem); line-height: .95; margin: 1.1rem 0 1.2rem; }
.feature p { color: rgba(245,242,234,.82); font-size: 1.15rem; margin-bottom: 1.8rem; }
.feature__meta { display: flex; gap: 2.5rem; margin-bottom: 2rem; flex-wrap: wrap; }
.feature__meta span { display: block; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--on-dark-muted); margin-bottom: .3rem; }
.feature__meta b { font-family: var(--font-display); font-weight: 400; font-size: 1.2rem; }

/* Settori / clienti */
.clients { background: var(--paper); }
.clients__grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: 2.5rem; }
.clients__cell { background: var(--paper); padding: clamp(1.4rem,3vw,2.4rem); min-height: 130px; display: flex; align-items: center; gap: .8rem; font-family: var(--font-display); font-size: clamp(1.2rem,2vw,1.7rem); transition: background .35s var(--ease), color .35s; }
.clients__cell:hover { background: var(--ink); color: var(--ivory); }
.clients__cell span { color: var(--brass-deep); font-size: .78rem; font-family: var(--font-sans); font-weight: 600; }
.clients__cell:hover span { color: var(--brass); }
@media (max-width: 760px){ .clients__grid { grid-template-columns: 1fr 1fr; } }

/* Footer-CTA immersivo */
.imm-fcta { background: var(--ink); color: var(--on-dark); text-align: center; padding-block: clamp(5rem,13vh,10rem); }
.imm-fcta .eyebrow { color: var(--brass); justify-content: center; }
.imm-fcta .eyebrow::before { display: none; }
.imm-fcta h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.6rem,9vw,8rem); line-height: .9; letter-spacing: -.03em; margin: 1.4rem 0; }
.imm-fcta a.big { display: inline-block; font-family: var(--font-display); font-size: clamp(1.4rem,3vw,2.4rem); color: var(--brass); border-bottom: 1px solid var(--brass); padding-bottom: .3rem; transition: color .3s, border-color .3s; }
.imm-fcta a.big:hover { color: var(--ivory); border-color: var(--ivory); }

/* Link con underline animata */
.imm-link { position: relative; }
.imm-link::after { content: ""; position: absolute; left: 0; bottom: -2px; height: 1px; width: 0; background: currentColor; transition: width .35s var(--ease); }
.imm-link:hover::after { width: 100%; }

/* Cursore: etichetta contestuale */
.cursor-ring.labeled { width: 90px; height: 90px; background: rgba(198,161,91,.92); border-color: transparent; }
.cursor-label { position: fixed; top: 0; left: 0; z-index: 10000; pointer-events: none; color: var(--ink); font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: 0; transform: translate(-50%,-50%); }
.cursor-label.show { opacity: 1; }

/* Magnetic */
.magnetic { will-change: transform; }

/* Immagini che si muovono col mouse */
.imm-hero__bg img, .chapter__bg img { will-change: transform; }

/* --- Menu trigger --- */
/* "Quadrante leggero": bottone MENU chiaro con angolo tagliato (stile hubtown) */
.menu-trigger { display: inline-flex; align-items: center; gap: .6rem; background: var(--ivory); color: var(--ink); font-size: .72rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; padding: .8rem 1.2rem; clip-path: polygon(0 0, 100% 0, 100% 100%, 16px 100%, 0 calc(100% - 16px)); box-shadow: 0 8px 26px -14px rgba(0,0,0,.55); transition: background .3s var(--ease), color .3s; }
.menu-trigger:hover { background: var(--brass); color: var(--ink); }
.menu-trigger .grid { display: grid; grid-template-columns: repeat(2, 4px); gap: 2px; }
.menu-trigger .grid i { width: 4px; height: 4px; background: currentColor; display: block; }

/* --- Overlay --- */
.menu-overlay { position: fixed; inset: 0; background: rgba(10,10,11,.55); backdrop-filter: blur(2px); opacity: 0; visibility: hidden; z-index: 400; transition: opacity .4s var(--ease), visibility .4s; }
.menu-overlay.show { opacity: 1; visibility: visible; }

/* --- Pannello laterale --- */
.side-menu { position: fixed; top: 0; right: 0; height: 100%; width: min(92vw, 460px); background: var(--ink-2); color: var(--on-dark); z-index: 500; transform: translateX(100%); transition: transform .6s var(--ease); display: flex; flex-direction: column; justify-content: center; padding: clamp(2rem,6vw,4.5rem); }
.side-menu.open { transform: translateX(0); }
.side-menu__close { position: absolute; top: 1.4rem; right: 1.6rem; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line-dark); color: var(--on-dark); font-size: 1rem; transition: background .3s, color .3s, border-color .3s; }
.side-menu__close:hover { background: var(--brass); color: var(--ink); border-color: var(--brass); }
.side-menu__nav a { display: flex; align-items: baseline; gap: 1rem; font-family: var(--font-display); font-size: clamp(1.9rem, 5vw, 3rem); line-height: 1.4; color: var(--on-dark); transition: color .3s var(--ease), transform .3s var(--ease); }
.side-menu__nav a:hover { color: var(--brass); transform: translateX(8px); }
.side-menu__nav .idx { font-family: var(--font-sans); font-size: .7rem; font-weight: 600; letter-spacing: .1em; color: var(--brass); opacity: .75; }
.side-menu__foot { position: absolute; left: clamp(2rem,6vw,4.5rem); bottom: clamp(2rem,5vw,3rem); font-size: .9rem; color: var(--on-dark-muted); }
.side-menu__foot a:hover { color: var(--brass); }

/* Cornice viewport (stile hubtown) */
.frame { position: fixed; inset: 16px; z-index: 170; pointer-events: none; border: 1px solid rgba(255,255,255,.24); mix-blend-mode: difference; }
@media (max-width: 640px){ .frame { inset: 8px; } }

/* Galleria orizzontale: cursore "grab" */
.h-track { cursor: grab; }
.h-track:active { cursor: grabbing; }

/* Mappa Italia interattiva */
.map-section { position: relative; background: var(--ink); color: var(--on-dark); }
.map-sticky { position: sticky; top: 0; height: 100svh; min-height: 640px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--ink); }
.map-head { position: absolute; top: 9vh; left: 0; right: 0; text-align: center; z-index: 3; padding: 0 1.5rem; transform-origin: top center; will-change: transform, opacity; pointer-events: none; }
.map-head .eyebrow { justify-content: center; }
.map-head .eyebrow::before { display: none; }
.map-head h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.9rem,4.5vw,3.4rem); line-height: 1.05; margin-top: .8rem; text-shadow: 0 6px 40px rgba(0,0,0,.55); }
.italy-map { position: relative; height: 84vh; width: 100%; display: flex; align-items: center; justify-content: center; }
.italy-svg { height: 100%; width: auto; max-width: 100%; overflow: visible; display: block; }
.mk-label { font-size: 9px; fill: #fff; opacity: 0; font-family: var(--font-sans); font-weight: 600; paint-order: stroke; stroke: rgba(18,18,19,.75); stroke-width: 2.4px; transition: opacity .4s var(--ease); pointer-events: none; }
.italy-map.detail .mk-label { opacity: 1; }
.italy-svg .region { fill: rgba(245,242,234,.05); stroke: rgba(198,161,91,.35); stroke-width: .6; transition: fill .4s; }
.marker { cursor: pointer; }
.marker .dot { fill: var(--brass); transition: fill .3s; }
.marker .pulse { fill: var(--brass); opacity: .5; transform-box: fill-box; transform-origin: center; animation: mpulse 2.6s var(--ease) infinite; animation-delay: var(--d); }
.marker:hover .dot { fill: #fff; }
@keyframes mpulse { 0%{ transform: scale(1); opacity: .5; } 70%{ transform: scale(3.6); opacity: 0; } 100%{ opacity: 0; } }
.map-tip { position: absolute; top: 0; left: 0; z-index: 5; pointer-events: none; transform: translate(-50%, calc(-100% - 16px)); width: 190px; background: var(--ink-2); border: 1px solid var(--line-dark); border-radius: 8px; padding: .5rem; opacity: 0; transition: opacity .25s var(--ease); box-shadow: var(--shadow-lg); }
.map-tip.show { opacity: 1; }
.map-tip__img { aspect-ratio: 16/10; border-radius: 5px; overflow: hidden; background: var(--ink-3); display: none; }
.map-tip.has-img .map-tip__img { display: block; }
.map-tip__img img { width: 100%; height: 100%; object-fit: cover; }
.map-tip__t { padding: .5rem .3rem .15rem; }
.map-tip__t .c { display: block; font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; color: var(--brass); margin-bottom: .15rem; }
.map-tip__t b { font-family: var(--font-display); font-weight: 400; font-size: 1rem; }

/* Pannello dettaglio mappa (destra, ~metà schermo) + carosello */
.map-overlay { position: fixed; inset: 0; background: rgba(10,10,11,.6); backdrop-filter: blur(3px); opacity: 0; visibility: hidden; z-index: 550; transition: opacity .45s var(--ease), visibility .45s; }
.map-overlay.show { opacity: 1; visibility: visible; }
.map-panel { position: fixed; top: 0; right: 0; height: 100%; width: 46vw; max-width: 760px; min-width: 380px; background: var(--ink-2); color: var(--on-dark); z-index: 600; transform: translateX(100%); transition: transform .65s var(--ease); overflow-y: auto; }
.map-panel.open { transform: translateX(0); }
@media (max-width: 800px){ .map-panel { width: 94vw; min-width: 0; } }
.map-panel__close { position: absolute; top: 1.1rem; right: 1.1rem; z-index: 5; width: 42px; height: 42px; border-radius: 50%; background: rgba(18,18,19,.5); border: 1px solid var(--line-dark); color: var(--on-dark); font-size: 1rem; backdrop-filter: blur(6px); transition: background .3s, color .3s, border-color .3s; }
.map-panel__close:hover { background: var(--brass); color: var(--ink); border-color: var(--brass); }
.map-panel__carousel { position: relative; aspect-ratio: 16/11; background: var(--ink-3); overflow: hidden; }
.mpc-track { position: absolute; inset: 0; }
.mpc-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .8s var(--ease); }
.mpc-slide.active { opacity: 1; }
.mpc-slide img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); transition: transform .5s var(--ease); will-change: transform; }
.mpc-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; background: rgba(18,18,19,.5); color: #fff; border: 1px solid rgba(255,255,255,.2); backdrop-filter: blur(6px); font-size: 1.5rem; line-height: 1; display: grid; place-items: center; z-index: 2; transition: background .3s, color .3s; }
.mpc-nav:hover { background: var(--brass); color: var(--ink); }
.mpc-prev { left: 1rem; } .mpc-next { right: 1rem; }
.mpc-dots { position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%); display: flex; gap: .4rem; z-index: 2; }
.mpc-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.45); cursor: pointer; transition: all .3s; }
.mpc-dots i.active { background: var(--brass); width: 20px; border-radius: 4px; }
.map-panel__body { padding: clamp(1.6rem,3vw,2.6rem); }
.map-panel__cat { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--brass); font-weight: 600; }
.map-panel__title { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.8rem,3.2vw,2.8rem); margin: .6rem 0 .5rem; line-height: 1.05; }
.map-panel__city { font-size: .95rem; color: var(--on-dark-muted); margin-bottom: 1.4rem; }
.map-panel__desc { color: var(--on-dark-muted); font-size: 1.05rem; line-height: 1.7; margin-bottom: 1.8rem; }
.map-panel__meta { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line-dark); border: 1px solid var(--line-dark); border-radius: 8px; overflow: hidden; margin-bottom: 1.8rem; }
.map-panel__meta > div { background: var(--ink-2); padding: 1rem 1.1rem; }
.map-panel__meta dt { font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; color: var(--on-dark-muted); margin-bottom: .35rem; }
.map-panel__meta dd { font-family: var(--font-display); font-weight: 400; font-size: 1.1rem; }
.map-panel__cta { width: 100%; justify-content: center; }
.map-panel .anim-in { opacity: 0; }

/* Hint mappa */
.map-hint { text-align: center; font-size: .72rem; letter-spacing: .06em; color: var(--on-dark-muted); margin-top: 1.2rem; opacity: .7; }

/* Didascalie mappa: intro a sinistra; l'esplorazione a destra (resta fino al click) */
.map-caption { position: absolute; z-index: 4; pointer-events: none; max-width: 360px; }
.map-caption[data-cap="0"] { left: clamp(175px, 12vw, 300px); top: 50%; transform: translateY(-50%); text-align: left; }
.map-caption[data-cap="0"] span { font-size: clamp(2rem, 4vw, 3.4rem); }
.map-caption[data-cap="1"] { right: clamp(1.5rem, 6vw, 6rem); top: 45%; transform: translateY(-50%); text-align: right; }
.map-caption[data-cap="2"] { right: clamp(1.5rem, 6vw, 6rem); top: 57%; transform: translateY(-50%); text-align: right; }
.map-caption[data-cap="2"] span { font-size: clamp(1rem, 1.5vw, 1.25rem); color: var(--brass); }
.map-caption span { display: block; font-family: var(--font-display); font-weight: 400; font-size: clamp(1.6rem, 2.8vw, 2.6rem); line-height: 1.18; color: var(--on-dark); opacity: 0; transform: translateY(16px); will-change: opacity, transform; text-shadow: 0 4px 34px rgba(0,0,0,.6); }
@media (max-width: 1024px){ .map-caption { display: none; } }

/* Transizione fluida tra Lavori e Mappa (cuscinetto anti-scatto) */
.section-transition { height: 90vh; background: var(--ink); display: flex; align-items: center; justify-content: center; }
.section-transition .st-line { width: 1px; height: 64px; background: linear-gradient(var(--brass), transparent); opacity: .5; }
/* Cuscinetto d'uscita: più alto della viewport, sfumatura piena dal grigio scuro al bianco */
.section-transition--out { height: 135vh; background: linear-gradient(var(--ink) 10%, #55555a 48%, var(--ivory-2) 92%); }
.section-transition--out .st-line { display: none; }
@media (max-width: 1024px){ .section-transition { display: none; } }

/* Finale CTA: sfondo con particelle (più vita in basso) */
.imm-fcta { position: relative; overflow: hidden; }

/* Numeri "fantasma" dietro i capitoli (al posto di "01 — Metodo") */
.chapter__in { position: relative; }
.ghost-num { position: absolute; top: 50%; right: 2%; transform: translateY(-58%); font-family: var(--font-display); font-weight: 400; font-size: clamp(9rem, 26vw, 26rem); line-height: 1; color: transparent; -webkit-text-stroke: 1px rgba(198,161,91,.20); z-index: 0; pointer-events: none; user-select: none; }
@media (max-width: 760px){ .ghost-num { font-size: 34vw; right: -2%; } }

/* "Allestimento" luminoso (emette luce) */
.mega--glow { color: var(--brass); -webkit-text-stroke: 0; text-shadow: 0 0 28px rgba(198,161,91,.5), 0 0 64px rgba(198,161,91,.28); animation: megaGlow 3.6s ease-in-out infinite; }
@keyframes megaGlow { 0%,100% { text-shadow: 0 0 22px rgba(198,161,91,.4), 0 0 52px rgba(198,161,91,.2); } 50% { text-shadow: 0 0 44px rgba(198,161,91,.78), 0 0 98px rgba(198,161,91,.44); } }

/* Luci laterali rimosse su richiesta (restano la cornice + le particelle) */

/* Ombre / profondità */
.side-menu.open, .map-panel.open { box-shadow: -44px 0 110px -30px rgba(0,0,0,.72); }
.mpc-nav { box-shadow: 0 8px 24px -10px rgba(0,0,0,.6); }

/* Toggle audio (Sound) — in basso a sinistra */
.sound-toggle { position: fixed; left: clamp(1rem,2.5vw,2rem); bottom: clamp(1rem,2.5vw,2rem); z-index: 210; display: inline-flex; align-items: center; gap: .6rem; color: #fff; mix-blend-mode: difference; font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; }
.sound-eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.sound-eq i { width: 2px; height: 4px; background: #fff; }
.sound-toggle.on .sound-eq i { animation: eq .9s ease-in-out infinite; }
.sound-eq i:nth-child(2){ animation-delay: .15s; } .sound-eq i:nth-child(3){ animation-delay: .3s; } .sound-eq i:nth-child(4){ animation-delay: .45s; }
@keyframes eq { 0%,100%{ height: 4px; } 50%{ height: 14px; } }
@media (max-width: 1024px){
  /* Toggle audio ben visibile su mobile (pillola) */
  .sound-toggle { mix-blend-mode: normal; background: rgba(18,18,19,.62); border: 1px solid rgba(245,242,234,.32); color: var(--ivory); padding: .6rem .9rem; border-radius: 100px; backdrop-filter: blur(6px); box-shadow: 0 6px 22px -8px rgba(0,0,0,.65); }
  .sound-eq i { background: var(--ivory); }
}

/* Riduzione movimento */
@media (prefers-reduced-motion: reduce){
  .imm-hero__bg, .chapter__bg { inset: 0 !important; }
  .reveal-img { clip-path: none !important; }
  .marker .pulse { animation: none !important; }
  .mpc-slide img { transition: none !important; transform: none !important; }
  .mega--glow { animation: none !important; }
}

/* =================== OTTIMIZZAZIONE MOBILE / ANDROID (≤1024px) =================== */
@media (max-width: 1024px){
  .imm-hero { height: 100svh; }
  .imm-hero__in { padding-left: 0; }
  /* Mappa: blocco normale, niente camera-zoom pinnata */
  .map-section { height: auto !important; }
  .map-sticky { position: static; height: auto; min-height: 0; display: block; overflow: visible; padding-block: clamp(3rem,9vh,5rem); }
  .map-head { position: static; transform: none !important; opacity: 1 !important; margin-bottom: 1.4rem; }
  .italy-map { height: auto; }
  .italy-svg { height: auto; width: 100%; max-height: 64vh; }
  .mk-label { opacity: 0 !important; }
  /* Lavori: swipe orizzontale nativo, niente pin */
  .h-section { height: auto !important; }
  .h-panel { position: static; height: auto; display: block; overflow: visible; padding-block: clamp(3rem,8vh,4.5rem); }
  .h-track { transform: none !important; overflow-x: auto; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; padding-left: clamp(1.25rem,5vw,2rem) !important; padding-bottom: 1.2rem; }
  .h-track::-webkit-scrollbar { height: 0; }
  .h-card, .h-intro { scroll-snap-align: start; }
}
@media (max-width: 640px){
  .imm-hero__claim { font-size: clamp(2.6rem, 13vw, 4rem); }
  .mega { font-size: clamp(2.8rem, 15vw, 5rem); }
  .ghost-num { font-size: 40vw; opacity: .8; }
  .map-panel__meta { grid-template-columns: 1fr 1fr; }
}
