/* ===== Servizi "immersivi": scena scura, i video accompagnano lo scorrimento ===== */
section.services.services--imm { background: var(--black); padding: 0; position: relative; }

.imm-intro { display: flex; justify-content: center; text-align: center; padding: calc(var(--header-h, 100px) + 30px) 0 0; }
.imm-intro h2 { margin: 14px auto 0; max-width: 900px; }
.imm-intro .section-lead { margin-left: auto; margin-right: auto; }
.imm-intro .container { will-change: transform, opacity; }
.imm-down { display: block; width: 2px; height: 36px; margin: 20px auto 0; background: linear-gradient(var(--orange), transparent); animation: immDown 1.6s ease-in-out infinite; }
@keyframes immDown { 0%,100% { transform: translateY(0); opacity: .5; } 50% { transform: translateY(12px); opacity: 1; } }

.imm { position: relative; height: 430vh; height: 430svh; margin-top: -4svh; }
.imm-pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.imm-glow {
  position: absolute; left: 0; top: 0; width: 90vmax; height: 90vmax; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(245,126,29,.22), rgba(245,126,29,.06) 55%, transparent); will-change: transform;
}
.imm-sparks { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }

.imm-word {
  position: absolute; left: 50%; top: 50%; white-space: nowrap; pointer-events: none; z-index: 1;
  font-family: var(--font-display); text-transform: uppercase; line-height: 1; font-size: 24vw;
  color: transparent; -webkit-text-stroke: 1.5px rgba(245,126,29,.3); opacity: 0; will-change: transform, opacity;
}
.imm-stage { position: absolute; inset: 0; perspective: 1500px; z-index: 2; pointer-events: none; }
.imm-film { position: absolute; left: 0; top: 0; opacity: 0; will-change: transform, opacity; backface-visibility: hidden; }
.imm-film canvas, .imm-film img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  /* bordi sfumati nel nero: niente riquadro */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 13%, #000 89%, transparent), linear-gradient(to bottom, transparent, #000 12%, #000 86%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 13%, #000 89%, transparent), linear-gradient(to bottom, transparent, #000 12%, #000 86%, transparent);
  -webkit-mask-composite: source-in; mask-composite: intersect;
}
.imm-film canvas { position: absolute; inset: 0; }
.imm-film canvas[hidden] { display: none; }

.imm-copy { position: absolute; z-index: 5; top: calc(50% + var(--header-h, 100px) / 2); transform: translateY(-50%); width: min(31vw, 440px); pointer-events: none; }
.imm-copy.left { left: 4.5vw; }
.imm-copy.right { right: 5.5vw; }
.imm-copy > * { opacity: 0; will-change: transform, opacity; text-shadow: 0 2px 24px rgba(0,0,0,.9); }
.imm-kicker { display: block; color: var(--orange); font-weight: 700; font-size: .78rem; letter-spacing: .24em; text-transform: uppercase; }
.imm-copy h3 { font-family: var(--font-display); font-weight: 400; text-transform: uppercase; font-size: clamp(2.2rem, 4.6vw, 4.4rem); line-height: 1.02; margin: 12px 0 16px; overflow-wrap: anywhere; }
.imm-copy p { color: #c9c9c9; line-height: 1.65; }
.imm-copy .btn { display: inline-block; margin-top: 24px; }
.imm-copy.is-on .btn { pointer-events: auto; }

.imm-dots { position: absolute; z-index: 6; right: 16px; top: 50%; transform: translateY(-50%); display: grid; gap: 12px; }
.imm-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.22); transition: background .3s, box-shadow .3s, transform .3s; }
.imm-dots i.on { background: var(--orange); box-shadow: 0 0 12px var(--orange); transform: scale(1.35); }
.imm-hint { position: absolute; z-index: 5; left: 50%; bottom: 18px; transform: translateX(-50%); width: 150px; height: 3px; border-radius: 3px; background: rgba(255,255,255,.14); overflow: hidden; }
.imm-hint b { display: block; height: 100%; width: 0; background: var(--orange); }


@media (orientation: portrait) {
  .imm-copy, .imm-copy.left, .imm-copy.right { left: 20px; right: 20px; width: auto; top: auto; bottom: 58px; transform: none; text-align: center; }
  .imm-copy h3 { font-size: clamp(2rem, 10vw, 3.4rem); margin: 8px 0 10px; }
  .imm-copy p { font-size: .9rem; line-height: 1.5; }
  .imm-copy .btn { margin-top: 16px; padding: 12px 26px; }
  .imm-word { font-size: 38vw; }
  .imm-dots { right: 8px; top: 40%; }
  .imm-hint { bottom: 22px; }
}
@media (orientation: portrait) and (max-height: 640px) {
  .imm-copy p { display: none; }
}

/* ===== Passaggi senza stacchi: tutto sfuma nello stesso nero ===== */
.imm-pin::before, .imm-pin::after { content: ''; position: absolute; left: 0; right: 0; z-index: 4; pointer-events: none; }
.imm-pin::before {
  top: 0; height: calc(var(--header-h, 100px) + 80px);
  background: linear-gradient(to bottom, #090909 0, #090909 30%, rgba(9,9,9,.78) 52%, rgba(9,9,9,.42) 70%, rgba(9,9,9,.14) 86%, rgba(9,9,9,0) 100%);
}
.imm-pin::after {
  bottom: 0; height: 28%;
  background: linear-gradient(to top, #090909 0, #090909 6%, rgba(9,9,9,.8) 30%, rgba(9,9,9,.46) 55%, rgba(9,9,9,.16) 78%, rgba(9,9,9,0) 100%);
}
/* trasformazioni in alto e in basso (computer): il bordo inferiore entra nel nero */
@media (min-width: 769px) {
  .scroll-3d-sticky::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 24%; z-index: 1; pointer-events: none;
    background: linear-gradient(to top, #090909 0, rgba(9,9,9,.78) 28%, rgba(9,9,9,.4) 56%, rgba(9,9,9,.12) 80%, rgba(9,9,9,0) 100%);
  }
  .scroll-3d--diag .scroll-3d-sticky::before {
    content: ''; position: absolute; left: 0; right: 0; top: 0; height: 24%; z-index: 1; pointer-events: none;
    background: linear-gradient(to bottom, #090909 0, rgba(9,9,9,.78) 28%, rgba(9,9,9,.4) 56%, rgba(9,9,9,.12) 80%, rgba(9,9,9,0) 100%);
  }
}
/* telefono: anche la seconda trasformazione parte dal nero */
@media (max-width: 768px) {
  .scroll-3d--diag .scroll-3d-sticky::before {
    content: ''; position: absolute; left: 0; right: 0; top: 0; height: calc(var(--header-h, 80px) + 170px); z-index: 1; pointer-events: none;
    background: linear-gradient(to bottom, #090909 0, #090909 var(--header-h, 80px), rgba(9,9,9,.82) calc(var(--header-h, 80px) + 40px), rgba(9,9,9,.48) calc(var(--header-h, 80px) + 90px), rgba(9,9,9,.18) calc(var(--header-h, 80px) + 130px), rgba(9,9,9,0) 100%);
  }
}
